From 1d6968225fe96d05f5f69cb4b6298499f583ae3c Mon Sep 17 00:00:00 2001 From: "Gerard L." Date: Thu, 8 Oct 2026 22:01:23 +0200 Subject: [PATCH] test(agc): run agc_driver_mesh_tests under ctest The mesh test was built only on request and never registered, so the translation of NGG geometry programs to mesh shaders ran in no test run. On an RTX 4060 it passes. Register it with the other AGC driver tests. Three cases would fail or mislead under ctest. Without a Vulkan device the test failed, and the Windows job has none. A device without VK_EXT_mesh_shader exited 0, so ctest reported a pass for a test that drew nothing. On llvmpipe, with the Linux job's Mesa 25.2.8 and Ubuntu 24.04's LLVM 20.1.2, every draw that builds a mesh pipeline stops the process with "LLVM ERROR: Cannot emit physreg copy instruction"; Mesa 26.2.4 with LLVM 23.1 segfaults in LLVM's code generation instead. The SPIR-V of all 18 modules the test builds passes spirv-val. Mesa #14376 reports the same error for lavapipe mesh shaders that index shared memory per invocation; that the cause is the same is not established. The test now opens its device with OpenVulkanTestDevice and exits 77 without a device, without VK_EXT_mesh_shader and on llvmpipe, saying why. ANYPS5_REQUIRE_VULKAN still turns a missing device into a failure. The Linux job therefore skips the test; it runs on hosts with a GPU. Co-Authored-By: Claude Opus 5.5 --- core/libs/prx/libSceAgcDriver/CMakeLists.txt | 2 +- core/libs/prx/libSceAgcDriver/tests/Mesh.cpp | 13 ++++++++++--- tools/check_test_registration.py | 1 - 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/core/libs/prx/libSceAgcDriver/CMakeLists.txt b/core/libs/prx/libSceAgcDriver/CMakeLists.txt index 7d05a2b54..bb0bd8f35 100644 --- a/core/libs/prx/libSceAgcDriver/CMakeLists.txt +++ b/core/libs/prx/libSceAgcDriver/CMakeLists.txt @@ -623,7 +623,7 @@ if(BUILD_TESTING) if(WIN32) set_tests_properties(agc_shader_bindless PROPERTIES ENVIRONMENT_MODIFICATION "PATH=path_list_prepend:$") endif() - foreach(agcTest IN ITEMS agc_driver_tests agc_shader_memory_tests agc_structurizer_tests agc_spirv_module_tests agc_dpp_write_tests agc_masked_select_tests agc_vop1_control_decode_tests agc_validate_program_tests agc_shader_disk_cache_tests agc_shader_device_profile_tests agc_shader_control_flow_tests agc_driver_flip_tests agc_driver_pm4_tests agc_driver_graphics_tests agc_driver_bda_device_tests ${agcExecutionTests}) + foreach(agcTest IN ITEMS agc_driver_tests agc_shader_memory_tests agc_structurizer_tests agc_spirv_module_tests agc_dpp_write_tests agc_masked_select_tests agc_vop1_control_decode_tests agc_validate_program_tests agc_shader_disk_cache_tests agc_shader_device_profile_tests agc_shader_control_flow_tests agc_driver_flip_tests agc_driver_pm4_tests agc_driver_graphics_tests agc_driver_bda_device_tests agc_driver_mesh_tests ${agcExecutionTests}) if(agcTest STREQUAL "agc_driver_constant_store_tests") continue() endif() diff --git a/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp b/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp index 335a0ab01..d4ce2560d 100644 --- a/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp +++ b/core/libs/prx/libSceAgcDriver/tests/Mesh.cpp @@ -1,5 +1,6 @@ #include "prx/libSceAgcDriver/Execution/include/VulkanDevice.hpp" #include "Recompiler.hpp" +#include "execution/VulkanTestDevice.hpp" #include "prx/libc/include/GuestAllocations.hpp" #include #include @@ -240,11 +241,17 @@ int main() { } FanRestart[FanRim] = 0xffffu; - AgcDriver::VulkanDevice device; + const auto testDevice = OpenVulkanTestDevice(); + if (!testDevice) return VulkanTestSkipped; + auto& device = *testDevice; const auto target = device.Target(); if (!target.mesh.has_value()) { - std::puts("Mesh tests skipped: the device has no VK_EXT_mesh_shader"); - return 0; + std::puts("skipped, the device has no VK_EXT_mesh_shader"); + return VulkanTestSkipped; + } + if (device.DeviceName().starts_with("llvmpipe")) { + std::puts("skipped, the device has no mesh shader compiler that handles these programs (llvmpipe)"); + return VulkanTestSkipped; } for (const auto& [name, subgroup] : {std::pair{"one-wave subgroups", SmallSubgroup}, std::pair{"two-wave subgroups", WideSubgroup}}) { diff --git a/tools/check_test_registration.py b/tools/check_test_registration.py index aef595bd3..a0115b2cd 100644 --- a/tools/check_test_registration.py +++ b/tools/check_test_registration.py @@ -6,7 +6,6 @@ from pathlib import Path TEST_OUTPUT = r"tests[\\/]" KNOWN_UNRUN = { - "agc_driver_mesh_tests", "agc_driver_recorder_tests", "video_out_flip_tests", }