Repository navigation
fix(agc): round the color compare array layer half to even and compare NOT_EQUAL unordered (supersedes #907) - #8625
oneandonlydean wants to merge 3 commits into
Conversation
…nt sampling in the color compare emulation NOT_EQUAL is unordered (true when the reference, the texel or both are NaN) and the other functions are false for NaN, as adriadam10 measured on RDNA2 in the boykopovar#907 review; OpFUnordNotEqual matches. TRUNC_COORD with point sampling changes which texel is read, which the emulation does not model, so the specialization throws for it like the other out-of-scope sampler state; with bilinear filtering it changes the weights, the same gap as the full-float weights, and is documented with them. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ation A four-layer array view with layer coordinates at the rounding points (0.49999997, 0.5, 1.5, 2.5, 3.5) and past the clamp, and neighbouring layers far apart in value, so floor(z + 0.5) and round-half-even give different results; point, bilinear, wrap and border sampling. GREATER next to LESSEQUAL. NOT_EQUAL and LESSEQUAL on a 16_16_16_16_FLOAT texture with NaN and signed-zero references and texels. The TRUNC_COORD rejection. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The emulated comparison picked the array layer as floor(z + 0.5). Measured on RDNA2 (adriadam10, in the boykopovar#907 review), the hardware takes clamp(roundEven(z), 0, layers - 1): z = 0.5 selects layer 0 and 2.5 layer 2, and 0.49999997, which floor(z + 0.5) rounds up to 1 in f32, selects 0. GLSL.std.450 RoundEven matches that and is the rule Vulkan uses for its own array layer. The floor(z + 0.5) came in with boykopovar#668. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
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.
|
|
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? |
|
@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, |
|
First AMD run of this PR, on Linux with RADV. Head 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.
For #8642, which depends on this one: it doesn't merge on top of this head yet ( 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 |
|
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,
|
|
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.
|
|
Closing this as superseded by #8642. Since #8642, these colour compares return a measured zero on |
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 onmain86c1784 (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 86c1784 + 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 (fix(agc): color compare emulation: review follow-up to #668 #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)