From 6fc279eef46cf6e4bec724c1e29f33f3f255214a Mon Sep 17 00:00:00 2001 From: Marcos Slomp Date: Wed, 10 Jun 2026 06:23:57 -0700 Subject: [PATCH] more descriptive API name --- examples/webgpu/triangle/spinning_triangle.cpp | 2 +- manual/tracy.tex | 2 +- public/tracy/TracyWebGPU.hpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/examples/webgpu/triangle/spinning_triangle.cpp b/examples/webgpu/triangle/spinning_triangle.cpp index f5c2660a..dbb54745 100644 --- a/examples/webgpu/triangle/spinning_triangle.cpp +++ b/examples/webgpu/triangle/spinning_triangle.cpp @@ -147,7 +147,7 @@ static int initWebGPU() { WGPUDeviceDescriptor deviceDesc = {}; deviceDesc.uncapturedErrorCallbackInfo = errorCB; - TracyWebGPUSetupDevice(deviceDesc); + TracyWebGPUSetupDeviceDescriptor(deviceDesc); WGPURequestDeviceCallbackInfo deviceCB = {}; deviceCB.mode = WGPUCallbackMode_AllowProcessEvents; diff --git a/manual/tracy.tex b/manual/tracy.tex index 491f1cb6..3bed6025 100644 --- a/manual/tracy.tex +++ b/manual/tracy.tex @@ -1797,7 +1797,7 @@ To stop profiling, call the \texttt{TracyCUDAStopProfiling(ctx)} macro. WebGPU support is enabled by including the \texttt{public/tracy/TracyWebGPU.hpp} header file. Both major implementations of WebGPU (Dawn and wgpu-native) are supported. -Before creating the WebGPU device, make sure to call \texttt{TracyWebGPUSetupDevice()} to let Tracy request the necessary device features and extensions necessary for profiling. After the device is created, use the \texttt{TracyWebGPUContext()} macro to instantiate the necessary \texttt{WebGPUQueueCtx} object required for GPU instrumentation. The object should later be cleaned up with the \texttt{TracyWebGPUDestroy()} macro. To set a custom name for the context, use the \texttt{TracyWebGPUContextName()} macro. +Before creating the WebGPU device, make sure to call \texttt{TracyWebGPUSetupDeviceDescriptor()} to let Tracy request the necessary device features and extensions necessary for profiling. After the device is created, use the \texttt{TracyWebGPUContext()} macro to instantiate the necessary \texttt{WebGPUQueueCtx} object required for GPU instrumentation. The object should later be cleaned up with the \texttt{TracyWebGPUDestroy()} macro. To set a custom name for the context, use the \texttt{TracyWebGPUContextName()} macro. To instrument a GPU zone, use the various \texttt{TracyWebGPU*Zone*()} macros. Note that WebGPU only offers command instrumentation at the "pass"-level. While command-level granularity is possible through implementation-specific WebGPU extensions, Tracy does not support it at the moment. Supply the corresponding WebGPU pass descriptor to the instrumentation macro \textit{before} creating the WebGPU pass encoder. diff --git a/public/tracy/TracyWebGPU.hpp b/public/tracy/TracyWebGPU.hpp index 2e5f00e2..ba9bc5a7 100644 --- a/public/tracy/TracyWebGPU.hpp +++ b/public/tracy/TracyWebGPU.hpp @@ -11,7 +11,7 @@ #ifndef TRACY_ENABLE -#define TracyWebGPUSetupDevice(deviceDescriptor) +#define TracyWebGPUSetupDeviceDescriptor(deviceDescriptor) #define TracyWebGPUContext(instance, device, queue) nullptr #define TracyWebGPUDestroy(ctx) @@ -395,7 +395,7 @@ namespace tracy } public: - static bool SetupDevice(WGPUDeviceDescriptor& deviceDescriptor) + static bool SetupDeviceDescriptor(WGPUDeviceDescriptor& deviceDescriptor) { // TODO: pass features array/size as argument to better allow for repeated calls static constexpr int MaxFeatures = 128; @@ -909,7 +909,7 @@ namespace tracy using TracyWebGPUCtx = tracy::WebGPUQueueCtx*; -#define TracyWebGPUSetupDevice(deviceDescriptor) tracy::WebGPUQueueCtx::SetupDevice(deviceDescriptor) +#define TracyWebGPUSetupDeviceDescriptor(deviceDescriptor) tracy::WebGPUQueueCtx::SetupDeviceDescriptor(deviceDescriptor) #define TracyWebGPUContext(instance, device, queue) tracy::CreateWebGPUContext(instance, device, queue); #define TracyWebGPUDestroy(ctx) tracy::DestroyWebGPUContext(ctx);