Skip to content

feat(agc): remap unsupported tessellation viewport depth ranges - #2

Draft
joedeangelis533-bot wants to merge 1 commit into
review/tessellation-depth-base-20261025from
feat/tessellation-depth-remap-20261025
Draft

joedeangelis533-bot wants to merge 1 commit into
review/tessellation-depth-base-20261025from
feat/tessellation-depth-remap-20261025

Conversation

@joedeangelis533-bot

Copy link
Copy Markdown
Owner

What

When a device lacks VK_EXT_depth_range_unrestricted, a tessellation draw with viewport depth outside [0, 1] stops at ApplyDepthRemap, although the existing vertex fallback can express that transform. Extend that fallback to tessellation evaluation's final position export, including its two near/far clip distances, dynamic scale/offset, prepared-module specialization and push-stage metadata. Reserve the transform's words at bytes 104/108 alongside tessellation levels at 120/124 in both capture and preparation paths, and carry the mode into prepared vertex info. Reject remaps that lack two free combined clip/cull components.

The placement follows Vulkan tessellation and ClipDistance: the evaluation shader supplies the tessellated vertices, and clipping consumes the final pre-rasterization stage's distances. Existing RDNA instruction semantics are reused.

This is a fork draft for review, based on upstream 5b85225ef39b9321d8f5c251ecb391b8331e8aea. Mesh/combined geometry and the existing float-depth clamp limitation remain documented. No additional playable game or speed improvement is claimed.

The required upstream overlap check was run. boykopovar#6612 now merges cleanly after separating our capacity clamp from its stage-routing rewrite. boykopovar#6989, boykopovar#6995, boykopovar#7002 and boykopovar#7310 conflict at neighboring debt entries. A merge-tree comparison of 102 reported PRs also identifies stale shader/driver branches requiring manual coordination, including boykopovar#7642, boykopovar#9356, boykopovar#9387, boykopovar#9508 and boykopovar#10193. These are integration concerns for upstream submission; none is included in this standalone draft.

Tested

Windows 11 Pro 26300, WinLibs GCC 15.2.0 UCRT r7, Release, SPIRV-Tools enabled. Built the runtime/graphics libraries and dependencies plus seven focused test executables.

On each GPU, the exact final tests grafted onto unchanged upstream fail the three new regression paths (agc_driver_tessellation_depth_range_remap, the new graphics-state case, and depth-remap unit coverage); the other five tests pass. With this patch, 8/8 pass on each GPU:

agc_tessellation_lowering, agc_driver_tessellation_depth_range_remap, agc_driver, agc_shader_disk_cache, agc_driver_graphics, agc_driver_depth_range_remap_draw, agc_driver_tessellation, agc_depth_range_remap.

  • New GPU regression: 14 clipping and stored-depth cases, including negative-one-to-one, normal/reversed transforms, both clipping planes and narrowed clamp ranges. Existing vertex GPU coverage still passes.
  • Unit coverage: both raster stages, prepared specialization/reuse, push overlap rejection, preserving six guest clip distances, and rejecting excess clip/cull output capacity.
  • Matched baseline and candidate runs use ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest -V; all four logs contain zero VUID- messages and no missing-layer warning. Loader debug additionally confirms insertion of the official Khronos validation DLL (1.4.366). The test explicitly forces the restricted feature path on both GPUs.
  • Test-registration CTests: 2/2 pass; project registration checker passes. Conventions and whitespace checks pass.
  • Runtime validation used source 7c3084d84d64; final commit only shortens the debt entry. All core source, tests and CMake files are byte-identical.

No game/console run or Intel hardware validation. The complete local evidence is retained in anyps5-playability-review-20261025.

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
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 5080 (621.01 / 32.0.16.2101) and AMD Radeon(TM) Graphics (31.0.22044.1), Windows 11 Pro 26300.
  • AI-assisted: yes

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant