Repository navigation
fix(agc): bind a multisampled sRGB target as a storage image in its UNORM twin - #9260
klosixgaming-arch wants to merge 2 commits into
Conversation
23e2486 to
1397502
Compare
|
Real-title result for PPSA03974 (Cyberpunk 2077 v02.120.000), added after the PR body, and one correction to it. Setup. Windows 11 (10.0.26200), NVIDIA GeForce RTX 5090, driver 617.42, Ryzen 9 9950X3D. Build: a local merge of Before this PR. On With this PR. The same kind of session (same inputs, same scenes) went through character design and on into the first scenes after it, and ran 1878 s (31 minutes) before it stopped. The message above appears 0 times in that log, and the session passed the scene and the time at which the earlier session stopped. I did not trace the lookup in that session, so I cannot show the new code path being taken; the unit test in this PR (fails on Correction to the PR body. The body says the session "ran past 29 minutes with no driver stop". That was written while the session was still running. It later stopped at 1878 s with a different message that this PR does not touch: Validation layer. Khronos validation 1.4.363 was loaded in every test run (VK_LOADER_DEBUG=layer shows it inserted for the instance and the device). Focused multisample and recorder set, 29 ctest entries: Logs are available if useful: the session summary lines ( AI-assisted: yes. Written with AI assistance and reviewed by me. |
|
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
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.
Confirmed red→green on NVIDIA on Linux (the PR's run is an RTX 5090 on Windows).
Tested
Ubuntu 26.04, i7-8700, GCC 15.2.0, Release, BUILD_TESTING=ON, ANYPS5_NO_SHADER_CACHE=1, device selected with VK_ICD_FILENAMES, run as ./agc_driver_multisample_retirement_tests, on main a6dcea927 (this PR applies cleanly on it).
agc_driver_multisample_retirement |
NVIDIA RTX 3070 (595.99.02) |
|---|---|
main a6dcea927 + the test only (MultisampleTarget.cpp reverted) |
fail |
| this PR | pass |
With MultisampleTarget.cpp reverted and the PR's test kept, the run fails with:
AGC graphics: storage image access to multisampled color target 0x... (256x256, 4 samples, vk format 43) as a 256x256 texture of 4 samples and guest format 56 (vk 37) is not implemented
vk format 43 is R8G8B8A8_SRGB and vk 37 is its R8G8B8A8_UNORM twin — the sRGB→UNORM storage binding this PR adds. With the full PR it passes.
lavapipe (Mesa, LLVM 21.1.8): not a clean signal here. agc_driver_multisample_retirement already fails on main a6dcea927 on lavapipe, with and without this PR, at MSAA storage promotion did not retain its source image — a separate, pre-existing born-storable (sample-order, grid 1x1) issue in StorageRemap, unrelated to this change.
GPUs tested: NVIDIA GeForce RTX 3070 (595.99.02, Linux), Ubuntu 26.04.
Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
…NORM twin MultisampleTargetStorageView required the rendered VkFormat to equal the requested one. A 4x R8G8B8A8_SRGB target asked for as guest format 56 (R8G8B8A8_UNORM) therefore threw "storage image access to multisampled color target ... is not implemented", although the target is created with a UNORM storage view for exactly this access. The lookup now matches when both formats resolve to the same host storage format, which only holds for an sRGB format and its UNORM twin or for identical formats. Unrelated formats of the same size are still refused. AI-assisted: yes. Written with AI assistance and reviewed by me.
…rage usage A multisampled sRGB target promoted to storage gained VK_IMAGE_USAGE_STORAGE_BIT on its image, and its color view in the sRGB format inherited that usage. sRGB formats have no storage image feature, so the validation layer reported VUID-VkImageViewCreateInfo-usage-02275 on the first storage access. The view now excludes the storage usage whenever the image has it, which is what it already did for targets created with a sample-order storage form. AI-assisted: yes. Written with AI assistance and reviewed by me.
|
Rebased onto main a6646f8 (two commits, same two changes). One conflict, in Windows 11, RTX 5090, driver 617.42, Vulkan validation layer 1.4.363 (inserted for the instance in the run), AI-assisted: yes. Written with AI assistance and reviewed by me. |
1397502 to
909a9ba
Compare
What
MultisampleTargetStorageViewmatched a rendered multisampled target only when itsVkFormatequalled the requested one. A 4xR8G8B8A8_SRGBtarget asked for as guest format 56 (R8G8B8A8_UNORM) therefore threw, although both are the same bytes and the target already creates a UNORM storage view for exactly this access. The lookup now matches when both formats resolve to the same host storage format, which holds only for identical formats or an sRGB format and its UNORM twin. An unrelated format of the same size is still refused.A second commit removes a spec violation the first one makes reachable: after promotion to storage the target's own color view in the sRGB format inherited
VK_IMAGE_USAGE_STORAGE_BIT, which sRGB formats do not support (VUID-VkImageViewCreateInfo-usage-02275). The view now excludes the storage usage whenever the image has it, as it already did for targets created with a sample-order storage form.Cyberpunk 2077 (PPSA03974) stops with this on a 128x64, 4 sample target in character creation, about 21 minutes into a session:
AGC graphics: storage image access to multisampled color target 0x1cca530000 (128x64, 4 samples, vk format 43) as a 128x64 texture of 4 samples and guest format 56 (vk 37) is not implementedRelated, not the same: #8847 matches sRGB twins for resolve and render and says storage-image access in the twin format "still throws as before"; this PR is that case. #9186 rewrites the same
ifinMultisampleTargetStorageViewinto a block, so the second of the two to merge needs a trivial rebase.Tested
Windows 11 (10.0.26200), NVIDIA GeForce RTX 5090, driver 617.42, Vulkan validation layer 1.4.363.0 (
VK_LAYER_KHRONOS_validation, inserted for the instance and the device in every test).New case
StorageSrgbTwininagc_driver_multisample_retirement: renders a 4xR8G8B8A8_SRGBtarget, asks for a guest format 56 storage view, checks the view is stable on a repeated lookup, and checks guest format 60 is still refused.maincecb540 plus the test only: fails with the message above (vk format 43 / guest 56 / vk 37).Focused set,
ctest -R 'multisample|multisampled|msaa|^agc_recorder|agc_driver_recorder|sampled_cache_budget'withANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1,VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation:main: 25/29 pass, 0VUID-.VUID-VkImageViewCreateInfo-usage-02275(in the new case).VUID-.agc_driver_msaa_dcc_state(exit 0xc0000139) andagc_driver_msaa_dcc_clear_2/4/8(not run). They fail identically onmainand have no executable in my build directory.tools/check_conventions.py --base origin/main: passed.Cyberpunk 2077 (PPSA03974), same machine, a build of this branch merged with #6218 and #7048 (both still open): the session passed character creation and ran past 29 minutes (1767 s in the summary file when this was written) with no driver stop; the
storage image access to multisampled color targetmessage did not appear in the log. Onmainplus #6218, an earlier session with the same kind of play stopped with it at +1253 s. I have not traced whether the new lookup ran in that session, so the unit test above is the direct evidence for the change itself; the game run only shows that this scene no longer stops with it.Checklist
main; no other open PR implements the same functions (fix(agc): retire an undrawn filled multisampled color target that a guest access overlaps #9186 and fix(agc): resolve and render a multisampled target through its sRGB twin format #8847 touch nearby lines, neither implements this).mdfiles or images added to the repositoryAI-assisted: yes. Written with AI assistance and reviewed by me.