Replies: 2 comments 1 reply
-
@mhawryluk @iwoplaza @aleksanderkatan what do you think? |
Beta Was this translation helpful? Give feedback.
1 reply
-
I like the proposal. I think for this usage a high level abstraction makes sense, so I would go for option no. 1 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Proposal: Enhanced Timestamp Querying for GPU Pass Performance Profiling
Overview
Profiling the performance of compute and render passes is essential for GPU optimization. However, the current vanilla WebGPU approach for timestamp queries is cumbersome and error-prone. It requires developers to manually create a
QuerySet
and two buffers—one for query resolution and another for reading—due to incompatible usage flags.Current Implementation
In vanilla WebGPU, timing a pass involves the following manual steps:
Developers must also inject timestamp properties into the pass descriptor and resolve the query set post-pass. Given that pass durations are typically shorter than the overhead of GPU-host communication, reading the timestamp after every pass becomes impractical.
Proposed Solutions
To streamline this process and improve developer experience, we propose two potential approaches:
1. High-Level API:
withPerformanceListener
Introduce a method that encapsulates the entire timestamp querying process:
Key Features:
QuerySet
and both required buffers, manages the injection of timestamp queries into the pass descriptor, and resolves the queries.2. Lower-Level Abstraction:
TgpuQuerySet
Alternatively, we could develop an abstraction—
TgpuQuerySet
—that closely mirrors the native WebGPU API. This approach preserves familiarity while reducing boilerplate:Advantages:
Beta Was this translation helpful? Give feedback.
All reactions