upleb.uk

Public git repos — served from a NIP-34 GRASP relay at git.upleb.uk

summaryrefslogtreecommitdiff
path: root/runtime/test
diff options
context:
space:
mode:
authorLuiz Neves <luizgustavobenicio@gmail.com>2026-11-21 18:28:19 -0300
committerLuiz Neves <luizgustavobenicio@gmail.com>2026-11-21 18:29:45 -0300
commitcdc67e4d20e793da260d08e55d0793d6952fc75f (patch)
treee997dcc2d1b71158fa6b7492e5d19762d870b44a /runtime/test
parent4e390e0871d7265e629b51aca8ff99a15a6a6845 (diff)
GPU tests: report gs_tri/ms_tri as SKIP without geometry or mesh shaders (TEST-18)
vk_harness exits 77, the code vk_compute_test and vk_store_test already use for a device that cannot run a test, when VKH_GS is set and the device has no geometryShader, or VKH_MESH is set and it has no VK_EXT_mesh_shader. Before, a missing mesh extension exited 1 and a missing geometryShader failed in vkCreateDevice with VK_ERROR_FEATURE_NOT_PRESENT (MoltenVK, #166). run_gpu_tests.py (gs_tri, ms_tri, ms_w64x_ballot, ms_clip) and check.py (ms_w64x_ballot) turn that exit code into SKIP, quoting the harness's reason.
Diffstat (limited to 'runtime/test')
-rw-r--r--runtime/test/shaders/check.py3
-rw-r--r--runtime/test/vk_harness.cpp7
2 files changed, 9 insertions, 1 deletions
diff --git a/runtime/test/shaders/check.py b/runtime/test/shaders/check.py
index 75f9a2d50..ba47f097a 100644
--- a/runtime/test/shaders/check.py
+++ b/runtime/test/shaders/check.py
@@ -146,6 +146,9 @@ def mesh_w64x_test(tools, spirv, name):
146 with tempfile.TemporaryDirectory(prefix="leonida-mesh-") as tmp: 146 with tempfile.TemporaryDirectory(prefix="leonida-mesh-") as tmp:
147 raw = Path(tmp) / "pixels.raw" 147 raw = Path(tmp) / "pixels.raw"
148 r = subprocess.run([os.path.join(tools, "vk_harness" + EXE), shader, fs, raw], capture_output=True, text=True, env=env) 148 r = subprocess.run([os.path.join(tools, "vk_harness" + EXE), shader, fs, raw], capture_output=True, text=True, env=env)
149 if r.returncode == UNSUPPORTED: # vk_harness: the device has no VK_EXT_mesh_shader
150 m = re.search(r"unsupported: .*", r.stderr)
151 return Skip(f"SKIP ({m.group(0) if m else 'unsupported device'})")
149 if r.returncode or not raw.is_file(): 152 if r.returncode or not raw.is_file():
150 return failure(r.returncode, r.stdout + r.stderr, 2) 153 return failure(r.returncode, r.stdout + r.stderr, 2)
151 data = raw.read_bytes() 154 data = raw.read_bytes()
diff --git a/runtime/test/vk_harness.cpp b/runtime/test/vk_harness.cpp
index 1c29cce86..cdce9e06b 100644
--- a/runtime/test/vk_harness.cpp
+++ b/runtime/test/vk_harness.cpp
@@ -105,7 +105,8 @@ int main(int argc, char** argv) {
105 const bool mesh = std::getenv("VKH_MESH") != nullptr; 105 const bool mesh = std::getenv("VKH_MESH") != nullptr;
106 VkPhysicalDeviceMeshShaderFeaturesEXT meshf{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT}; 106 VkPhysicalDeviceMeshShaderFeaturesEXT meshf{VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_MESH_SHADER_FEATURES_EXT};
107 if (mesh) { 107 if (mesh) {
108 if (!has(VK_EXT_MESH_SHADER_EXTENSION_NAME)) { std::fprintf(stderr, "no VK_EXT_mesh_shader\n"); return 1; } 108 // 77: the device cannot run this test (as vk_compute_test and vk_store_test), so the runners report SKIP.
109 if (!has(VK_EXT_MESH_SHADER_EXTENSION_NAME)) { std::fprintf(stderr, "unsupported: no VK_EXT_mesh_shader\n"); return 77; }
109 enable.push_back(VK_EXT_MESH_SHADER_EXTENSION_NAME); 110 enable.push_back(VK_EXT_MESH_SHADER_EXTENSION_NAME);
110 meshf.meshShader = VK_TRUE; meshf.pNext = chain; chain = &meshf; 111 meshf.meshShader = VK_TRUE; meshf.pNext = chain; chain = &meshf;
111 } 112 }
@@ -133,6 +134,10 @@ int main(int argc, char** argv) {
133 dci.pNext = chain; 134 dci.pNext = chain;
134 // VKH_GS=<geometry.spv>: insert a geometry stage between the vertex and fragment shaders. 135 // VKH_GS=<geometry.spv>: insert a geometry stage between the vertex and fragment shaders.
135 const char* gs_path = std::getenv("VKH_GS"); 136 const char* gs_path = std::getenv("VKH_GS");
137 if (gs_path && !f2q.features.geometryShader) { // MoltenVK: Metal has no geometry stage
138 std::fprintf(stderr, "unsupported: no geometryShader\n");
139 return 77;
140 }
136 VkPhysicalDeviceFeatures feats{}; 141 VkPhysicalDeviceFeatures feats{};
137 feats.geometryShader = gs_path ? VK_TRUE : VK_FALSE; 142 feats.geometryShader = gs_path ? VK_TRUE : VK_FALSE;
138 feats.shaderClipDistance = f2q.features.shaderClipDistance; 143 feats.shaderClipDistance = f2q.features.shaderClipDistance;