From 721ea8fa6031d78ce03740a7c6fb216879066ebf Mon Sep 17 00:00:00 2001 From: Zebediah Figura Date: Mon, 7 Mar 2022 19:55:44 -0600 Subject: [PATCH] tests: Mark some tests as requiring shader model 4.0. Signed-off-by: Zebediah Figura Signed-off-by: Henri Verbeet Signed-off-by: Alexandre Julliard --- tests/arithmetic-uint.shader_test | 3 +++ tests/bitwise.shader_test | 3 +++ tests/cast-to-float.shader_test | 4 +++- tests/cast-to-half.shader_test | 3 +++ tests/cast-to-int.shader_test | 3 +++ tests/cast-to-uint.shader_test | 3 +++ tests/floor.shader_test | 3 +++ tests/hlsl-function-cast.shader_test | 3 +++ tests/sampler-offset.shader_test | 3 +++ tests/shader_runner.c | 3 +++ tests/shader_runner.h | 3 ++- tests/shader_runner_d3d11.c | 1 + tests/shader_runner_d3d12.c | 1 + 13 files changed, 34 insertions(+), 2 deletions(-) diff --git a/tests/arithmetic-uint.shader_test b/tests/arithmetic-uint.shader_test index d73947f9..b016dbb6 100644 --- a/tests/arithmetic-uint.shader_test +++ b/tests/arithmetic-uint.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main() : SV_TARGET { diff --git a/tests/bitwise.shader_test b/tests/bitwise.shader_test index 679cf9cd..55160037 100644 --- a/tests/bitwise.shader_test +++ b/tests/bitwise.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main() : SV_TARGET { diff --git a/tests/cast-to-float.shader_test b/tests/cast-to-float.shader_test index 75822e52..f0910020 100644 --- a/tests/cast-to-float.shader_test +++ b/tests/cast-to-float.shader_test @@ -1,5 +1,7 @@ -[pixel shader] +[require] +shader model >= 4.0 +[pixel shader] float4 main(uniform int i, uniform uint u, uniform bool b, uniform half h) : sv_target { return float4(((float)i) + 1.5, ((float)u) - 2.5, ((float)b) / 2, h); diff --git a/tests/cast-to-half.shader_test b/tests/cast-to-half.shader_test index 6db5412d..81d6bc5d 100644 --- a/tests/cast-to-half.shader_test +++ b/tests/cast-to-half.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target diff --git a/tests/cast-to-int.shader_test b/tests/cast-to-int.shader_test index c7d1e23c..fe8c79a3 100644 --- a/tests/cast-to-int.shader_test +++ b/tests/cast-to-int.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main(uniform float f, uniform uint u, uniform bool b, uniform half h) : sv_target diff --git a/tests/cast-to-uint.shader_test b/tests/cast-to-uint.shader_test index 01b0442c..93862a36 100644 --- a/tests/cast-to-uint.shader_test +++ b/tests/cast-to-uint.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [pixel shader] float4 main(uniform float f, uniform int i, uniform bool b, uniform half h) : sv_target diff --git a/tests/floor.shader_test b/tests/floor.shader_test index 033d759c..c111f98b 100644 --- a/tests/floor.shader_test +++ b/tests/floor.shader_test @@ -23,6 +23,9 @@ uniform 0 float4 -0.5 6.5 7.5 3.4 draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4 +[require] +shader model >= 4.0 + [pixel shader] float4 main(uniform int4 u) : sv_target { diff --git a/tests/hlsl-function-cast.shader_test b/tests/hlsl-function-cast.shader_test index 4f80ac59..41c452e5 100644 --- a/tests/hlsl-function-cast.shader_test +++ b/tests/hlsl-function-cast.shader_test @@ -67,6 +67,9 @@ uniform 0 float4 -1.9 -1.0 2.9 4.0 draw quad probe all rgba (-1.0, -1.0, 2.0, 4.0) +[require] +shader model >= 4.0 + [pixel shader] void func(inout float4 a) diff --git a/tests/sampler-offset.shader_test b/tests/sampler-offset.shader_test index 83900c55..6f8357df 100644 --- a/tests/sampler-offset.shader_test +++ b/tests/sampler-offset.shader_test @@ -1,3 +1,6 @@ +[require] +shader model >= 4.0 + [sampler 0] filter point point point address clamp clamp clamp diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 558d074d..1808a581 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -105,6 +105,7 @@ static void parse_require_directive(struct shader_context *context, const char * { static const char *const model_strings[] = { + [SHADER_MODEL_2_0] = "2.0", [SHADER_MODEL_4_0] = "4.0", [SHADER_MODEL_4_1] = "4.1", [SHADER_MODEL_5_0] = "5.0", @@ -445,6 +446,8 @@ void run_shader_tests(struct shader_context *context, int argc, char **argv, con char line[256]; FILE *f; + context->minimum_shader_model = SHADER_MODEL_2_0; + for (i = 1; i < argc; ++i) { if (argv[i][0] != '-') diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 245ef358..822a863f 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -25,7 +25,8 @@ enum shader_model { - SHADER_MODEL_4_0 = 0, + SHADER_MODEL_2_0, + SHADER_MODEL_4_0, SHADER_MODEL_4_1, SHADER_MODEL_5_0, SHADER_MODEL_5_1, diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index d77a4b24..79f98640 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -441,6 +441,7 @@ static void d3d11_runner_draw_quad(struct shader_context *c) static const char *const ps_profiles[] = { + [SHADER_MODEL_2_0] = "ps_4_0", [SHADER_MODEL_4_0] = "ps_4_0", [SHADER_MODEL_4_1] = "ps_4_1", [SHADER_MODEL_5_0] = "ps_5_0", diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 3b415ec7..00bb9e41 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -58,6 +58,7 @@ static ID3D10Blob *compile_shader(const char *source, enum shader_model shader_m static const char *const shader_models[] = { + [SHADER_MODEL_2_0] = "ps_4_0", [SHADER_MODEL_4_0] = "ps_4_0", [SHADER_MODEL_4_1] = "ps_4_1", [SHADER_MODEL_5_0] = "ps_5_0",