feat(agc): implement quad tessellation with counter-clockwise output and level clamps #4082

Merged
Celegans12 merged 1 commit from upstream-pr/4082 into main 2026-10-13 10:42:26 +00:00
Celegans12 commented 2026-10-11 22:54:10 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-11T22:54:10Z.


What

The tessellation reference path from #1491 accepts only triangle patches with clockwise output, and refuses any HOS level clamp narrower than [1, 63]. Draws with quad patches, TRI_CCW output or a lower VGT_HOS_MAX_TESS_LEVEL abort in DecodeShaderStages.

  • Quad domains and TRI_CCW now decode, and the domain program gets Quads and VertexOrderCcw. Isolines, other partitionings, point or line output and the reserved domain still throw.
  • VGT_HOS_MIN/MAX_TESS_LEVEL are runtime values: each draw pushes them in the last 8 bytes of the pre-rasterization push constant slot (as the mesh draw words), and the hull reads them there to clamp its factors. One hull serves every level; the levels are in no shader, draw, validation or pipeline key and not in the recompile request. Outer factors that are zero, negative or NaN still cull. Clamps outside 0 <= min <= 63, max >= 1, min <= max throw.
  • Quad hulls write four outer and two inner factors per patch at a 24-byte stride, mapped 1:1 to TessLevelOuter[0..3] and TessLevelInner[0..1]. The source is the TF ring store in Mesa's ac_nir_lower_tess_io_to_mem.c, the fork the technical debt already cites. Quad hulls using the 16-byte triangle stride are refused.
  • ShaderValidation derives the expected execution modes from the configuration.

PPSA26344's first terrain draw uses VGT_LS_HS_CONFIG 0x1043f and VGT_TF_PARAM 0x4006a (quad, fractional-odd, TRI_CCW) with a maximum level of 9, as Pipodi decoded on discussion #675. debt/shader.md notes that the quad factor layout and the clamp/cull order are unmeasured on the console.

Tested

Based on main 4bb2c7f3. Windows 11 (MinGW-w64 GCC 15.2.0) and Linux: configure -DBUILD_TESTING=ON, full build, --target libs, ctest. Measured on #4222's head, which contains this PR:

  • Windows NVIDIA: 1049/1051 pass; log_macros fails here on every branch and on main, and patched_libraries cannot load main's libkernel_sys.prx (error 127), which this chain does not touch
  • Linux (upstream's job in WSL, GCC 13.3, llvmpipe), merged with main 8299b2f7: 1033/1034 pass; agc_driver_depth_compare_copy also fails on main

agc_driver_tessellation gains a counter-clockwise winding case, a clamp case that draws with one compiled hull at max 1 (a level-5 patch goes flat), again at max 64 (it is tessellated again) and at min 5 (a level-1 patch is tessellated; level 0 still culls), a hand-assembled quad patch with opposite CW/CCW winding, and a refusal of a quad hull at the triangle stride. agc_driver_graphics now expects the title's registers to decode. Each fails on main; the shared-hull draws also fail with the levels compiled into the hull.

Not tested: console behaviour (factor edge order, clamp order).

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: PPSA26344 #675
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4823008780 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-11T22:54:10Z. --- ### What The tessellation reference path from #1491 accepts only triangle patches with clockwise output, and refuses any HOS level clamp narrower than [1, 63]. Draws with quad patches, `TRI_CCW` output or a lower `VGT_HOS_MAX_TESS_LEVEL` abort in `DecodeShaderStages`. - Quad domains and `TRI_CCW` now decode, and the domain program gets `Quads` and `VertexOrderCcw`. Isolines, other partitionings, point or line output and the reserved domain still throw. - `VGT_HOS_MIN/MAX_TESS_LEVEL` are runtime values: each draw pushes them in the last 8 bytes of the pre-rasterization push constant slot (as the mesh draw words), and the hull reads them there to clamp its factors. One hull serves every level; the levels are in no shader, draw, validation or pipeline key and not in the recompile request. Outer factors that are zero, negative or NaN still cull. Clamps outside 0 <= min <= 63, max >= 1, min <= max throw. - Quad hulls write four outer and two inner factors per patch at a 24-byte stride, mapped 1:1 to `TessLevelOuter[0..3]` and `TessLevelInner[0..1]`. The source is the TF ring store in Mesa's `ac_nir_lower_tess_io_to_mem.c`, the fork the technical debt already cites. Quad hulls using the 16-byte triangle stride are refused. - `ShaderValidation` derives the expected execution modes from the configuration. PPSA26344's first terrain draw uses `VGT_LS_HS_CONFIG` 0x1043f and `VGT_TF_PARAM` 0x4006a (quad, fractional-odd, `TRI_CCW`) with a maximum level of 9, as Pipodi decoded on discussion #675. `debt/shader.md` notes that the quad factor layout and the clamp/cull order are unmeasured on the console. ### Tested Based on `main` 4bb2c7f3. Windows 11 (MinGW-w64 GCC 15.2.0) and Linux: configure -DBUILD_TESTING=ON, full build, --target libs, ctest. Measured on #4222's head, which contains this PR: - Windows NVIDIA: 1049/1051 pass; `log_macros` fails here on every branch and on `main`, and `patched_libraries` cannot load `main`'s `libkernel_sys.prx` (error 127), which this chain does not touch - Linux (upstream's job in WSL, GCC 13.3, llvmpipe), merged with `main` 8299b2f7: 1033/1034 pass; `agc_driver_depth_compare_copy` also fails on `main` `agc_driver_tessellation` gains a counter-clockwise winding case, a clamp case that draws with one compiled hull at max 1 (a level-5 patch goes flat), again at max 64 (it is tessellated again) and at min 5 (a level-1 patch is tessellated; level 0 still culls), a hand-assembled quad patch with opposite CW/CCW winding, and a refusal of a quad hull at the triangle stride. `agc_driver_graphics` now expects the title's registers to decode. Each fails on main; the shared-hull draws also fail with the levels compiled into the hull. Not tested: console behaviour (factor edge order, clamp order). ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: PPSA26344 #675 - [x] AI-assisted: yes
oneandonlydean commented 2026-10-13 00:33:08 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T00:33:08Z.


Needs a rebase: it conflicts with main in RequestSerializer.cpp (the request is at version 18 now), tests/ShaderMemory.cpp and docs/dev/TechnicalDebt.md, which was split into docs/dev/debt/.

One change while you are there. VGT_HOS_MIN/MAX_TESS_LEVEL are per-draw register values, and this bakes them into the hull as constants and adds them to its cache key (CacheKey.hpp, EmitSetTessellationAttribute in SpirvModuleEmitter.cpp), so a title that changes the maximum level compiles one hull per value. Please pass the two levels to the hull as runtime values and keep them out of the shader cache key and the request, the same as the depth export clamp; the request version then doesn't need to move. The quad domain, TRI_CCW and the factor layout are fine as they are.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6135329455 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6135329455). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T00:33:08Z. --- Needs a rebase: it conflicts with main in `RequestSerializer.cpp` (the request is at version 18 now), `tests/ShaderMemory.cpp` and `docs/dev/TechnicalDebt.md`, which was split into `docs/dev/debt/`. One change while you are there. `VGT_HOS_MIN/MAX_TESS_LEVEL` are per-draw register values, and this bakes them into the hull as constants and adds them to its cache key (`CacheKey.hpp`, `EmitSetTessellationAttribute` in `SpirvModuleEmitter.cpp`), so a title that changes the maximum level compiles one hull per value. Please pass the two levels to the hull as runtime values and keep them out of the shader cache key and the request, the same as the depth export clamp; the request version then doesn't need to move. The quad domain, `TRI_CCW` and the factor layout are fine as they are.
Celegans12 commented 2026-10-13 01:51:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-13T01:51:54Z.


@oneandonlydean rebase complete

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136337126 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6136337126). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-13T01:51:54Z. --- @oneandonlydean rebase complete
oneandonlydean commented 2026-10-13 02:19:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-13T02:19:24Z.


The rebase is clean. The second point is still open: VGT_HOS_MIN/MAX_TESS_LEVEL are still constants in the hull (SpirvModuleEmitter.cpp:1229-1237) and part of its cache key (CacheKey.hpp:110-111), the draw, validation and pipeline keys (DrawLookup.cpp:30, DrawRegisterKey.cpp:87, Draw.cpp:710-711, Pipeline.cpp:828-829) and the request, which went to version 20 for them (RequestSerializer.cpp:522-535). Please pass the two levels to the hull as runtime values and take them out of those keys and the request, so it stays at version 19; or say what stops that here.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136778648 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6136778648). Originally posted by [oneandonlydean](https://github.com/oneandonlydean) on 2026-10-13T02:19:24Z. --- The rebase is clean. The second point is still open: `VGT_HOS_MIN/MAX_TESS_LEVEL` are still constants in the hull (`SpirvModuleEmitter.cpp:1229-1237`) and part of its cache key (`CacheKey.hpp:110-111`), the draw, validation and pipeline keys (`DrawLookup.cpp:30`, `DrawRegisterKey.cpp:87`, `Draw.cpp:710-711`, `Pipeline.cpp:828-829`) and the request, which went to version 20 for them (`RequestSerializer.cpp:522-535`). Please pass the two levels to the hull as runtime values and take them out of those keys and the request, so it stays at version 19; or say what stops that here.
Celegans12 commented 2026-10-13 02:38:47 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-13T02:38:47Z.


You're right, and sorry for missing that part on the first pass. I'll pass both levels to the hull at runtime the way the depth export clamp is passed, and take them out of the cache, draw, validation and pipeline keys and out of the request, so #4082 no longer moves the request version. The rest of the chain then shifts down by one version. I'll restack it and post here when the new head is up.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6136990957 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6136990957). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-13T02:38:47Z. --- You're right, and sorry for missing that part on the first pass. I'll pass both levels to the hull at runtime the way the depth export clamp is passed, and take them out of the cache, draw, validation and pipeline keys and out of the request, so #4082 no longer moves the request version. The rest of the chain then shifts down by one version. I'll restack it and post here when the new head is up.
kr4y4 commented 2026-10-13 06:15:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by kr4y4 on 2026-10-13T06:15:40Z.


An Intel run, a second hardware driver for the tessellation test.

Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head e1b7688b8 merged into main 495bf91a0, which passes 1023 of 1023 on both GPUs.

  • agc_driver_tessellation, agc_driver_graphics and the agc_shader_memory entries (9 entries) pass on both GPUs with --repeat until-fail:3. None of them skipped on the Intel iGPU.
  • Full suite (ctest --timeout 120 --parallel 4): 1023 of 1023 on both GPUs.

No negative control: all three test executables use this branch's new interfaces and don't build against main's sources.

Written with AI assistance.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6139508658 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6139508658). Originally posted by [kr4y4](https://github.com/kr4y4) on 2026-10-13T06:15:40Z. --- An Intel run, a second hardware driver for the tessellation test. Setup: Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, CI configure flags, an RTX 4070 Laptop GPU and an Intel Raptor Lake-S iGPU. The head e1b7688b8 merged into `main` 495bf91a0, which passes 1023 of 1023 on both GPUs. - `agc_driver_tessellation`, `agc_driver_graphics` and the `agc_shader_memory` entries (9 entries) pass on both GPUs with `--repeat until-fail:3`. None of them skipped on the Intel iGPU. - Full suite (`ctest --timeout 120 --parallel 4`): 1023 of 1023 on both GPUs. No negative control: all three test executables use this branch's new interfaces and don't build against `main`'s sources. Written with AI assistance.
fdfawef324 commented 2026-10-13 06:22:22 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by fdfawef324 on 2026-10-13T06:22:22Z.


Rebased e1b7688b onto main 88107b7d as 7e3eefae (author kept: Celegans12). Branch: integ/pr4082-rebased on the fork.

Conflicts:

  • tests/execution/Tessellation.cpp, main(): #4727 (0b7de0e7) added RequirePatches(..., HullDynamicIndex, ...) where this PR adds RequireCounterClockwise, RequireLevelClamps and RequireQuads. Kept all four, HullDynamicIndex first.
  • Everything else merged without conflicts. TessellationLowering.cpp and SpirvModuleEmitter.cpp merged next to #4727's dynamic hull-input index changes, and docs/dev/debt/shader.md keeps #4727's entry plus this PR's two. git range-diff against the original commit shows only those context lines. main is still at request version 19, so the bump to 20 still applies. tools/check_conventions.py --base upstream/main passes.

Tests (Windows Server 2025, MinGW-w64 GCC 15.2.0):

  • The 13 changed C++ sources (including the three test files and, through tests/ShaderMemory.cpp, CacheKey.hpp) pass g++ -std=c++23 -fsyntax-only.
  • Not run yet: agc_shader_memory, agc_driver_graphics, agc_driver_tessellation, agc_tessellation_factor_ring. The build directory for this rebase did not configure (its submodule checkout was broken), so nothing was built or linked.

The second review point (pass VGT_HOS_MIN/MAX_TESS_LEVEL to the hull at runtime, take them out of the cache, draw, validation and pipeline keys and the request) is still open. This rebase does not change it.

GTA V (PPSA04264) stops on this exact check: after 205 frames (17.5 FPS) it aborts with AGC graphics: tessellation level clamps inside the fractional-odd range [1, 63] are unsupported from DecodeShaderStages (State.cpp:619). That run used an integration build on main 7e181fcc. State.cpp is the same on 88107b7d. The log does not print VGT_HOS_MIN/MAX_TESS_LEVEL (context 0x287/0x286). Because of the order of the checks on main, the draw must be a triangle domain with fractional-odd partitioning and clockwise output, and both levels must be finite. Beyond that, min > 1 or max < 63. Whether the values are inside what this PR accepts (0 <= min <= 63, max >= 1, min <= max) cannot be read from that log.

With this rebase in an integration build (main 7e181fcc plus other open PRs, libraries built with GCC 15.2 -O3), GTA V gets past the level-clamp check: the error above no longer appears. It now stops at the next tessellation limitation, in a hull shader: ShaderRecompiler::Recompile: tessellation lowering: the tessellation ring or LDS address is not affine in the control point and relative patch (pc 0xc7c). So this PR removes GTA V's first tessellation stop; the next one is in the lowering, not in this PR's scope.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6139600697 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6139600697). Originally posted by [fdfawef324](https://github.com/fdfawef324) on 2026-10-13T06:22:22Z. --- Rebased e1b7688b onto `main` 88107b7d as 7e3eefae (author kept: Celegans12). Branch: `integ/pr4082-rebased` on the fork. Conflicts: - `tests/execution/Tessellation.cpp`, `main()`: #4727 (0b7de0e7) added `RequirePatches(..., HullDynamicIndex, ...)` where this PR adds `RequireCounterClockwise`, `RequireLevelClamps` and `RequireQuads`. Kept all four, `HullDynamicIndex` first. - Everything else merged without conflicts. `TessellationLowering.cpp` and `SpirvModuleEmitter.cpp` merged next to #4727's dynamic hull-input index changes, and `docs/dev/debt/shader.md` keeps #4727's entry plus this PR's two. `git range-diff` against the original commit shows only those context lines. `main` is still at request version 19, so the bump to 20 still applies. `tools/check_conventions.py --base upstream/main` passes. Tests (Windows Server 2025, MinGW-w64 GCC 15.2.0): - The 13 changed C++ sources (including the three test files and, through `tests/ShaderMemory.cpp`, `CacheKey.hpp`) pass `g++ -std=c++23 -fsyntax-only`. - Not run yet: `agc_shader_memory`, `agc_driver_graphics`, `agc_driver_tessellation`, `agc_tessellation_factor_ring`. The build directory for this rebase did not configure (its submodule checkout was broken), so nothing was built or linked. The second review point (pass `VGT_HOS_MIN/MAX_TESS_LEVEL` to the hull at runtime, take them out of the cache, draw, validation and pipeline keys and the request) is still open. This rebase does not change it. GTA V (PPSA04264) stops on this exact check: after 205 frames (17.5 FPS) it aborts with `AGC graphics: tessellation level clamps inside the fractional-odd range [1, 63] are unsupported` from `DecodeShaderStages` (`State.cpp:619`). That run used an integration build on `main` 7e181fcc. `State.cpp` is the same on 88107b7d. The log does not print `VGT_HOS_MIN/MAX_TESS_LEVEL` (context 0x287/0x286). Because of the order of the checks on `main`, the draw must be a triangle domain with fractional-odd partitioning and clockwise output, and both levels must be finite. Beyond that, min > 1 or max < 63. Whether the values are inside what this PR accepts (0 <= min <= 63, max >= 1, min <= max) cannot be read from that log. With this rebase in an integration build (`main` 7e181fcc plus other open PRs, libraries built with GCC 15.2 -O3), GTA V gets past the level-clamp check: the error above no longer appears. It now stops at the next tessellation limitation, in a hull shader: `ShaderRecompiler::Recompile: tessellation lowering: the tessellation ring or LDS address is not affine in the control point and relative patch` (pc 0xc7c). So this PR removes GTA V's first tessellation stop; the next one is in the lowering, not in this PR's scope.
Celegans12 commented 2026-10-13 09:42:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Celegans12 on 2026-10-13T09:42:59Z.


@oneandonlydean the levels are runtime values now; the new head is 23342340cc.

Each draw reads VGT_HOS_MIN/MAX_TESS_LEVEL and pushes them into the last 8 bytes of the pre-rasterization push constant slot, and the hull loads them from there before it clamps its factors. They're out of the hull cache key, the draw, validation and pipeline keys and the request, so #4082 no longer touches RequestSerializer. One thing I couldn't place: I didn't find a depth export clamp on main that reads its value at run time, so I followed the mesh draw words, which reach the mesh shader the same way. If you meant a different mechanism, point me at it and I'll switch.

The clamp test now compiles the hull once and draws with it three times: max level 1 flattens the level-5 patch, the next draw at 64 tessellates it again, and min 5 tessellates the level-1 patch. Ported to the old head, where the levels were compiled into the hull, the first of those draws fails.

The rest of the chain is restacked on main 4bb2c7f3. main itself now writes request version 20 (#423), so #4114 takes 21 and #4201 takes 22, the same numbers they had before.

Details
  • Push layout: TessellationLevelPushOffsetBytes 120, 8 bytes (min and max as f32). Tessellation draws cap every stage's push data in that slot at 120 bytes (DrawCapture and both ShaderRegistry paths), and pushDrawConstants refuses a stage whose push range would overlap the levels. The hull always declares the push block, so PushConstantStages includes the tessellation control stage, as it does the mesh stage.
  • The clamp math is unchanged: a factor counts as inside when it is > 0 (outer) or > 1 (inner), then becomes min(max(factor, lowest), min(HOS_MAX, 63)) with lowest = HOS_MIN for outer and max(HOS_MIN, 1) for inner factors. Zero, negative and NaN outer factors still cull. DecodeShaderStages still refuses clamps outside 0 <= min <= 63, max >= 1, min <= max.
  • The levels moved from TessellationConfiguration to Graphics::ShaderStages (minTessellationLevel, maxTessellationLevel). VGT_HOS_* stay in DrawKeyRegisters, which already listed them on main because the decoder reads them.
  • Targeted tests (agc_driver_tessellation, agc_shader_memory, agc_driver_graphics, agc_tessellation_factor_ring, agc_driver_bda_device, agc_driver_prepared_graphics, agc_driver_mesh) pass on each of the six heads (RTX 3080 Laptop).
  • CI on #4222's head c4b02f0db6: Windows NVIDIA 1049/1051 (log_macros, plus patched_libraries, which can't load main's libkernel_sys.prx; the chain doesn't touch it); Linux on llvmpipe merged with main 8299b2f7, 1033/1034 (agc_driver_depth_compare_copy, also failing on main).
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6142774443 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/4082#issuecomment-6142774443). Originally posted by [Celegans12](https://github.com/Celegans12) on 2026-10-13T09:42:59Z. --- @oneandonlydean the levels are runtime values now; the new head is 23342340cc. Each draw reads `VGT_HOS_MIN/MAX_TESS_LEVEL` and pushes them into the last 8 bytes of the pre-rasterization push constant slot, and the hull loads them from there before it clamps its factors. They're out of the hull cache key, the draw, validation and pipeline keys and the request, so #4082 no longer touches `RequestSerializer`. One thing I couldn't place: I didn't find a depth export clamp on `main` that reads its value at run time, so I followed the mesh draw words, which reach the mesh shader the same way. If you meant a different mechanism, point me at it and I'll switch. The clamp test now compiles the hull once and draws with it three times: max level 1 flattens the level-5 patch, the next draw at 64 tessellates it again, and min 5 tessellates the level-1 patch. Ported to the old head, where the levels were compiled into the hull, the first of those draws fails. The rest of the chain is restacked on `main` 4bb2c7f3. `main` itself now writes request version 20 (#423), so #4114 takes 21 and #4201 takes 22, the same numbers they had before. <details><summary>Details</summary> - Push layout: `TessellationLevelPushOffsetBytes` 120, 8 bytes (min and max as f32). Tessellation draws cap every stage's push data in that slot at 120 bytes (`DrawCapture` and both `ShaderRegistry` paths), and `pushDrawConstants` refuses a stage whose push range would overlap the levels. The hull always declares the push block, so `PushConstantStages` includes the tessellation control stage, as it does the mesh stage. - The clamp math is unchanged: a factor counts as inside when it is > 0 (outer) or > 1 (inner), then becomes min(max(factor, lowest), min(HOS_MAX, 63)) with lowest = HOS_MIN for outer and max(HOS_MIN, 1) for inner factors. Zero, negative and NaN outer factors still cull. `DecodeShaderStages` still refuses clamps outside 0 <= min <= 63, max >= 1, min <= max. - The levels moved from `TessellationConfiguration` to `Graphics::ShaderStages` (`minTessellationLevel`, `maxTessellationLevel`). `VGT_HOS_*` stay in `DrawKeyRegisters`, which already listed them on `main` because the decoder reads them. - Targeted tests (`agc_driver_tessellation`, `agc_shader_memory`, `agc_driver_graphics`, `agc_tessellation_factor_ring`, `agc_driver_bda_device`, `agc_driver_prepared_graphics`, `agc_driver_mesh`) pass on each of the six heads (RTX 3080 Laptop). - CI on #4222's head c4b02f0db6: Windows NVIDIA 1049/1051 (`log_macros`, plus `patched_libraries`, which can't load `main`'s `libkernel_sys.prx`; the chain doesn't touch it); Linux on llvmpipe merged with `main` 8299b2f7, 1033/1034 (`agc_driver_depth_compare_copy`, also failing on `main`). </details>
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5!4082
No description provided.