mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2025-09-12 18:50:22 -07:00
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:
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
@@ -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)
|
||||||
|
@@ -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)
|
||||||
|
@@ -370,6 +370,7 @@ static const char *const shader_cap_strings[] =
|
|||||||
[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_TESSELLATION_SHADER] = "tessellation-shader",
|
||||||
[SHADER_CAP_WAVE_OPS] = "wave-ops",
|
[SHADER_CAP_WAVE_OPS] = "wave-ops",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@@ -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,
|
||||||
};
|
};
|
||||||
|
@@ -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]);
|
||||||
|
@@ -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;
|
||||||
|
|
||||||
|
@@ -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;
|
||||||
}
|
}
|
||||||
|
@@ -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)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user