Skip to content

WebGPU "Queries" implementation (for profiling purposes) #721

Closed
@z2oh

Description

@z2oh

I am strictly a hobbyist when it comes to graphics programming, so please forgive any misinformed assumptions that I make :)

I am trying to benchmark individual render passes in an application built on wgpu-rs. In my research to resolve this, I stumbled upon the "timestamp" GPUQueryType. This API seems like it exposes data which could be used to benchmark any particular command, render passes among them (a very useful feature indeed!).

However, I could not find any APIs for interfacing with these Queries in wgpu-rs. I followed the trail and it seems that gfx-hal does provide this interface, which (in theory) means it can be propagated to my application code with the only necessary changes being contained within wgpu-rs and wgpu-core. I have two theories as to why this feature is not already implemented:

  1. Software projects must allocate their limited resources judiciously; profiling isn't very useful if there is nothing to profile!
  2. This open issue on gfx-hal precludes it from being spec-compliant with WebGPU, namely this restriction:

Timestamp query requires timestamp-query is available on the device.

I am willing to put in some legwork to make this happen, but I want to make sure my understanding of the situation is correct before I invest too much time. Any guidance would also be appreciated. Thanks for working on wgpu-rs!

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions