mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests/shader-runner: Make geometry shaders optional.
This allows the Vulkan runner to execute in environments which do not support geometry shaders, most notably MoltenVK. In particular, that enables SM<4 shaders to run in such environments
This commit is contained in:
parent
7f834f57e5
commit
bc351f4b70
Notes:
Henri Verbeet
2024-10-15 17:05:20 +02:00
Approved-by: Giovanni Mascellani (@giomasce) Approved-by: Henri Verbeet (@hverbeet) Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1182
@ -1,5 +1,6 @@
|
|||||||
[require]
|
[require]
|
||||||
shader model >= 4.0
|
shader model >= 4.0
|
||||||
|
geometry-shader
|
||||||
|
|
||||||
[input layout]
|
[input layout]
|
||||||
0 r32g32b32a32-float SV_POSITION
|
0 r32g32b32a32-float SV_POSITION
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
[require]
|
[require]
|
||||||
shader model >= 5.0
|
shader model >= 5.0
|
||||||
|
% Used for SV_PrimitiveID/SpvBuiltInPrimitiveId.
|
||||||
|
geometry-shader
|
||||||
|
|
||||||
[rtv 0]
|
[rtv 0]
|
||||||
format r32-uint
|
format r32-uint
|
||||||
@ -61,6 +63,7 @@ uint4 main(float4 pos : SV_Position, uint id : SV_PrimitiveID) : SV_Target
|
|||||||
|
|
||||||
[require]
|
[require]
|
||||||
shader model >= 5.0
|
shader model >= 5.0
|
||||||
|
geometry-shader
|
||||||
rov
|
rov
|
||||||
|
|
||||||
[test]
|
[test]
|
||||||
|
@ -386,6 +386,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li
|
|||||||
fatal_error("Unknown format cap '%s'.\n", line);
|
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))
|
else if (match_string(line, "float64", &line))
|
||||||
{
|
{
|
||||||
runner->require_float64 = true;
|
runner->require_float64 = true;
|
||||||
@ -1563,6 +1567,8 @@ static bool check_capabilities(const struct shader_runner *runner, const struct
|
|||||||
{
|
{
|
||||||
unsigned int i;
|
unsigned int i;
|
||||||
|
|
||||||
|
if (runner->require_geometry_shader && !caps->geometry_shader)
|
||||||
|
return false;
|
||||||
if (runner->require_float64 && !caps->float64)
|
if (runner->require_float64 && !caps->float64)
|
||||||
return false;
|
return false;
|
||||||
if (runner->require_int64 && !caps->int64)
|
if (runner->require_int64 && !caps->int64)
|
||||||
@ -1626,7 +1632,7 @@ static void trace_format_cap(const struct shader_runner_caps *caps, enum format_
|
|||||||
|
|
||||||
p = buffer;
|
p = buffer;
|
||||||
rem = ARRAY_SIZE(buffer);
|
rem = ARRAY_SIZE(buffer);
|
||||||
rc = snprintf(p, rem, "%14s:", cap_name);
|
rc = snprintf(p, rem, "%15s:", cap_name);
|
||||||
p += rc;
|
p += rc;
|
||||||
rem -= rc;
|
rem -= rc;
|
||||||
|
|
||||||
@ -1688,6 +1694,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c
|
|||||||
dxc_compiler ? "dxcompiler" : HLSL_COMPILER, caps->runner);
|
dxc_compiler ? "dxcompiler" : HLSL_COMPILER, caps->runner);
|
||||||
if (caps->tag_count)
|
if (caps->tag_count)
|
||||||
trace_tags(caps);
|
trace_tags(caps);
|
||||||
|
trace("geometry-shader: %u.\n", caps->geometry_shader);
|
||||||
trace(" float64: %u.\n", caps->float64);
|
trace(" float64: %u.\n", caps->float64);
|
||||||
trace(" int64: %u.\n", caps->int64);
|
trace(" int64: %u.\n", caps->int64);
|
||||||
trace(" rov: %u.\n", caps->rov);
|
trace(" rov: %u.\n", caps->rov);
|
||||||
@ -1956,6 +1963,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_c
|
|||||||
state = STATE_REQUIRE;
|
state = STATE_REQUIRE;
|
||||||
runner->minimum_shader_model = caps->minimum_shader_model;
|
runner->minimum_shader_model = caps->minimum_shader_model;
|
||||||
runner->maximum_shader_model = caps->maximum_shader_model;
|
runner->maximum_shader_model = caps->maximum_shader_model;
|
||||||
|
runner->require_geometry_shader = false;
|
||||||
runner->require_float64 = false;
|
runner->require_float64 = false;
|
||||||
runner->require_int64 = false;
|
runner->require_int64 = false;
|
||||||
runner->require_rov = false;
|
runner->require_rov = false;
|
||||||
|
@ -142,6 +142,7 @@ struct shader_runner_caps
|
|||||||
size_t tag_count;
|
size_t tag_count;
|
||||||
enum shader_model minimum_shader_model;
|
enum shader_model minimum_shader_model;
|
||||||
enum shader_model maximum_shader_model;
|
enum shader_model maximum_shader_model;
|
||||||
|
bool geometry_shader;
|
||||||
bool float64;
|
bool float64;
|
||||||
bool int64;
|
bool int64;
|
||||||
bool rov;
|
bool rov;
|
||||||
@ -181,6 +182,7 @@ struct shader_runner
|
|||||||
char *gs_source;
|
char *gs_source;
|
||||||
enum shader_model minimum_shader_model;
|
enum shader_model minimum_shader_model;
|
||||||
enum shader_model maximum_shader_model;
|
enum shader_model maximum_shader_model;
|
||||||
|
bool require_geometry_shader;
|
||||||
bool require_float64;
|
bool require_float64;
|
||||||
bool require_int64;
|
bool require_int64;
|
||||||
bool require_rov;
|
bool require_rov;
|
||||||
|
@ -1022,6 +1022,7 @@ static void d3d12_runner_init_caps(struct d3d12_shader_runner *runner,
|
|||||||
#endif
|
#endif
|
||||||
runner->caps.minimum_shader_model = minimum_shader_model;
|
runner->caps.minimum_shader_model = minimum_shader_model;
|
||||||
runner->caps.maximum_shader_model = maximum_shader_model;
|
runner->caps.maximum_shader_model = maximum_shader_model;
|
||||||
|
runner->caps.geometry_shader = true;
|
||||||
runner->caps.float64 = options.DoublePrecisionFloatShaderOps;
|
runner->caps.float64 = options.DoublePrecisionFloatShaderOps;
|
||||||
runner->caps.int64 = options1.Int64ShaderOps;
|
runner->caps.int64 = options1.Int64ShaderOps;
|
||||||
runner->caps.rov = options.ROVsSupported;
|
runner->caps.rov = options.ROVsSupported;
|
||||||
|
@ -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.tag_count = runner->language == GLSL;
|
||||||
runner->caps.minimum_shader_model = SHADER_MODEL_4_0;
|
runner->caps.minimum_shader_model = SHADER_MODEL_4_0;
|
||||||
runner->caps.maximum_shader_model = SHADER_MODEL_5_1;
|
runner->caps.maximum_shader_model = SHADER_MODEL_5_1;
|
||||||
|
runner->caps.geometry_shader = true;
|
||||||
|
|
||||||
glGetIntegerv(GL_NUM_EXTENSIONS, &extension_count);
|
glGetIntegerv(GL_NUM_EXTENSIONS, &extension_count);
|
||||||
if (check_gl_extension("GL_ARB_internalformat_query2", extension_count))
|
if (check_gl_extension("GL_ARB_internalformat_query2", extension_count))
|
||||||
|
@ -1571,12 +1571,16 @@ static bool init_vulkan_runner(struct vulkan_shader_runner *runner)
|
|||||||
features.x = VK_TRUE
|
features.x = VK_TRUE
|
||||||
|
|
||||||
ENABLE_FEATURE(fragmentStoresAndAtomics);
|
ENABLE_FEATURE(fragmentStoresAndAtomics);
|
||||||
/* For SV_PrimitiveID/SpvBuiltInPrimitiveId in fragment shaders. */
|
|
||||||
ENABLE_FEATURE(geometryShader);
|
|
||||||
ENABLE_FEATURE(shaderClipDistance);
|
ENABLE_FEATURE(shaderClipDistance);
|
||||||
ENABLE_FEATURE(shaderImageGatherExtended);
|
ENABLE_FEATURE(shaderImageGatherExtended);
|
||||||
ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat);
|
ENABLE_FEATURE(shaderStorageImageWriteWithoutFormat);
|
||||||
|
|
||||||
|
if (ret_features->geometryShader)
|
||||||
|
{
|
||||||
|
features.geometryShader = VK_TRUE;
|
||||||
|
runner->caps.geometry_shader = true;
|
||||||
|
}
|
||||||
|
|
||||||
if (ret_features->shaderFloat64)
|
if (ret_features->shaderFloat64)
|
||||||
{
|
{
|
||||||
features.shaderFloat64 = VK_TRUE;
|
features.shaderFloat64 = VK_TRUE;
|
||||||
|
Loading…
Reference in New Issue
Block a user