Repository navigation
fix(shader): normalize negative color comparison wrap indices - #2177
Conversation
570e680 to
72c6f98
Compare
|
The PR is based on current |
|
Windows run: Windows 11 Pro 25H2 (10.0.26200.9457), RTX 5060 Ti (NVIDIA 617.42), MinGW-w64 GCC 15.2.0 (WinLibs r7), Release,
AI-assisted: yes |
|
Thanks for the Windows run: it covers the exact head 72c6f98 on current main, and the full Windows CTest passes (510/510), including the NVIDIA emulated color-comparison test. That supplies the Windows evidence. The upstream PR still reports only Conventions; under CONTRIBUTING, could an authorized collaborator run the official Build for this exact head to record Linux and the relinker matrix? I will keep the PR open until that check is available. |
72c6f98 to
e755aaf
Compare
|
Rebased the existing PR linearly onto current |
e755aaf to
911d951
Compare
|
Rebased the existing PR onto current |
adriadam10
left a comment
There was a problem hiding this comment.
Thanks for the PR. Checked on current main + this head (Linux, lavapipe, Release):
- The new
point, wrapcase passes without the emitter change (revertedSpirvImageEmitter.cpp, rebuilt, test still passes), so it doesn't pin the fix. It runs withoffsets=false, so it never produces a negative texel index either; the existingbilinear, wrap, offsets...case already covers negative indices and passes onmain. - SPIR-V
OpSModalready takes the sign of the divisor (result in[0, extent)for a positive extent), so on a conformant driver the current code is correct. The description says the regression fails with directOpSModon llvmpipe (LLVM 15.0.6); I couldn't reproduce that, and no log is attached. docs/dev/TechnicalDebt.md:361describes a driver workaround as a PS5 behaviour gap; if this is a driver bug it should say which driver/version.
To move forward: provide a test that fails on main and passes with the change (negative texel coordinates or offsets, with the driver and version where it fails), or close the PR if it was not reproducible.
911d951 to
606bc16
Compare
|
Thanks for identifying the missing negative-index case. I added one to the execution regression and reproduced the failure on the named driver. Current head:
Both versions were built and run from the same Linux x86_64 GCC 12.2 Release tree. I updated TechnicalDebt and the PR description to identify this as a Mesa 22.3.6 llvmpipe result. Conventions and This reproduces a driver-specific regression and validates the workaround on that driver. It does not establish PS5 behavior, which remains unmeasured. Please re-evaluate the change request with the added case and control result. |
Current-head CI resultBuild run 38034308447 completed successfully on head
The focused Linux regression and baseline-control result are described above. This provides no PS5 hardware or game-runtime evidence. The requested negative-offset case reproduces on the named Mesa/llvmpipe version and passes with the change; please re-review when convenient. |
adriadam10
left a comment
There was a problem hiding this comment.
Checked on current main + this head (Linux, Release): agc_driver_emulated_color_compare passes. The new case passes on conformant drivers even without the emitter change (so it only discriminates on the old llvmpipe you named, which we can't reproduce), but the OpSRem + correction is equivalent to OpSMod for a positive extent and harmless elsewhere. Windows/NVIDIA run by @rmz-24 also passes. PS5 behaviour is unmeasured, as recorded in TechnicalDebt. Merging.
What
Normalize negative texel indices in the emulated color-comparison wrap path before converting them to unsigned image coordinates. Add a point-filtered wrap execution case with texel offsets that produce negative indices. This specifically exercises the failure on Mesa 22.3.6 llvmpipe (LLVM 15.0.6): the base
OpSModpath returned 0 where the CPU reference expected 1; the explicitOpSRemnormalization passes. The implementation follows repeat addressing (VK_SAMPLER_ADDRESS_MODE_REPEAT) and uses signed remainder semantics with a correction into the nonnegative texel range. See the Vulkan specification and SPIR-VOpSRem. The technical-debt entry records that PS5 behavior has not been measured.This is distinct from #2092, which expands supported color-comparison descriptor formats and views; it does not change address wrapping.
Tested
Current head
9ffd06eais rebased onto upstreammainata291ae0f88d3dbee71ebf0226ede547284450fd5. The three-file diff remains limited to the emitter, its execution test, and TechnicalDebt.libSceAgcDriverandagc_driver_emulated_color_compare_tests; focused CTestagc_driver_emulated_color_comparepasses (1/1) with the new negative-offset point-wrap case.main's unmodifiedOpSModemitter and the new test case, the test fails at thread 4 (actual 0, expected 1). With this PR'sOpSRemnormalization, the test passes. The baseline and candidate were built and run from the same Release tree.python3 tools/check_conventions.py --base upstream/mainandgit diff --check upstream/main...HEADpass.Checklist
main; no other open PR implements the same wrap correctionNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt — not applicable to this change.mdfiles or images added to the repository