Skip to content

test(agc): disable barycentric built-ins in the mesh barycentric emulation test - #12062

Merged
oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lancito01:fix/mesh-barycentric-builtins
Oct 28, 2026
Merged

oneandonlydean merged 1 commit into
boykopovar:mainfrom
Lancito01:fix/mesh-barycentric-builtins

Conversation

@Lancito01

@Lancito01 Lancito01 commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

What

agc_driver_mesh_barycentric_emulation fails on every run on a device with VK_KHR_fragment_shader_barycentric since #9193:

AGC graphics: the pixel shader did not emulate barycentrics

#9193 added SpirvTarget::fragmentBarycentricBuiltins and cleared it in PixelBarycentricEmulation's Draw, but MeshBarycentricEmulation's Draw still copies it from the device target and only clears fragmentShaderBarycentricEnabled. With the built-ins left on, HostInterpolationChecker::Lower reads the I/J VGPRs from BaryCoordKHR, so barycentricEmulation.active stays false and the test stops at its first Require. This sets target.fragmentBarycentricBuiltins = false there, as #9193 did for the pixel test. Test-only change.

Tested

Windows 10 22H2 (19045), WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON, all AGC execution tests built. ctest --test-dir build -R "^agc_driver_(mesh|pixel)_barycentric_emulation$" -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1 and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, 5 fresh-process runs each:

tree agc_driver_mesh_barycentric_emulation agc_driver_pixel_barycentric_emulation
main 228cd64b538 fails 5/5 (the pixel shader did not emulate barycentrics) passes 5/5
this change on 228cd64b538 passes 5/5 (mesh barycentric emulation tests passed: 932 perspective and 932 linear I/J pixels, 932 raw vertex value pixels) passes 5/5
this PR, rebased on main 14332cd8d0 passes 3/3 passes 3/3

VK_LOADER_DEBUG=layer shows VK_LAYER_KHRONOS_validation inserted (Khronos nightly Windows build); no log contains VUID- or was not found but was requested by env var VK_INSTANCE_LAYERS. tools/check_conventions.py --base origin/main passes and tools/pr_overlap.py reports no overlap.

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 3080 (10de:2216, Ampere), driver 610.62, Windows 10 22H2 (19045)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

…ation test

boykopovar#9193 added fragmentBarycentricBuiltins and cleared it in
PixelBarycentricEmulation, but MeshBarycentricEmulation still takes
the flag from the device. On a device with
VK_KHR_fragment_shader_barycentric the host interpolation check then
reads I/J from BaryCoordKHR, the pixel shader does not emulate
barycentrics, and the test fails before its first draw.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI balanced review requested due to automatic review settings October 27, 2026 18:16

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@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 exact head 552d38908301cdbf6cb8a41ce7256de121f65a23. The one-line test setup change clears fragmentBarycentricBuiltins alongside fragmentShaderBarycentricEnabled, matching the existing pixel barycentric emulation setup and the described mesh-test failure. The PR includes repeated main-versus-change runs with validation enabled on an RTX 3080; this host has no compatible Vulkan device for independently reproducing those GPU results.\n\nValidation here: tools/check_conventions.py --base refs/remotes/upstream/main passed and git diff --check passed. No local GPU runtime result is claimed.

@milescoviello

Copy link
Copy Markdown
Contributor

A Linux + NVIDIA data point for this head (552d389083), next to the Windows run in the description:

  • Setup: Ubuntu 26.04 (Linux 7.0), GCC 15.2, Release, NVIDIA GeForce RTX 4070 Ti on 615.71.09, ANYPS5_REQUIRE_VULKAN=1, ctest -R '^agc_driver_mesh_barycentric_emulation$'.
  • main 14332cd8d0: fails in each of 3 runs with the pixel shader did not emulate barycentrics.
  • This head: passes 3 of 3 (932 perspective and 932 linear I/J pixels, 932 raw vertex value pixels).
  • Validation layer: the Khronos layer 1.4.363 reports no VUID- on either side, with one Vulkan device created per side. That run used my local copy of the same line on the same base 14332cd8d0, before I found this PR.
  • lavapipe on the same host (ANYPS5_GPU=llvmpipe): the test skips there (the device has no mesh shader compiler that handles these programs). That's why CI didn't catch the failure.

I came to the same one-line change from a validation-layer sweep of main, and dropped my branch once I found this PR.

AI-assisted: yes (Claude Code)

@Lancito01

Copy link
Copy Markdown
Contributor Author

thanks for the review!

@maskym

maskym commented Oct 28, 2026

Copy link
Copy Markdown
Contributor

Windows + NVIDIA result for head 552d389083, merged into main f759e165d9 (the PR's GPUs tested line names no NVIDIA run on Windows 11 or on Turing).

This PR's own tests: agc_driver_mesh_barycentric_emulation passes (0.97 s); it fails on main on this device (Turing, driver 621.01, Windows 11), so this adds a Turing data point to the Ampere/Windows 10 one in the description, all passed.

Host: Windows 11 26300, Intel i7-12700K, NVIDIA GeForce RTX 2070 SUPER (vendor 0x10de, device 0x1e84; Vulkan loader 1.4.357 from the NVIDIA driver 621.01), Khronos Validation Layers nightly 1.4.366 (b2b44c0d37) through VK_ADD_LAYER_PATH, WinLibs GCC 15.2.0 (x86_64-ucrt-posix-seh, r6), Release, BUILD_TESTING=ON, Ninja.

Same focused run on main f759e165d9 and on this tree, same machine and GPU: VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, VK_LOADER_DEBUG=error,warn,layer, ctest --test-dir build -R '^(agc|guest_video_out|video_out)' --parallel 4 -V.

The tree also carried the open PRs #11948, #12132, #12070, #11680, #11679, #11678, #11677, #11675, #11674, #11605, #11604, #11600, all merged cleanly, so the run is a joint one. Not run on a PS5.

AI-assisted: yes (Claude Code), the runs and the numbers above are from this machine.

@CruddOCE

Copy link
Copy Markdown

AMD result for this PR's head 552d38908 merged into main 0cd07dc4a (merged locally without a commit).

AMD Radeon RX 9070 GRE (RDNA 4, 1002:7550), driver 32.0.32015.7029 (Adrenalin 26.10.1), Windows 11 Home 10.0.26200, Ryzen 5 7500X3D, WinLibs GCC 15.2.0 r7, Release, ANYPS5_GPU="RX 9070" ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, serial CTest.

agc_driver_mesh_barycentric_emulation main 0cd07dc4a this PR
RX 9070 GRE fails 3 of 3: the pixel shader did not emulate barycentrics passes 3 of 3

The other five agc_driver_mesh* tests also pass with the PR on this device.

The iGPU in the same machine (Radeon(TM) Graphics, 1002:164e, 32.0.21045.16010) exposes no mesh shaders, so the test is skipped there on both. The Khronos validation layer is not installed here, so no VUID- comparison was made.

AI-assisted: yes

@HabibUrRehmanBhattii

Copy link
Copy Markdown

Verified on current main (0cd07dc4ab25d924cbcebee5e0468a1b785042f7) on a third GPU:

  • Windows 11 26200, NVIDIA GeForce RTX 4070, driver 616.92, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON.
  • Baseline (without this change): agc_driver_mesh_barycentric_emulation fails 3 of 3 runs, exit 1, AGC graphics: the pixel shader did not emulate barycentrics.
  • With only this PR's change (target.fragmentBarycentricBuiltins = false; in core/libs/prx/libSceAgcDriver/tests/execution/MeshBarycentricEmulation.cpp): 3 of 3 runs pass (ctest -R '^agc_driver_mesh_barycentric_emulation$' --repeat until-fail:3; 5.11 s cold, 0.32 s each after).
  • The device exposes mesh shaders and VK_KHR_fragment_shader_barycentric (mesh=1 in the test log).
  • No Khronos validation layer was loaded in these runs (not installed on this machine), so no VUID- comparison is available from them.

This reproduces #12121 on a third device (RTX 4070; #12121 reports RTX 2070 SUPER and RTX 4090) and confirms this one-line change fixes it at the commit above.

AI-assisted: yes

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

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants