diff --git a/tests/hlsl/geometry.shader_test b/tests/hlsl/geometry.shader_test index b59f693c..f5d87a1d 100644 --- a/tests/hlsl/geometry.shader_test +++ b/tests/hlsl/geometry.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 4.0 +geometry-shader [input layout] 0 r32g32b32a32-float SV_POSITION diff --git a/tests/hlsl/rasteriser-ordered-views.shader_test b/tests/hlsl/rasteriser-ordered-views.shader_test index 7672fca3..05fe816a 100644 --- a/tests/hlsl/rasteriser-ordered-views.shader_test +++ b/tests/hlsl/rasteriser-ordered-views.shader_test @@ -1,5 +1,7 @@ [require] shader model >= 5.0 +% Used for SV_PrimitiveID/SpvBuiltInPrimitiveId. +geometry-shader [rtv 0] format r32-uint @@ -61,6 +63,7 @@ uint4 main(float4 pos : SV_Position, uint id : SV_PrimitiveID) : SV_Target [require] shader model >= 5.0 +geometry-shader rov [test] diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 8fff287e..c506dc38 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -386,6 +386,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li fatal_error("Unknown format cap '%s'.\n", line); } } + else if (match_string(line, "geometry-shader", &line)) + { + runner->require_geometry_shader = true; + } else if (match_string(line, "float64", &line)) { runner->require_float64 = true; @@ -1563,6 +1567,8 @@ static bool check_capabilities(const struct shader_runner *runner, const struct { unsigned int i; + if (runner->require_geometry_shader && !caps->geometry_shader) + return false; if (runner->require_float64 && !caps->float64) return false; if (runner->require_int64 && !caps->int64) @@ -1594,7 +1600,7 @@ static void trace_tags(const struct shader_runner_caps *caps) p = tags; rem = ARRAY_SIZE(tags); - rc = snprintf(p, rem, " tags:"); + rc = snprintf(p, rem, " tags:"); p += rc; rem -= rc; @@ -1608,7 +1614,7 @@ static void trace_tags(const struct shader_runner_caps *caps) p = tags; rem = ARRAY_SIZE(tags); - rc = snprintf(p, rem, " "); + rc = snprintf(p, rem, " "); --i; } p += rc; @@ -1626,7 +1632,7 @@ static void trace_format_cap(const struct shader_runner_caps *caps, enum format_ p = buffer; rem = ARRAY_SIZE(buffer); - rc = snprintf(p, rem, "%14s:", cap_name); + rc = snprintf(p, rem, "%15s:", cap_name); p += rc; rem -= rc; @@ -1642,7 +1648,7 @@ static void trace_format_cap(const struct shader_runner_caps *caps, enum format_ p = buffer; rem = ARRAY_SIZE(buffer); - rc = snprintf(p, rem, " "); + rc = snprintf(p, rem, " "); --i; } p += rc; @@ -1688,13 +1694,14 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c dxc_compiler ? "dxcompiler" : HLSL_COMPILER, caps->runner); if (caps->tag_count) trace_tags(caps); - trace(" float64: %u.\n", caps->float64); - trace(" int64: %u.\n", caps->int64); - trace(" rov: %u.\n", caps->rov); - trace(" wave-ops: %u.\n", caps->wave_ops); - trace(" depth-bounds: %u.\n", caps->depth_bounds); - trace(" clip-planes: %u.\n", caps->clip_planes); - trace(" point-size: %u.\n", caps->point_size); + trace("geometry-shader: %u.\n", caps->geometry_shader); + trace(" float64: %u.\n", caps->float64); + trace(" int64: %u.\n", caps->int64); + trace(" rov: %u.\n", caps->rov); + trace(" wave-ops: %u.\n", caps->wave_ops); + trace(" depth-bounds: %u.\n", caps->depth_bounds); + trace(" clip-planes: %u.\n", caps->clip_planes); + trace(" point-size: %u.\n", caps->point_size); trace_format_cap(caps, FORMAT_CAP_UAV_LOAD, "uav-load"); if (!test_options.filename) @@ -1956,6 +1963,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c state = STATE_REQUIRE; runner->minimum_shader_model = caps->minimum_shader_model; runner->maximum_shader_model = caps->maximum_shader_model; + runner->require_geometry_shader = false; runner->require_float64 = false; runner->require_int64 = false; runner->require_rov = false; diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 992867e1..8a886091 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -142,6 +142,7 @@ struct shader_runner_caps size_t tag_count; enum shader_model minimum_shader_model; enum shader_model maximum_shader_model; + bool geometry_shader; bool float64; bool int64; bool rov; @@ -181,6 +182,7 @@ struct shader_runner char *gs_source; enum shader_model minimum_shader_model; enum shader_model maximum_shader_model; + bool require_geometry_shader; bool require_float64; bool require_int64; bool require_rov; diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index f16e4c7d..0d26f593 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -1022,6 +1022,7 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner, #endif runner->caps.minimum_shader_model = minimum_shader_model; runner->caps.maximum_shader_model = maximum_shader_model; + runner->caps.geometry_shader = true; runner->caps.float64 = options.DoublePrecisionFloatShaderOps; runner->caps.int64 = options1.Int64ShaderOps; runner->caps.rov = options.ROVsSupported; diff --git a/tests/shader_runner_gl.c b/tests/shader_runner_gl.c index f659b0d5..86887d57 100644 --- a/tests/shader_runner_gl.c +++ b/tests/shader_runner_gl.c @@ -346,6 +346,7 @@ static bool gl_runner_init(struct gl_runner *runner, enum shading_language langu runner->caps.tag_count = runner->language == GLSL; runner->caps.minimum_shader_model = SHADER_MODEL_4_0; runner->caps.maximum_shader_model = SHADER_MODEL_5_1; + runner->caps.geometry_shader = true; glGetIntegerv(GL_NUM_EXTENSIONS, &extension_count); if (check_gl_extension("GL_ARB_internalformat_query2", extension_count)) diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index d403ebc8..deca5d60 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -1571,12 +1571,16 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner) features.x = VK_TRUE ENABLE_FEATURE(fragmentStoresAndAtomics); - /* For SV_PrimitiveID/SpvBuiltInPrimitiveId in fragment shaders. */ - ENABLE_FEATURE(geometryShader); ENABLE_FEATURE(shaderClipDistance); ENABLE_FEATURE(shaderImageGatherExtended); ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat); + if (ret_features->geometryShader) + { + features.geometryShader = VK_TRUE; + runner->caps.geometry_shader = true; + } + if (ret_features->shaderFloat64) { features.shaderFloat64 = VK_TRUE;