Skip to content

Commit

Permalink
Add more adapter info (#483)
Browse files Browse the repository at this point in the history
* Add more adapter info

* Pretty sure this is the correct mapping, after seeing samples
  • Loading branch information
almarklein committed Mar 28, 2024
1 parent 570738c commit adf9bfe
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions wgpu/backends/wgpu_native/_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,19 +280,23 @@ def to_py_str(key):
return ffi.string(char_p).decode(errors="ignore")
return ""

# Populate a dict according to the WebGPU spec: https://gpuweb.github.io/gpuweb/#gpuadapterinfo
# And add all other info we get from wgpu-native too.
adapter_info = {
# Spec
"vendor": to_py_str("vendorName"),
"architecture": to_py_str("architecture"),
"device": to_py_str("name"),
"description": to_py_str("driverDescription"),
# Extra
"vendor_id": c_properties.vendorID,
"device_id": c_properties.deviceID,
"adapter_type": enum_int2str["AdapterType"].get(
c_properties.adapterType, "unknown"
),
"backend_type": enum_int2str["BackendType"].get(
c_properties.backendType, "unknown"
),
# "vendor_id": c_properties.vendorID,
# "device_id": c_properties.deviceID,
}

# ----- Get adapter limits
Expand Down

0 comments on commit adf9bfe

Please sign in to comment.