fix(agc): round the color compare array layer half to even and compare NOT_EQUAL unordered (supersedes #907) #8625
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8625"
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-10-20T18:52:53Z.
Supersedes #907
What
AGC colour-compare emulation (
image_sample_con a colour texture) fixes by @ThisIsAkill, rebased onto currentmain. The branch is #907's three commits with their authorship kept; Rujul Talekar (@Roojool) posted the resolved rebase in a #907 comment on 14 Oct, and this branch re-applies that resolution onmain86c1784b9(the debt note and the test file conflicted again and were resolved the same way).RoundEven), where it wasFloor(z + 0.5).docs/dev/debt/shader.mdis updated.Both behaviours are the ones @adriadam10 measured on RDNA2 (gfx1035). #907 had no review blocker (adriadam10: "ready to merge from my side", 11 Oct) and the author has not replied since 7 Oct.
Tested
Linux (CachyOS, kernel 7.2.3), NVIDIA GeForce RTX 4090, driver 610.57.04, Release, GCC 16 build from this branch (main
86c1784b9+ the three commits):ctest -R agc_driver_emulated_color_compare:agc_driver_emulated_color_compareandagc_driver_emulated_color_compare_srgb_decodepass (0.58 s, 0.27 s)..cppfiles (SpirvImageEmitter.cpp,ResourceMaterializer.cpp,EmulatedColorCompare.cpp) pass ag++ 13.5 -fsyntax-onlycheck with the project flags (Linux CI uses GCC 13).main's shader (the new cases are written to fail there; not run here).Checklist
main; no other open PR implements the same functions (#907 is the same change and is superseded)NotImplemented_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-10-20T19:45:47Z.
I checked the overlap against the separate measurements now recorded on #7934. This PR corrects array-layer rounding, NOT_EQUAL NaN behavior, and TRUNC_COORD handling. The GFX10 format split is a distinct behavior: point comparisons return zero for every sampled floating format except codes 7 (16_UNORM) and 22 (32_FLOAT), corroborated on gfx1031 and gfx1036, with gfx1100 also reporting point and bilinear results. The candidate fix changes the format dispatch and the same regression test file touched here, so I won't publish a competing branch. Would you prefer that the format split be stacked as a follow-up to this PR, or kept as a separate PR after this lands?
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-20T19:51:12Z.
@MarcZX10 thanks for checking the overlap and for the measurements on #7934. Please keep the format split as a separate PR. This one is queued for testing on its current branch, and stacking would mean starting that over. If you open it now,
Depends on: #8625is fine. It can go in right after this lands, and it'll need its own rebase of the shared test file.Imported from boykopovar/AnyPS5. Originally posted by DavidAmsellem on 2026-10-20T20:35:56Z.
First AMD run of this PR, on Linux with RADV. Head
8feaa79a7merged ontomainaa1b1bfce(clean merge), built in full and compared with the samemain, on the same machine.AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.
agc_driver_emulated_color_compareandagc_driver_emulated_color_compare_srgb_decode: pass 3 of 3 each withANYPS5_NO_SHADER_CACHE=1, and under the Khronos validation layer they add no VUID (the only message isVkDeviceCreateInfo-pNext-pNext, which my older 1.3.275 layer prints for every device because it doesn't knowmaintenance8).ANYPS5_REQUIRE_VULKAN=1 ctest -j8) ateb01b8813: 1733/1734, failing onlyagc_driver_guest_memory_lifetime(#7784), which fails onmaintoo.For #8642, which depends on this one: it doesn't merge on top of this head yet (
EmulatedColorCompare.cppanddocs/dev/debt/shader.mdconflict), as its description says, so I'm testing it on its own againstmainand will report there.GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38
AI-assisted: yes
Imported from boykopovar/AnyPS5. Originally posted by janzezno on 2026-10-20T23:04:30Z.
Run on AMD hardware.
Host: Arch Linux, kernel 7.2.11, AMD Radeon RX 7900 GRE (RADV NAVI31), Mesa 26.2.5, GCC 16.2.1, Release,
BUILD_TESTING=ON.maine25333e39; PR head8feaa79a7emerged on top (clean merge).ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R 'compare|denorm|f32|f16|f64|agc_shader_memory|agc_shader_disk_cache|request_serializer|dcc|storage|pm4|indirect' -Vmain: 137 of 137 pass. PR: 137 of 137 pass, includingagc_driver_emulated_color_compareandagc_driver_emulated_color_compare_srgb_decode.VUID-set and counts on both; none is new. The validation layer loaded in both runs.Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-21T04:39:40Z.
An AMD proprietary-driver run: RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2.0 Release.
main7ab4b2e56with only this PR'sEmulatedColorCompare.cpp:agc_driver_emulated_color_compareand_srgb_decodefail 3 of 3 with2D array, point, clamp to edge: thread 2 compared to 1.000000, expected 0.000000.main7ab4b2e56merged with this head8feaa79a7(clean merge): all 5 tests pass 3 of 3: those two plusagc_driver_depth_compare_copy,agc_driver_image_plane_compare_on_lineandagc_driver_image_one_dimensional_compare.ctest -Von the same 5: 0VUID-lines onmainand with this PR. The layer was inserted in all 5 test processes on each side.Pull request closed