fix(agc): sample multisampled targets in read-only layout #6971
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/6971"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T22:56:38Z.
What
Fixes #6957 by tracking a borrowed multisampled target's current image layout. After storage writes, sampled reads transition the image from
GENERALtoSHADER_READ_ONLY_OPTIMAL; before later attachment or storage use, it transitions back toGENERAL. This targets the Intel UHD 770 behavior reported in the issue while leaving other image access paths intact.The sampled view keeps the requested
VkImageViewTypein its cache key and supports a restricted view usage, so this change composes with #6635's multisampled array views and #6683's sample-order storage view. Their sample-order pass writes through the tracked storage path, so the next sampled read uses the read-only transition. The author of #6635 requested that it land first; this PR remains draft until then. New PR #6973 also changesMultisampleTarget.cppand the sampled view path to initialize native multisample color contents. I have flagged the overlap there and will verify that the layout tracking preserves its initial upload before marking this PR ready.Tested
agc_driver_graphics_tests,agc_driver_recorder_tests, andagc_driver_sample_multisample_target_tests. GCC 12 required a temporarytemplatekeyword workaround in unrelatedSrtDescriptorEvaluation.cpp; I restored that file, and the workaround is not part of this PR.MultisampleTarget.cpp,Texture.cpp,SampleOrder.cpp, andRecorder.cpparray-view regression, and linked the graphics, recorder, multisample-target, and sample-order test executables.agc_driver_sample_multisample_target,agc_multisample_guest_access,agc_driver_sample_order, andagc_driver_sample_order_planningaborts before assertions on this host because its Xeon E5-1620 v2 lacks LZCNT, BMI1/2, MOVBE, AVX2, and FMA. No runtime or Intel UHD 770 result is claimed.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpass.Checklist
main; no duplicate PR implements this layout fixImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-16T23:42:47Z.
Thanks for confirming the composition and preserved authorship. I verified that #6973 carries the #6971 commits, while #6635 and #6973 remain open. I will keep #6971 in draft pending the requested #6635 order and the composition review. The reported validation is useful for the combined changes, but does not establish the Intel UHD 770 result for #6957.
Imported from boykopovar/AnyPS5. Originally posted by savvaniss on 2026-10-17T08:42:36Z.
UHD 770 result, as asked in #6957: this fixes
agc_driver_sample_multisample_targeton the device that reported it.Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
ANYPS5_NO_SHADER_CACHE=1. This headf65cecddamerged intomain5f61879a9. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, withVkCacheemptied first.Tests: the 14 multisample tests on
mainandagc_driver_graphics. The multisample tests areagc_multisample_guest_access,agc_tiled_resolve,agc_driver_msaa_dcc_state,agc_driver_msaa_dcc_clear_2/_4/_8,agc_driver_msaa_enable_single_sample,agc_driver_multisample_fill_host_only,agc_driver_native_multisample_depth,agc_driver_sample_mask_draw/_depth_stencil/_multisample,agc_driver_sample_multisample_targetandimage_msaa_load.main, ×3sample_multisample_targetfails (sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn target); the other 14 passFull CTest with this PR,
--parallel 4: UHD 770 1365 of 1373, RX 9070 XT 1369 of 1373. None of the failures involve multisample targets:select_tests(symlink privilege, #6961).agc_import_watch(the Windows import probe failed at the settle queue (0)) andagc_sample_dumps(access violation inigvk64.dll). Both fail the same way onmainadb0e7a8cwithout this PR.agc_driver_quad_pixel_mask(#6255), andagc_driver_layered_volume_drawandagc_driver_layered_volume_vertex(the GPL cache swap of #4768, #6436).AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-17T09:46:34Z.
Retest on the affected GPU (#6957): Intel UHD Graphics 770 (driver 32.0.101.6129), with an RTX 4090 (NVIDIA 616.92) in the same machine for comparison. Windows 11, WinLibs GCC 15.2, Release. This PR merged onto main
bf2053816; GPU picked withANYPS5_GPU.agc_driver_sample_multisample_target:bf2053816sample 1 of pixel (0, 0) does not hold the stored color into one sample of each pixel of the drawn targetf65cecdda)b64742f86Multisample-related group (
ctest -R 'multisample\|msaa\|resolve\|sample_mask\|image_msaa', 16 tests):sample_multisample_targetfails)So the read-only layout transition fixes the Intel failure, with nothing newly broken in that group on either GPU.
AI-assisted (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T13:18:05Z.
Thanks for the two independent UHD 770 results. Both show the reported
agc_driver_sample_multisample_targetfailure on main and a pass with this change; the broader multisample groups also pass on UHD 770 and the comparison GPUs. This validates the issue-specific fix across the reported driver versions. I’ll keep the dependency/order with #6635 and the combined #6973 review explicit before changing this PR’s merge state.AI-assisted: yes (Codex); reports reviewed.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-20T10:15:20Z.
Status update: #6635 is merged, and open #6973 now contains the multisampled-array support and the read-only sampled-layout commits from this PR, with their authorship preserved. Its current head
cafd4f749is clean. The latest reports cover initial-color preservation on Intel UHD 770 and RX 9070 XT; the separate readback-layout follow-up is tracked in Amoenus/AnyPS5#3. I’m leaving this branch unchanged while that composed series and its follow-up remain active, to avoid publishing duplicate code.Pull request closed