Repository navigation
asahi,borealis: port pre-packed BG clears and raw32/W16 reloads to native AGX3 - #1432
Conversation
…tive AGX3 Extend the M5 background clear and load fast paths to native AGX3b chips (G15G/S/C, G16G, and G17P): 1. Pre-packed tile background clears (`packed_clear_mask`): enable on `agx_chip_native_or_m5()` for single-sample aligned targets (`R8G8B8A8_UNORM`, `B8G8R8A8_UNORM`, `R16G16B16A16_FLOAT`, `R16G16_FLOAT`, `R16_FLOAT`, `R11G11B10_FLOAT`) across single-RT, dedicated dual-RT, multi-RT, and mixed MRT Borealis paths, gated on tilebuffer byte alignment via `agx_m5_packed_clear_rt_ok()`. 2. Raw32 `R11G11B10_FLOAT` background reloads (`raw32_load_mask`): pack separate `background_raw32_desc` / `layered_background_raw32_desc` `R32_UINT` descriptors in `hk_image_view` while keeping the typed `background` / `layered_background` descriptors intact so partial-area `preserve_resolve_outside` reloads still read typed float3 resolve targets (also fixing M5 when the shader skips raw32 for misaligned offsets). Include the raw32 descriptor and mode bit in `struct hk_g17p_bg_eot_dev_key` so single-RT cached BG programs never alias raw32 vs typed views, and bind the layered descriptor for targets 1+ on layered multi-target reloads. 3. W16 FP16 background reloads: enable `load_f16` on AGX3b exclusively for `PIPE_FORMAT_R16_FLOAT` tile formats (`R16F`, `RG16F`, `RGBA16F`), which store directly via W16 `lstcol` without `fltnorm`. Keep 8-bit normalized W16 reloads (`U8NORM`/`S8NORM`/`SRGBA8`) M5 (AGX3c)-only because AGX3b `fltnorm` has no f16 register source operand. 4. Tests: extend `asahi-g17p-mrt-mixed` with AGX3b binary decode checks covering single-RT/dual-RT/MRT packed clears, 5-RT alignment gating, raw32 `R11G11B10_FLOAT` reloads, W16 FP16 reloads, and negative tests verifying 8-bit normalized, MSAA, and `preserve_resolve_outside` reloads stay on W32/typed paths. Signed-off-by: AxxzyWasTaken <axxzytte@gmail.com>
There was a problem hiding this comment.
Verdict: HOLD at 5fc6d245
Blockers:
- Second GPU-generation hardware row missing: Current hardware evidence covers
J616C(M4 Max,G17P) only. Because this PR modifies sharedagx_bg_eot.c,hk_image_view.c(background_raw32_desc/hk_image_view_can_raw32_bg()), andhk_cmd_draw.cpaths used by both native AGX3 (G17P) and M5 (AGX3C), please add an exact-head hardware row on a second Apple Silicon generation (ideally M5 to verify non-regression on the refactoredbackground_raw32_descpath, or another generation). - Renderpass clear/reload conformance coverage: Please include a targeted Vulkan CTS renderpass clear/load sweep covering the newly enabled native AGX3 packed-clear and raw32/W16 reload formats (
R8G8B8A8_UNORM,B8G8R8A8_UNORM,R16_FLOAT,R16G16_FLOAT,R16G16B16A16_FLOAT,R11G11B10_FLOAT, including mixed MRT reload+clear passes).
Checked:
- Audited full production diff (
+671/-123across 7 files):src/asahi/lib/agx_bg_eot.c: cleanly widenspacked_clear_mask,raw32_load_mask, andR16_FLOATW16 reload toagx_chip_native_or_m5(), while correctly keepingU8NORM/S8NORM/SRGBA8W16 reloads M5 (AGX3C)-only because AGX3Bfltnormlacks anf16register source operand, and gatingload_f16on!key->preserve_resolve_outside.src/asahi/vulkan/hk_image_view.{c,h}: cleanly splitsHK_DESC_USAGE_{,LAYERED_}BG_EOT_RAW32into dedicatedbackground_raw32_desc/layered_background_raw32_descdescriptors so typed descriptors remain intact for paths such aspreserve_resolve_outside.src/asahi/vulkan/hk_cmd_draw.c:hk_build_g17p_mixed_bg_eot(),hk_g17p_bg_eot_dev_key_init(), andhk_build_g17p_bg_eot()consistently checknr_samples == 1,!preserve_resolve_outside,!spilled[rt], and 4-byte tilebuffer offset alignment before settingraw32_load_mask, and includeraw32indk->pbe_valid(bit 2) to keep the device BG/EOT cache key unambiguous.
- Noted host
meson test --suite asahi359/359 PASSandJ616Cexact-head5fc6d245c0aeA/B (render.postfx -0.50%,render.light -0.56%,render.deferred -0.19%, exact CRCs, 0 faults).
Evidence
- Head commit:
5fc6d245c0ae...(MERGEABLEintoaurora-wip). - Modified files:
agx_bg_eot.{c,h},lib/meson.build,test-agx-g17p-mrt-mixed.c,hk_cmd_draw.c,hk_image_view.{c,h}.
|
Targeted J616C (M4 Max, |
|
Second-generation row + renderpass clear/load sweep: J615 (MacBook Air M3, G15G, native AGX3) at exact head Base aurora-wip Renderpass clear/load sweep (VK CTS 1.4.7.1, both arms):
9,619 Pass -> Pass, 0 Fail, 0 regressions. These cover every format with LOAD/CLEAR/DONT_CARE load ops, plus draw and clear_draw, through both render pass APIs. Broader graphics groups, both arms: gpubench-vk (
Output is bit-exact across arms. Timings are within run-to-run spread, about ±1%. Kit and raw output on our buildbox store: This doesn't cover the M5 (AGX3C) refactor of |
There was a problem hiding this comment.
Verdict: MERGE at 5fc6d245c0ae
Blockers:
- None.
Checked:
- Previously audited full 7-file diff (
+671/-123,MERGEABLEagainstaurora-wip):agx_bg_eot.{c,h},hk_image_view.{c,h},hk_cmd_draw.c,test-agx-g17p-mrt-mixed.c,lib/meson.build— cleanly enables pre-packed BG clears and raw32/W16 reloads on native AGX3 while keepingU8NORM/S8NORM/SRGBA8W16 reloads M5-only, splittingbackground_raw32_desccleanly, and preservingpreserve_resolve_outside/ spill / alignment guards and cache-key uniqueness (dk->pbe_validbit 2). - Both earlier review blockers are now satisfied at exact head
5fc6d245c0ae:- Two Apple Silicon GPU generations verified on the changed native AGX3 path:
J616C(M4 Max,G17P) andJ615(M3 Air,G15G), plus hostmeson test --suite asahi359/359 PASS. - Renderpass clear/load conformance verified:
J616C87/87targeted format cases PASS andJ6159,619renderpass format/allocation/simple +14,885image-clearing/draw-renderpass VK CTS cases (24,504Pass->Pass,0regressions, bit-exact CRCs,0GPU faults).
- Two Apple Silicon GPU generations verified on the changed native AGX3 path:
Evidence
- Head:
5fc6d245c0ae0b7e6a89682d1b5b5a8e1b97dac1(baseaurora-wip,MERGEABLE). - Host:
meson test --suite asahi359/359 PASS (-Db_ndebug=false). - J616C (
G17P, M4 Max):gpubench-vkA/B (render.postfx -0.50%,render.light -0.56%,render.deferred -0.19%, bit-exact CRCs), 87/87 targeted renderpass clear/load CTS PASS, 0 faults. - J615 (
G15G, M3 Air): 24,504 VK CTS cases Pass->Pass (0 Fail, 0 regressions),gpubench-vkbit-exact CRCs, 0 faults.
|
Base M5 row (MacBook Air 15" M5, J815, G17G), kernel 7.3.0-aurora-j815-dev, PR head 5fc6d24 vs aurora-wip 8b59f2b, release builds, dEQP-VK 1.4.7.1 (+ KhronosGroup/VK-GL-CTS@c2c05e95f97f):
|
|
@DjDeveloperr, code-owner heads-up: App approval at |
What: Port pre-packed background clear shaders and raw32/W16 tile reload paths to native AGX3 (
G17P/HAL200) in Asahi/Borealis instead of falling back to AGX2-only paths.Tested:
-Db_ndebug=false, rebased onaurora-wip8b59f2b0a70, head5fc6d245c0ae):meson test --suite asahi359/359 PASS (0fail,0skip).G17P,7.3.0-j616c-parity5+, Release ARM64libvulkan_asahi.so) at exact head5fc6d245c0ae:ASAHI_MESA_DEBUG=verifygpubench-vk --test render.deferred --depths 2: exact CRC2cfe9a54,0faults.aurora-wip(8b59f2b0a70,depth=2):render.postfx: wall287.15 -> 285.51 us(-0.57%), GPU270.40 -> 269.04 us(-0.50%), CRC4707efa8exact.render.light: wall60.16 -> 60.15 us(-0.01%), GPU7.46 -> 7.42 us(-0.56%).render.deferred: wall109.47 -> 109.26 us(-0.19%), CRC2cfe9a54exact.overlap.passes: ratio1.16 -> 1.16(+0.27%).dmesg:0GPU/DART faults or recoveries.Risk: two-way door · touches AGX3 background clear and raw32/W16 tile reload lowering; gated to AGX3 native paths.
Not yet: Second Apple Silicon generation hardware row (e.g. M3/M4 base/M5) and full VK-CTS renderpass sweep.