GPU async timing instrumentation via MX_TRACE_ASYNC#2824
Open
ppenenko wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Open
GPU async timing instrumentation via MX_TRACE_ASYNC#2824ppenenko wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
ppenenko wants to merge 2 commits intoAcademySoftwareFoundation:mainfrom
Conversation
New MX_TRACE_ASYNC macro and AsyncTrack infrastructure for emitting GPU timer query results on a dedicated Perfetto track, enabling per-material render time analysis. - AsyncTrack enum and Sink::asyncEvent() in Tracing.h - PerfettoSink implementation using custom track descriptors - GpuTimerQuery helper class using GL_TIME_ELAPSED - Single-frame GPU timing around _renderer->render()
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
Extends the
MaterialXTraceAPI with support for async events with explicit timing, enabling GPU render-time-per-material analysis on a dedicated Perfetto track.MX_TRACE_ASYNCmacro: Records events with explicit start time and duration, rendered on a separate Perfetto track from the CPU thread slicesAsyncTrackenum: Identifies async tracks (currentlyGPU, extensible for future use cases like shader compilation)Sink::asyncEvent(): New virtual method on the tracing sink interface, with a Perfetto implementation using custom track descriptorsGpuTimerQuery: Helper class wrapping GL_TIME_ELAPSED queries for measuring actual GPU execution time_renderer->render()with a timer query and emits the result as an async eventThis enables visualizing GPU render time per material alongside CPU codegen/compilation traces in the Perfetto UI.
Test plan
MATERIALX_BUILD_PERFETTO_TRACING=ONon Windows (MSVC)MATERIALX_BUILD_PERFETTO_TRACING=OFF(no-op macros)Related
envSampleCount,framesPerMaterial(companion PR, adds multi-frame rendering)