Skip to content

feat(agc): draw the last provoking vertex through the barycentric tessellation stages - #7426

Merged
adriadam10 merged 9 commits into
boykopovar:mainfrom
DavidSamir:feat/shader-barycentric-tessellation-last-vertex
Oct 21, 2026
Merged

adriadam10 merged 9 commits into
boykopovar:mainfrom
DavidSamir:feat/shader-barycentric-tessellation-last-vertex

Conversation

@DavidSamir

Copy link
Copy Markdown
Contributor

What

With #7308, a device without geometry shaders draws the barycentric emulation through generated tessellation stages. In last provoking vertex mode (PA_SU_SC_MODE_CNTL.PROVOKING_VTX_LAST) those draws still stopped with last provoking vertex requires VK_EXT_provoking_vertex with provokingVertexLast enabled. Apple GPUs under MoltenVK have neither geometry shaders nor that extension, so after #7308 this became the next stop for several catalog titles on macOS.

The generated stages don't need the extension. The evaluation stage already writes each flat parameter as one vertex's value at every corner of the patch, so the host's choice of provoking vertex for the tessellated triangle cannot change what the pixel shader reads. This PR picks that vertex from the draw's mode, the same way #7251 handles rect lists:

  • Recompiler: BuildBarycentricTessellationShaders takes the provoking vertex, 0 or 2 (anything else throws), and the evaluation stage writes the flat parameters from it.
  • Draw: it passes 2 when the draw is in last mode.
  • ValidateProvokingVertex: for these generated stages, last mode no longer requires VK_EXT_provoking_vertex. A flat per-vertex parameter (flat && perVertex) still throws, as it does for every pipeline in last mode.
  • Tests and docs: below; the debt entries in shader.md and libSceAgcDriver.md now describe the exception.

Commits: shader stages, driver wiring, tests, docs, then a merge of current main.

Tested

Apple M2, macOS 26.7.1, MoltenVK 1.4.2 (no geometryShader, no VK_EXT_provoking_vertex), x86-64 under Rosetta, on the community macOS stack with #7308. The changed files also compile on this Mac against current main, and the conventions check passes.

  • agc_driver_pixel_barycentric_emulation (extended) passes on the M2. A new pixel shader reads the raw I/J (which turns the emulation on) and a FLAT_SHADE input through v_interp_mov_f32 P0. Inside the triangle the weights match, and the flat value is exactly vertex 0's clip x (-0.8) in first mode and vertex 2's (-0.25) in last mode. The geometry route still runs first mode only, where the device has geometry shaders.
  • agc_driver_graphics_tests passes. New cases:
    • provoking vertex 1 is refused;
    • last mode is accepted for the generated tessellation stages without the extension;
    • last mode with the geometry stage still requires the extension;
    • a flat per-vertex parameter in last mode still throws.

Titles (homebrew catalog, checksum-checked, 60 s each, relinked for macOS):

Title With #7308 only With this PR
Stremio Plus (PPSA74126) stops at the last provoking vertex runs 60 s
CD Player (PPSA98427) same stop runs 60 s
OpenNOW PS5 (PPSA99082) same stop runs 60 s (a mutex lock failed message appears only when the run is stopped at the end)
ProsperoStore (PPSA99000) same stop runs 60 s
ProsperoPuzzles (PPSA99006) same stop gets past it, stops at viewport depth outside [0, 1] requires VK_EXT_depth_range_unrestricted, which the M2 lacks

Régie5 (PPSA99520) also gets past this stop, then hangs the GPU about 2 s in. The hang stays when every draw of this PR's stages is skipped (APS5_SKIP_SHADER on their pixel shader), so it is unrelated.

Device limits of the M2 that stop titles here, not tested past them: no geometryShader, shaderFloat64, VK_EXT_provoking_vertex or VK_EXT_depth_range_unrestricted.

Not tested: Windows and Linux, where devices with geometry shaders keep the unchanged geometry route.

Overlap: our #6741 changes the same function, letting a last-mode draw with no flat or per-vertex pixel input use the first-vertex mode. The two only add separate exemptions, so the code merges as both together. Whichever lands second gets a small merge of Pipeline.cpp and the provoking-vertex debt line from me.

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 (feat(shader): emulate barycentrics through tessellation on devices without geometry shaders #7308 is merged)
  • Fixes: none
  • Unblocks: PPSA74126, PPSA98427, PPSA99082, PPSA99000 on macOS (macOS support #1); past this stop also PPSA99006
  • GPUs tested: Apple M2, MoltenVK 1.4.2, macOS 26.7.1 (x86-64 under Rosetta)
  • AI-assisted: yes

…sellation stages

The generated evaluation stage writes the provoking vertex's flat values
at every corner of the patch, so the host's provoking vertex no longer
changes what the pixel shader reads and VK_EXT_provoking_vertex is not
needed for these draws.
…ic-tessellation-last-vertex

# Conflicts:
#	docs/dev/debt/libSceAgcDriver.md
@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 18, 2026
@DavidSamir

Copy link
Copy Markdown
Contributor Author

Cross-vendor check on NVIDIA, head 814f17982 built as is (the merge with main is already in the head).

Setup: Windows 11 Pro 26300, NVIDIA GeForce RTX 3070 (10de:2488), driver 610.60, Vulkan API 1.4.341 as the device reports it, MinGW GCC (WinLibs), Ninja, Release, BUILD_TESTING=ON. Both tests ran under ctest with ANYPS5_NO_SHADER_CACHE=1. The device reports tessellationAvailable=1 and has geometry shaders, so the test runs both routes.

agc_driver_pixel_barycentric_emulation: passed 3 of 3 runs (0.46 to 0.97 s). Each run prints both routes:

barycentric emulation through the geometry stage passed: 932 perspective and 932 linear I/J pixels, raw vertex values, host interpolation, face culling and flat inputs
barycentric emulation through the tessellation stages passed: 932 perspective and 932 linear I/J pixels, raw vertex values, host interpolation, face culling and flat inputs

agc_driver_graphics: passed 3 of 3 runs (6.9 to 9.0 s).

So on NVIDIA the tessellation route gives the same pixels as the geometry route, including the flat inputs from the last provoking vertex.

AI-assisted: yes

@github-actions

github-actions Bot commented Oct 18, 2026 •

Copy link
Copy Markdown

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.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 7883 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L117-118
docs/dev/debt/libSceAgcDriver.md L134
PR 7893 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L117-118
docs/dev/debt/libSceAgcDriver.md L134
PR 8281 docs/dev/debt/shader.md L99-101
PR 8406 docs/dev/debt/shader.md L98-99
PR 8538 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp L114
docs/dev/debt/libSceAgcDriver.md L134

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.

Pull request Shared files not compared
PR 1395 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 1896 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 2434 docs/dev/debt/libSceAgcDriver.md
PR 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 4448 docs/dev/debt/libSceAgcDriver.md
PR 4449 docs/dev/debt/libSceAgcDriver.md
PR 5021 docs/dev/debt/shader.md
PR 5058 docs/dev/debt/libSceAgcDriver.md
PR 5371 docs/dev/debt/shader.md
PR 5372 docs/dev/debt/libSceAgcDriver.md
PR 5404 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 5441 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5499 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 5609 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 5941 docs/dev/debt/shader.md
PR 6009 docs/dev/debt/shader.md
PR 6011 docs/dev/debt/shader.md
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/shader/recompiler/Recompiler.hpp
PR 6194 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6223 docs/dev/debt/libSceAgcDriver.md
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6300 docs/dev/debt/libSceAgcDriver.md
PR 6412 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6488 docs/dev/debt/shader.md
PR 6539 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 6548 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6549 docs/dev/debt/libSceAgcDriver.md
PR 6604 docs/dev/debt/shader.md
PR 6612 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6636 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6639 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6801 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 6867 docs/dev/debt/libSceAgcDriver.md
PR 6868 docs/dev/debt/libSceAgcDriver.md
PR 6879 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 6924 docs/dev/debt/shader.md
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 6973 docs/dev/debt/libSceAgcDriver.md
PR 6977 docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 6987 docs/dev/debt/libSceAgcDriver.md
PR 6989 docs/dev/debt/libSceAgcDriver.md
PR 6995 docs/dev/debt/libSceAgcDriver.md
PR 7002 docs/dev/debt/libSceAgcDriver.md
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7275 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7395 docs/dev/debt/shader.md
PR 7410 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 7449 docs/dev/debt/libSceAgcDriver.md
PR 7484 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 7505 docs/dev/debt/libSceAgcDriver.md
PR 7604 docs/dev/debt/libSceAgcDriver.md
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
PR 7659 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 7684 docs/dev/debt/shader.md
PR 7689 core/shader/recompiler/Recompiler.hpp
PR 7800 docs/dev/debt/libSceAgcDriver.md
PR 7803 docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 7888 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 7911 docs/dev/debt/libSceAgcDriver.md
PR 8004 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 8014 docs/dev/debt/libSceAgcDriver.md
PR 8077 docs/dev/debt/shader.md
PR 8180 docs/dev/debt/libSceAgcDriver.md
PR 8212 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 8365 docs/dev/debt/libSceAgcDriver.md
PR 8489 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 8542 docs/dev/debt/libSceAgcDriver.md
PR 8564 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md
PR 8592 docs/dev/debt/libSceAgcDriver.md
PR 8612 core/shader/recompiler/Recompiler.hpp
PR 8658 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 8881 core/shader/recompiler/Recompiler.hpp
docs/dev/debt/shader.md
PR 8939 docs/dev/debt/shader.md
PR 8971 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
docs/dev/debt/libSceAgcDriver.md
PR 9020 core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
docs/dev/debt/libSceAgcDriver.md
docs/dev/debt/shader.md

@github-actions github-actions Bot added shader core/shader docs agc libSceAgc* labels Oct 18, 2026
…ic-tessellation-last-vertex

# Conflicts:
#	core/shader/recompiler/SpirvBackend/src/BarycentricGeometryShader.cpp
@blawesom

Copy link
Copy Markdown
Contributor

Rebase handoff — rebased onto current main (the full 36-commit series, authorship unchanged). One conflict in BarycentricGeometryShader.cpp: main's newer evaluation-output access-chain form kept, with your provokingVertex substitution for flat values layered onto it (the PR's older glIn/glOut indexing superseded).

Verified on Linux (CachyOS, kernel 7.2.9, GCC 16.2.1, Ninja, Release, BUILD_TESTING=ON, AMD RX 9070 XT / RADV): builds; conventions pass; full suite green apart from the known main regression (agc_driver_tessellation segfault — Mesa, #5444), not this PR — the provoking-vertex tests pass.

To pick it up:

git fetch https://github.com/blawesom/AnyPS5 rebase/7426
git checkout <your branch>
git merge --ff-only FETCH_HEAD

Head is b0cf7e91c.

@github-actions github-actions Bot added needs rebase Conflicts with main, rebase needed unblocks title Names a title ID on the Unblocks line labels Oct 18, 2026
…ic-tessellation-last-vertex

# Conflicts:
#	core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
#	core/shader/recompiler/SpirvBackend/src/BarycentricGeometryShader.cpp
#	docs/dev/debt/libSceAgcDriver.md
#	docs/dev/debt/shader.md
@savvaniss

Copy link
Copy Markdown
Contributor

Intel and AMD Windows data: with this PR the 19 tests built from tests/Graphics.cpp and PixelBarycentricEmulation.cpp pass on an Intel UHD 770 and an AMD RX 9070 XT.

Windows 11 Pro 26300, WinLibs GCC 15.2.0 r7, Release, every execution test built, ANYPS5_NO_SHADER_CACHE=1, serial CTest. Intel UHD Graphics 770 (8086:a780), driver 32.0.101.7088. AMD Radeon RX 9070 XT (1002:7550), driver 32.0.31041.1004, with VkCache emptied first. This head 8f4a50d72 merged into main 07377573f.

Tests, ×3 UHD 770 RX 9070 XT
This head: 19 tests 19 of 19 pass 19 of 19 pass

The test files don't build on main without the rest of the PR, so there is no before-run.

I also ran full CTest with this PR and the 13 other open AGC and shader PRs I tested in the same batch merged together (#7668, #7659, #7504, #7432, #7413, #7480, #7465, #7466, #7464, #7449, #7489, #7673, #7560). Neither GPU showed a failure beyond main's own: the five image-table tests (#6647) and agc_driver_sample_multisample_target (#6957) on the UHD 770, and agc_driver_layered_volume_vertex_no_gpl (#4768) on the RX 9070 XT.

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 19, 2026
…hrough the barycentric tessellation stages (@DavidSamir)

Apple GPUs under MoltenVK have neither geometry shaders nor
VK_EXT_provoking_vertex, so a last-provoking-vertex draw that needs the
barycentric emulation stopped on macOS; DavidSamir's PR draws it
through the generated tessellation stages instead. In Pipeline.cpp its
early return for those draws sits before this branch's early return
for draws no pixel input sees (boykopovar#6741), and both stay. The barycentric
emulation test takes the PR's flat and provoking parameters and keeps
this branch's built-in switch after them. The debt files take the PR's
entries and keep this branch's short MoltenVK ones.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
ycarogabriel-lgtm added a commit to ycarogabriel-lgtm/AnyPS5 that referenced this pull request Oct 19, 2026
… no pixel input sees without the extension (@DavidSamir)

This branch already carried an earlier head of this PR; DavidSamir has
pushed newer commits since, and this merge brings the branch up to
them. The only conflict is the provoking vertex debt entry, where the
branch already holds boykopovar#7426's entry and its own short entry for the
draws no pixel input sees; both are kept as they are.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ic-tessellation-last-vertex

# Conflicts:
#	docs/dev/debt/shader.md
@adriadam10 adriadam10 self-assigned this Oct 19, 2026
@github-actions github-actions Bot removed the needs rebase Conflicts with main, rebase needed label Oct 19, 2026
@DavidAmsellem

Copy link
Copy Markdown
Contributor

First AMD-on-Linux (RADV) run of this PR. Merged onto main 8d5d4df96 (clean merge), built in full and compared with the same main, on the same machine.

AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 (Ubuntu 24.04 base), kernel 7.0.0-38, GCC 13.3, Release.

Full suite (ANYPS5_REQUIRE_VULKAN=1 ctest -j8) at b4532dacd: 1638/1640 with this PR, against 1638/1640 on main. The two failures are the same on both, so this PR adds none: agc_driver_image_table_vouched_lookups (#7766, fixed by #7916) and agc_driver_guest_memory_lifetime (#7784).

Comparing the JUnit output with main: this PR adds no ctest entry, and none is skipped or removed.

This checks correctness only; I did not measure performance.

GPUs tested: AMD Radeon RX 7900 XT (RADV NAVI31, gfx1100), Mesa 25.2.8, Linux Mint 22.3 / kernel 7.0.0-38

AI-assisted: yes

@DavidSamir

Copy link
Copy Markdown
Contributor Author

Title evidence for #6741 and #7426 together, from a macOS catalog sweep: Apple M2, MoltenVK 1.4.x (no VK_EXT_provoking_vertex, no geometry shaders), Rosetta 2, on main 00d7e61 with @mugurc's ci/macos-series-2 and #7937 (so libkernel builds on macOS). 30 s per title, same build apart from the two PRs.

On that base, 12 catalog titles stop at AGC graphics: last provoking vertex requires VK_EXT_provoking_vertex with provokingVertexLast enabled. Results:

Title base + #6741 only + #7426 only + both
SymphonyStation5 PPSA17641 stop stop stop still running at 30 s
VITA5 PPSA39410 stop stop stop still running
Signal Companion PPSA69426 stop stop stop still running
PokeMMO Prospero PPSA98001 stop stop stop still running
ProsperoLight PPSA99002 stop stop stop still running
Surround Sound Studio PPSA99051 stop stop stop still running
PS5LM PPSA99575 stop stop stop still running
PS5LM Plus PPSA99581 stop stop stop still running
Cloud Play PPSA99600 stop stop stop still running
PShare PPSA99773 stop stop stop still running
Pulse PPSA99993 stop stop stop still running
Afterglow PPSA47770 stop own exit (code 1, 15 s) stop own exit (code 1, 15 s)

So on a device without the extension these titles need both changes: #6741 for their last-vertex draws whose pixel shader cannot see which vertex provokes, and #7426 for the ones whose pixel shader reads emulated barycentrics through the generated tessellation stages. Either alone still stops at the same check. Nothing past 30 s is tested; MoltenVK-specific limits (#6235, #6528) are not in the way of these 11.

The two PRs touch the same function (ValidateProvokingVertex); merged together, the #7426 block for barycentric patches goes first and #6741's check of whether a pixel input reads the provoking vertex follows, with no other change.

AI-assisted: yes (Claude Code)

@DavidSamir

Copy link
Copy Markdown
Contributor Author

Validation-layer comparison, as AGENTS.md now asks for AGC changes. Apple M2, MoltenVK 1.4.x (Vulkan SDK 1.4.363), macOS 26, x86-64 under Rosetta 2, same machine and build directory, on main with @mugurc's ci/macos-series-2 and #7937 (needed for libkernel on macOS). Each test run with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation; the loader reports loading libVkLayer_khronos_validation.dylib, and no log contains was not found but was requested by env var VK_INSTANCE_LAYERS.

Test without #7426 and #6741 with both
agc_driver_pixel_barycentric_emulation passes, 0 VUID- passes (now also the flat-input cases), 0 VUID-
agc_driver_graphics passes, 0 VUID- passes, 0 VUID-
agc_driver_provoking_vertex exits: required provoking vertex rendering coverage is unavailable: provokingVertexLast is not supported the same (this device has no VK_EXT_provoking_vertex; without ANYPS5_REQUIRE_VULKAN it skips)

No new validation errors with the two changes. The title results for the pair are in the comment above (11 catalog titles run past the provoking-vertex stop with both).

AI-assisted: yes (Claude Code)

@DavidSamir

Copy link
Copy Markdown
Contributor Author

Validation-layer comparison as AGENTS.md describes: main e5b65a911 against main plus head 573d85e2b8. Linux, WSL2 Ubuntu 24.04, lavapipe (llvmpipe, LLVM 20.1.2, Mesa 25.2.8), Khronos validation layer 1.3.275. Environment: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1. Command: ctest -R "agc_driver_pixel_barycentric_emulation|agc_driver_graphics|agc_driver_provoking_vertex" -V.

  • All three tests pass on both.
  • The layer loaded: neither log reports was not found but was requested by env var VK_INSTANCE_LAYERS.
  • No new VUID- errors. Both logs carry the same set, already present on main: 66 VUID-VkGraphicsPipelineCreateInfo-pLibraries-06681 and 6 VUID-VkDeviceCreateInfo-pNext-pNext.
  • agc_driver_provoking_vertex exercises first, last and first again on lavapipe, which has provokingVertexLast, so the native path is the one compared here.

Not covered: an NVIDIA run with the validation layer. This machine's RTX 3070 has no Khronos layer installed.

AI-assisted: yes

@DavidSamir

Copy link
Copy Markdown
Contributor Author

No-regression run on a GPU with VK_EXT_provoking_vertex: main 567c5fd630 against main plus head 573d85e2b8. Windows 11 Pro 26300, NVIDIA RTX 3070 (driver 610.60), WinLibs GCC 15.2.0, Release. Catalog releases with sha256 checked, 60 s each.

The nine titles listed for the Mac all run the full 60 s on both builds: SymphonyStation5 (PPSA17641), VITA5 (PPSA39410), Signal Companion (PPSA69426), PokeMMO (PPSA98001), ProsperoLight (PPSA99002), PS5LM (PPSA99575), Cloud Play (PPSA99600), PShare (PPSA99773) and Pulse (PPSA99993). None stops early.

This device takes the extension's native path, so this run checks only that nothing regresses. The emulated path is covered by the Mac runs in the description.

AI-assisted: yes

@adriadam10
adriadam10 merged commit 98145b4 into boykopovar:main Oct 21, 2026
10 checks passed
@adriadam10

Copy link
Copy Markdown
Collaborator

Re-checked against current main: same patch, clean merge, every caller of BuildBarycentricTessellationShaders passes the provoking vertex. The validation exemption stays limited to the generated tessellation route (guest tessellation and the geometry route still require VK_EXT_provoking_vertex), flat per-vertex parameters still throw, and the execution test pins the flat value per vertex (-0.8 first, -0.25 last). Debt entries match the code; merged.

iamthehimansh added a commit to iamthehimansh/AnyPS5 that referenced this pull request Oct 21, 2026
…ellation

Upstream's boykopovar#7426 gave BuildBarycentricTessellationShaders a provoking
vertex argument. The macOS mesh-emulation draw still called it with
four arguments, so VulkanDevice.cpp no longer compiled after merging
feat/macos-port. It now passes the draw's provoking vertex mode the
same way the regular vertex path in Draw.cpp does (0 for first, 2 for
last).

macOS only; the Linux and Windows views are unchanged. The 16 mesh,
barycentric and provoking-vertex tests pass or skip as before.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc* docs shader core/shader unblocks title Names a title ID on the Unblocks line

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants