Repository navigation
fix(shader): normalize offset perspective barycentrics after interpolation - #7831
Conversation
|
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.
|
|
First GPU run, on AMD and Windows. AMD Radeon 860M (RDNA 3.5,
AI-assisted: yes (Claude Code) |
|
RADV run, the case from #7825: Linux (Ubuntu, kernel 7.0), Ryzen 5 5625U iGPU (Vega, RADV RENOIR, Mesa 26.0.8, no
On None of the four logs contains |
|
AMD and Intel Windows data: the 29 tests built from Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built,
There is no run without the change: the test diff uses the new AI-assisted: yes (Claude Code) |
|
Follow-up with
|
|
Thanks for the AMD/Windows, RADV, lavapipe, Intel, and validation-layer runs. Together they show the target |
c567669 to
53643d3
Compare
|
Rebased this PR onto current |
|
Rebased this PR onto current main as 53643d3. The conflict resolution keeps both this change’s reciprocal-W interpolation and main’s mesh barycentric position inputs; the cache encoder/decoder preserve both metadata additions in matching order. check_conventions.py and git diff --check pass on the new head. The AMD, Intel, RADV and lavapipe test results above were from c567669, before rebase, and have not been rerun on this head. This host cannot run the focused test executables because its Xeon E5-1620 v2 lacks the project’s required AVX2/BMI/FMA features; the filesystem also has only 1.2 GiB free, so a clean rebuild is not available here. |
adriadam10
left a comment
There was a problem hiding this comment.
Rechecked against current main: the reciprocal-W normalization and main's mesh barycentric inputs still coexist, and the merge is clean. One point left:
core/shader/recompiler/ShaderDiskCache.hpp:16: the PR addsShaderInfo::smoothOffsetBarycentricsandBarycentricEmulation::smoothOffsetto the serialized format but doesn't bumpFormatVersion(still 41 on main), so existing v41 caches would be decoded misaligned. Bump it to 42.
With that, this is ready to merge.
|
Addressed the cache-format review in I used 44 rather than 42 because two other open cache-format changes already occupy the intervening versions: #7689 uses 43, and #6924 also changes serialized cache records. This keeps the format identifier distinct regardless of merge order. The code change is one focused commit; I did not add merge or empty commits. |
|
Thanks for catching the cache compatibility issue. The current head |
|
The current PR head |
|
@adriadam10 could you take another look? Your remaining point is addressed on b4b2314: Once you're happy, it goes to full CI on this head. Several open PRs bump the same |
|
The cache-format issue is fixed on current head |
MarcZX10
left a comment
There was a problem hiding this comment.
Rechecked the current head b4b231470e21d852a1d000e067660ec006f86a98: the serialized barycentric fields now bump the cache format from 41 to 44, so the v41 misdecode concern is addressed. The author-facing follow-ups here have asked for a re-review several times; reviewer adriadam10 should now be able to dismiss the old CHANGES_REQUESTED state if satisfied.
b4b2314 to
b67f0d2
Compare
|
Rebased the PR onto current |
|
CI has now completed on exact head b67f0d2: eligibility, conventions, labels and the progress report pass. Runtime build jobs (Linux, Windows, relinker, register-context and write-watch) were skipped by workflow gating, so this is not a runtime validation result. The outstanding review state is still the cache-version request; current main is format 42 and this PR uses 44 to avoid the other open serialization changes. |
|
A Windows GPU run, since the PR's runtime CI jobs were skipped. It ran on an RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.5002, Windows 11 26200, MinGW GCC 15.2.0, Release, AMD's driver reports Four tests:
So AMD's proprietary compiler doesn't show the RADV behaviour from #7825: Not run: the validation layer, RADV, and titles. |
|
Thanks for the independent Windows GPU matrix. The forced emulation runs exercise the path implicated by #7825 on gfx1031, while the native runs check the driver-supported path; the 3/3 results are useful and clearly scoped. I have asked @adriadam10 to reassess the cache-version correction and this additional evidence together. |
adriadam10
left a comment
There was a problem hiding this comment.
The normalization and the serialized-field changes look right. One point left:
core/shader/recompiler/ShaderDiskCache.hpp:16: main already reachedFormatVersion44, so the PR's 44 no longer invalidates anything and v44 caches would be decoded misaligned. Bump it to 45 (the existing test then still checks the previous version is rejected).
With that, this is ready to merge.
|
RADV / Polaris run at
AI-assisted: yes. |
|
Updated the cache format to 45 on this PR so it invalidates v44 entries containing the old serialized layout, as requested in the latest review. The other active schema changes need merge-order coordination: #9889 and #9897 also currently set 45, while #9852 changes serialized fields but currently leaves the format at 44. If another schema change lands first, this branch will need to rebase and use the next version on the resulting main. Please coordinate the merge order; this update is based on current main at v44. |
bd2d457 to
62bd463
Compare
|
The cache format is now 45 as requested (main is at 44, so v44 entries are invalidated; the existing disk-cache test checks the previous version is rejected). The only conflict with main was |
Keeps this branch's FormatVersion above main's 45 (#7831's barycentric bump).
What
Fixes perspective-correct barycentric reads at sample and center offsets when the host lacks native fragment barycentric support. The emulation path interpolates reciprocal clip-W weighted vertex basis values with
NoPerspective, then normalizes the selected component to recover perspective-correct barycentrics. Geometry and tessellation emulation layouts are updated, along with shader disk cache format and layout regression checks.Tested
Linux, AnyPS5 shader recompiler/AGC driver.
cmake --build /tmp/AnyPS5-7794-build --target agc_driver_pixel_sample_iteration_tests agc_driver_graphics_tests --parallel 4passed.python3 tools/check_conventions.py --base upstream/mainandgit diff --checkpassed. Targeted CTest launch aborted before test code because this host's Xeon E5-1620 v2 lacks AnyPS5's required AVX2/BMI/FMA CPU features. No RADV GPU is available here; GPU validation remains outstanding.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)