Skip to content

Add GPU timestamp queries for per-pass profiling#153

Merged
stainlu merged 1 commit intomainfrom
gpu-timestamp-queries
Apr 8, 2026
Merged

Add GPU timestamp queries for per-pass profiling#153
stainlu merged 1 commit intomainfrom
gpu-timestamp-queries

Conversation

@stainlu
Copy link
Copy Markdown
Owner

@stainlu stainlu commented Apr 8, 2026

Summary

  • Extend the RHI trait with QuerySet, create_query_set, resolve_query_set, timestamp_period_ns, read_timestamp_buffer, and copy_buffer_to_buffer methods
  • Implement wgpu timestamp query support (feature-gated on adapter support) with resolve-to-staging readback pipeline
  • Add ProfileSectionKind (Cpu/Gpu) to the profiler so GPU and CPU timings coexist in frame_summary()
  • Add GpuTimerState to the renderer with 1-frame-delayed readback (shadow + PBR passes instrumented)
  • Add supports_timestamp_queries to HardwareSurvey and timestamp_query to Capabilities
  • Metal backend: stub QuerySet = () with no-op defaults

Test plan

  • cargo test --workspace -- all tests pass (including 3 new profiler tests)
  • cargo clippy --workspace -- -D warnings -- zero warnings
  • cargo fmt --all -- --check -- formatted

🤖 Generated with Claude Code

Extend the RHI with QuerySet, timestamp query methods, and
copy_buffer_to_buffer so the renderer can measure per-pass GPU time
via wgpu timestamp queries. The CPU Profiler now distinguishes
Cpu vs Gpu sections and GPU timings appear in the same frame summary.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@cloudflare-workers-and-pages
Copy link
Copy Markdown

Deploying euca-engine with  Cloudflare Pages  Cloudflare Pages

Latest commit: 1308d28
Status: ✅  Deploy successful!
Preview URL: https://07ef2109.euca-engine.pages.dev
Branch Preview URL: https://gpu-timestamp-queries.euca-engine.pages.dev

View logs

@stainlu stainlu merged commit b345a58 into main Apr 8, 2026
6 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant