Repository navigation
Time replay phases from the timestamp counter - #304
Closed
SkippySteve wants to merge 1 commit into
Closed
SkippySteve wants to merge 1 commit into
SkippySteve wants to merge 1 commit into
Conversation
A performance-counter read on every phase of every draw was already measured at about 4% of the GPU thread, and the double conversion dropped bits past 2^53.
Owner
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
QueryPerformanceCounteron the way into and out of every draw, dispatch, and descriptor build. The WebGPU renderer already measured ten of those reads as about 4% of the GPU thread, and switched its own stats clock to the timestamp counter.prof_nownow reads the invariant TSC after one calibration against the performance counter. When that counter's tick is a whole number of nanoseconds (Linux reports 1 ns), the conversion is an integer multiply, so a reading past 2^53 keeps its low bits.Test plan
python -I -B tests/test_prof_clock.pypasses(1<<53)+3nanoseconds round away) and fails ifprof_nowno longer returns the timestamp-counter reading