diff --git a/docs/backends.rst b/docs/backends.rst index fb23323c..01010194 100644 --- a/docs/backends.rst +++ b/docs/backends.rst @@ -44,12 +44,14 @@ It also works out of the box, because the wgpu-native DLL is shipped with wgpu-p The wgpu_native backend provides a few extra functionalities: -.. py:function:: wgpu.backends.wgpu_native.request_device_tracing(adapter, trace_path, *, label="", required_features, required_limits, default_queue) +.. py:function:: wgpu.backends.wgpu_native.request_device(adapter, trace_path, *, label="", required_features, required_limits, default_queue) An alternative to :func:`wgpu.GPUAdapter.request_adapter`, that streams a trace of all low level calls to disk, so the visualization can be replayed (also on other systems), investigated, and debugged. + The trace_path argument is ignored on drivers that do not support tracing. + :param adapter: The adapter to create a device for. :param trace_path: The path to an (empty) directory. Is created if it does not exist. :param label: A human readable label. Optional. diff --git a/docs/guide.rst b/docs/guide.rst index 3d476eca..118443ba 100644 --- a/docs/guide.rst +++ b/docs/guide.rst @@ -232,7 +232,7 @@ You can run your application via RenderDoc, which is able to capture a frame, including all API calls, objects and the complete pipeline state, and display all of that information within a nice UI. -You can use ``adapter.request_device_tracing()`` to provide a directory path +You can use ``adapter.request_device()`` to provide a directory path where a trace of all API calls will be written. This trace can then be used to re-play your use-case elsewhere (it's cross-platform). diff --git a/tests/test_wgpu_native_basics.py b/tests/test_wgpu_native_basics.py index f5ff4d73..b4db2c87 100644 --- a/tests/test_wgpu_native_basics.py +++ b/tests/test_wgpu_native_basics.py @@ -328,7 +328,7 @@ def test_wgpu_native_tracer(): assert not os.path.isdir(tempdir) # Works! - wgpu.backends.wgpu_native.request_device_tracing(adapter, tempdir) + wgpu.backends.wgpu_native.request_device(adapter, tempdir) assert os.path.isdir(tempdir) # Make dir not empty @@ -336,7 +336,7 @@ def test_wgpu_native_tracer(): pass # Still works, but produces warning - wgpu.backends.wgpu_native.request_device_tracing(adapter, tempdir) + wgpu.backends.wgpu_native.request_device(adapter, tempdir) @mark.skipif(not can_use_wgpu_lib, reason="Needs wgpu lib") diff --git a/wgpu/backends/wgpu_native/__init__.py b/wgpu/backends/wgpu_native/__init__.py index 26366fdb..430200dd 100644 --- a/wgpu/backends/wgpu_native/__init__.py +++ b/wgpu/backends/wgpu_native/__init__.py @@ -18,4 +18,4 @@ gpu = GPU() # noqa: F405 _register_backend(gpu) # noqa: F405 -from .extras import enumerate_adapters, request_device_tracing # noqa: F401, E402 +from .extras import enumerate_adapters, request_device # noqa: F401, E402 diff --git a/wgpu/backends/wgpu_native/extras.py b/wgpu/backends/wgpu_native/extras.py index b54d44fb..29ad0c7f 100644 --- a/wgpu/backends/wgpu_native/extras.py +++ b/wgpu/backends/wgpu_native/extras.py @@ -14,7 +14,7 @@ def enumerate_adapters(): raise RuntimeError("Deprecated: use wgpu.gpu.enumerate_adapters() instead.") -def request_device_tracing( +def request_device( adapter, trace_path, *,