Skip to content

Commit 0cb93b5

Browse files
committed
fix(native): guard wgpuDeviceTick with Dawn preprocessor check
1 parent 94279f5 commit 0cb93b5

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

src/webgpu/bindings.cpp

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3906,12 +3906,15 @@ void beginDawnFrame() {
39063906
}
39073907

39083908
void endDawnFrame() {
3909-
// Tick Dawn to process completed GPU work and free internal resources
3910-
// (staging buffers, command encoder state, etc.). Without this, Dawn's
3911-
// internal objects accumulate unboundedly since completion callbacks
3912-
// never fire.
3909+
// Tick the WebGPU device to process completed GPU work and free internal
3910+
// resources (staging buffers, command encoder state, etc.). Without this,
3911+
// internal objects accumulate unboundedly since completion callbacks never fire.
39133912
if (g_device) {
3913+
#if defined(MYSTRAL_WEBGPU_DAWN)
39143914
wgpuDeviceTick(g_device);
3915+
#elif defined(MYSTRAL_WEBGPU_WGPU)
3916+
wgpuDevicePoll(g_device, false, nullptr);
3917+
#endif
39153918
}
39163919
}
39173920

0 commit comments

Comments
 (0)