fix(shader): place hull input components by their offset in the control-point slot #4723
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/4723"
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 gjonn on 2026-10-12T19:46:39Z.
What
A hull program that reads another input control point at a constant LDS offset (the fast path in
TessellationPointerforinv * stride + constant) took the vec4 component from the whole constant (constant % 16 / 4) instead of from the offset inside the slot the constant lands in. The attribute already usedconstant % stride, and so does the general path. With a local stride that is not a multiple of 16 the two disagree: with a 24-byte stride, a read of control pointinv + 1at offset 24 + 4 = 28 picked component 3 instead of 1, so the hull got the wrong data. The component is nowconstant % stride % 16 / 4.PPSA01317 needs this. Its tessellated hull programs read the next input control point with a 24-byte local stride, and on
mainthey read the wrong components.The new execution test
hull program reading the next of 4 input control points of 24 bytesdraws triangle patches with 4 input and 3 output control points. A local program writes 24-byte slots, and output control pointicopies inputi + 1withds_read_b128 ... offset:24.#4082 changes another part of
TessellationPointer(the factor index), not this line.Tested
Windows 11, MinGW Release build,
ctest -R "^agc_driver_tessellation$"on an NVIDIA GPU.On
mainwith only the test added:With the fix:
agc_tessellation_factor_ringpasses as well.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository (attach them to this PR)Imported from boykopovar/AnyPS5. Originally posted by blawesom on 2026-10-13T06:58:56Z.
Rebase handoff — rebased onto current
main, authorship unchanged.The conflicts needed a real semantic merge with today's #4727: main's
inPatch(...)wrapper on the vertex computation is kept, with this PR's fixed component expression (constant % stride % 16u / 4uinstead ofconstant % 16u / 4u) inside it. Both test lines (main'sHullDynamicIndex, this PR'sHullNextInput) are kept.Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
BUILD_TESTING=ON, AMD RX 9070 XT / RADV):tools/check_conventions.py --base origin/mainpassesagc_driver_tessellationsegfault that currentmainitself has (reported on #4727)One data point for #4727: this PR's fix does not resolve that segfault — with this branch applied (including #4727's
inPatchchange plus this PR's component fix),agc_driver_tessellationstill crashes identically. So the regression is in #4727's computed-index path itself, not the constant-offset component indexing this PR repairs.To pick it up:
Head is
ea2bbefb2.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-13T15:34:45Z.
Rebased onto current
main(the test had to be moved onto the newPatchDrawhelper from the quad/clamp work; the fix itself is unchanged, inside #4727'sinPatch(...)).constant % stride % 16u / 4uis consistent with the attribute index (constant % stride / 16u) and with the general path.agc_driver_tessellationstill segfaults onmainitself, independent of this PR.Merging once the full Build is green.