From f187b4879284ac901a0f905dbfb452f9002cddf8 Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 18 Apr 2022 08:33:57 +0200 Subject: [PATCH] tests: Mark individual invalid shaders as todo. Signed-off-by: Henri Verbeet Signed-off-by: Giovanni Mascellani Signed-off-by: Matteo Bruni Signed-off-by: Zebediah Figura Signed-off-by: Alexandre Julliard --- Makefile.am | 3 --- tests/hlsl-function.shader_test | 14 ++++++------- ...lsl-return-implicit-conversion.shader_test | 10 ++++----- tests/shader_runner.c | 21 ++++++++++++++++--- 4 files changed, 30 insertions(+), 18 deletions(-) diff --git a/Makefile.am b/Makefile.am index 894f1e63..e760a66b 100644 --- a/Makefile.am +++ b/Makefile.am @@ -317,9 +317,6 @@ tests_shader_runner_SOURCES = \ tests_vkd3d_api_LDADD = libvkd3d.la @DL_LIBS@ tests_vkd3d_shader_api_LDADD = libvkd3d-shader.la SHADER_TEST_LOG_COMPILER = tests/shader_runner -XFAIL_TESTS = \ - tests/hlsl-function.shader_test \ - tests/hlsl-return-implicit-conversion.shader_test endif EXTRA_DIST += $(vkd3d_shader_tests) diff --git a/tests/hlsl-function.shader_test b/tests/hlsl-function.shader_test index 586f1ab7..6f11e35b 100644 --- a/tests/hlsl-function.shader_test +++ b/tests/hlsl-function.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail todo] float4 func(); @@ -23,7 +23,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail] +[pixel shader fail todo] void func(inout float o) { @@ -37,7 +37,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail] +[pixel shader fail todo] void func(inout float2 o) { @@ -51,7 +51,7 @@ float4 main() : sv_target return 0; } -[pixel shader fail] +[pixel shader fail todo] void func(out float o) { @@ -65,7 +65,7 @@ float4 main() : sv_target return x; } -[pixel shader fail] +[pixel shader fail todo] void func(inout float o) { @@ -78,7 +78,7 @@ float4 main() : sv_target return x; } -[pixel shader fail] +[pixel shader fail todo] void func() { @@ -89,7 +89,7 @@ float4 main() : sv_target return func(); } -[pixel shader fail] +[pixel shader fail todo] void foo() { diff --git a/tests/hlsl-return-implicit-conversion.shader_test b/tests/hlsl-return-implicit-conversion.shader_test index 4c07cf84..38d21633 100644 --- a/tests/hlsl-return-implicit-conversion.shader_test +++ b/tests/hlsl-return-implicit-conversion.shader_test @@ -98,7 +98,7 @@ float4 main() : sv_target todo draw quad probe all rgba (0.4, 0.3, 0.2, 0.0) -[pixel shader fail] +[pixel shader fail todo] float3x1 func() { return float1x3(0.4, 0.3, 0.2); @@ -109,7 +109,7 @@ float4 main() : sv_target return float4(func(), 0.0); } -[pixel shader fail] +[pixel shader fail todo] float1x3 func() { return float3x1(0.4, 0.3, 0.2); @@ -165,7 +165,7 @@ float4 main() : sv_target todo draw quad probe all rgba (0.4, 0.3, 0.2, 0.0) -[pixel shader fail] +[pixel shader fail todo] float3x1 func() { return float4(0.4, 0.3, 0.2, 0.1); @@ -191,7 +191,7 @@ float4 main() : sv_target todo draw quad probe all rgba (0.4, 0.3, 0.2, 0.0) -[pixel shader fail] +[pixel shader fail todo] float3x1 func() { return float1x4(0.4, 0.3, 0.2, 0.1); @@ -217,7 +217,7 @@ float4 main() : sv_target todo draw quad probe all rgba (0.4, 0.3, 0.2, 0.0) -[pixel shader fail] +[pixel shader fail todo] float1x3 func() { return float4x1(0.4, 0.3, 0.2, 0.1); diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 8633ee9a..8804164e 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -80,6 +80,7 @@ enum parse_state STATE_REQUIRE, STATE_SAMPLER, STATE_SHADER_INVALID_PIXEL, + STATE_SHADER_INVALID_PIXEL_TODO, STATE_SHADER_PIXEL, STATE_SHADER_VERTEX, STATE_TEXTURE, @@ -642,15 +643,24 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const break; case STATE_SHADER_INVALID_PIXEL: + case STATE_SHADER_INVALID_PIXEL_TODO: { ID3D10Blob *blob = NULL, *errors = NULL; HRESULT hr; hr = D3DCompile(shader_source, strlen(shader_source), NULL, NULL, NULL, "main", "ps_4_0", 0, 0, &blob, &errors); - ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); - ok(!blob, "Expected no compiled shader blob.\n"); - ok(!!errors, "Expected non-NULL error blob.\n"); + todo_if (state == STATE_SHADER_INVALID_PIXEL_TODO) + ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); + if (hr == S_OK) + { + ID3D10Blob_Release(blob); + } + else + { + ok(!blob, "Expected no compiled shader blob.\n"); + ok(!!errors, "Expected non-NULL error blob.\n"); + } if (errors) { if (vkd3d_test_state.debug_level) @@ -735,6 +745,10 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const { state = STATE_SHADER_INVALID_PIXEL; } + else if (!strcmp(line, "[pixel shader fail todo]\n")) + { + state = STATE_SHADER_INVALID_PIXEL_TODO; + } else if (sscanf(line, "[sampler %u]\n", &index)) { state = STATE_SAMPLER; @@ -817,6 +831,7 @@ void run_shader_tests(struct shader_runner *runner, int argc, char **argv, const case STATE_PREPROC: case STATE_PREPROC_INVALID: case STATE_SHADER_INVALID_PIXEL: + case STATE_SHADER_INVALID_PIXEL_TODO: case STATE_SHADER_PIXEL: case STATE_SHADER_VERTEX: {