Skip to content

Commit 35a7536

Browse files
Add wgpu_device_tick for dawn backend
1 parent 7176279 commit 35a7536

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

lib/lib_webgpu.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -432,6 +432,12 @@ EM_BOOL wgpu_is_device(WGpuObjectBase object);
432432

433433
WGpuQueue wgpu_device_get_queue(WGpuDevice device);
434434

435+
#ifdef __EMSCRIPTEN__
436+
void wgpu_device_tick(WGpuDevice device) __attribute__((deprecated("The function wgpu_device_tick() is not available when targeting the web. Presentation always occurs when yielding out from browser event loop.")));
437+
#else
438+
void wgpu_device_tick(WGpuDevice device);
439+
#endif
440+
435441
WGpuBuffer wgpu_device_create_buffer(WGpuDevice device, const WGpuBufferDescriptor *bufferDesc NOTNULL);
436442
WGpuTexture wgpu_device_create_texture(WGpuDevice device, const WGpuTextureDescriptor *textureDesc NOTNULL);
437443
WGpuSampler wgpu_device_create_sampler(WGpuDevice device, const WGpuSamplerDescriptor *samplerDesc NOTNULL);

lib/lib_webgpu_dawn.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1113,6 +1113,12 @@ WGpuQueue wgpu_device_get_queue(WGpuDevice device) {
11131113
return _wgpu_store_and_set_parent(kWebGPUQueue, queue, device);
11141114
}
11151115

1116+
void wgpu_device_tick(WGpuDevice device) {
1117+
assert(wgpu_is_device(device));
1118+
WGPUDevice _device = _wgpu_get_dawn<WGPUDevice>(device);
1119+
wgpuDeviceTick(_device);
1120+
}
1121+
11161122
WGpuBuffer wgpu_device_create_buffer(WGpuDevice device, const WGpuBufferDescriptor* bufferDesc) {
11171123
assert(wgpu_is_device(device));
11181124
assert(bufferDesc);

0 commit comments

Comments
 (0)