feat(agc): upload varying guest samples of a multisampled texture no draw rendered to #13146
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/13146"
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 Prophet069 on 2026-10-30T04:15:56Z.
What
Sampling or storing to a multisampled R_X or Z_X color texture that no draw rendered to threw when its guest memory held more than one repeated 32-bit value.
createFillednow detiles the guest samples withMultisampleTextureLayout::Detileand writes them into the host target withDispatchMultisampleImagethrough an unsigned storage view; the staging buffer lives only until the recorder finishes. Uniform memory keeps the exact clear as before. D_X, standard swizzles and compressed surfaces still throw. The debt entry is updated; that the console samples such a surface from its guest color memory stays inferred, not measured.Tested
ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1andVK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation(VVL vulkan-sdk-1.4.321.0; neither log containswas not found but was requested by env var VK_INSTANCE_LAYERS),ctest --test-dir build -R <the 63 tests of agc_shader_memory_tests, agc_driver_cmask_fast_clear_tests, agc_driver_graphics_tests and agc_driver_sample_multisample_target_tests> -Von main8c8b998620and on this branch, same machine and GPU: main 63/63 passed, 0VUID-; this branch 63/63 passed, 0VUID-. New cases inSampleMultisampleTarget.cppcompare the uploaded samples with the guest bytes.sampling the 1920x1080 multisampled texture 0xc2e95f0000 of 4 samples, which no draw rendered to … does not hold one repeated 32-bit value(compute shader0xc280055c00). With it that stop is gone; the next run reached 1800 dispatches (previously 1500) and stopped later at the CMASK/DCC fast clear handled in a separate PR. Whether the upload path itself ran in that run was not logged.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-11-01T19:47:45Z.
Review: COMMENTED
The evidence is in good order (main vs branch on the same GPU with validation, no new VUIDs, Death Stranding 2 reaching it). Two points on the new upload path in
MultisampleTarget.cpp:Barrier wider than needed. After the
DispatchMultisampleImageloop the barrier isCOMPUTE_SHADER -> ALL_COMMANDSwith colour attachment, shader and transfer read/write access. The path this replaces ended withTRANSFER -> COLOR_ATTACHMENT_OUTPUT. This runs once per created target, but it is still a full drain of everything recorded after it in the batch, and it is not tied to any consumer. Please narrow the destination to the stages that actually touch the image next (fragment shader / colour attachment output / compute), or say which consumer needs transfer and ALL_COMMANDS.Whole-surface host staging at creation.
guestSampleUploadbuilds a buffer ofwidth * height * samples * elementBytes(for the 1920x1080, 4-sample case that is about 33 MB for a 4-byte element) and keeps it until the recorder finishes, then dispatches inmaxStorageBufferRange-sized pieces. Is the buffer freed as soon as the recorder retires, and is there a cap if a title creates several of these in one frame? A counter for the bytes uploaded and the number of uploads per run in the test would show the cost is bounded.