Repository navigation
asahi: ASAHI_MESA_DEBUG=stats: time every command and name each render pass - #419
Merged
RyanTheTide merged 1 commit intoNov 19, 2026
Conversation
stats printed batch times only when a timer query had requested timestamps, and did not say which pass a batch was. With stats on, give every render and compute command timestamps, write the compute end to comp_end, and log one AGXPROF line per command: GPU microseconds, size, draw count, colour and depth/stencil formats, clear and load masks and the last fragment shader's source hash (matching MESA_SHADER_DUMP_PATH names). With MESA_LOG_FILE this is a per-pass profile of a real game. Assisted-by: LLM
AxxzyWasTaken
force-pushed
the
pr/gl-stats-per-pass
branch
from
November 17, 2026 21:24
68a7ce3 to
1b68358
Compare
This was referenced Nov 19, 2026
|
Hardware test on an A18 Pro (G17P, J700), Fedora 45 arm64 release build, as a user-space overlay over Mesa 26.3.0-30 on kernel 7.3.0-40. Arms: A = aurora-wip 57df4db. B = A + #417 #418 #419 #428 #429 #430 #435 at their current heads (one clean merge). Same machine, same boot.
|
This was referenced Nov 19, 2026
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.
statsprinted vertex and fragment times per batch, but only when a timer query happened to request timestamps, and it didn't say which pass a batch was. With this:statsis on;AGXPROFline: start, GPU microseconds, framebuffer size, draw count, colour and depth/stencil formats, clear and load masks, and the source hash of the last fragment shader drawn (the first 4 bytes ofshader_info::source_blake3, which matchMESA_SHADER_DUMP_PATHfile names);comp_endwhilestatsis on, instead of overwritingcomp_start.With
MESA_LOG_FILE, this gives a per-pass profile of a real game. It's how the texel-fetch cost in #417 showed up: three full-screen passes in a Minecraft shader pack took 43 % of the frame.Benchmark
This is a debugging option and is off by default; without
ASAHI_MESA_DEBUG=statsno code path changes, so there's no before/after to measure. Withstatson, every command takes timestamps; that overhead wasn't measured.Testing
On a MacBook Pro 16" M4 Max (J616C, T6041, 32-core GPU), GPU firmware 25G83, Linux 7.3 with the aurora-silicon GPU driver:
aurora-wipf22f090 plus local patches): a Sodium-style test prints one line per pass with plausible times. Minecraft with a shader pack produced a 38 MB log of about 350k commands that aggregated cleanly per frame.aurora-wipdb928e7 + this commit, tested as 68a7ce3, the same tree as 1b68358), release build:meson test --suite asahi138 passed, 0 failed.sodiumpace ... game(100 frames, 3456x2234, source in asahi: compress private Z32F depth on G17P #418) withASAHI_MESA_DEBUG=1queue,stats MESA_LOG_FILE=...logged 122AGXPROFlines. 0 GPU recoveries.Command and raw output (this branch, 17 Nov)