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
Sets the global instance with extras. Needs to be called before instance is created (in enumerate_adapters or request_adapter).
323
+
Most of these options are for specific backends, and might not create an instance or crash when used in the wrong combinations.
323
324
324
325
: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
326
:param flags: bitflags as list[str], debug flags for the compiler. Defaults to ``["Default"]``, can be any combination of ``["Debug", "Validation", "DiscardHalLabels"]``.
326
327
:param dx12_compiler: enum/str, either "Fxc", "Dxc" or "Undefined". Defaults to "Fxc" same as "Undefined". Dxc requires additional library files.
327
328
:param gles3_minor_version: enum/int 0, 1 or 2. Defaults to "Atomic" (handled by driver).
328
329
: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
330
:param dxc_path: str, path to dxcompiler.dll, defaults to ``None``. None looks in the resource directory.
331
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
+
:param budget_for_device_creation: Optional[int], between 0 and 100, to specify memory budget threshold for when creating resources (buffer, textures...) will fail. Defaults to None.
333
+
:param budget_for_device_loss: Optional[int], between 0 and 100, to specify memory budget threshold when the device will be lost. Defaults to None.
332
334
333
335
Use like the following before the instance is created, which happens during request_adapter or enumerate_adapters.
# NOTE: destroy is not yet implemented in wgpu-native - this does not actually do anything yet
42
52
yieldqs
43
53
44
54
@@ -56,11 +66,12 @@ def test_destroy_buffer(n):
56
66
# can still be queries from wgpu-native, but it cannot be used.
57
67
58
68
# Uncomment the following lines to see. These are commented because it makes wgpu-core create a command-buffer.
69
+
# error = None
59
70
# try:
60
71
# b.map_sync("READ")
61
72
# except wgpu.GPUValidationError as err:
62
73
# error = err
63
-
# assert "destroyed" in error.message.lower()
74
+
# assert error and "destroyed" in error.message.lower()
64
75
65
76
yieldb
66
77
@@ -77,11 +88,13 @@ def test_destroy_texture(n):
77
88
t.destroy()
78
89
79
90
# Uncomment the following lines to see. These are commented because the views are created at the native side, but we never store them, but we also don't release them.
91
+
# error = None
80
92
# try:
81
93
# t.create_view()
82
94
# except wgpu.GPUValidationError as err:
83
95
# error = err
84
-
# assert "destroyed" in error.message.lower()
96
+
# assert error and "destroyed" in error.message.lower()
0 commit comments