Repository navigation
borealis: enable direct EOT MSAA color resolve on mixed-format AGX3 render passes - #736
Conversation
|
Review at e02eabd. Eligibility is all-or-nothing for the pass:
Rows: the change reaches every |
e02eabd to
3ed967b
Compare
|
Re-review at 3ed967b (first pass was at e02eabd). Earlier points:
New:
Rows: every result in the description is at e02eabd, and the code changed since then. Please re-run at 3ed967b on G16G (M4, e.g. J713), and add G17P (M4 Pro) and G15x (M3, e.g. J615) rows. Each should include the full Assisted-by: LLM (Claude:Opus 5.5) |
…ender passes Multi-RT AGX3 render passes whose attachments do not all share RT0's format take hk_build_g17p_mixed_bg_eot(), which previously always emitted per-sample multisample store EOTs and left MSAA resolves to the post-render blit pass in hk_CmdEndRendering(). For full-area (non-partial renderArea and non-sparse multiview viewMask), non-partial-render, non-suspending/non-resuming 2x/4x MSAA passes where every stored color attachment uses AVERAGE resolve with STORE_OP_DONT_CARE, has a valid matching single-sample PBE resolve target, does not require a shader resolve or raw integer/R11G11B10F/sRGB handling (checked against both the EOT key format and the unmapped view format: required on chips without hk_eot_r11g11b10_own_class() whose PBE uses raw R32_UINT, and conservative on G17P), and stays within the kernel's 14 color/resolve write-range slots (HK_AGX3_G17P_MAX_COLOR_RESOLVE_WRITE_RANGES = 16 - 2), emit single-sample resolving 2D PBE stores directly in hk_build_g17p_mixed_bg_eot() and set render->g17p_direct_color_resolve so hk_CmdEndRendering() skips the redundant post-pass resolve blit. Also harden the shared single-target G17P direct resolve path: - Exclude single-RT R11G11B10_FLOAT from direct EOT resolve when !hk_eot_r11g11b10_own_class(&dev->dev) (G15x, and G16G without the own class) so it never resolves through the raw R32_UINT PBE class while keeping G17P's own-class fast path intact. - Guard both single-target and mixed-target direct resolve against VK_RENDERING_SUSPENDING_BIT and VK_RENDERING_RESUMING_BIT (resumed passes return early from hk_begin_rendering() before loaded_resolve/process_empty_tiles are configured, so a resumed direct EOT could miss tiles drawn only by the suspended half), and include suspend_resume in the per-command-buffer BG/EOT cache key. - Guard sparse multiview viewMask (gating partial_area and sparse_view_mask on incomplete_render_area), drop the unreachable sRGB transfer-bit block in mixed direct resolve, check the unmapped view format for single-target sRGB transfer selection, and check all resolving color attachments when computing loaded_resolve. Add host unit tests covering single-RT R11G11B10_FLOAT own-class gating, mixed-format direct-resolve eligibility (SNORM admission, sRGB and R11G11B10_FLOAT rejection via view_format, suspend/resume and incomplete_render_area rejection, and the named write-range budget), mixed-RT Ioto EOT program generation, and AGX3 2D resolving EOT shader emission. Signed-off-by: Diljit Singh <hey@djdev.me>
3ed967b to
2bfa1cc
Compare
|
Re-review at 2bfa1cc (last pass was at 3ed967b). Everything from the last round is addressed in code:
What is left is hardware evidence. The description still reports e02eabd, and the code has changed twice since then. Please re-run at 2bfa1cc on:
Could you also add the single-RT R11G11B10F change and the suspend/resume refusal to the summary in the description? Assisted-by: LLM (Claude:Opus 5.5) |
Exact-head
|
| Mode | Depth | Base (8b8db5b137c6) |
PR #736 (2bfa1cc139ad) |
Speedup | CRC (valid=true) |
|---|---|---|---|---|---|
tile, msaa=4 |
1 | 10,869.6 us (92 fps) | 9,615.4 us (104 fps) | 1.130× (+13.0%) | 5e4130ce -> 6dc74b48 |
tile, msaa=4 |
2 | 10,416.7 us (96 fps) | 9,259.3 us (108 fps) | 1.125× (+12.5%) | 5e4130ce -> 6dc74b48 |
dram, msaa=4 |
1 | 6,756.8 us (148 fps) | 6,756.8 us (148 fps) | 1.000× (+0.0%) | 7c09507f == 7c09507f |
dram, msaa=4 |
2 | 6,410.3 us (156 fps) | 6,410.3 us (156 fps) | 1.000× (+0.0%) | 7c09507f == 7c09507f |
(tile, msaa=4 CRC 6dc74b48 matches the M4 G16G direct-resolve CRC bit-for-bit.)
Vulkan CTS 1.4.7.1 (5,274 Pass / 2,778 NotSupported / 0 Fail)
| CTS Group | Total | Pass | NotSupported | Fail |
|---|---|---|---|---|
dEQP-VK.renderpasses.dynamic_rendering.*multisample_resolve* (full) |
3,650 | 2,496 | 1,154 | 0 |
dEQP-VK.renderpasses.renderpass2.*attachment_allocation* (full) |
1,200 | 712 | 488 | 0 |
dEQP-VK.renderpasses.renderpass2.*multisample_resolve* (full) |
2,601 | 1,729 | 872 | 0 |
dEQP-VK.renderpasses.dynamic_rendering.*(suspend|resum)* (full) |
431 | 191 | 240 | 0 |
dEQP-VK.renderpasses.dynamic_rendering.*local_read* (full) |
170 | 146 | 24 | 0 |
| Total | 8,052 | 5,274 | 2,778 | 0 |
(Note: b10g11r11_ufloat_pack32 is not present under renderpasses.*multisample_resolve* in CTS 1.4.7.1 and is directly verified on G17P B1 by single_rt_r11g11b10f in test-mixed-mrt-snorm-resolve above; renderpass2.*multisample_resolve* was run single-shard to stay within 8 GB RAM.)
Machine Health
0 kernel GPU faults, 0 AVC denials, PMU 30 00, neo-no-idle-sleep.service active.
Assisted-by: LLM (Antigravity:Gemini 4 Neon)
|
Thanks for the G17P rows at 2bfa1cc. The full multisample_resolve, attachment_allocation and suspend/resume sets pass with 0 Fail. The mixed-MRT SNORM cases and the suspend/resume cases settle the open coverage questions on G17P. The tile CRC matching the G16G direct-resolve CRC fits the 1 LSB edge difference in the pixel audit. One thing left, and it is on M4 (G16G) and M3 (G15x). Those are the chips where this revision changes the path: single-RT R11G11B10F falls back to the meta resolve there, and the G17P Assisted-by: LLM (Claude:Opus 5.5) |
|
Exact-head M4 (
(Note: the installed VK-GL-CTS caselist contains
Assisted-by: LLM (Gemini:4 Neon) |
J714s verification at
|
| Vulkan CTS multisample resolve | Base pass / skip | PR pass / skip |
|---|---|---|
| Render pass 1, suballocation | 2,361 / 250 | 2,361 / 250 |
| Render pass 2, suballocation | 2,353 / 248 | 2,353 / 248 |
| Dynamic rendering, suballocation | 3,168 / 482 | 3,168 / 482 |
All 8,862 individual outcomes matched, with zero failures, crashes or timeouts. The mixed-format pixel verifier also passed all five cases on both drivers, covering signed-normalized color, floating-point color, suspend/resume and single-target R11G11B10F.
4× MSAA at 1080p. Four benchmark invocations per arm, in ABBA then BAAB order, with the median time per submit in microseconds. The Vulkan benchmark performed its built-in pixel checks and every framebuffer CRC matched across arms.
| Workload | Queue depth | Base µs | PR µs | CRC on both |
|---|---|---|---|---|
| Post-processing | 1 | 363.64 | 355.88 | 668d6f0a |
| Post-processing | 2 | 247.16 | 245.82 | 668d6f0a |
| Deferred, tile mode | 1 | 299.76 | 300.48 | 6dc74b48 |
| Deferred, tile mode | 2 | 152.35 | 152.35 | 6dc74b48 |
Release and assert builds each passed 316/316 tests with meson test --suite asahi. GCC and Clang produced the same pre-existing diagnostics on the changed translation units under -Werror. GPU online, crashed=0, quarantined=0, zero new kernel GPU faults.
Release libvulkan_asahi.so SHA-256
- Base
a8f14aa57b839701e7807d8a1a6a5699c5c235b6·0e120da51e133be6d6d71aafbc22bc1bdbeda163f6d5173872dd675736aa5c9a - PR
c01ed0de97b99bffe3827853aa1482d0e3fa70f3·31f316a2fc2f8d139dba497f70fa80d437ef1a54f08da9bee5bc41c6d952b316
Verifier source and earlier G16G and G17P results
Shared the exact verbatim source of test-mixed-mrt-snorm-resolve (all 5 cases, including single_rt_r11g11b10f, plus GLSL shaders, pre-generated SPIR-V headers, and build.sh) as a public gist:
- Gist: https://gist.github.com/DjDeveloperr/c476e07e376352f8179218f21b142fa4
- Exact binary match: compiled cleanly with
clang -O2 -Wall -Wextra -Werror(73,792bytes, same source & binary verified on bothG17P B1in#issuecomment-7085761854andG16G B0in#issuecomment-7085884872). - Build & run:
(If
git clone https://gist.github.com/DjDeveloperr/c476e07e376352f8179218f21b142fa4 test-mixed-mrt-snorm-resolve && cd test-mixed-mrt-snorm-resolve ./build.sh # or: cc -O2 -Wall -Wextra -Werror test_mixed_mrt_snorm_resolve.c -I. -lvulkan -lm -o test-mixed-mrt-snorm-resolve VK_DRIVER_FILES=<asahi_icd.json> ./test-mixed-mrt-snorm-resolve
vulkan/vulkan.his not in system include paths, passCFLAGS="-I<mesa>/include"to./build.sh.)
Note that exact-head M4 (G16G B0) results for all 5 cases + full unstrided CTS (5,257/0) are also live above in #issuecomment-7085884872.
Signed-off-by: Diljit Singh <hey@djdev.me>
satchlj
left a comment
There was a problem hiding this comment.
Verdict: MERGE at c01ed0de97b9
Blockers: none
Checked: Full 875-line diff across src/asahi/vulkan/hk_agx3_ioto_program_core.{c,h}, src/asahi/vulkan/hk_cmd_draw.c, src/asahi/lib/tests/test-agx-g17p-mrt-mixed.c, and src/asahi/vulkan/tests/test-hk-agx3-ioto-program-core.c; native GCC 16 release-with-assertions build (-Db_ndebug=false), full meson test --suite asahi suite (including the new mixed direct-resolve unit tests), and live Mac Studio M5 Max (J775c, T6050) Vulkan CTS execution with LD_DEBUG=libs verification and zero GPU faults.
Evidence
- Audited
hk_agx3_g17p_mixed_direct_color_resolve_supported()andhk_build_g17p_mixed_bg_eot(): direct EOT MSAA resolve on mixed/subset MRT passes is properly gated to 2x/4x non-partial, non-spilled, full render-area/multiview passes outside suspend/resume, enforces the 14 color+resolve write-range cap (reserving 2 slots for depth/stencil within the 16-range limit), requires every stored attachment to AVERAGE-resolve withoutSTORE_OP_STOREinto a matching 1x valid PBE view, and rejects raw-word,R11G11B10_FLOAT, sRGB, and integer formats via both EOT key format and unmappedview_format. - Single-target direct resolve (
hk_agx3_g17p_direct_color_resolve_supported()) cleanly gatesR11G11B10_FLOATonhk_eot_r11g11b10_own_class(), blocks suspend/resume and sparse multiview masks consistently acrosspreserve_resolve_outside,resolved_after_pass,store_and_resolve, anddirect_resolve, checks unmapped view format for sRGB transfer bit0x20, addssuspend_resumetohk_g17p_bg_eot_cache_key, and scans all color attachments forloaded_resolveinhk_begin_rendering(). - Native build on Mac Studio M5 Max (J775c, T6050) at
c01ed0de97b99bffe3827853aa1482d0e3fa70f3(-Dbuildtype=release -Db_ndebug=false, GCC 16.1.1): build succeeded;meson test --suite asahipassed 206/206 (0 failed), includingasahi-g17p-mrt-mixedandhk_agx3_ioto_program_core. - Verified private
libvulkan_asahi.soloaded viaLD_DEBUG=libson Mac Studio M5 Max (J775c, T6050) Vulkan CTS (dEQP Core vulkan-cts-1.4.7.1):dEQP-VK.api.smoke.*(includingdEQP-VK.api.smoke.unused_resolve_attachment): 8/8 PASS (0 failed)- Kernel GPU fault delta:
0
- Exact-head J714s verification (8,862 CTS cases + pixel checks) is recorded on
c01ed0de97b9alongside earlier G16G/G17P hardware rows at2bfa1cc139ad.
|
|
What: Borealis can resolve eligible 2× and 4× MSAA mixed-format color attachments in the end-of-tile store. Ineligible passes retain the separate resolve, including suspended or resumed rendering and packed-float formats that need a shader resolve.
Tested: M5 Pro J714s at
c01ed0de97b99bffe3827853aa1482d0e3fa70f3passed 316/316 Asahi tests in each of two builds and all five pixel checks. The base and PR matched on all 8,862 selected Vulkan CTS cases and on framebuffer CRCs for both benchmarks.Risk: Two-way door · native AGX3 rendering on M3, M4 and Neo. The M5 Pro exercises the separate AGX3C builder and provides regression coverage.
Not yet: Direct execution of the mixed-format optimization on G15x, G16G and G17P at this merge commit.
Details
All stored color attachments must resolve with AVERAGE to matching single-sample views. The eligibility check accounts for the original view format, the tile format, complete render area and multiview coverage, and the fragment write-range budget. Single-target packed-float resolves require the PBE's native packed-float class. Suspended or resumed rendering retains the samples needed by the continuation.
Evidence
J714s used Linux
7.3.0-m5-cdirect15and compared againsta8f14aa57b839701e7807d8a1a6a5699c5c235b6. The J714s verification includes the CTS breakdown, benchmark timings, checksums and pixel checks.The earlier head
2bfa1cc139adc0a3914cfd0245b0ae6ec90b90c1has hardware results on G16G and G17P. The earlier G16G pixel audit found differences of at most one RGB code value at MSAA edges between the direct and separate resolve paths.