Skip to content

fix(agc): draw a last provoking vertex through the barycentric tessellation stages without VK_EXT_provoking_vertex - #21938

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
kurexw:fix/agc-last-provoking-vertex-tessellation
Nov 20, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
kurexw:fix/agc-last-provoking-vertex-tessellation

Conversation

@kurexw

@kurexw kurexw commented Nov 16, 2026 •

Copy link
Copy Markdown

What

On a device without VK_EXT_provoking_vertex provokingVertexLast (MoltenVK on Apple GPUs), a draw in last-provoking-vertex mode whose pixel shader shows the provoking vertex fails at ValidateProvokingVertex (Graphics/src/Pipeline.cpp) with last provoking vertex requires VK_EXT_provoking_vertex with provokingVertexLast enabled. The barycentric tessellation stages already give each corner the last vertex's flat values (#7426, #8083), but a draw used them only when its pixel shader had been recompiled with emulated barycentrics, which happens only on devices without native fragment barycentrics. The Apple M4 has native barycentrics, so these draws took the native path and threw.

This PR sends such draws through the existing tessellation stages:

  • LastVertexPatches (Pipeline.cpp) decides it. The device lacks provokingVertexLast and has tessellation shaders, the draw is in last mode on the vertex path (not a rect list, mesh or tessellation draw), and its pixel shader shows the provoking vertex (the same test ValidateProvokingVertex already applies, moved to file scope). Its vertex shader writes no Layer or ViewportIndex, and the topology is one the stages draw: a triangle list (primitive restart only without VK_EXT_primitive_topology_list_restart) or a triangle strip (primitive restart only in a non-indexed draw).
  • The driver (Execution/src/Driver/Draw/Draw.cpp) then recompiles the pixel shader with a new GraphicsCompileContext::emulateBarycentrics flag and builds the tessellation stages with the last vertex, as it already does for emulated barycentrics. Re-materialised stages of an indirect draw keep the flag.
  • The recompiler (Recompiler.cpp) translates a pixel shader with that flag the way it already does when lowering to host interpolation fails.
  • The flag only enters the cache key of a pixel shader that sets it; every other request keeps its exact key. Request serialization moves to version 63 and writes the flag as one trailing byte only when it is set. A request without it serializes to the same bytes as before apart from the version number. Version 62 requests still load.
  • Points, lines, fans, mesh and tessellation paths, and draws whose vertex shader writes the layer or viewport still throw, as before. A debt fragment records that, and that the cost of the two extra stages per draw is not measured.

Note for merging: #20153 also moves request serialization to version 63. Whichever merges second needs version 64.

Tested

macOS 27.2 on an Apple M4 (MoltenVK 1.4.2 from the LunarG Vulkan SDK 1.4.363.1, x86-64 build under Rosetta). This is the only GPU I tested. I could not run RADV, NVIDIA or Windows here. Devices with provokingVertexLast don't reach the new path, which LastVertexPatchTests checks on the CPU.

New tests

  • agc_driver_vertex_provoking_vertex (new) submits real DCB draws through the driver: a guest vertex program with a flat v_interp_mov P0 pixel shader, as a triangle list and a triangle strip, alternating first, last and first mode. It checks that each triangle takes its first or its last vertex's color.
    • Main at 3b17977 fails it with the throw above.
    • With the Draw.cpp routing disabled, it also fails with that message.
    • This branch passes.
  • agc_driver_provoking_vertex: on a device without provokingVertexLast and with tessellation, it now also draws the guest P0 shader through the emulated barycentric stages, as a list and a strip, first/last/first, and checks the last-vertex colors.
    • Building the last-mode stages with vertex 0 instead of 2 makes it fail.
    • Main fails this test on the M4 under ANYPS5_REQUIRE_VULKAN; this branch passes it.
  • agc_driver_unobserved_provoking_vertex gains LastVertexPatchTests, which covers every condition of the decision.
  • agc_shader_memory gains verifyEmulatedBarycentricRequests. It checks that:
    • a pixel request without the flag has the same cache key and context hash as one without a graphics context;
    • the flag adds exactly one key element, and only for the pixel stage;
    • the flag round-trips through serialization;
    • a version 62 request is upgraded byte-identically;
    • malformed trailing flags are refused.
  • request_serializer and agc_shader_memory were updated for version 63.

GPU tests, main vs. this branch

  • Main was 3b17977; this branch was first tested on that commit, then rebased onto 459f4f8 and tested again.
  • Command: ctest --test-dir build -R '^agc_driver_.*(barycentric|tessellation|provoking|patch_vertex|interpolation|rect_list).*' -V, three runs per side.
  • Environment: ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer.
  • Every test process logged Insert instance layer "VK_LAYER_KHRONOS_validation" (layer 1.4.363). None logged was not found but was requested by env var VK_INSTANCE_LAYERS.
main (3 runs) this branch (3 runs, before and after rebase)
agc_driver_provoking_vertex Failed Passed
agc_driver_vertex_provoking_vertex (absent) Passed
agc_driver_tessellation Failed Failed (same message: instanced patch relative index, unrelated)
other 14 Passed or skipped Passed or skipped, identical
VUID- lines 0 0

Full ctest -j8

  • Main: 50 failures out of 5650 tests. This branch: 51 out of 5651.
  • By name, three tests fail only on the branch: guest_audio_propagation, guest_main_stack_move and guest_system_service_open_url. None of them links the AGC driver or the recompiler. Run alone, each passes on some runs and fails on others on this branch.
  • Two tests time out only on main: guest_pthread_mutex_contention and write_watch_backing_shared.

Not tested

  • PPSA98001 and PPSA99993 themselves, which I don't have.
  • On the GPU, the new driver test submits only non-indexed, non-indirect DRAW_INDEX_AUTO draws without primitive restart. These run only in the CPU tests (LastVertexPatchTests), not on a GPU:
    • indexed draws;
    • primitive restart: a list on a device without VK_EXT_primitive_topology_list_restart, or a non-indexed strip;
    • re-materialising the pixel stage of an indirect draw, which passes the flag again (Draw.cpp, the patched-program loop).

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: PPSA98001 (PokeMMO) and PPSA99993 (Pulse), which stop at this throw on macOS in macOS support #1 (comment). Not run with the titles.
  • GPUs tested: Apple M4, MoltenVK 1.4.2 (LunarG Vulkan SDK 1.4.363.1), macOS 27.2
  • AI-assisted: yes

🤖 Generated with Claude Code

…lation stages without VK_EXT_provoking_vertex

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@tablefrogpillow

Copy link
Copy Markdown
Contributor

Real-AMD coverage — the PR lists macOS/MoltenVK (Rosetta) as the only GPU tested, so here's Linux + real-AMD RADV. Head 942ec64f, Khronos validation 1.4.363, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1:

test lavapipe RDNA2 (gfx1036) RDNA3 (NAVI31, gfx1100)
agc_driver_provoking_vertex Pass Pass Pass
agc_driver_vertex_provoking_vertex Pass Pass Pass
agc_driver_mesh_provoking_vertex Skipped Pass Pass

0 validation errors on NAVI31. Notably agc_driver_mesh_provoking_vertex is skipped on lavapipe (mesh path), so CI never exercises it — this is a first real run of it, and it passes on both RDNA gens.

One caveat for accuracy: RADV exposes VK_EXT_provoking_vertex on both gens, so on our HW these validate the native provoking-vertex path — i.e. this confirms the change doesn't regress real AMD, but it doesn't exercise the no-VK_EXT_provoking_vertex emulation that is the heart of this PR (that needs a driver/config lacking the extension). agc_driver_unobserved_provoking_vertex has no build target in-tree, so it stayed Not Run on all stacks.

AI-assisted: yes

@github-actions github-actions Bot added unblocks title Names a title ID on the Unblocks line shader core/shader docs agc libSceAgc* labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 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 14561 core/shader/recompiler/tests/RequestSerializerTests.cpp L205, L229, L779, L894-895
PR 15343 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9097-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229-230, L240-241, L779, L894-897
PR 17022 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp L1135-1136
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp L160
PR 17056 core/shader/recompiler/tests/RequestSerializerTests.cpp L204-205, L229, L779, L894-895
PR 19821 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9097-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229-230, L240, L779, L894-897
PR 20010 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9097
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205, L229, L779, L894-897
PR 20153 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9096-9102, L9117
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L779, L894-895
PR 20518 core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L779, L894-897
PR 22071 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9097-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L240-241, L779, L894-896
PR 22251 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9096-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L779, L894-897
PR 22328 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9096-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/Recompiler.hpp L506
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L779, L894-897
PR 22439 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp L180
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9096-9098
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L972, L981, L1056
core/shader/recompiler/Recompiler.hpp L506
core/shader/recompiler/tests/RequestSerializerTests.cpp L205-206, L229, L779, L894-897
PR 23553 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp L8918, L9039, L9096-9097
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp L919, L981
core/shader/recompiler/tests/RequestSerializerTests.cpp L205, L229, L779, L894-897

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 4040 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 5371 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 5925 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/shader/recompiler/Recompiler.hpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/shader/recompiler/Recompiler.hpp
PR 6235 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 6280 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6412 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 6481 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6488 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 6804 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6808 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 6924 core/shader/recompiler/Recompiler.cpp
PR 7256 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 7275 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 7684 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
PR 7689 core/shader/recompiler/Recompiler.hpp
PR 8246 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9356 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 9387 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 9508 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 9712 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 9852 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 9895 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 10193 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 10249 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
PR 10359 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 10652 core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 11435 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 11436 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 11483 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 11551 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 11825 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 12324 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 12828 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 12840 core/shader/recompiler/Recompiler.cpp
PR 12944 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 13928 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 13929 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 14032 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 14944 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 15136 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 15548 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 15555 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 15570 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 15845 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
PR 16472 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 16753 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 16812 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 16814 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 16935 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 17611 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 18106 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 18107 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
PR 18369 core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 19697 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
PR 20030 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 20111 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 20187 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 20315 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20519 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 20728 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 20845 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 21059 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 22025 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 22424 core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 22434 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
PR 22628 core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 22647 core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/Draw.cpp
core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCapture.cpp
core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
PR 22687 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 22697 core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23229 core/libs/prx/libSceAgcDriver/Graphics/include/Pipeline.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Pipeline.cpp
core/libs/prx/libSceAgcDriver/tests/Graphics.cpp
PR 23243 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp
PR 23244 core/libs/prx/libSceAgcDriver/tests/ShaderMemory.cpp
core/shader/recompiler/CacheKey.hpp
core/shader/recompiler/ControlFlow/src/RequestSerializer.cpp
core/shader/recompiler/Recompiler.cpp
core/shader/recompiler/Recompiler.hpp
core/shader/recompiler/tests/RequestSerializerTests.cpp

@kurexw

kurexw commented Nov 17, 2026

Copy link
Copy Markdown
Author

@tablefrogpillow thank you for running this on real AMD hardware and lavapipe. Having agc_driver_mesh_provoking_vertex actually run on RDNA2 and RDNA3 is especially useful, since CI and my M4 both skip it. Your caveat is right: with VK_EXT_provoking_vertex present, RADV takes the native path. So your results show no regression on AMD, and the emulation itself is only exercised on a device without the extension (MoltenVK here).

On agc_driver_unobserved_provoking_vertex: it is registered in-tree, on main as well as on this PR. It's in core/libs/prx/libSceAgcDriver/tests/cmake/agc_driver_graphics_tests.cmake (line 279, inside the plain if(BUILD_TESTING) block that starts at line 270):

add_test(NAME agc_driver_unobserved_provoking_vertex COMMAND agc_driver_graphics_tests --unobserved-provoking-vertex)

So it needs the agc_driver_graphics_tests target. If your build reported it as Not Run, a reconfigure or ninja agc_driver_graphics_tests should bring it in. On this PR, that mode runs UnobservedProvokingVertexTests, the new LastVertexPatchTests and ProvokingVertexTests. On the Apple M4 it passed in all three runs after the rebase ("Unobserved provoking vertex checks passed"), and on main as well.

AI-assisted: yes

@tablefrogpillow

Copy link
Copy Markdown
Contributor

Thanks for the pointer — built agc_driver_graphics_tests and the --unobserved-provoking-vertex mode runs now. It passes on all three stacks: lavapipe, RDNA2 (RAPHAEL, gfx1036) and RDNA3 (NAVI31, gfx1100), 0 VUID (Unobserved provoking vertex checks passed). That closes the one test I'd listed as Not Run, so the full provoking-vertex set is green on real AMD — with the native-path / no-regression caveat still standing for the emulation itself. 👍

@MarcZX10 MarcZX10 left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed — no blocking findings

The inspected implementation supports the described last-vertex fallback; a complete review and local checks were not possible because several changed files were not read and no tests were run.

What I ran

Reviewed head 942ec64f2f798b0a8adbc5990c6cb9c6c3590685 using the prepared review bundle and repo_read.py reader. No test commands were run. I read description.md, commits.md, manifest.json, and the relevant portions of diff.patch; repository code read included Draw.cpp, DrawCapture.cpp, Pipeline.hpp, Pipeline.cpp, CacheKey.hpp, RequestSerializer.cpp, Recompiler.cpp, and tests/execution/VertexProvokingVertex.cpp.

Results

Check Result Note
Targeted code review passed No concrete defect found in the inspected changes.
Tests not run Author-reported results were not independently verified.
Full review coverage not run Some changed files were not read.

Findings

Blocking

None in the inspected code.

Non-blocking

  • The description notes that another PR also moves request serialization to version 63. Coordinate merge order so the second change advances the version to 64; otherwise both changes can assign different payload meanings to the same version.

Not verified

I did not read the changed files tests/Graphics.cpp and tests/ShaderMemory.cpp, which were excluded from the review folder as too large, or the remaining changed files and hunks not listed above. I did not run tests or verify the author-reported GPU results. The PR description says indexed draws, primitive-restart cases, and indirect draw re-materialization were not GPU-tested.

To get this to a good state

Nothing is required. Optional: coordinate the serialization version with the other PR before merging.

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 17, 2026
@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 18, 2026
@domx4q

domx4q commented Nov 18, 2026

Copy link
Copy Markdown
Contributor

Ran the provoking-vertex and barycentric tests on NVIDIA's proprietary Linux driver with the Khronos validation layer, since the description reports MoltenVK only.

Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release, NVIDIA GeForce RTX 4090 (vendor 0x10de, device 0x2684, Ada), proprietary driver 620.70.06, Vulkan 1.4.357, Khronos validation layer 1.4.363.1. Head 942ec64f2f merged onto main f2d10b6999 with --no-ff, clean merge. Main baseline is a Release build of f2d10b6999 on the same machine.

WAYLAND_DISPLAY=wayland-1 XDG_RUNTIME_DIR=/run/user/1000 DISPLAY=:0 ANYPS5_REQUIRE_DISPLAY=1 \
ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer \
ctest --test-dir build -R '^agc_driver_.*(barycentric|tessellation|provoking|patch_vertex|interpolation|rect_list).*|^agc_driver_graphics$|^agc_shader_memory$|^request_serializer$' -V
main f2d10b6999 this PR
Result 19/19 passed 20/20 passed
Insert instance layer "VK_LAYER_KHRONOS_validation" 51 53
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0
VUID- none none

agc_driver_vertex_provoking_vertex is new in this PR and doesn't exist on main; it passes (vertex-program triangles take flat inputs from vertex 0 with the first provoking vertex and from vertex 2 with the last ... in a triangle list and a triangle strip). The changed agc_driver_provoking_vertex, agc_driver_graphics, agc_shader_memory and request_serializer pass on both sides, as do the barycentric, tessellation, interpolation and rect-list tests the description's pattern selects. Every device selection picked the RTX 4090.

The RTX 4090 reports provokingVertexLast, so these runs take the native VK_EXT_provoking_vertex path: agc_driver_provoking_vertex prints provoking vertex rendering tests passed: GLSL and guest P0, triangle list and strip, guest P0 rect list, first/last/first, not the new ...without provokingVertexLast... line. The emulated barycentric route the PR adds is not reached on this GPU; this run only shows that the change does not regress the native path. No negative control for the same reason.

No new VUID- errors; all focused tests pass on Ada (native last-vertex path).

AI-assisted: yes (Claude Code)

@github-actions github-actions Bot added the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 19, 2026
@eaglescoutmaster

Copy link
Copy Markdown
Contributor

RTX 5080 Windows run of head 942ec64f2f.

  • agc_driver_provoking_vertex, agc_driver_unobserved_provoking_vertex, request_serializer: 3 of 3 on main and with the PR.
  • agc_driver_vertex_provoking_vertex (new, absent on main): 3 of 3 with the PR.
  • The tests matching agc_driver_.*(barycentric|tessellation|provoking|patch_vertex|interpolation|rect_list) plus the agc_driver_graphics_tests cases: 67 of 67 on main, 68 of 68 with the PR.
  • Not covered: this card has provokingVertexLast, so the tests took the native path (provoking vertex rendering tests passed: GLSL and guest P0, triangle list and strip, guest P0 rect list, first/last/first); the emulated barycentric path this PR changes was not exercised here. agc_shader_memory did not run on either side (Microsoft Defender blocks its executable on this machine), nor did agc_copy_input_failure_lifetime and agc_copy_input_kept_bytes.

Setup: base main afe88d44ad, the PR diff applied with git apply (clean), only the affected targets rebuilt. Windows 11 Pro build 26300, Intel Core i9-14900K, NVIDIA GeForce RTX 5080 (10de:2c02), driver 617.14, Vulkan API 1.4.351, WinLibs GCC 15.2.0 r7, Release. ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_GPU=RTX 5080. No validation layer installed, so no VUID- check. Another application was using the GPU during the runs.

AI-assisted: yes (Claude Code)

@Jitheswar

Copy link
Copy Markdown
Contributor

Run on Linux with Intel ANV and an Ampere NVIDIA, using the description's test set and the Khronos validation layer.

Setup: Arch Linux, kernel 7.2.15, GCC 16.2.1, Release. One laptop, device picked with ANYPS5_GPU: Intel UHD Graphics (Raptor Lake-S, 8086:a78b, Mesa 26.2.5 ANV) and NVIDIA GeForce RTX 3050 Laptop (GA107, 10de:25ec, 615.78.08). Khronos validation layer 1.4.363. Head 942ec64f2f merged with --no-ff onto main 223cc23237 (clean). The main baseline is the same build directory at that commit.

VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 \
  ctest --test-dir build -R '^(agc_driver_.*(barycentric|tessellation|provoking|patch_vertex|interpolation|rect_list).*|request_serializer|agc_shader_memory)$' -V

3 runs per cell:

Intel RPL-S (ANV) NVIDIA RTX 3050 (GA107)
main 14 pass, 4 skip, every run 18 pass, every run
this PR 15 pass, 4 skip, every run 19 pass, every run
difference agc_driver_vertex_provoking_vertex (new) 3/3 agc_driver_vertex_provoking_vertex (new) 3/3

Every other test has the same result on both sides. Every test process logged Insert instance layer "VK_LAYER_KHRONOS_validation", and none logged was not found but was requested by env var VK_INSTANCE_LAYERS. Both devices report provokingVertexLast, so this is a regression check, not a run of the new emulated path.

VUID lines: NVIDIA has none on either side. Intel has the same 96 lines on main and on this PR, all VUID-RuntimeSpirv-maxCombinedClipAndCullDistances-00710, from agc_driver_barycentric_patch_vertex_layer and agc_driver_rect_list_vertex_layer (the TCS and TES of the emulated barycentric and rect-list stages, which ANV takes because it lacks VK_KHR_fragment_shader_barycentric):

shader [VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT] has a ClipDistance BuiltIn array size of 12 and a CullDistance BuiltIn array size of 0 which sum to 12 and exceed maxCombinedClipAndCullDistances of 8.

This looks like the layer's false positive in KhronosGroup/Vulkan-ValidationLayers#13414: it added a stage's input and output clip arrays together. It was fixed by KhronosGroup/Vulkan-ValidationLayers#13415, merged 2026-10-10, which isn't in the 1.4.363 SDK layer. The fixed layer's message says "Input" or "Output", and this one doesn't. It isn't caused by this PR, and other reviewers running these tests with SDK 1.4.363 on a device without fragment-shader barycentrics will see the same lines.

AI-assisted: yes (Claude)

@ShootanoJumper

Copy link
Copy Markdown
Contributor

Windows 11 23H2 (22631), Ryzen 7 5700X, NVIDIA RTX 4060 (driver 616.56), WinLibs GCC 15.2.0 r7, Release, merged into main ed1def4dd4 with git merge --no-ff.

New test agc_driver_vertex_provoking_vertex: passes.
Of the 1370 tests the change reaches, the only failures are ones main also fails on this GPU (#23232, #23711); agc_driver and agc_driver_store_over_untracked failed once under parallel load and pass 3 of 3 alone, as on main.
No validation layer is installed here, so this says nothing about VUID- errors.

@oneandonlydean
oneandonlydean merged commit 4546f8e into boykopovar:main Nov 20, 2026
16 of 18 checks passed
@github-actions github-actions Bot removed the review queue Next in the maintainer review queue: checks pass, no open change request, no conflict label Nov 20, 2026
B-Howell added a commit to B-Howell/AnyPS5 that referenced this pull request Nov 20, 2026
Main's boykopovar#21938 took request serialization version 63 for its trailing
emulated-barycentrics flag. The on-chip tessellation flag moves to
version 64 and is written before that flag, so version 63 requests
from main still read the same way.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B-Howell added a commit to B-Howell/AnyPS5 that referenced this pull request Nov 20, 2026
…aude/gcn-on-chip-tessellation

Main's boykopovar#21938 took request serialization version 63 for its trailing
emulated-barycentrics flag, and boykopovar#22251 moved the on-chip flag to 64.
The tessellation constants move to version 65, written after the
on-chip flag and before the barycentrics flag.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
B-Howell added a commit to B-Howell/AnyPS5 that referenced this pull request Nov 20, 2026
…aude/gcn-es-gs-copy-vs

Main's boykopovar#21938 took request serialization version 63 for its trailing
emulated-barycentrics flag, and the stack below moved the on-chip flag
to 64 and the tessellation constants to 65. The geometry configuration
moves to version 66 and stays before the barycentrics flag. The new
emulateBarycentrics field sits before tessellationConstants and
geometry, so the positional initializers gain a false or the stage's
flag in that place, and the barycentrics test drops the geometry byte
before reading the request as version 62.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.

8 participants