You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* add download script
* add basic example
* basic debug example
* ruff format
* diable examples correctly
* renderdoc launcher script
* add more links
* write docs
* fix duplicate
* fix typo
* simplify check
* label cube example
* support more os
* add debug markers
* improve intro docstring
* avoid env var
* include troubleshooting help
* simply bind groups in cube example
* cat related typo
* remove canvas type hint
* ruff format
Sets the global instance with extras. Needs to be called before instance is created (in enumerate_adapters or request_adapter).
323
+
324
+
:param backends: bitflags as list[str], which backends to enable on the instance level. Defaults to ``["All"]``. Can be any combination of ``["Vulkan", "GL", "Metal", "DX12", "BrowserWebGPU"]`` or the premade combinations ``["All", "Primary", "secondary"]``. Note that your device needs to support these backends, for detailed information see https://docs.rs/wgpu/latest/wgpu/struct.Backends.html
325
+
:param flags: bitflags as list[str], debug flags for the compiler. Defaults to ``["Default"]``, can be any combination of ``["Debug", "Validation", "DiscardHalLabels"]``.
326
+
:param dx12_compiler: enum/str, either "Fxc", "Dxc" or "Undefined". Defaults to "Fxc" same as "Undefined". Dxc requires additional library files.
327
+
:param gles3_minor_version: enum/int 0, 1 or 2. Defaults to "Atomic" (handled by driver).
328
+
:param fence_behavior: enum/int, "Normal" or "AutoFinish", Default to "Normal".
329
+
:param dxil_path: str, path to dxil.dll, defaults to ``None``. None looks in the resource directory.
330
+
:param dxc_path: str, path to dxcompiler.dll, defaults to ``None``. None looks in the resource directory.
331
+
:param dxc_max_shader_model: float between 6.0 and 6.7, Maximum shader model the given dll supports. Defaults to 6.5.
332
+
333
+
Use like the following before the instance is created, which happens during request_adapter or enumerate_adapters.
334
+
335
+
.. code-block:: py
336
+
337
+
import wgpu
338
+
from wgpu.backends.wgpu_native.extras import set_instance_extras
339
+
set_instance_extras(
340
+
backends=["Vulkan"],
341
+
flags=["Debug"],
342
+
)
343
+
344
+
# ...
345
+
346
+
for a in wgpu.gpu.enumerate_adapters_sync():
347
+
print(a.summary)
348
+
349
+
For additional usage examples look at `extras_dxc.py` and `extras_debug.py` in the examples directory.
0 commit comments