Repository navigation
fix(shader): read 2D textures through MSAA image loads - #6815
Conversation
|
Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
|
jotitadev
left a comment
There was a problem hiding this comment.
NVIDIA run, since the description lists NVIDIA as not run.
Machine: NVIDIA GeForce RTX 3070, driver 595.99.02, Vulkan 1.4.329, plus lavapipe (Mesa 26.0.3, LLVM 21.1.8) on the same machine. Ubuntu 26.04 (kernel 7.0.0-38), i7-8700, GCC 15.2, Release, BUILD_TESTING=ON. Head d513fb987 merged onto main bc400bede, clean merge.
GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02), lavapipe (Mesa 26.0.3, LLVM 21.1.8), Ubuntu 26.04
Set: agc_driver_image_msaa_address_on_plane, agc_shader_memory, agc_driver_image_volume_address_on_plane, agc_driver_sample_multisample_target, -j1 --timeout 60.
- Test only (
ResourceMaterializer.cppfrommain):agc_driver_image_msaa_address_on_planefails on both devices withimage descriptor is incompatible with the static runtime image interface: descriptor format 20 .... The other three pass. - With the change: 4/4 pass in 3 runs on the RTX 3070 and in 3 runs on lavapipe. On the 3070 the new test goes through all four formats (20, 22, 56, 130: R32_UINT, R32_FLOAT, RGBA8_UNORM, RGBA8_SRGB), so the per-driver sRGB control comparison also holds on NVIDIA.
- RTX 3070,
ctest -R "^agc|shader|recompiler" -E "agc_display_buffer_dcc|agc_driver_flip|agc_driver_lds_atomics64|display|flip" -j1 --timeout 60: 616 tests. Onlyagc_driver_store_over_untrackedfails, and it fails on unchangedmainbc400bedehere too (#6347).agc_driver_stencil_ref_exportskips.
Not checked: Windows, titles, any hardware oracle rows beyond what the test pins.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
A data point from PPSA01317 on current main (Windows 11, RTX 5090 Laptop): this PR fixes one of its aborts. After about 50 s of boot, a shader does multisample image loads on a plain 1x1 2D R8 texture, and main refuses that. With this PR's two commits cherry-picked, the title gets past it, to about 900 to 1,100 frames. AI-assisted: yes |
|
RTX 4090 data point on PPSA01317, on top of today's runs on D4697 (same box, same stack): with this PR the Setup. Gran Turismo 7 PPSA01317 01.000.001 (base package), Windows 11 (26200), RTX 4090 (NVIDIA 616.92), AMD Ryzen 7 5800X, MinGW-w64 GCC 15.2.0 r7 (UCRT), Release Result. The control (same tree without this PR, four runs earlier today) aborts 36 to 37 s after launch, every time, on (a 2D 8-bit T#, TYPE 9, read by a pixel shader whose only compiled modes are 2D MSAA). With this PR that shader compiles and runs in all three runs; no refusal of that wording anywhere. The runs then diverge in time, not in outcome:
Runs 2 and 3 both end on Two observations on the way there, neither caused by this PR as far as I can tell: the screen stays black after the "Sony Interactive Entertainment presents" splash in all runs (title-bar counter 59.94 FPS at 476 frames at +15 s, 12 FPS at about 1,320 frames by +35 s), and the frame counter stops advancing for long stretches (run 1: 860 frames from +50 s to the 300 s kill; run 2: 1,327 frames from +50 s to at least +180 s, then the abort at 247 s) while the guest keeps streaming textures. Run 1 was the cold run, so it may be the same cold-cache stall I saw on #7238; run 2 was warm, so it is not only that. Run 3 reached the same shader in 43 s without the pause.
stderr of run 3 (warm, box idle) from the save-data mount to the abort, the per-shader
|
d513fb9 to
72959f7
Compare
klosixgaming-arch
left a comment
There was a problem hiding this comment.
Tested on Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA GeForce RTX 5090 (driver 617.42), Ryzen 9 9950X3D. Head 72959f7c0 (two commits) merged onto current main (ad502d7); clean merge. I first tested the earlier head d513fb987 with the same result and re-ran after the force-push.
agc_driver_image_msaa_address_on_planepasses with the change.- On
mainwith only this PR's test file it fails withimage descriptor is incompatible with the static runtime image interface: descriptor format 20 decodes to {class 2, dim 3, ...}, the refusal quoted in the description, so the new test fails without the fix and passes with it. - I read the production change (five lines in
ResourceMaterializer::RuntimeImageModes): it adds the ordinary 2D mode only for a 2D_MSAA image that is mip-less 32-bit and is not a table, storage, depth, converted or packed access, so everything else keeps its previous refusal. The hardware-oracle table in the description is the author's measurement on gfx1032; I did not rerun it.
Not tested: Cocoon (PPSA08766); I have no dump, so the title claim is the author's.
AI-assisted: yes. Written with AI assistance and reviewed by me.
jotitadev
left a comment
There was a problem hiding this comment.
Apple GPU / MoltenVK run of the new head. agc_driver_image_msaa_address_on_plane passes on Metal with all four formats. Apple is a third driver whose sRGB decode differs from the Radeon oracle, so the switch to comparing encoded texels in 72959f7 is needed here too.
Machine: Apple M2 Max, macOS 27.2, x86-64 build under Rosetta. Head 72959f7, PR diff applied cleanly. Drivers: MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0) and MoltenVK main + SPIRV-Cross #2704.
Tested: the tree is main a373e85 + mugurc's macOS series (ci/macos-series-2) + the PRs needed to build on macOS (#6667, #6668, #7524, #6969, and two files of #7332), not plain main (it doesn't build on macOS yet). Also in the same build: #7725, #7729, #7717, #7694, #7682, #7731 and #6815 (they applied cleanly together), plus a test-only patch that lets nine AGC fixtures load the Vulkan loader on macOS (branch jotitadev:fix/agc-tests-vulkan-loader-macos). Base on that tree: 40 ^agc failures with MoltenVK 1.4.2 and 26 with MoltenVK main + #2704.
-
agc_driver_image_msaa_address_on_plane,agc_shader_memoryandagc_driver_image_volume_address_on_planepass 3 of 3 on both drivers.agc_driver_sample_multisample_targetskips here (storage image multisampling unavailableon MoltenVK). -
With
ResourceMaterializer.cppback to the base, the new test fails on both drivers withimage descriptor is incompatible with the static runtime image interface. -
With the test as it was at d513fb9 (absolute tolerance 0.0001 against the oracle), it fails on both drivers with
MSAA-address normalized load differs from the Radeon oracle. Only format 130 (sRGB) differs, on 4 of the 9 texels:Apple Radeon oracle exact decode of the byte 0.052747 0.052979 0.052861 (65) 0.527228 0.527344 0.527115 (192) 0.533333 0.535156 0.533276 (193) 0.545788 0.546875 0.545724 (195) Apple stays within about 1e-4 of the exact decode, and the oracle's values are quantized (
0x3f090000). The encoded 8-bit texel matches in every case, so the current check passes. -
Full
^agcsuite with the stack: the base failures on each driver, plusagc_driver_pooled_buffer_rangeandagc_performance_overlay, which only run because of the loader patch. Nothing from this PR.
GPUs tested: Apple M2 Max (MoltenVK 1.4.2; MoltenVK main + SPIRV-Cross #2704)
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
|
Tested on Windows 10 (19045), RTX 3060 12 GB (NVIDIA 617.42), Cocoon PPSA08766 01.004.000,
|
|
Thanks for the Windows main/change comparison. I have added your machine, revisions, and observed result to the description, explicitly attributed to your report. It confirms this PR clears the descriptor/interface refusal; #6801 addresses the next geometry-output refusal. Your follow-up on #6801 reaches the separate point-context-defaults path covered by #6821. No gameplay or fully working Windows title claim is made. AI-assisted: yes |
|
Checked the diff: the new runtime mode is limited to mip-less 32-bit non-storage, non-depth, non-packed, non-converted, non-table |
What
Cocoon (PPSA08766, #6651) reaches a fragment program with DIM 2D_MSAA
image_loads bound to an ordinary 2D T#. Main refuses it withimage descriptor is incompatible with the static runtime image interface: the descriptor is 2D, while all compiled modes are multisampled.For a mip-less 32-bit image load, add the ordinary 2D runtime mode. The existing emitter then reads x/y at the viewed base level and ignores the sample operand, as the measured hardware does. The genuine MSAA mode remains available. This does not change stores, atomics, A16 or mip-bearing addresses, packed accesses, converted formats, depth-bit views, array-MSAA addresses or image-table handling.
Only five production lines change. No new metadata fields, request version or runtime ABI is introduced; the existing shader-source version invalidates old artifacts.
Hardware evidence
Measured directly with
tools/hw-oracleon RX 6650 XT, gfx1032: wave32 and wave64, R32_UINT / R32_FLOAT / RGBA8_UNORM / RGBA8_SRGB, sample indices 0, 1, 2, 7, 31 and 0xffffffff, and in-range plus out-of-range x/y. Every one of 768 rows matches the same ordinary DIM 2D load on the same 4x4 linear 2D T#. Integer/float markers separate the addressed texels; out-of-range coordinates return zero.All FP controls were explicit: IEEE 0, DX10 clamp 1, denorm32 0, denorm16 3, round32/16 0, FP16 overflow 0. This is gfx1032 evidence, not a console/gfx1013 measurement. The scope and remaining refusals are recorded in shader debt.
Tested
Standalone head
d513fb987f731207cbd5503ec3ceccceb7bbc9f0: two linear commits on main82ddae75b676, no dependencies. Arch Linux 7.2.9-arch1-1, GCC 16.2.1, Ryzen 9 7950X.libsand all four selected test executables build.agc_driver_image_msaa_address_on_plane,agc_shader_memory,agc_driver_image_volume_address_on_plane,agc_driver_sample_multisample_target.ResourceMaterializer.cppwith main's version, retaining the final test; it fails at the original static-runtime-image-interface refusal. Restore the fix and rebuild: the selected tests pass.Related #6635 adds genuine multisampled-array image views; it does not implement ordinary 2D T# loads and is not a dependency.
Independent NVIDIA validation
jotitadev tested this head merged onto main
bc400bedeon an RTX 3070, NVIDIA 595.99.02 / Vulkan 1.4.329, Ubuntu 26.04 (kernel 7.0.0-38), GCC 15.2. The four selected checks passed in three runs on NVIDIA and three runs on lavapipe Mesa 26.0.3 / LLVM 21.1.8. The new check exercised all four formats on NVIDIA. With the test retained and main'sResourceMaterializer.cpp, the new check failed on both devices; the other three passed.Their broader NVIDIA run covered 616 tests.
agc_driver_store_over_untrackedfailed on both this change and unchanged main (#6347);agc_driver_stencil_ref_exportskipped. They did not test Windows, titles, or additional hardware-oracle rows. These are the reviewer's results, separate from the local Radeon measurements above.Native bring-up
The Cocoon diagnostic stack carries #6639/#6801, #6653 and #6743. They are not code dependencies of this PR. Baseline
c283a7718396refuses the descriptor at 4.03 seconds. Integrationb83e429e7613, which adds only this change and its regression, builds full runtime libraries and passes 7/7 focused checks. The title passes that image refusal and aborts at 6.03 seconds on a separate missingPA_SU_POINT_SIZEcontext register. Both runs exit 134 and restore temporary settings. No matching game window or visible gameplay is confirmed.Hardware rows, reproduction script, exact sources and sanitized validation. A separate private capture of the failing fragment request contains 136 code words and two DIM 2D_MSAA loads; no guest bytes, memory capture or full title logs are published.
No FPS, load-time gain, newly playable title, Windows or console result is claimed. Full hosted CI remains for collaborator dispatch.
A separate isolated Override 2 (PPSA01907 v01.007.000) check restacks these two unchanged topic commits onto main
66e290f1cas66a91f2c2. Fulllibsbuilds; the new GPU test passes 1/1 on RADV and 1/1 on lavapipe, zero skips. Both native runs exit 0 and restore temporary settings. The cold-cache run only supplies startup captures; the warm follow-up reaches the menu but its 85 s capture still has very dark 3D output. This change does not resolve that observation, and no Override compatibility or performance gain is claimed. The 19 locally captured compute requests replay successfully; they do not cover the active graphics requests. Sanitized report and screenshot:image-msaa-main66-validation-public.json,image-msaa-main66-menu.png.Current-main refresh (2026-10-19 UTC)
Rebased the two topic commits onto main
659230f7b676e8c848d70640f823342be6704526, head72959f7c0055c20871ed207868746f928e9cc26f, without merge commits. The sole conflict was additive shader debt; both the upstream VCC-sampler entry and this MSAA-load entry are retained. The five production lines and regression semantics are unchanged.Full runtime
libsand all four selected test executables build. With required Vulkan andVK_LAYER_KHRONOS_validation, the same four checks pass without skips on RX 6650 XT / RADV Mesa 26.2.4-arch1.1 (3.36 s total) and lavapipe Mesa 26.2.4-arch1.1 / LLVM 23.1.1 (3.79 s total), Arch Linux. Conventions and whitespace checks pass. Earlier hardware measurements, negative controls and collaborator runs above are historical evidence, not rerun measurements on this head. No additional title or performance result is claimed.Contributor-reported Windows/NVIDIA validation by klosixgaming-arch: head
72959f7c0, two commits, cleanly merged onto mainad502d717; Windows 11, MinGW-w64 GCC 15.2.0, NVIDIA GeForce RTX 5090 driver 617.42, Ryzen 9 9950X3D.agc_driver_image_msaa_address_on_planepasses with the fix and fails with only the test on main at the descriptor-format-20 incompatibility named above. The contributor also reviewed the five-line production restriction. They did not test Cocoon or rerun the author’s gfx1032 hardware oracle. These are independently reported results, not local Windows runs; their review was AI-assisted and human-reviewed.Reviewer-reported Apple compatibility (2026-10-19)
jotitadev tested head
72959f7c0on Apple M2 Max under Rosetta with MoltenVK 1.4.2 and MoltenVK main plus SPIRV-Cross #2704. The MSAA-address-on-plane, shader-memory and volume-address checks pass three times on both drivers; the multisample-target check skips because storage image multisampling is unavailable. Reverting the production change fails the new test on both drivers. Their old absolute-oracle comparison also fails for four sRGB texels, while the current encoded-byte comparison passes.This is reviewer-provided evidence from main
a373e85e5plus the macOS series, build prerequisites, several other PRs and a test-loader patch, as listed in that review; it is not a plain-main macOS build, our local execution, or a title/performance claim. No source change is requested by this report.Independent Windows main/change title result: parl0v tested Cocoon PPSA08766 01.004.000 on Windows 10 (19045), NVIDIA RTX 3060 12 GB driver 617.42, main
64e2a810aand main plus this PR72959f7c0. Main aborts on the static runtime image-interface mismatch; with this PR that refusal is gone and the run reaches the geometry-output refusal covered by #6801. Contributor report. Contributor-reported evidence, not independently reproduced on Windows; no gameplay claim.Checklist
main; no duplicate ordinary-2D load implementation found