Repository navigation
fix(shader): place hull input components by their offset in the control-point slot - #4723
Conversation
|
Rebase handoff — rebased onto current The conflicts needed a real semantic merge with today's #4727: main's Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release,
One data point for #4727: this PR's fix does not resolve that segfault — with this branch applied (including #4727's To pick it up: Head is |
…ol-point slot A hull reading input control point i + k at a constant LDS offset took the vec4 component from the whole constant (constant % 16 / 4) instead of from its offset inside that control point's slot. With a local stride that is not a multiple of 16, a read of the next control point (offset 24 + 4 with a 24-byte stride) landed on component 3 instead of 1. Take the component from constant % stride, as the attribute and the general path already do.
|
Rebased onto current
Merging once the full Build is green. |
21758e6 to
1c8d898
Compare
* fix(agc): accept integer tessellation partitioning Ported from upstream PR boykopovar#5234, adapted to our triangle/fractional-odd only tessellation path: VGT_TF_PARAM.PARTITIONING 0 decodes, emits equal spacing and bounds factors at 64. Metal still refuses guest tessellation draws in MetalRenderState. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(agc): accept fractional-even tessellation partitioning Ported from upstream PR boykopovar#5402 (its integer-partitioning base commit is the previous commit), adapted to our triangle-only tessellation path: VGT_TF_PARAM.PARTITIONING 3 decodes, emits fractional-even spacing and bounds factors at 64. Metal still refuses guest tessellation draws. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): place hull input components by their offset in the control-point slot Ported from upstream PR boykopovar#4723 (shader hunk; its Vulkan execution test is not ported). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): lower hulls with one input or one output control point (partial) Ported from upstream PR boykopovar#5457, commits 1, 4 and 5 of 5 (hull exec masks restored through phis, input stride from the patch term, one output control point per patch). Vulkan execution-test hunks are not ported. Skipped from boykopovar#5457, with reasons: - relative patch index rebuilt as data: needs GE_CNTL.PRIM_GRP_SIZE and BREAK_WAVE_AT_EOI in TessellationConfiguration, VGT_LS_HS_CONFIG patchesPerGroup and the request key/serializer additions. None of these exist on main, which only lowers triangle fractional-odd hulls. - recording BDA faults in hull programs: drops a refusal whose safety rests on upstream hull work we lack; the refusal stays. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): honour SPI_BARYC_CNTL.FRONT_FACE_ALL_BITS for the front-face input Ported from upstream PR boykopovar#5314. Tracks SPI_BARYC_CNTL in the draw key and shader request key, and bumps the request serialization to version 24 (shared with the following slice-offset port, which adds no second bump). Not ported: the ShaderMemory serializer-version assertions of the PR, which build on upstream test scaffolding absent from main. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * fix(shader): propagate color view slice to pixel ancillary input Ported from upstream PR boykopovar#5500, adapted to main: the draw decode sets the color view slice as layerBase (the layer-export decode this PR also touches does not exist on main, so its diagnostic and layers hunks are skipped). layerBase is added to the pixel info, request key, shader info, disk cache and pipeline specialization constants. The request serialization stays at version 24, bumped once by the front-face commit. The shader disk cache format is bumped to 36. Not ported: unrelated hunks the upstream commit carried in Recompiler.cpp (dot-product capability option) and its ShaderMemory serializer tests. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj * test(shader): cover tessellation partitioning, hull slot placement, layerBase and serializer v24 Fix the stale serialization version expectation in the shader memory test, add pixel ancillary rows with a non-zero layerBase, extract PixelLayerBase for a derivation test, and point the FrontFace note at TechnicalDebt.md. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DgW4n3qYgi5jAAohEmXRQj --------- Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com> Co-authored-by: XairRrR <dev910382@gmail.com>
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)