fix(agc): sample multisampled targets in read-only layout #19686
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19686"
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 oneandonlydean on 2026-11-13T19:56:40Z.
What
On the Intel UHD 770 (#6957), a sampled
OpImageFetchof a multisampled image inVK_IMAGE_LAYOUT_GENERALafter a computeimageStorereturns sample 0's value for every sample index. The stores land (a typedimageLoadsees them); only aGENERALtoSHADER_READ_ONLY_OPTIMALtransition before sampling makes the fetch correct.MultisampleTarget::Sampled()onmainonly settles the storage writes with a memory barrier and binds the target through the borrowed-imageTextureconstructor, which hardcodesGENERAL, soagc_driver_sample_multisample_targetfails there.This change:
MultisampleTarget;SHADER_READ_ONLY_OPTIMALinSampled(), and the sampledTextureview advertises that layout (the borrowed-imageTextureconstructor takes the layout, defaultGENERAL, so other callers are unchanged);GENERALbefore every other use: fast clears, storage writes (Storage(), beforemakeStorablecopies the image), recreation, and color attachment or resolve use throughacquire()(PrepareForColorAttachment);FirstSample()already reads its source throughSampled()with the view's own layout, so its copy follows the new layout.This re-lands only the read-only-layout slice of #6971, which was folded into #6973. #6973 was backed out by #15935; its initial-contents half is already back on
mainthrough #15985, #15986 and #16086. The rest of #6973 (the constructor-time initial guest read and its test changes) is deliberately not part of this PR.Two commits:
MarcZX10's commit from #6971, adapted to thelayerCountparameter the borrowed-imageTextureconstructor has gained since (the layout parameter follows it).Amoenus's fix-up from the #6973 stack, which restoresGENERALwhen a target is recreated;mainhas that recreation path inacquire().Tested
Linux, NVIDIA RTX 4090, Release build with GCC:
On head
5696deb265(based onmain1d1ff1118d;mainhas not touched these files since), all 60 tests matchingmultisample|native_depth|recorderpass, none skipped:This includes
agc_driver_sample_multisample_target,agc_driver_native_multisample_depth, everyagc_driver_native_depth_*test andagc_driver_recorder(with the updated layout assertion).The UHD 770 is not available here, so this does not show the Intel fix itself; on the RTX 4090 the tests only show that the layout tracking breaks nothing. I will ask for a UHD 770 rerun of
agc_driver_sample_multisample_targeton this head in the thread.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:01:24Z.
Review: APPROVED
Reviewed — looks good
Nothing blocks this change; the UHD 770 behavior remains unverified because the author-reported tests ran on an RTX 4090.
What I ran
Reviewed head
93c770c55abe600eefe0c0e58d1f8b980f4fee32from the prepared review bundle usingrepo_read.py. No build or tests were run. Readdescription.md,commits.md,manifest.json,diff.patch, and all four changed files, including targeted repository context for layout transitions and target use.Results
Findings
Blocking
None.
Non-blocking
agc_driver_sample_multisample_targetrerun when that GPU is available.Not verified
No build, tests, or physical-console behavior were run or confirmed in this review. Author-reported test results were not independently verified.
files.jsonhas no excluded entries; all changed files were read. The review bundle excluded the full contents ofTexture.cppandRecorder.cpp, so those were inspected only around their changed lines usingrepo_read.py.To get this to a good state
Nothing is required. Optional: rerun
agc_driver_sample_multisample_targeton an Intel UHD 770 and report the result.Pull request closed