tests/shader_runner: Introduce a "tessellation-shader" cap.

Similar to how we have the "geometry-shader" cap. In principle shader
model 5+ implies support for tessellation shaders, but the Vulkan,
OpenGL, and Metal runners are able to support most of shader model 5+
without the underlying GPU (or API) necessarily supporting tessellation
shaders.
This commit is contained in:
Henri Verbeet
2025-05-18 22:36:39 +02:00
parent 2b257caea9
commit 85d2703c03
Notes: Henri Verbeet 2025-06-04 13:13:37 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1521
8 changed files with 32 additions and 19 deletions

View File

@@ -1,5 +1,6 @@
[require] [require]
shader model >= 5.0 shader model >= 5.0
tessellation-shader
[vertex shader] [vertex shader]
struct data struct data
@@ -106,5 +107,5 @@ float4 main(data input) : sv_target
[test] [test]
% llvmpipe currently segfaults due to a bug during shader compilation in the driver. % llvmpipe currently segfaults due to a bug during shader compilation in the driver.
if(!llvmpipe) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3 if(!llvmpipe) todo(glsl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba (-1.0, -2.0, 0.5, 1.0) if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba (-1.0, -2.0, 0.5, 1.0)

View File

@@ -1,5 +1,6 @@
[require] [require]
shader model >= 5.0 shader model >= 5.0
tessellation-shader
[vertex shader] [vertex shader]
struct data struct data
@@ -95,7 +96,7 @@ float4 main(data input) : sv_target
[test] [test]
% llvmpipe currently segfaults due to a bug during shader compilation in the driver. % llvmpipe currently segfaults due to a bug during shader compilation in the driver.
if(!llvmpipe) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3 if(!llvmpipe) todo(glsl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0) if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)
% Passthrough hull shader control point function. % Passthrough hull shader control point function.
@@ -131,12 +132,13 @@ void main(InputPatch<data, 3> input)
[test] [test]
% DXC doesn't generate a passthrough control point phase like FXC does % DXC doesn't generate a passthrough control point phase like FXC does
if(!llvmpipe & sm<6) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3 if(!llvmpipe & sm<6) todo(glsl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe & sm<6) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0) if(!llvmpipe & sm<6) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)
[require] [require]
shader model >= 5.0 shader model >= 5.0
shader model < 5.1 shader model < 5.1
tessellation-shader
[hull shader dxbc-tpf-hex] [hull shader dxbc-tpf-hex]
% As above, but with some DCL_INDEXRANGE instructions that skip a signature % As above, but with some DCL_INDEXRANGE instructions that skip a signature
@@ -304,5 +306,5 @@ void main(patch_constant_data input,
} }
[test] [test]
if(!llvmpipe) todo(glsl | msl | mvk & vulkan) draw 3 control point patch list 3 if(!llvmpipe) todo(glsl | mvk & vulkan) draw 3 control point patch list 3
if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0) if(!llvmpipe) todo(mvk) probe (0, 0, 640, 480) rgba(0.0, 1.0, 0.0, 1.0)

View File

@@ -360,17 +360,18 @@ static DXGI_FORMAT parse_format(const char *line, unsigned int *texel_size, bool
static const char *const shader_cap_strings[] = static const char *const shader_cap_strings[] =
{ {
[SHADER_CAP_CLIP_PLANES] = "clip-planes", [SHADER_CAP_CLIP_PLANES] = "clip-planes",
[SHADER_CAP_DEPTH_BOUNDS] = "depth-bounds", [SHADER_CAP_DEPTH_BOUNDS] = "depth-bounds",
[SHADER_CAP_FLOAT64] = "float64", [SHADER_CAP_FLOAT64] = "float64",
[SHADER_CAP_FOG] = "fog", [SHADER_CAP_FOG] = "fog",
[SHADER_CAP_GEOMETRY_SHADER] = "geometry-shader", [SHADER_CAP_GEOMETRY_SHADER] = "geometry-shader",
[SHADER_CAP_INT64] = "int64", [SHADER_CAP_INT64] = "int64",
[SHADER_CAP_NATIVE_16_BIT] = "native-16-bit", [SHADER_CAP_NATIVE_16_BIT] = "native-16-bit",
[SHADER_CAP_POINT_SIZE] = "point-size", [SHADER_CAP_POINT_SIZE] = "point-size",
[SHADER_CAP_ROV] = "rov", [SHADER_CAP_ROV] = "rov",
[SHADER_CAP_RT_VP_ARRAY_INDEX] = "rt-vp-array-index", [SHADER_CAP_RT_VP_ARRAY_INDEX] = "rt-vp-array-index",
[SHADER_CAP_WAVE_OPS] = "wave-ops", [SHADER_CAP_TESSELLATION_SHADER] = "tessellation-shader",
[SHADER_CAP_WAVE_OPS] = "wave-ops",
}; };
static bool match_shader_cap_string(const char *line, enum shader_cap *cap) static bool match_shader_cap_string(const char *line, enum shader_cap *cap)

View File

@@ -149,6 +149,7 @@ enum shader_cap
SHADER_CAP_POINT_SIZE, SHADER_CAP_POINT_SIZE,
SHADER_CAP_ROV, SHADER_CAP_ROV,
SHADER_CAP_RT_VP_ARRAY_INDEX, SHADER_CAP_RT_VP_ARRAY_INDEX,
SHADER_CAP_TESSELLATION_SHADER,
SHADER_CAP_WAVE_OPS, SHADER_CAP_WAVE_OPS,
SHADER_CAP_COUNT, SHADER_CAP_COUNT,
}; };

View File

@@ -318,6 +318,7 @@ static BOOL init_test_context(struct d3d11_shader_runner *runner)
runner->caps.shader_caps[SHADER_CAP_ROV] = options2.ROVsSupported; runner->caps.shader_caps[SHADER_CAP_ROV] = options2.ROVsSupported;
runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX] = options3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer; runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX] = options3.VPAndRTArrayIndexFromAnyShaderFeedingRasterizer;
runner->caps.shader_caps[SHADER_CAP_TESSELLATION_SHADER] = true;
for (unsigned int i = 0; i < ARRAY_SIZE(formats); ++i) for (unsigned int i = 0; i < ARRAY_SIZE(formats); ++i)
{ {
runner->caps.format_caps[formats[i]] = get_format_support(runner->device, formats[i]); runner->caps.format_caps[formats[i]] = get_format_support(runner->device, formats[i]);

View File

@@ -1044,6 +1044,7 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner,
runner->caps.shader_caps[SHADER_CAP_ROV] = options.ROVsSupported; runner->caps.shader_caps[SHADER_CAP_ROV] = options.ROVsSupported;
runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX] runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX]
= options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation; = options.VPAndRTArrayIndexFromAnyShaderFeedingRasterizerSupportedWithoutGSEmulation;
runner->caps.shader_caps[SHADER_CAP_TESSELLATION_SHADER] = true;
runner->caps.shader_caps[SHADER_CAP_WAVE_OPS] = options1.WaveOps; runner->caps.shader_caps[SHADER_CAP_WAVE_OPS] = options1.WaveOps;
runner->caps.shader_caps[SHADER_CAP_NATIVE_16_BIT] = options4.Native16BitShaderOpsSupported; runner->caps.shader_caps[SHADER_CAP_NATIVE_16_BIT] = options4.Native16BitShaderOpsSupported;

View File

@@ -131,7 +131,6 @@ static bool check_gl_extensions(struct gl_runner *runner)
"GL_ARB_internalformat_query", "GL_ARB_internalformat_query",
"GL_ARB_sampler_objects", "GL_ARB_sampler_objects",
"GL_ARB_shader_image_load_store", "GL_ARB_shader_image_load_store",
"GL_ARB_tessellation_shader",
"GL_ARB_texture_storage", "GL_ARB_texture_storage",
}; };
@@ -152,6 +151,8 @@ static bool check_gl_extensions(struct gl_runner *runner)
return false; return false;
} }
if (check_gl_extension("GL_EXT_depth_bounds_test", count))
runner->caps.shader_caps[SHADER_CAP_DEPTH_BOUNDS] = true;
if (check_gl_extension("GL_ARB_gpu_shader_fp64", count)) if (check_gl_extension("GL_ARB_gpu_shader_fp64", count))
runner->caps.shader_caps[SHADER_CAP_FLOAT64] = true; runner->caps.shader_caps[SHADER_CAP_FLOAT64] = true;
if (check_gl_extension("GL_ARB_gpu_shader_int64", count)) if (check_gl_extension("GL_ARB_gpu_shader_int64", count))
@@ -159,8 +160,8 @@ static bool check_gl_extensions(struct gl_runner *runner)
if (check_gl_extension("GL_ARB_shader_viewport_layer_array", count) && (runner->language == GLSL if (check_gl_extension("GL_ARB_shader_viewport_layer_array", count) && (runner->language == GLSL
|| check_spirv_extension("SPV_EXT_shader_viewport_index_layer", spirv_count))) || check_spirv_extension("SPV_EXT_shader_viewport_index_layer", spirv_count)))
runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX] = true; runner->caps.shader_caps[SHADER_CAP_RT_VP_ARRAY_INDEX] = true;
if (check_gl_extension("GL_EXT_depth_bounds_test", count)) if (check_gl_extension("GL_ARB_tessellation_shader", count))
runner->caps.shader_caps[SHADER_CAP_DEPTH_BOUNDS] = true; runner->caps.shader_caps[SHADER_CAP_TESSELLATION_SHADER] = true;
return true; return true;
} }

View File

@@ -1781,7 +1781,12 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
ENABLE_FEATURE(shaderClipDistance); ENABLE_FEATURE(shaderClipDistance);
ENABLE_FEATURE(shaderImageGatherExtended); ENABLE_FEATURE(shaderImageGatherExtended);
ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat); ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat);
ENABLE_FEATURE(tessellationShader);
if (ret_features->tessellationShader)
{
features.tessellationShader = VK_TRUE;
runner->caps.shader_caps[SHADER_CAP_TESSELLATION_SHADER] = true;
}
if (ret_features->geometryShader) if (ret_features->geometryShader)
{ {