This goes on top of MR 345.
-- v21: tests/shader-runner: Test shaders with dxcompiler.
From: Conor McCarthy cmccarthy@codeweavers.com
Matching all possible combinations of keywords becomes too complex if more keywords are added. --- tests/shader_runner.c | 123 +++++++++++++++++++++--------------------- 1 file changed, 62 insertions(+), 61 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 05edf5daf..8185df504 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -109,6 +109,24 @@ static bool match_string(const char *line, const char *token, const char **const return true; }
+static bool match_directive_substring(const char *line, const char *token, const char **const rest) +{ + size_t len = strlen(token); + + while (isspace(*line) || *line == ']') + ++line; + + if (strncmp(line, token, len) || !(isspace(line[len]) || line[len] == ']')) + return false; + if (rest) + { + *rest = line + len; + while (isspace(**rest)) + ++*rest; + } + return true; +} + static void parse_require_directive(struct shader_runner *runner, const char *line) { unsigned int i; @@ -809,6 +827,40 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz } }
+static enum parse_state read_shader_directive(struct shader_runner *runner, enum parse_state state, const char *line, + const char *src, HRESULT *expect_hr) +{ + while (*src && *src != ']') + { + if (match_directive_substring(src, "todo", &src)) + { + if (state == STATE_SHADER_COMPUTE) + state = STATE_SHADER_COMPUTE_TODO; + else if (state == STATE_SHADER_PIXEL) + state = STATE_SHADER_PIXEL_TODO; + else + state = STATE_SHADER_VERTEX_TODO; + } + else if (match_directive_substring(src, "fail", &src)) + { + *expect_hr = E_FAIL; + } + else if (match_directive_substring(src, "notimpl", &src)) + { + *expect_hr = E_NOTIMPL; + } + else + { + fatal_error("Malformed line '%s'.\n", line); + } + } + + if (strcmp(src, "]\n")) + fatal_error("Malformed line '%s'.\n", line); + + return state; +} + void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops) { size_t shader_source_size = 0, shader_source_len = 0; @@ -818,7 +870,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o unsigned int i, line_number = 0; char *shader_source = NULL; HRESULT expect_hr = S_OK; - char line[256]; + char line_buffer[256]; FILE *f;
if (!test_options.filename) @@ -833,7 +885,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
for (;;) { - char *ret = fgets(line, sizeof(line), f); + char *ret = fgets(line_buffer, sizeof(line_buffer), f); + const char *line = line_buffer;
++line_number;
@@ -957,59 +1010,21 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o { unsigned int index;
- if (!strcmp(line, "[compute shader]\n")) + if (match_directive_substring(line, "[compute shader", &line)) { state = STATE_SHADER_COMPUTE; expect_hr = S_OK; - } - else if (!strcmp(line, "[compute shader todo]\n")) - { - state = STATE_SHADER_COMPUTE_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[compute shader fail]\n")) - { - state = STATE_SHADER_COMPUTE; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[compute shader fail todo]\n")) - { - state = STATE_SHADER_COMPUTE_TODO; - expect_hr = E_FAIL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; } - else if (!strcmp(line, "[pixel shader]\n")) + else if (match_directive_substring(line, "[pixel shader", &line)) { state = STATE_SHADER_PIXEL; expect_hr = S_OK; - } - else if (!strcmp(line, "[pixel shader todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[pixel shader fail]\n")) - { - state = STATE_SHADER_PIXEL; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[pixel shader fail todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[pixel shader notimpl]\n")) - { - state = STATE_SHADER_PIXEL; - expect_hr = E_NOTIMPL; - } - else if (!strcmp(line, "[pixel shader notimpl todo]\n")) - { - state = STATE_SHADER_PIXEL_TODO; - expect_hr = E_NOTIMPL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (sscanf(line, "[sampler %u]\n", &index)) { @@ -1103,25 +1118,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o { state = STATE_PREPROC_INVALID; } - else if (!strcmp(line, "[vertex shader]\n")) + else if (match_directive_substring(line, "[vertex shader", &line)) { state = STATE_SHADER_VERTEX; expect_hr = S_OK; - } - else if (!strcmp(line, "[vertex shader todo]\n")) - { - state = STATE_SHADER_VERTEX_TODO; - expect_hr = S_OK; - } - else if (!strcmp(line, "[vertex shader fail]\n")) - { - state = STATE_SHADER_VERTEX; - expect_hr = E_FAIL; - } - else if (!strcmp(line, "[vertex shader fail todo]\n")) - { - state = STATE_SHADER_VERTEX_TODO; - expect_hr = E_FAIL; + state = read_shader_directive(runner, state, line_buffer, line, &expect_hr); } else if (!strcmp(line, "[input layout]\n")) { @@ -1132,7 +1133,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o runner->input_element_count = 0; }
- vkd3d_test_push_context("Section %.*s, line %u", strlen(line) - 1, line, line_number); + vkd3d_test_push_context("Section %.*s, line %u", strlen(line_buffer) - 1, line_buffer, line_number); } else if (line[0] != '%' && line[0] != '\n') {
From: Conor McCarthy cmccarthy@codeweavers.com
Tests are skipped until the next 'require' directive, which restores the defaults before the new requirements are read. --- tests/shader_runner.c | 38 ++++++++++++++++++++++++++++---------- 1 file changed, 28 insertions(+), 10 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 8185df504..87502f010 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -870,6 +870,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o unsigned int i, line_number = 0; char *shader_source = NULL; HRESULT expect_hr = S_OK; + bool skip_tests = false; char line_buffer[256]; FILE *f;
@@ -903,8 +904,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o case STATE_REQUIRE: if (runner->ops->check_requirements && !runner->ops->check_requirements(runner)) { - vkd3d_test_pop_context(); - goto out; + skip_tests = true; } break;
@@ -915,8 +915,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_COMPUTE: case STATE_SHADER_COMPUTE_TODO: - todo_if (state == STATE_SHADER_COMPUTE_TODO) - compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_COMPUTE_TODO) + compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + } free(runner->cs_source); runner->cs_source = shader_source; shader_source = NULL; @@ -926,8 +929,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_PIXEL: case STATE_SHADER_PIXEL_TODO: - todo_if (state == STATE_SHADER_PIXEL_TODO) - compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_PIXEL_TODO) + compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + } free(runner->ps_source); runner->ps_source = shader_source; shader_source = NULL; @@ -937,8 +943,11 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
case STATE_SHADER_VERTEX: case STATE_SHADER_VERTEX_TODO: - todo_if (state == STATE_SHADER_VERTEX_TODO) - compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + if (!skip_tests) + { + todo_if (state == STATE_SHADER_VERTEX_TODO) + compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + } free(runner->vs_source); runner->vs_source = shader_source; shader_source = NULL; @@ -951,6 +960,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o ID3D10Blob *blob = NULL, *errors = NULL; HRESULT hr;
+ if (skip_tests) + break; + hr = D3DPreprocess(shader_source, strlen(shader_source), NULL, NULL, NULL, &blob, &errors); ok(hr == E_FAIL, "Got unexpected hr %#x.\n", hr); ok(!blob, "Expected no compiled shader blob.\n"); @@ -974,6 +986,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o HRESULT hr; char *text;
+ if (skip_tests) + break; + hr = D3DPreprocess(shader_source, strlen(shader_source), NULL, NULL, NULL, &blob, &errors); ok(hr == S_OK, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) @@ -1019,6 +1034,9 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; + runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->compile_options = 0; + skip_tests = false; } else if (match_directive_substring(line, "[pixel shader", &line)) { @@ -1177,13 +1195,13 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break;
case STATE_TEST: - parse_test_directive(runner, line); + if (!skip_tests) + parse_test_directive(runner, line); break; } } }
-out: for (i = 0; i < runner->input_element_count; ++i) free(runner->input_elements[i].name); free(runner->input_elements);
From: Conor McCarthy cmccarthy@codeweavers.com
--- tests/shader_runner.c | 23 ++++++++++++++++++----- tests/shader_runner.h | 9 +++++++++ tests/shader_runner_d3d12.c | 10 +++++----- 3 files changed, 32 insertions(+), 10 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 87502f010..bec08d7e7 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -790,7 +790,20 @@ static HRESULT map_unidentified_hrs(HRESULT hr) return hr; }
-static void compile_shader(struct shader_runner *runner, const char *source, size_t len, const char *type, HRESULT expect) +const char *shader_type_string(enum shader_type type) +{ + static const char *const shader_types[] = + { + [SHADER_TYPE_CS] = "cs", + [SHADER_TYPE_PS] = "ps", + [SHADER_TYPE_VS] = "vs", + }; + assert(type < ARRAY_SIZE(shader_types)); + return shader_types[type]; +} + +static void compile_shader(struct shader_runner *runner, const char *source, size_t len, enum shader_type type, + HRESULT expect) { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; @@ -806,7 +819,7 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz [SHADER_MODEL_5_1] = "5_1", };
- sprintf(profile, "%s_%s", type, shader_models[runner->minimum_shader_model]); + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); hr = map_unidentified_hrs(hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr); @@ -918,7 +931,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_COMPUTE_TODO) - compile_shader(runner, shader_source, shader_source_len, "cs", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_CS, expect_hr); } free(runner->cs_source); runner->cs_source = shader_source; @@ -932,7 +945,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_PIXEL_TODO) - compile_shader(runner, shader_source, shader_source_len, "ps", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_PS, expect_hr); } free(runner->ps_source); runner->ps_source = shader_source; @@ -946,7 +959,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_VERTEX_TODO) - compile_shader(runner, shader_source, shader_source_len, "vs", expect_hr); + compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_VS, expect_hr); } free(runner->vs_source); runner->vs_source = shader_source; diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 0844943da..6591143e6 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -38,6 +38,15 @@ enum shader_model SHADER_MODEL_5_1, };
+enum shader_type +{ + SHADER_TYPE_CS, + SHADER_TYPE_PS, + SHADER_TYPE_VS, +}; + +const char *shader_type_string(enum shader_type type); + enum texture_data_type { TEXTURE_DATA_FLOAT, diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index d620f1e2d..925bdca99 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -56,7 +56,7 @@ static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r) return CONTAINING_RECORD(r, struct d3d12_shader_runner, r); }
-static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, const char *source, const char *type) +static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, const char *source, enum shader_type type) { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; @@ -72,7 +72,7 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons [SHADER_MODEL_5_1] = "5_1", };
- sprintf(profile, "%s_%s", type, shader_models[runner->r.minimum_shader_model]); + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob); if (errors) @@ -310,7 +310,7 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig HRESULT hr; size_t i;
- cs_code = compile_shader(runner, runner->r.cs_source, "cs"); + cs_code = compile_shader(runner, runner->r.cs_source, SHADER_TYPE_CS); todo_if (runner->r.is_todo) ok(cs_code, "Failed to compile shader.\n"); if (!cs_code) return false; @@ -385,8 +385,8 @@ static bool d3d12_runner_draw(struct shader_runner *r, HRESULT hr; size_t i;
- ps_code = compile_shader(runner, runner->r.ps_source, "ps"); - vs_code = compile_shader(runner, runner->r.vs_source, "vs"); + ps_code = compile_shader(runner, runner->r.ps_source, SHADER_TYPE_PS); + vs_code = compile_shader(runner, runner->r.vs_source, SHADER_TYPE_VS); todo_if (runner->r.is_todo) ok(ps_code && vs_code, "Failed to compile shaders.\n");
if (!ps_code || !vs_code)
From: Conor McCarthy cmccarthy@codeweavers.com
The location of dxcompiler should be set during configuration with 'DXCOMPILER_LIBS=-L/path/to/dxcompiler', and then at runtime with LD_LIBRARY_PATH, WINEPATH or PATH as applicable.
A new 'fail(sm<6)' decoration is needed on many shader declarations because dxcompiler succeeds on many shaders which fail with fxc. The opposite case is less common and is flagged with 'fail(sm>=6)'. A few tests cause dxcompiler to crash or hang, so these are avoided using [require], which now skips tests until reset instead of exiting. Also, 'todo(sm<6)' and 'todo(sm>=6)' are used to separate checking of results. --- Makefile.am | 10 +- README | 10 + configure.ac | 7 + tests/dxcompiler.idl | 170 ++++++++++++ tests/hlsl/abs.shader_test | 6 +- tests/hlsl/all.shader_test | 14 +- tests/hlsl/any.shader_test | 36 +-- .../hlsl/arithmetic-float-uniform.shader_test | 12 +- tests/hlsl/arithmetic-float.shader_test | 2 +- tests/hlsl/arithmetic-int-uniform.shader_test | 16 +- tests/hlsl/arithmetic-int.shader_test | 9 +- tests/hlsl/arithmetic-uint.shader_test | 4 +- tests/hlsl/array-dimension.shader_test | 2 +- tests/hlsl/array-index-expr.shader_test | 16 +- tests/hlsl/array-parameters.shader_test | 2 +- tests/hlsl/array-size-expr.shader_test | 2 +- tests/hlsl/asfloat.shader_test | 8 +- tests/hlsl/asuint.shader_test | 8 +- tests/hlsl/attributes.shader_test | 20 +- tests/hlsl/bool-cast.shader_test | 4 +- tests/hlsl/bool-semantics.shader_test | 2 +- .../cast-componentwise-compatible.shader_test | 14 +- .../hlsl/cast-componentwise-equal.shader_test | 10 +- tests/hlsl/cast-to-float.shader_test | 4 +- tests/hlsl/cast-to-half.shader_test | 4 +- tests/hlsl/cast-to-int.shader_test | 4 +- tests/hlsl/cast-to-uint.shader_test | 4 +- tests/hlsl/cbuffer.shader_test | 46 ++-- tests/hlsl/clamp.shader_test | 4 +- tests/hlsl/clip.shader_test | 8 +- tests/hlsl/combined-samplers.shader_test | 26 +- tests/hlsl/compute.shader_test | 2 +- tests/hlsl/conditional.shader_test | 18 +- tests/hlsl/const.shader_test | 4 +- tests/hlsl/cross.shader_test | 8 +- tests/hlsl/d3dcolor-to-ubyte4.shader_test | 8 +- tests/hlsl/ddxddy.shader_test | 8 +- tests/hlsl/discard.shader_test | 4 +- tests/hlsl/distance.shader_test | 2 +- tests/hlsl/dot.shader_test | 10 +- tests/hlsl/duplicate-modifiers.shader_test | 4 + tests/hlsl/entry-point-semantics.shader_test | 22 +- tests/hlsl/exp.shader_test | 4 +- tests/hlsl/expr-indexing.shader_test | 14 +- tests/hlsl/floor.shader_test | 12 +- tests/hlsl/fmod.shader_test | 12 +- tests/hlsl/for.shader_test | 2 +- tests/hlsl/frac.shader_test | 2 +- tests/hlsl/function-cast.shader_test | 6 +- tests/hlsl/function-overload.shader_test | 2 +- tests/hlsl/function-return.shader_test | 24 +- tests/hlsl/function.shader_test | 8 +- tests/hlsl/gather-offset.shader_test | 12 +- tests/hlsl/gather.shader_test | 12 +- tests/hlsl/getdimensions.shader_test | 4 +- .../initializer-implicit-array.shader_test | 55 ++-- tests/hlsl/initializer-objects.shader_test | 4 +- tests/hlsl/intrinsic-override.shader_test | 4 +- tests/hlsl/invalid.shader_test | 12 +- tests/hlsl/is-front-face.shader_test | 4 +- tests/hlsl/ldexp.shader_test | 4 +- tests/hlsl/length.shader_test | 10 +- tests/hlsl/lerp.shader_test | 4 +- tests/hlsl/lit.shader_test | 12 +- tests/hlsl/load-level.shader_test | 6 +- tests/hlsl/log.shader_test | 6 +- tests/hlsl/loop.shader_test | 4 +- tests/hlsl/majority-pragma.shader_test | 30 +-- tests/hlsl/majority-syntax.shader_test | 4 +- tests/hlsl/majority-typedef.shader_test | 2 +- tests/hlsl/math.shader_test | 4 +- tests/hlsl/matrix-indexing.shader_test | 10 +- tests/hlsl/matrix-semantics.shader_test | 16 +- tests/hlsl/max.shader_test | 8 +- tests/hlsl/nested-arrays.shader_test | 4 +- tests/hlsl/nointerpolation.shader_test | 2 +- tests/hlsl/normalize.shader_test | 10 +- tests/hlsl/numeric-types.shader_test | 6 +- tests/hlsl/numthreads.shader_test | 10 +- tests/hlsl/object-field-offsets.shader_test | 6 +- tests/hlsl/object-parameters.shader_test | 13 +- tests/hlsl/object-references.shader_test | 18 +- tests/hlsl/pow.shader_test | 4 +- tests/hlsl/reflect.shader_test | 12 +- tests/hlsl/register-reservations.shader_test | 18 +- .../return-implicit-conversion.shader_test | 2 +- tests/hlsl/return.shader_test | 34 +-- tests/hlsl/round.shader_test | 12 +- tests/hlsl/sample-bias.shader_test | 6 +- tests/hlsl/sample-grad.shader_test | 6 +- tests/hlsl/sample-level.shader_test | 6 +- tests/hlsl/sampler-offset.shader_test | 6 +- tests/hlsl/sampler.shader_test | 8 +- tests/hlsl/saturate.shader_test | 8 +- .../shader-interstage-interface.shader_test | 2 +- tests/hlsl/side-effects.shader_test | 5 + tests/hlsl/sign.shader_test | 20 +- tests/hlsl/smoothstep.shader_test | 2 +- tests/hlsl/sqrt.shader_test | 4 +- tests/hlsl/state-block-syntax.shader_test | 20 +- tests/hlsl/static-initializer.shader_test | 6 +- tests/hlsl/step.shader_test | 2 +- tests/hlsl/storage-qualifiers.shader_test | 4 +- tests/hlsl/struct-array.shader_test | 2 +- tests/hlsl/swizzle-constant-prop.shader_test | 6 +- tests/hlsl/swizzle-matrix.shader_test | 6 +- tests/hlsl/swizzles.shader_test | 6 +- tests/hlsl/ternary.shader_test | 10 +- tests/hlsl/texture-load-offset.shader_test | 4 +- tests/hlsl/texture-load-typed.shader_test | 2 +- tests/hlsl/texture-load.shader_test | 6 +- tests/hlsl/texture-ordering.shader_test | 20 +- tests/hlsl/trigonometry.shader_test | 8 +- tests/hlsl/trunc.shader_test | 14 +- tests/hlsl/type-names.shader_test | 6 +- tests/hlsl/uav-load.shader_test | 2 +- tests/hlsl/uav-out-param.shader_test | 4 +- tests/hlsl/uav-rwbuffer.shader_test | 8 +- tests/hlsl/uav-rwstructuredbuffer.shader_test | 2 +- tests/hlsl/uav-rwtexture.shader_test | 22 +- tests/hlsl/uniform-semantics.shader_test | 4 +- .../hlsl/vector-indexing-uniform.shader_test | 2 +- tests/hlsl/vector-indexing.shader_test | 4 +- tests/hlsl/writemask-assignop-0.shader_test | 2 +- tests/hlsl/writemask-assignop-1.shader_test | 2 +- tests/shader_runner.c | 255 ++++++++++++++++-- tests/shader_runner.h | 10 +- tests/shader_runner_d3d11.c | 2 +- tests/shader_runner_d3d12.c | 50 +++- tests/shader_runner_d3d9.c | 2 +- tests/shader_runner_vulkan.c | 2 +- 131 files changed, 1044 insertions(+), 562 deletions(-) create mode 100644 tests/dxcompiler.idl
diff --git a/Makefile.am b/Makefile.am index 744e46127..cab9345f4 100644 --- a/Makefile.am +++ b/Makefile.am @@ -14,7 +14,8 @@ widl_headers = \ include/vkd3d_dxgi1_4.h \ include/vkd3d_dxgibase.h \ include/vkd3d_dxgiformat.h \ - include/vkd3d_dxgitype.h + include/vkd3d_dxgitype.h \ + tests/dxcompiler.h
vkd3d_public_headers = \ include/vkd3d.h \ @@ -197,6 +198,7 @@ vkd3d_shader_tests = \ vkd3d_test_headers = \ tests/d3d12_crosstest.h \ tests/d3d12_test_utils.h \ + tests/dxcompiler.h \ tests/shader_runner.h \ tests/utils.h \ tests/vulkan_procs.h @@ -379,7 +381,9 @@ tests_d3d12_LDADD = $(LDADD) @PTHREAD_LIBS@ @DL_LIBS@ tests_d3d12_invalid_usage_LDADD = $(LDADD) @DL_LIBS@ tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@ tests_shader_runner_LDADD = $(LDADD) @DL_LIBS@ +tests_shader_runner_CFLAGS = $(AM_CFLAGS) -I$(builddir)/tests tests_shader_runner_SOURCES = \ + tests/dxcompiler.idl \ tests/shader_runner.c \ tests/shader_runner_d3d9.c \ tests/shader_runner_d3d11.c \ @@ -419,7 +423,7 @@ endif EXTRA_DIST += $(widl_headers) $(widl_headers:.h=.idl) $(widl_headers): %.h: %.idl if HAVE_WIDL - $(VKD3D_V_WIDL)$(WIDL) -h -o $@ $< + $(VKD3D_V_WIDL)$(WIDL) -I$(srcdir)/include -h -o $@ $< else @echo "widl is required to generate $@" endif @@ -463,7 +467,7 @@ dummy-vkd3d-version:
## Cross-compile tests cross_implibs = crosslibs/d3d12 -CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include +CROSS_CPPFLAGS = -I$(srcdir)/include -I$(srcdir)/include/private -I$(builddir)/include -I$(builddir)/tests CROSS_CFLAGS = -g -O2 -Wall -municode ${CROSS_CPPFLAGS} -D__USE_MINGW_ANSI_STDIO=0 -DVKD3D_CROSSTEST=1 EXTRA_DIST += $(cross_implibs:=.cross32.def) $(cross_implibs:=.cross64.def) EXTRA_DIST += tests/shader_runner_d3d11.c tests/shader_runner_d3d9.c diff --git a/README b/README index cb9d66156..664a28670 100644 --- a/README +++ b/README @@ -83,6 +83,16 @@ commas or semicolons.
* VKD3D_TEST_BUG - set to 0 to disable bug_if() conditions in tests.
+If the configuration defines 'DXCOMPILER_LIBS=-L/path/to/dxcompiler', Shader +Runner attempts to load libdxcompiler.so or dxcompiler.dll to compile test +shaders in Shader Model 6. LD_LIBRARY_PATH (linux), WINEPATH (wine) or PATH +(native windows) should include the location of dxcompiler if SM 6 shader +tests are desired. If dxcompiler is not found, Shader Runner will compile the +test shaders only in earlier shader models. The DXC source does not contain +code for adding DXBC checksums, so the official release should be installed +from: +https://github.com/microsoft/DirectXShaderCompiler/releases + ================ Developing vkd3d ================ diff --git a/configure.ac b/configure.ac index 07eeabbfc..3f6e6b789 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,12 @@ AS_IF([test "x$SONAME_LIBVULKAN" = "x"], [VKD3D_CHECK_VULKAN], [AC_DEFINE_UNQUOTED([SONAME_LIBVULKAN],["$SONAME_LIBVULKAN"],[Define to the shared object name of the Vulkan library.])])
+AC_ARG_VAR([SONAME_LIBDXCOMPILER], [shared object name for the dxcompiler library]) +AC_ARG_VAR([DXCOMPILER_LIBS], [linker flags for the dxcompiler library]) +AS_IF([test "x$SONAME_LIBDXCOMPILER" = "x"], + [VKD3D_CHECK_SONAME([dxcompiler], [DxcCreateInstance], [HAVE_DXCOMPILER=yes], [HAVE_DXCOMPILER=no], [$DXCOMPILER_LIBS])], + [AC_DEFINE_UNQUOTED([SONAME_LIBDXCOMPILER],["$SONAME_LIBDXCOMPILER"],[Define to the shared object name of the dxcompiler library.])]) + AS_IF([test "x$with_ncurses" != "xno"], [PKG_CHECK_MODULES([NCURSES], [ncurses], [AC_DEFINE([HAVE_NCURSES], [1], [Define to 1 if you have ncurses.]) with_ncurses=yes], @@ -183,6 +189,7 @@ AS_ECHO([" Have ncurses: ${with_ncurses} Have SPIRV-Tools: ${with_spirv_tools} Have xcb: ${HAVE_XCB} + Have dxcompiler: ${HAVE_DXCOMPILER}
Building demos: ${enable_demos} Building tests: ${enable_tests} diff --git a/tests/dxcompiler.idl b/tests/dxcompiler.idl new file mode 100644 index 000000000..280c0f975 --- /dev/null +++ b/tests/dxcompiler.idl @@ -0,0 +1,170 @@ +/* + * Copyright 2023 Conor McCarthy for CodeWeavers + * + * This library is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2.1 of the License, or (at your option) any later version. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public + * License along with this library; if not, write to the Free Software + * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA + */ + +import "vkd3d_windows.h"; +#include "vkd3d_unknown.idl" + +/* The linux build of dxcompiler does not apply the ms_abi calling convention to its COM interfaces, + * so they default to sysv_abi. The '__stdcall' macro is set in vkd3d_windows.h to ms_abi, and widl + * emits STDMETHODCALLTYPE for COM interfaces, so '__stdcall' must be temporarily undefined. Doing + * this in a PE build (x86 or x64) is unnecessary since the default calling convention is identical. + * A 32-bit linux release of dxcompiler is not available. + * TODO: modily widl to optionally omit STDMETHODCALLTYPE? */ +cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)") +cpp_quote("# pragma push_macro("__stdcall")") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif") + +static const HRESULT DXC_E_LLVM_CAST_ERROR = 0x80aa001d; + +cpp_quote("DEFINE_GUID(CLSID_DxcCompiler, 0x73e22d93, 0xe6ce, 0x47f3, 0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0);") + +[ + uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102), + object, + local, + pointer_default(unique) +] +interface IDxcBlob : IUnknown +{ + void *GetBufferPointer(); + SIZE_T GetBufferSize(); +} + +[ + uuid(7241d424-2646-4191-97c0-98e96e42fc68), + object, + local, + pointer_default(unique) +] +interface IDxcBlobEncoding : IDxcBlob +{ + HRESULT GetEncoding(BOOL *known, UINT32 *code_page); +} + +[ + uuid(3da636c9-ba71-4024-a301-30cbf125305b), + object, + local, + pointer_default(unique) +] +interface IDxcBlobUtf8 : IDxcBlobEncoding +{ + const char *GetStringPointer(); + SIZE_T GetStringLength(); +} + +[ + uuid(a3f84eab-0faa-497e-a39c-ee6ed60b2d84), + object, + local, + pointer_default(unique) +] +interface IDxcBlobUtf16 : IDxcBlobEncoding +{ + const WCHAR *GetStringPointer(); + SIZE_T GetStringLength(); +} + +[ + uuid(7f61fc7d-950d-467f-b3e3-3c02fb49187c), + object, + local, + pointer_default(unique) +] +interface IDxcIncludeHandler : IUnknown +{ + HRESULT LoadSource(const WCHAR *filename, IDxcBlob **include_source); +} + +typedef struct DxcBuffer +{ + const void *Ptr; + SIZE_T Size; + UINT Encoding; +} DxcBuffer; + +[ + uuid(cedb484a-d4e9-445a-b991-ca21ca157dc2), + object, + local, + pointer_default(unique) +] +interface IDxcOperationResult : IUnknown +{ + HRESULT GetStatus(HRESULT *status); + + HRESULT GetResult(IDxcBlob **result); + + HRESULT GetErrorBuffer(IDxcBlobEncoding **errors); +} + +typedef enum DXC_OUT_KIND +{ + DXC_OUT_NONE = 0, + DXC_OUT_OBJECT = 1, + DXC_OUT_ERRORS = 2, + DXC_OUT_PDB = 3, + DXC_OUT_SHADER_HASH = 4, + DXC_OUT_DISASSEMBLY = 5, + DXC_OUT_HLSL = 6, + DXC_OUT_TEXT = 7, + DXC_OUT_REFLECTION = 8, + DXC_OUT_ROOT_SIGNATURE = 9, + DXC_OUT_EXTRA_OUTPUTS = 10, + + DXC_OUT_FORCE_DWORD = 0xFFFFFFFF +} DXC_OUT_KIND; + +[ + uuid(58346cda-dde7-4497-9461-6f87af5e0659), + object, + local, + pointer_default(unique) +] +interface IDxcResult : IDxcOperationResult +{ + BOOL HasOutput(DXC_OUT_KIND dxc_out_kind); + HRESULT GetOutput(DXC_OUT_KIND dxc_out_kind, + REFIID iid, void **object, IDxcBlobUtf16 **output_name); + + UINT32 GetNumOutputs(); + DXC_OUT_KIND GetOutputByIndex(UINT32 index); + DXC_OUT_KIND PrimaryOutput(); +} + +[ + uuid(228b4687-5a6a-4730-900c-9702b2203f54), + object, + local, + pointer_default(unique) +] +interface IDxcCompiler3 : IUnknown +{ + HRESULT Compile(const DxcBuffer *source, const WCHAR **arguments, UINT32 arg_count, + IDxcIncludeHandler *include_handler, REFIID riid, void **result); + + HRESULT Disassemble(const DxcBuffer *object, REFIID riid, void **result); +} + +typedef HRESULT (__stdcall *DxcCreateInstanceProc)(const IID *rclsid, REFIID riid, void **ppv); + +cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)") +cpp_quote("# pragma pop_macro("__stdcall")") +cpp_quote("#endif") diff --git a/tests/hlsl/abs.shader_test b/tests/hlsl/abs.shader_test index 6fa6d1ca7..14b444d15 100644 --- a/tests/hlsl/abs.shader_test +++ b/tests/hlsl/abs.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float2 u) : sv_target { return float4(abs(u), abs(u.x - 0.5), abs(-0.4)); @@ -6,8 +6,8 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.1 0.7 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.7, 0.4, 0.4) uniform 0 float4 -0.7 0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.1, 1.2, 0.4) diff --git a/tests/hlsl/all.shader_test b/tests/hlsl/all.shader_test index 7bdb0dc82..564cc5b00 100644 --- a/tests/hlsl/all.shader_test +++ b/tests/hlsl/all.shader_test @@ -11,17 +11,17 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.1 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 0.0 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[test] uniform 0 float4 1.0 0.0 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -34,12 +34,12 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -53,11 +53,11 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 3.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 0.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/any.shader_test b/tests/hlsl/any.shader_test index f2298d3a3..9b8b922c9 100644 --- a/tests/hlsl/any.shader_test +++ b/tests/hlsl/any.shader_test @@ -8,25 +8,25 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 1.0 1.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 1.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 1.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 -1.0 -1.0 -1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -39,13 +39,13 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) uniform 0 float4 -1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[require] @@ -61,22 +61,22 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 1 1 1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 1 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 1 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -89,8 +89,8 @@ float4 main() : sv_target
[test] uniform 0 uint4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 uint4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0) diff --git a/tests/hlsl/arithmetic-float-uniform.shader_test b/tests/hlsl/arithmetic-float-uniform.shader_test index f022ac79f..8aaca621a 100644 --- a/tests/hlsl/arithmetic-float-uniform.shader_test +++ b/tests/hlsl/arithmetic-float-uniform.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 15.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (20.0, -10.0, 75.0, 0.33333333) 1
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 15.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 5.0, -5.0, 3.0) 1
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -2.0, 2.0, -2.0) 16
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -69,7 +69,7 @@ float4 main() : sv_target [test] uniform 0 float4 5.0 -42.1 4.0 45.0 uniform 4 float4 15.0 -5.0 4.1 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, -2.1, 4.0, 0.0) 4
[require] @@ -88,5 +88,5 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1e99, 1e99, 1e99, 1e99) diff --git a/tests/hlsl/arithmetic-float.shader_test b/tests/hlsl/arithmetic-float.shader_test index 73bd627c0..71835082c 100644 --- a/tests/hlsl/arithmetic-float.shader_test +++ b/tests/hlsl/arithmetic-float.shader_test @@ -61,7 +61,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (5.0, -2.1, 4.0, 0.0) 4 +probe all rgba (5.0, -2.1, 4.0, 0.0) 6
[require] % Infinities are not allowed in SM1 diff --git a/tests/hlsl/arithmetic-int-uniform.shader_test b/tests/hlsl/arithmetic-int-uniform.shader_test index b2bf720fc..726a191a7 100644 --- a/tests/hlsl/arithmetic-int-uniform.shader_test +++ b/tests/hlsl/arithmetic-int-uniform.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 16.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, -11.0, 80.0, 0.0)
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 16.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 5.0, -5.0, 3.0)
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (8.0, -8.0, -8.0, 8.0)
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 42.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -2.0, 2.0, -2.0)
[pixel shader] @@ -70,7 +70,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (9.0, -9.0, -9.0, 9.0)
[pixel shader] @@ -85,7 +85,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 45.0 5.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -98,7 +98,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 5.0 -7.0 0.0 -10.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.0, 7.0, 0.0, 10.0)
[pixel shader] @@ -117,5 +117,5 @@ float4 main() : sv_target [test] uniform 0 float4 45.0 5.0 50.0 10.0 uniform 4 float4 3.0 8.0 2.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (9.0, 5.0, 1.0, 3.0) diff --git a/tests/hlsl/arithmetic-int.shader_test b/tests/hlsl/arithmetic-int.shader_test index c97022099..6a84574b2 100644 --- a/tests/hlsl/arithmetic-int.shader_test +++ b/tests/hlsl/arithmetic-int.shader_test @@ -76,7 +76,7 @@ float4 main() : SV_TARGET draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { int x = 1; @@ -85,7 +85,7 @@ float4 main() : SV_TARGET return x / y; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { int x = 1; @@ -96,6 +96,8 @@ float4 main() : SV_TARGET
[require] shader model >= 4.0 +% dxcompiler performs this calculation on unsigned values and emits zero. +shader model < 6.0
[pixel shader] float4 main() : SV_TARGET @@ -110,6 +112,9 @@ float4 main() : SV_TARGET draw quad probe all rgba (-2147483648.0, -2147483648.0, -2147483648.0, -2147483648.0)
+[require] +shader model >= 4.0 + [pixel shader] float4 main() : sv_target { diff --git a/tests/hlsl/arithmetic-uint.shader_test b/tests/hlsl/arithmetic-uint.shader_test index f1801b9c2..8b9c2bc91 100644 --- a/tests/hlsl/arithmetic-uint.shader_test +++ b/tests/hlsl/arithmetic-uint.shader_test @@ -27,7 +27,7 @@ float4 main() : SV_TARGET draw quad probe all rgba (5.0, 5.0, 4294967296.0, 3.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { uint x = 1; @@ -36,7 +36,7 @@ float4 main() : SV_TARGET return x / y; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { uint x = 1; diff --git a/tests/hlsl/array-dimension.shader_test b/tests/hlsl/array-dimension.shader_test index 4e8bc12f7..4bdf5f01e 100644 --- a/tests/hlsl/array-dimension.shader_test +++ b/tests/hlsl/array-dimension.shader_test @@ -1,6 +1,6 @@ % Test what kinds of expressions are valid array dimensions.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] float4 main() : sv_target { const int dim = 4; diff --git a/tests/hlsl/array-index-expr.shader_test b/tests/hlsl/array-index-expr.shader_test index 0a83080cc..357b82f57 100644 --- a/tests/hlsl/array-index-expr.shader_test +++ b/tests/hlsl/array-index-expr.shader_test @@ -36,16 +36,16 @@ float4 main() : SV_TARGET
[test] uniform 0 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 11.0, 11.0, 11.0) uniform 0 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (12.0, 12.0, 12.0, 12.0) uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (13.0, 13.0, 13.0, 13.0) uniform 0 float 3 -draw quad +todo(sm>=6) draw quad probe all rgba (14.0, 14.0, 14.0, 14.0)
@@ -61,16 +61,16 @@ float4 main() : SV_TARGET
[test] uniform 0 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, 1.0, 24.0, 0.0) uniform 0 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (22.0, 0.0, 23.0, 1.0) uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (23.0, 1.0, 22.0, 0.0) uniform 0 float 3 -draw quad +todo(sm>=6) draw quad probe all rgba (24.0, 0.0, 21.0, 1.0)
diff --git a/tests/hlsl/array-parameters.shader_test b/tests/hlsl/array-parameters.shader_test index 6e866ceb5..28a3c5996 100644 --- a/tests/hlsl/array-parameters.shader_test +++ b/tests/hlsl/array-parameters.shader_test @@ -111,7 +111,7 @@ float4 main() : sv_target
% Implicit size arrays are not allowed. -[pixel shader fail] +[pixel shader fail(sm<6)] float fun(float a[]) { return 0; diff --git a/tests/hlsl/array-size-expr.shader_test b/tests/hlsl/array-size-expr.shader_test index 1fd4e2627..55af741da 100644 --- a/tests/hlsl/array-size-expr.shader_test +++ b/tests/hlsl/array-size-expr.shader_test @@ -53,7 +53,7 @@ draw quad probe all rgba (2, 3, 6, 1)
% Additional level of indirection -[pixel shader todo] +[pixel shader todo fail(sm>=6)] static const float array[8] = {1, 2, 3, 4, 5, 6, 7, 8}; static const int idx = 2; static const float array2[array[idx]] = {1, 2, 3}; diff --git a/tests/hlsl/asfloat.shader_test b/tests/hlsl/asfloat.shader_test index 9c0d93732..04e2e1a52 100644 --- a/tests/hlsl/asfloat.shader_test +++ b/tests/hlsl/asfloat.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target { float4 ret; @@ -15,10 +15,10 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
[test] uniform 0 float4 123.0 -2.0 456 0.01 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (123.0, -2.0, 456.0, 0.01)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float2x2 m, uniform float4 v) : sv_target { return float4(asfloat(m)[0][1], asfloat(v).y, 0, 0); @@ -28,7 +28,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target uniform 0 float4 11 12 0 0 uniform 4 float4 13 14 0 0 uniform 8 float4 20 21 22 23 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
[pixel shader fail] diff --git a/tests/hlsl/asuint.shader_test b/tests/hlsl/asuint.shader_test index 633a543a6..fdef0915d 100644 --- a/tests/hlsl/asuint.shader_test +++ b/tests/hlsl/asuint.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)]
float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv_target { @@ -16,11 +16,11 @@ float4 main(uniform float f, uniform int i, uniform uint u, uniform half h) : sv
[test] uniform 0 uint4 123 0xc0000000 456 0x7fd69345 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (123.0, 3221225472.0, 456.0, 2144768896.0)
-[pixel shader] +[pixel shader fail(sm>=6)]
float4 main(uniform float2x2 m, uniform float4 v) : sv_target { @@ -31,7 +31,7 @@ float4 main(uniform float2x2 m, uniform float4 v) : sv_target uniform 0 uint4 11 12 0 0 uniform 4 uint4 13 14 0 0 uniform 8 uint4 20 21 22 23 -draw quad +todo(sm>=6) draw quad probe (320,240) rgba (13.0, 21.0, 0.0, 0.0)
diff --git a/tests/hlsl/attributes.shader_test b/tests/hlsl/attributes.shader_test index cb6c2b5e5..fd9c087a3 100644 --- a/tests/hlsl/attributes.shader_test +++ b/tests/hlsl/attributes.shader_test @@ -2,32 +2,32 @@ % we need to get the parsing syntax right. Most of the following tests which % succeed print warnings.
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[ numthreads ] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads(1)] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
[numthreads("")] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
[numthreads("one")] float4 main() : sv_target { return 0; }
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
@@ -77,12 +77,12 @@ float4 main() : sv_target { return 0; } [one][two] float4 main() : sv_target { return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo]
[one][one] float4 main() : sv_target { return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo]
[one][one(1)] float4 main() : sv_target { return 0; } @@ -92,7 +92,7 @@ float4 main() : sv_target { return 0; } [one][One] float4 main() : sv_target { return 0; }
-[pixel shader] +[pixel shader fail(sm>=6)]
[numthreads] float4 main(); @@ -112,7 +112,7 @@ static int i = 1; [three(i = 4)] float4 main() : sv_target { return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)]
[one] float4 f; diff --git a/tests/hlsl/bool-cast.shader_test b/tests/hlsl/bool-cast.shader_test index 09ca12e2b..dc75ea376 100644 --- a/tests/hlsl/bool-cast.shader_test +++ b/tests/hlsl/bool-cast.shader_test @@ -30,7 +30,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 0.0 0.0 2.0 4.0 uniform 4 int4 0 1 0 10 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 10.0, 1.0, 11.0)
@@ -44,5 +44,5 @@ float4 main() : sv_target
[test] uniform 0 uint4 0x00000001 0x00000002 0x80000000 0x00000000 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 0.0) diff --git a/tests/hlsl/bool-semantics.shader_test b/tests/hlsl/bool-semantics.shader_test index bcbd9f9bf..d8df96a2a 100644 --- a/tests/hlsl/bool-semantics.shader_test +++ b/tests/hlsl/bool-semantics.shader_test @@ -49,5 +49,5 @@ float4 main(struct input i) : sv_target }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (0.0, 2.0, 2.0, 2.0) diff --git a/tests/hlsl/cast-componentwise-compatible.shader_test b/tests/hlsl/cast-componentwise-compatible.shader_test index da55628bf..8ad21d12a 100644 --- a/tests/hlsl/cast-componentwise-compatible.shader_test +++ b/tests/hlsl/cast-componentwise-compatible.shader_test @@ -262,7 +262,7 @@ draw quad probe all rgba (41.0, 42.0, 43.0, 44.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float2 aa; @@ -301,7 +301,7 @@ draw quad probe all rgba (55.0, 56.0, 57.0, 58.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float2 aa; @@ -333,7 +333,7 @@ draw quad probe all rgba (61.0, 62.0, 63.0, 64.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float arr[5] = {1, 2, 3, 4, 5}; @@ -359,7 +359,7 @@ draw quad probe all rgba (71.0, 72.0, 73.0, 74.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float2x2 mat = {1, 2, 3, 4}; @@ -381,7 +381,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float arr[5] = {1, 2, 3, 4, 5}; @@ -440,7 +440,7 @@ draw quad probe all rgba (11.0, 12.0, 13.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { float3 aa; @@ -541,7 +541,7 @@ draw quad probe all rgba (51.0, 52.0, 53.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float4 vec = {1, 2, 3, 4}; diff --git a/tests/hlsl/cast-componentwise-equal.shader_test b/tests/hlsl/cast-componentwise-equal.shader_test index 4a25f6dd5..bb1c26fe0 100644 --- a/tests/hlsl/cast-componentwise-equal.shader_test +++ b/tests/hlsl/cast-componentwise-equal.shader_test @@ -32,7 +32,7 @@ float4 main() : sv_target }
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 aa; @@ -71,7 +71,7 @@ float4 main() : sv_target }
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 aa; @@ -93,7 +93,7 @@ draw quad probe all rgba (5.0, 6.0, 7.0, 8.0)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex;
struct apple @@ -124,7 +124,7 @@ draw quad probe all rgba (4.0, 4.0, 4.0, 4.0)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex;
struct apple @@ -158,7 +158,7 @@ draw quad probe all rgba (5.0, 5.0, 5.0, 5.0)
-[pixel shader] +[pixel shader fail(sm>=6)] struct apple { float3 xx[2]; diff --git a/tests/hlsl/cast-to-float.shader_test b/tests/hlsl/cast-to-float.shader_test index f09100204..4e786f59e 100644 --- a/tests/hlsl/cast-to-float.shader_test +++ b/tests/hlsl/cast-to-float.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)] 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); @@ -12,7 +12,7 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-half.shader_test b/tests/hlsl/cast-to-half.shader_test index 81d6bc5d5..6e391699c 100644 --- a/tests/hlsl/cast-to-half.shader_test +++ b/tests/hlsl/cast-to-half.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)]
float4 main(uniform int i, uniform uint u, uniform bool b, uniform float f) : sv_target { @@ -13,7 +13,7 @@ uniform 0 int -1 uniform 1 uint 3 uniform 2 int -2 uniform 3 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-int.shader_test b/tests/hlsl/cast-to-int.shader_test index fe8c79a3c..53cf99f7d 100644 --- a/tests/hlsl/cast-to-int.shader_test +++ b/tests/hlsl/cast-to-int.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)]
float4 main(uniform float f, uniform uint u, uniform bool b, uniform half h) : sv_target { @@ -19,7 +19,7 @@ uniform 0 float 2.6 uniform 1 int -2 uniform 2 int -2 uniform 3 float -3.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cast-to-uint.shader_test b/tests/hlsl/cast-to-uint.shader_test index 93862a36f..b25e682f6 100644 --- a/tests/hlsl/cast-to-uint.shader_test +++ b/tests/hlsl/cast-to-uint.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)]
float4 main(uniform float f, uniform int i, uniform bool b, uniform half h) : sv_target { @@ -19,7 +19,7 @@ uniform 0 float 2.6 uniform 1 int 2 uniform 2 int -2 uniform 3 float -3.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader] diff --git a/tests/hlsl/cbuffer.shader_test b/tests/hlsl/cbuffer.shader_test index 83397c189..bd814bef7 100644 --- a/tests/hlsl/cbuffer.shader_test +++ b/tests/hlsl/cbuffer.shader_test @@ -13,7 +13,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
[pixel shader] @@ -31,7 +31,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
% SM1 buffer offset allocation follows different rules than SM4. @@ -72,7 +72,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 2.0, 4.0, 8.0)
@@ -93,7 +93,7 @@ float4 main() : sv_target uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 4.0, 8.0, 9.0)
@@ -119,11 +119,11 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 4.0, 5.0, 6.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] // Elements cannot overlap if buffer is used. cbuffer buffer { @@ -168,7 +168,7 @@ float4 main() : sv_target uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 -draw quad +todo(sm>=6) draw quad probe all rgba (509, 610, 711, 812)
@@ -196,7 +196,7 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (12468.0, 13509.0, 14010.0, 15011.0)
@@ -213,7 +213,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 3.0, 2.0, 3.0)
@@ -230,7 +230,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Matrices must be aligned. cbuffer buffer { @@ -243,7 +243,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Arrays must be aligned. cbuffer buffer { @@ -256,7 +256,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Structs must be aligned. struct apple { @@ -318,11 +318,11 @@ float4 main() : sv_target uniform 0 float 1.0 uniform 1 float 2.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (512.0, 612.0, 712.0, 812.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] // packoffset cannot be used unless all elements use it. cbuffer buffer { @@ -349,7 +349,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.0, 4.0, 3.0, 4.0)
@@ -491,7 +491,7 @@ float4 main() : sv_target uniform 0 float4 1.0 0.0 0.0 0.0 uniform 4 float4 0.0 2.0 0.0 0.0 uniform 8 float4 0.0 0.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 0.0, 4.0)
@@ -541,14 +541,14 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
% Samplers cannot have packoffset(), unless register() is also specified, or they are not used. % Note: In SM1 the rules are different: packoffset() is allowed for samplers, but they cannot be % used together with other numeric fields, which seems like a bug. -[pixel shader fail todo] +[pixel shader fail(sm<6) todo] Texture2D tex;
cbuffer buffer @@ -599,7 +599,7 @@ float4 main() : sv_target
% When packoffset is used in one field, resources are also expected to have a reservation. -[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo : packoffset(c0); @@ -611,7 +611,7 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo : packoffset(c0); @@ -649,7 +649,7 @@ float4 main() : sv_target }
% Using register() alone is considered manual packing for resources, so the other fields expect packoffset(). -[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo; @@ -661,7 +661,7 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] cbuffer buffer { float4 foo; @@ -718,5 +718,5 @@ uniform 0 float4 0.0 1.0 2.0 3.0 uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (124.0, 135.0, 146.0, 150.5) diff --git a/tests/hlsl/clamp.shader_test b/tests/hlsl/clamp.shader_test index 1320c3dd3..1edd4c0ce 100644 --- a/tests/hlsl/clamp.shader_test +++ b/tests/hlsl/clamp.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float3 u) : sv_target { return float4(clamp(u.x, u.y, u.z), clamp(0.9, u.y, u.z), clamp(u.x, -0.5, u.z), clamp(0.6, -0.4, 0.3)); @@ -6,7 +6,7 @@ float4 main(uniform float3 u) : sv_target
[test] uniform 0 float4 -0.3 -0.1 0.7 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.1, 0.7, -0.3, 0.3)
diff --git a/tests/hlsl/clip.shader_test b/tests/hlsl/clip.shader_test index f9859e1b8..d7473c999 100644 --- a/tests/hlsl/clip.shader_test +++ b/tests/hlsl/clip.shader_test @@ -9,14 +9,14 @@ float4 main() : sv_target
[test] uniform 0 float4 1 2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4) uniform 0 float4 9 8 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 8, 7, 6) uniform 0 float4 -1 8 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 8, 7, 6) uniform 0 float4 9 0 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (9, 0, 7, 6) diff --git a/tests/hlsl/combined-samplers.shader_test b/tests/hlsl/combined-samplers.shader_test index 465c11cb5..5e270c0b8 100644 --- a/tests/hlsl/combined-samplers.shader_test +++ b/tests/hlsl/combined-samplers.shader_test @@ -37,7 +37,7 @@ size (1, 1) [require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)] sampler sam;
float4 main() : sv_target @@ -46,12 +46,12 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0, 0, 0, 1)
% Textures for new separated samplers are allocated before regular textures. -[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex; sampler sam;
@@ -61,11 +61,11 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (10, 10, 10, 11)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex; sampler sam[2];
@@ -75,11 +75,11 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (21, 21, 21, 11)
-[pixel shader] +[pixel shader fail(sm>=6)] sampler sam0; sampler sam1; sampler sam2; @@ -91,11 +91,11 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (12, 12, 12, 111)
-[pixel shader] +[pixel shader fail(sm>=6)] Texture2D tex[2][2]; sampler sam;
@@ -106,7 +106,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (104, 104, 104, 111)
@@ -121,7 +121,7 @@ float4 main() : sv_target }
-[pixel shader] +[pixel shader fail(sm>=6)] sampler sam[2];
float4 main() : sv_target @@ -130,7 +130,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 11)
@@ -138,7 +138,7 @@ probe all rgba (1, 1, 1, 11) shader model >= 5.0
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] struct { Texture2D tex; diff --git a/tests/hlsl/compute.shader_test b/tests/hlsl/compute.shader_test index 6d2f698c7..2f2af9fc8 100644 --- a/tests/hlsl/compute.shader_test +++ b/tests/hlsl/compute.shader_test @@ -17,5 +17,5 @@ void main() }
[test] -dispatch 1 1 1 +todo(sm>=6) dispatch 1 1 1 probe uav 0 (0, 0) r (-123.0) diff --git a/tests/hlsl/conditional.shader_test b/tests/hlsl/conditional.shader_test index b3b18dc1a..0e4bfe943 100644 --- a/tests/hlsl/conditional.shader_test +++ b/tests/hlsl/conditional.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { if (u.x > 0.0) @@ -9,13 +9,13 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6) uniform 0 float4 0.1 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { [attr1] @@ -25,7 +25,7 @@ float4 main(uniform float4 u) : sv_target return float4(0.9, 0.8, 0.7, 0.6); }
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { [flatten] @@ -37,10 +37,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 u;
float main() : sv_target @@ -68,7 +68,7 @@ float main() : sv_target [require] shader model >= 3.0
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { [branch] @@ -80,5 +80,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.8, 0.7, 0.6) diff --git a/tests/hlsl/const.shader_test b/tests/hlsl/const.shader_test index ed5899f65..17427c385 100644 --- a/tests/hlsl/const.shader_test +++ b/tests/hlsl/const.shader_test @@ -10,10 +10,10 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 0.1 0.2 0.3 0.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1.1, 2.2, 3.3, 4.4)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { const float f; diff --git a/tests/hlsl/cross.shader_test b/tests/hlsl/cross.shader_test index 101db6071..2ed721d99 100644 --- a/tests/hlsl/cross.shader_test +++ b/tests/hlsl/cross.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u, uniform float4 v) : sv_target { float4 res = float4(0, 0, 0, 0); @@ -9,12 +9,12 @@ float4 main(uniform float4 u, uniform float4 v) : sv_target [test] uniform 0 float4 1 -2 3 4 uniform 4 float4 10 100 1000 10000 -draw quad +todo(sm>=6) draw quad probe all rgba (-2300, -970, 120, 0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { float4 res = float4(0, 0, 0, 3.5); @@ -24,5 +24,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 1 -2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (-20, 8, 12, 3.5) diff --git a/tests/hlsl/d3dcolor-to-ubyte4.shader_test b/tests/hlsl/d3dcolor-to-ubyte4.shader_test index e31ef61ca..08e7dbf70 100644 --- a/tests/hlsl/d3dcolor-to-ubyte4.shader_test +++ b/tests/hlsl/d3dcolor-to-ubyte4.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return D3DCOLORtoUBYTE4(u); @@ -9,10 +9,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1912.0, 1657.0, -127.0, 867.0) 1
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return D3DCOLORtoUBYTE4(u.x); @@ -20,5 +20,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-127.0, -127.0, -127.0, -127.0) 1 diff --git a/tests/hlsl/ddxddy.shader_test b/tests/hlsl/ddxddy.shader_test index 4986c233f..ba7215ca0 100644 --- a/tests/hlsl/ddxddy.shader_test +++ b/tests/hlsl/ddxddy.shader_test @@ -8,7 +8,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 0.0, 0.0)
@@ -29,7 +29,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) @@ -55,7 +55,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-16.0, -5.0, 3.0, 0.0) probe (11, 10) rgba (-21.0, -5.0, 3.0, 0.0) probe (10, 11) rgba (-13.0, -5.0, 3.0, 0.0) @@ -74,7 +74,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (10, 10) rgba (-0.524999976, -0.164999843, 0.104999900, 0.0) 16 probe (11, 10) rgba (-0.689999819, -0.164999843, 0.114999890, 0.0) 32 probe (10, 11) rgba (-0.420000076, -0.154999852, 0.104999900, 0.0) 32 diff --git a/tests/hlsl/discard.shader_test b/tests/hlsl/discard.shader_test index f543f877b..cecb8c1fd 100644 --- a/tests/hlsl/discard.shader_test +++ b/tests/hlsl/discard.shader_test @@ -9,8 +9,8 @@ float4 main() : sv_target
[test] uniform 0 float4 1 2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4) uniform 0 float4 9 8 7 6 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4) diff --git a/tests/hlsl/distance.shader_test b/tests/hlsl/distance.shader_test index 3f5446451..6527c218a 100644 --- a/tests/hlsl/distance.shader_test +++ b/tests/hlsl/distance.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target [test] uniform 0 float4 -2.0 3.0 4.0 0.1 uniform 4 float4 2.0 -1.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (7.483983, 7.483983, 7.483983, 7.483983) 1
[pixel shader] diff --git a/tests/hlsl/dot.shader_test b/tests/hlsl/dot.shader_test index 15f120f70..bb71919ce 100644 --- a/tests/hlsl/dot.shader_test +++ b/tests/hlsl/dot.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (166.0, 166.0, 166.0, 166.0)
[pixel shader] @@ -25,7 +25,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 0.0 0.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (53.0, 53.0, 53.0, 53.0)
[pixel shader] @@ -40,7 +40,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 0.0 0.0 0.0 uniform 4 float4 10.0 11.0 12.0 13.0 -draw quad +todo(sm>=6) draw quad probe all rgba (92.0, 92.0, 92.0, 92.0)
[pixel shader] @@ -55,7 +55,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 10.0 11.0 12.0 13.0 uniform 4 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (92.0, 92.0, 92.0, 92.0)
[pixel shader] @@ -71,7 +71,7 @@ float4 main() : SV_TARGET % Account for both the SM1 and SM4 uniform layout uniform 0 float4 2.0 3.0 0.0 0.0 uniform 4 float4 3.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 6.0, 6.0, 6.0)
[pixel shader] diff --git a/tests/hlsl/duplicate-modifiers.shader_test b/tests/hlsl/duplicate-modifiers.shader_test index 6491701ae..bf1d9c1b8 100644 --- a/tests/hlsl/duplicate-modifiers.shader_test +++ b/tests/hlsl/duplicate-modifiers.shader_test @@ -1,3 +1,7 @@ +% Returns (0.1, 0.3, 0.2, 0.4) with dxcompiler +[require] +shader model < 6.0 + [pixel shader] typedef const precise row_major float2x2 mat_t; float4 main() : sv_target diff --git a/tests/hlsl/entry-point-semantics.shader_test b/tests/hlsl/entry-point-semantics.shader_test index 32cd43c2f..6d355ab5c 100644 --- a/tests/hlsl/entry-point-semantics.shader_test +++ b/tests/hlsl/entry-point-semantics.shader_test @@ -84,7 +84,7 @@ float4 main(in apple a) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 20.0, 30.0, 40.0)
% Arrays of matrices get successive indexes. @@ -101,7 +101,7 @@ float4 main(in apple a) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 30.0, 31.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 30.0, 31.0)
% Arrays (even multi-dimensional) of struct elements are allowed. The fields in the different struct @@ -120,7 +120,7 @@ float4 main(in apple aps[2][2]) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 10.0, 20.0, 20.0)
[pixel shader] @@ -142,7 +142,7 @@ float4 main(in banana bans[2]) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0)
[pixel shader fail] @@ -201,11 +201,11 @@ float4 main(in float4 tex0 : TEXCOORD0, in float4 tex1 : TEXCOORD1) : sv_target
[test] draw quad -probe (0, 0) rgba (1.0, 2.0, 10.0, 20.0) +todo(sm>=6) probe (0, 0) rgba (1.0, 2.0, 10.0, 20.0)
% Output semantics cannot be mapped to more than one value. -[vertex shader fail] +[vertex shader fail(sm<6)] struct apple { float2 tex : TEXCOORD0; @@ -251,7 +251,7 @@ void main(out float4 tex[4] : texcoord, inout float4 pos : sv_position)
% Arguments with the same semantic aren't aliased. -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(in float4 t1 : TEXCOORD0, in float4 t2 : TEXCOORD0) : sv_target { t1 = 99; @@ -259,7 +259,7 @@ float4 main(in float4 t1 : TEXCOORD0, in float4 t2 : TEXCOORD0) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (99.0, 99.0, 10.0, 11.0)
@@ -272,19 +272,19 @@ float4 main(in float4 a : TEXCOORD0, in float3 b : TEXCOORD1) : sv_target
[test] draw quad -probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0) +todo(sm>=6) probe (0, 0) rgba (10.0, 11.0, 20.0, 21.0)
% In SM4, duplicated input semantics can only have different types if they have the same layout and % register types. SM1 is permissive in this regard. -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(in float2 a : TEXCOORD0, in half2 b : TEXCOORD0, in float2x1 c: TEXCOORD0) : sv_target { return 0.0; }
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(in uint2 a : TEXCOORD0, in int2 b : TEXCOORD0, in int2x1 c : TEXCOORD0, in bool2 d : TEXCOORD0) : sv_target { return 0.0; diff --git a/tests/hlsl/exp.shader_test b/tests/hlsl/exp.shader_test index 1d1889977..38f8750fd 100644 --- a/tests/hlsl/exp.shader_test +++ b/tests/hlsl/exp.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.0 0.0 1.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 1.0, 2.0, 4.0) 2
[pixel shader] @@ -21,5 +21,5 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.0 0.0 1.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.36787948, 1.0, 2.7182815, 7.38905573) 2 diff --git a/tests/hlsl/expr-indexing.shader_test b/tests/hlsl/expr-indexing.shader_test index 3dcc5727e..1816c6eb7 100644 --- a/tests/hlsl/expr-indexing.shader_test +++ b/tests/hlsl/expr-indexing.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (8.0, 8.0, 8.0, 8.0)
@@ -26,7 +26,7 @@ float4 main() : sv_target uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (10.0, 10.0, 10.0, 10.0)
@@ -40,7 +40,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.0, 3.0, 3.0, 3.0)
@@ -56,10 +56,10 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float 0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 4.0) uniform 4 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
@@ -78,7 +78,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 4.0)
@@ -99,5 +99,5 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float 1 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0) diff --git a/tests/hlsl/floor.shader_test b/tests/hlsl/floor.shader_test index c111f98b9..0ceb1d24f 100644 --- a/tests/hlsl/floor.shader_test +++ b/tests/hlsl/floor.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return floor(u); @@ -6,10 +6,10 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 6.0, 7.0, 3.0) 4
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { float a = floor(u.r); @@ -20,13 +20,13 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4
[require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform int4 u) : sv_target { float a = floor(u.r); @@ -37,5 +37,5 @@ float4 main(uniform int4 u) : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) 4 diff --git a/tests/hlsl/fmod.shader_test b/tests/hlsl/fmod.shader_test index 9eb69c3bb..f56750fa6 100644 --- a/tests/hlsl/fmod.shader_test +++ b/tests/hlsl/fmod.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return float4(fmod(u.x, u.y), 0, 0, 0); @@ -6,13 +6,13 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.5, 0.0, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.0, 0.0, 0.0) 4
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return float4(fmod(u.xy, u.z), 0, 0); @@ -20,8 +20,8 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 2.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.5, 0.5, 0.0, 0.0) 4 uniform 0 float4 1.1 0.3 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.1, 0.3, 0.0, 0.0) 4 diff --git a/tests/hlsl/for.shader_test b/tests/hlsl/for.shader_test index b68969819..3dd01d862 100644 --- a/tests/hlsl/for.shader_test +++ b/tests/hlsl/for.shader_test @@ -43,7 +43,7 @@ float4 main(float tex : texcoord) : sv_target draw quad probe all rgba (10.0, 45.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main(float tex : texcoord) : sv_target { int i; diff --git a/tests/hlsl/frac.shader_test b/tests/hlsl/frac.shader_test index f54f3fe88..2ac9b530d 100644 --- a/tests/hlsl/frac.shader_test +++ b/tests/hlsl/frac.shader_test @@ -8,5 +8,5 @@ float4 main() : sv_target
[test] uniform 0 float4 -1.1 1.6 1.3 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.6, 0.3, 0.5) 2 diff --git a/tests/hlsl/function-cast.shader_test b/tests/hlsl/function-cast.shader_test index e6a5a96b4..5a8e2bd61 100644 --- a/tests/hlsl/function-cast.shader_test +++ b/tests/hlsl/function-cast.shader_test @@ -23,7 +23,7 @@ probe all rgba (-1.0, -1.0, 2.0, 4.0)
% As above, but cast "x" to float4 first.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
@@ -46,7 +46,7 @@ probe all rgba (-1.0, -1.0, 2.0, 4.0)
% As above, but declare "x" as float4 and cast it to int4.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
uniform float4 f;
@@ -70,7 +70,7 @@ probe all rgba (-1.0, -1.0, 2.0, 4.0) [require] shader model >= 4.0
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
void func(inout float4 a) { diff --git a/tests/hlsl/function-overload.shader_test b/tests/hlsl/function-overload.shader_test index 099f63f34..c5a30b165 100644 --- a/tests/hlsl/function-overload.shader_test +++ b/tests/hlsl/function-overload.shader_test @@ -36,5 +36,5 @@ float4 main() : sv_target }
[test] -todo draw quad +todo(sm<6) draw quad probe all rgba (0.1, 0.2, 0.1, 0.2) diff --git a/tests/hlsl/function-return.shader_test b/tests/hlsl/function-return.shader_test index cbd29749f..98aac4fa7 100644 --- a/tests/hlsl/function-return.shader_test +++ b/tests/hlsl/function-return.shader_test @@ -80,16 +80,16 @@ float4 main() : sv_target
[test] uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.2, 0.6, 0.3) 1 uniform 0 float 0.4 -draw quad +todo(sm>=6) draw quad probe all rgba (0.6, 0.5, 0.6, 0.3) 1 uniform 0 float 0.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.6, 0.5, 0.4, 0.5) 1 uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.8, 0.7, 0.4, 0.5) 1
[pixel shader] @@ -136,13 +136,13 @@ float4 main() : sv_target
[test] uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.1, 0.2, 0.1) 1 uniform 0 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.4, 1.0, 0.9) 1 uniform 0 float 0.9 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.9, 1.0, 0.6) 1
[pixel shader] @@ -239,23 +239,23 @@ float4 main() : sv_target
[test] uniform 0 float 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.2, 0.3, 0.3) 1
uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.3, 0.3, 0.3) 1
uniform 0 float 0.3 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.5, 0.3, 0.3) 1
uniform 0 float 0.7 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.9, 0.7, 0.6) 1
uniform 0 float 0.9 -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.1, 0.7, 0.6) 1
[pixel shader todo] diff --git a/tests/hlsl/function.shader_test b/tests/hlsl/function.shader_test index 0db0477ed..d712f8522 100644 --- a/tests/hlsl/function.shader_test +++ b/tests/hlsl/function.shader_test @@ -89,7 +89,7 @@ float4 main() : sv_target return func(); }
-[pixel shader fail] +[pixel shader fail(sm<6)]
void foo() { @@ -226,7 +226,7 @@ probe all rgba (0.6, 0.1, 0.5, 0)
% Recursion is forbidden.
-[pixel shader notimpl] +[pixel shader notimpl(sm<6) fail(sm>=6)]
void bar();
@@ -246,7 +246,7 @@ float4 main() : sv_target return 0; }
-[pixel shader notimpl] +[pixel shader notimpl(sm<6) fail(sm>=6)]
% Even trivially finite recursion is forbidden.
@@ -317,7 +317,7 @@ probe all rgba (2.0, 3.0, 6.0, 7.0)
% Inline modifier used on entry point
-[pixel shader] +[pixel shader fail(sm>=6)] float func(float a) { return a + 1; diff --git a/tests/hlsl/gather-offset.shader_test b/tests/hlsl/gather-offset.shader_test index 51e6a6b64..6360d1fc8 100644 --- a/tests/hlsl/gather-offset.shader_test +++ b/tests/hlsl/gather-offset.shader_test @@ -23,7 +23,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.2, 0.1)
@@ -37,7 +37,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.1, 0.1, 0.0)
@@ -55,7 +55,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.1, 0.1)
@@ -69,7 +69,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.1, 0.0, 0.0)
@@ -83,7 +83,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.0, 0.5, 0.0)
@@ -97,5 +97,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.4, 0.0, 0.4) diff --git a/tests/hlsl/gather.shader_test b/tests/hlsl/gather.shader_test index 28fd6f9a5..9cfc2d599 100644 --- a/tests/hlsl/gather.shader_test +++ b/tests/hlsl/gather.shader_test @@ -23,7 +23,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.1, 0.1, 0.0)
@@ -37,7 +37,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.2, 0.1)
@@ -55,7 +55,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.1, 0.0, 0.0)
@@ -69,7 +69,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.1, 0.1)
@@ -97,7 +97,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.5, 0.0, 0.5)
@@ -111,5 +111,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.0, 0.4, 0.0) diff --git a/tests/hlsl/getdimensions.shader_test b/tests/hlsl/getdimensions.shader_test index 4d781b320..01d12f87a 100644 --- a/tests/hlsl/getdimensions.shader_test +++ b/tests/hlsl/getdimensions.shader_test @@ -28,7 +28,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 3.0, 2.0, 3.0)
[texture 1] @@ -53,5 +53,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 1.0, 2.0) diff --git a/tests/hlsl/initializer-implicit-array.shader_test b/tests/hlsl/initializer-implicit-array.shader_test index 38c8234cb..fff2b8fdf 100644 --- a/tests/hlsl/initializer-implicit-array.shader_test +++ b/tests/hlsl/initializer-implicit-array.shader_test @@ -11,6 +11,10 @@ draw quad probe all rgba (50, 60, 70, 80)
+% dxcompiler emits a nop shader which returns immediately. +[require] +shader model < 6.0 + [pixel shader] float4 main() : sv_target { @@ -22,8 +26,10 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (5.0, 6.0, 7.0, 8.0) +todo(sm>=6) probe all rgba (5.0, 6.0, 7.0, 8.0)
+[require] +% reset requirements
[pixel shader] float4 main() : sv_target @@ -121,7 +127,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Implicit size array as function argument float4 fun(float4 arr[]) { @@ -150,18 +156,7 @@ float4 main() : sv_target }
-[pixel shader fail] -// Implicit size array as a cast -float4 main() : sv_target -{ - float2 arr1[4] = {1, 2, 3, 4, 5, 6, 7, 8}; - float4 arr2[2] = (float4 []) arr1; - - return 0.0; -} - - -[pixel shader fail] +[pixel shader fail(sm<6)] // Implicit size array as a typedef typedef float4 arrtype[];
@@ -174,52 +169,68 @@ float4 main() : sv_target
[pixel shader fail] -// Implicit size array of elements of size 0 +// Implicit size array of elements of size 0, without initializer struct emp { };
float4 main() : sv_target { - struct emp arr[] = {1, 2, 3, 4}; + struct emp arr[];
return 0.0; }
[pixel shader fail] -// Implicit size array of elements of size 0, without initializer +// Implicit size array with an initializer of size 0 struct emp { };
float4 main() : sv_target { - struct emp arr[]; + float4 arr[] = (struct emp) 42;
return 0.0; }
+% dxcompiler crashes. +[require] +shader model < 6.0 + + [pixel shader fail] -// Broadcast to an implicit size array +// Implicit size array as a cast float4 main() : sv_target { - int a[4] = (int[]) 0; + float2 arr1[4] = {1, 2, 3, 4, 5, 6, 7, 8}; + float4 arr2[2] = (float4 []) arr1;
return 0.0; }
[pixel shader fail] -// Implicit size array with an initializer of size 0 +// Implicit size array of elements of size 0 struct emp { };
float4 main() : sv_target { - float4 arr[] = (struct emp) 42; + struct emp arr[] = {1, 2, 3, 4}; + + return 0.0; +} + + +[pixel shader fail] +// Broadcast to an implicit size array +float4 main() : sv_target +{ + int a[4] = (int[]) 0;
return 0.0; } diff --git a/tests/hlsl/initializer-objects.shader_test b/tests/hlsl/initializer-objects.shader_test index d9c0bc91c..514a7cebb 100644 --- a/tests/hlsl/initializer-objects.shader_test +++ b/tests/hlsl/initializer-objects.shader_test @@ -25,7 +25,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.2, 0.1)
@@ -48,7 +48,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (31.1, 41.1, 51.1, 61.1) 1
diff --git a/tests/hlsl/intrinsic-override.shader_test b/tests/hlsl/intrinsic-override.shader_test index 55a23f21d..a88392a65 100644 --- a/tests/hlsl/intrinsic-override.shader_test +++ b/tests/hlsl/intrinsic-override.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)]
float2 max(float2 a, float2 b) { @@ -14,7 +14,7 @@ float4 main() : sv_target draw quad probe all rgba (0.3, 0.3, 0.4, 0.6)
-[pixel shader] +[pixel shader fail(sm>=6)]
float2 max(float2 a, float3 b) { diff --git a/tests/hlsl/invalid.shader_test b/tests/hlsl/invalid.shader_test index ad0626520..815c86740 100644 --- a/tests/hlsl/invalid.shader_test +++ b/tests/hlsl/invalid.shader_test @@ -58,14 +58,14 @@ float4 main(float2 pos : TEXCOORD0) : sv_target return pos; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float a[0]; return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { float a[65537]; @@ -126,7 +126,7 @@ float4 main() : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { const float4 x; @@ -186,7 +186,7 @@ void main(out float4 o : sv_target) sub(o); }
-[pixel shader fail] +[pixel shader fail(sm<6)] void sub(in out uniform float4 o) { } @@ -211,7 +211,7 @@ float4 main(void) : sv_target return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] const const float4 c;
float4 main() : sv_target @@ -233,7 +233,7 @@ float4 main() : sv_target return a.a; }
-[pixel shader fail] +[pixel shader fail(sm<6)] struct apple { sampler sam; diff --git a/tests/hlsl/is-front-face.shader_test b/tests/hlsl/is-front-face.shader_test index 11447d262..162d4e634 100644 --- a/tests/hlsl/is-front-face.shader_test +++ b/tests/hlsl/is-front-face.shader_test @@ -22,7 +22,7 @@ float4 main(bool face : sv_isfrontface) : sv_target }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (0.0, 1.0, 0.0, 1.0)
[vertex buffer 0] @@ -32,5 +32,5 @@ probe all rgba (0.0, 1.0, 0.0, 1.0) 2.0 2.0
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (1.0, 2.0, 1.0, 2.0) diff --git a/tests/hlsl/ldexp.shader_test b/tests/hlsl/ldexp.shader_test index f8ad40d8e..2db624067 100644 --- a/tests/hlsl/ldexp.shader_test +++ b/tests/hlsl/ldexp.shader_test @@ -10,7 +10,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 0.0 -10.0 10.0 100.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
[require] @@ -28,7 +28,7 @@ float4 main() : SV_TARGET [test] uniform 0 int4 2 3 4 5 uniform 4 int4 0 -10 10 100 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 0.00292968750, 4096.0, 6.33825300e+030) 2
diff --git a/tests/hlsl/length.shader_test b/tests/hlsl/length.shader_test index d5a708e27..8653942e0 100644 --- a/tests/hlsl/length.shader_test +++ b/tests/hlsl/length.shader_test @@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (7.34846926, 7.34846926, 7.34846926, 7.34846926) 1
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (5.38516474, 5.38516474, 5.38516474, 5.38516474) 1
[pixel shader] @@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (3.60555124, 3.60555124, 3.60555124, 3.60555124) 1
[pixel shader] @@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader] @@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 2.0)
[pixel shader fail] diff --git a/tests/hlsl/lerp.shader_test b/tests/hlsl/lerp.shader_test index 15e90cef9..27c45fe7d 100644 --- a/tests/hlsl/lerp.shader_test +++ b/tests/hlsl/lerp.shader_test @@ -12,7 +12,7 @@ float4 main() : SV_TARGET uniform 0 float4 2.0 3.0 4.0 5.0 uniform 4 float4 0.0 -10.0 10.0 100.0 uniform 8 float4 0.0 1.0 -1.0 0.75 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -10.0, -2.0, 76.25)
[require] @@ -32,7 +32,7 @@ float4 main() : SV_TARGET uniform 0 int4 2 3 4 0 uniform 4 int4 0 -10 10 1000000 uniform 8 int4 0 1 -1 1000000 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, -10.0, -2.0, 1e12)
diff --git a/tests/hlsl/lit.shader_test b/tests/hlsl/lit.shader_test index cbfffb4ee..ede927fc4 100644 --- a/tests/hlsl/lit.shader_test +++ b/tests/hlsl/lit.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return lit(u.x, u.y, u.z); @@ -6,20 +6,20 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.1 10.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 0.0, 1.0)
[test] uniform 0 float4 1.2 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.2, 0.0, 1.0)
[test] uniform 0 float4 1.2 2.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.2, 8.0, 1.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return lit(u.x, u.y, u.z) + lit(u.x, u.y, u.z); @@ -27,7 +27,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 1.2 2.0 3.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.4, 16.0, 2.0)
[pixel shader fail] diff --git a/tests/hlsl/load-level.shader_test b/tests/hlsl/load-level.shader_test index 0f64bd5d5..9df2f01fb 100644 --- a/tests/hlsl/load-level.shader_test +++ b/tests/hlsl/load-level.shader_test @@ -22,10 +22,10 @@ float4 main() : sv_target
[test] uniform 0 uint 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 uint 1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0)
[pixel shader fail] @@ -47,5 +47,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/log.shader_test b/tests/hlsl/log.shader_test index b0f405d11..2f7d5c7c0 100644 --- a/tests/hlsl/log.shader_test +++ b/tests/hlsl/log.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 2.0 4.0 5.0 0.4 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 2.32192802, -1.32192802) 1
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : sv_target
[test] uniform 0 float4 10.0 100.0 1.0 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 0.0, -1.0) 1
[pixel shader] @@ -34,5 +34,5 @@ float4 main() : sv_target
[test] uniform 0 float4 3.0 10.0 1.0 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0986123, 2.302585, 0.0, -2.302585) 2 diff --git a/tests/hlsl/loop.shader_test b/tests/hlsl/loop.shader_test index 75a31f7af..2f70b1dc0 100644 --- a/tests/hlsl/loop.shader_test +++ b/tests/hlsl/loop.shader_test @@ -16,7 +16,7 @@ float4 main() : sv_target
[test] uniform 0 float 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (50.0, 50.0, 50.0, 50.0)
@@ -39,5 +39,5 @@ float4 main() : sv_target
[test] uniform 0 float 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (20.0, 20.0, 20.0, 20.0) diff --git a/tests/hlsl/majority-pragma.shader_test b/tests/hlsl/majority-pragma.shader_test index 808313e70..f7baa90b9 100644 --- a/tests/hlsl/majority-pragma.shader_test +++ b/tests/hlsl/majority-pragma.shader_test @@ -17,7 +17,7 @@ uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.1 0.3 0.0 0.0 uniform 12 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.17, 0.39, 0.17, 0.39) 1
@@ -40,7 +40,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -61,7 +61,7 @@ uniform 0 float4 0.0 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.5 0.6 0.0 0.0 uniform 12 float4 0.7 0.8 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8)
@@ -90,7 +90,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.23, 0.34, 0.5, 0.5) 1
@@ -111,7 +111,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -149,7 +149,7 @@ uniform 0 float4 0.3 0.4 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.0 0.0 0.0 0.0 uniform 12 float4 0.5 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6)
@@ -173,7 +173,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
@@ -201,7 +201,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.2 0.4 0.0 0.0 uniform 4 float4 0.3 0.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.4, 0.5)
@@ -221,7 +221,7 @@ uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.4 0.0 0.0 0.0 uniform 8 float4 0.0 0.5 0.0 0.0 uniform 12 float4 0.0 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6)
% Compiler options @@ -245,7 +245,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.7) 1
[require] @@ -267,7 +267,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.7) 1
[require] @@ -289,7 +289,7 @@ uniform 0 float4 0.1 0.5 0.9 1.3 uniform 4 float4 0.2 0.6 1.0 1.4 uniform 8 float4 0.3 0.7 1.1 1.5 uniform 12 float4 0.4 0.8 1.2 1.6 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.9, 0.6, 1.0) 1
[require] @@ -317,7 +317,7 @@ uniform 16 float4 1.7 2.1 2.5 2.9 uniform 20 float4 1.8 2.2 2.6 3.0 uniform 24 float4 1.9 2.3 2.7 3.1 uniform 28 float4 2.0 2.4 2.8 3.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 2.5, 2.9) 1
[require] @@ -345,7 +345,7 @@ uniform 16 float4 1.7 2.1 2.5 2.9 uniform 20 float4 1.8 2.2 2.6 3.0 uniform 24 float4 1.9 2.3 2.7 3.1 uniform 28 float4 2.0 2.4 2.8 3.2 -draw quad +todo(sm>=6) draw quad probe all rgba (1.2, 1.6, 3.1, 3.2) 1
[require] @@ -365,5 +365,5 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.3, 0.2, 0.4) 1 diff --git a/tests/hlsl/majority-syntax.shader_test b/tests/hlsl/majority-syntax.shader_test index 4ab385a5d..63e5d2986 100644 --- a/tests/hlsl/majority-syntax.shader_test +++ b/tests/hlsl/majority-syntax.shader_test @@ -11,10 +11,10 @@ float4 main() : sv_target [test] uniform 0 float4 0.1 0.3 0.0 0.0 uniform 4 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.3, 0.2, 0.4)
-[pixel shader fail] +[pixel shader fail(sm<6)] row_major row_major float4x4 m;
float4 main() : sv_target diff --git a/tests/hlsl/majority-typedef.shader_test b/tests/hlsl/majority-typedef.shader_test index 1460e9a08..fa62dd5f7 100644 --- a/tests/hlsl/majority-typedef.shader_test +++ b/tests/hlsl/majority-typedef.shader_test @@ -18,5 +18,5 @@ uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.1 0.3 0.0 0.0 uniform 12 float4 0.2 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.17, 0.39, 0.17, 0.39) 1 diff --git a/tests/hlsl/math.shader_test b/tests/hlsl/math.shader_test index 6bd9656d8..f4b071037 100644 --- a/tests/hlsl/math.shader_test +++ b/tests/hlsl/math.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 a, uniform float2 b) : SV_TARGET { float u = a.x, v = a.y, w = a.z, x = a.w, y = b.x, z = b.y; @@ -11,5 +11,5 @@ float4 main(uniform float4 a, uniform float2 b) : SV_TARGET [test] uniform 0 float4 2.5 0.3 0.2 0.7 uniform 4 float4 0.1 1.5 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-12.43, 9.833333, 1.6, 35.0) 1 diff --git a/tests/hlsl/matrix-indexing.shader_test b/tests/hlsl/matrix-indexing.shader_test index a57d8fb8b..a61983eef 100644 --- a/tests/hlsl/matrix-indexing.shader_test +++ b/tests/hlsl/matrix-indexing.shader_test @@ -11,7 +11,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader] @@ -27,7 +27,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 10.0, 15.0)
[pixel shader] @@ -43,7 +43,7 @@ uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 uniform 8 float4 9.0 10.0 11.0 12.0 uniform 12 float4 13.0 14.0 15.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 5.0, 7.0, 12.0)
[pixel shader] @@ -58,7 +58,7 @@ float4 main() : SV_TARGET [test] uniform 0 float4 1.0 2.0 3.0 0.0 uniform 4 float4 5.0 6.0 7.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 3.0, 6.0, 7.0)
[pixel shader] @@ -120,7 +120,7 @@ float4 main() : sv_target
[test] uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (8, 9, 10, 11)
diff --git a/tests/hlsl/matrix-semantics.shader_test b/tests/hlsl/matrix-semantics.shader_test index b704dc1a6..082c69c0c 100644 --- a/tests/hlsl/matrix-semantics.shader_test +++ b/tests/hlsl/matrix-semantics.shader_test @@ -37,27 +37,27 @@ size (640, 480) format r32 float size (640, 480)
-[pixel shader] +[pixel shader fail(sm>=6)] row_major float4x1 main() : sv_target { return float4(1.0, 2.0, 3.0, 4.0); }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (3.0) probe render target 3 all r (4.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float1x4 main() : sv_target { return float4(1.0, 2.0, 3.0, 4.0); }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (3.0) @@ -70,7 +70,7 @@ void main(out float1x2 x : sv_target0, out float1x2 y : sv_target1) y = float2(5.0, 6.0); }
-[pixel shader] +[pixel shader fail(sm>=6)] void main(out float1x2 x : sv_target0, out float1x2 y : sv_target2) { x = float2(1.0, 2.0); @@ -78,7 +78,7 @@ void main(out float1x2 x : sv_target0, out float1x2 y : sv_target2) }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all r (1.0) probe render target 1 all r (2.0) probe render target 2 all r (5.0) @@ -88,7 +88,7 @@ probe render target 3 all r (6.0) format r32g32b32a32 float size (640, 480)
-[pixel shader] +[pixel shader fail(sm>=6)] void main(out row_major float1x4 x : sv_target0, out float1x2 y : sv_target1) { x = float4(1.0, 2.0, 3.0, 4.0); @@ -96,7 +96,7 @@ void main(out row_major float1x4 x : sv_target0, out float1x2 y : sv_target1) }
[test] -draw quad +todo(sm>=6) draw quad probe render target 0 all rgba (1.0, 2.0, 3.0, 4.0) probe render target 1 all r (5.0) probe render target 2 all r (6.0) diff --git a/tests/hlsl/max.shader_test b/tests/hlsl/max.shader_test index 3a5c3125a..d56d1cca7 100644 --- a/tests/hlsl/max.shader_test +++ b/tests/hlsl/max.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float2 u) : sv_target { return float4(max(u.x, u.y), max(2, 2.1), max(true, 2), max(-1, -1)); @@ -6,11 +6,11 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 2.1, 2.0, -1.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { float3 a = float3(-0.1, 0.2, 0.3); @@ -20,7 +20,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.4 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.8, 0.7, 0.2)
diff --git a/tests/hlsl/nested-arrays.shader_test b/tests/hlsl/nested-arrays.shader_test index 66ae93e10..b7aeec442 100644 --- a/tests/hlsl/nested-arrays.shader_test +++ b/tests/hlsl/nested-arrays.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail(sm<6)] uniform float4 color[2][3];
float4 main() : sv_target @@ -21,5 +21,5 @@ uniform 8 float4 0.3 0.0 0.0 0.0 uniform 12 float4 0.4 0.0 0.0 0.0 uniform 16 float4 0.5 0.0 0.0 0.0 uniform 20 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.1, 0.6, 0.3) diff --git a/tests/hlsl/nointerpolation.shader_test b/tests/hlsl/nointerpolation.shader_test index 8f15be6ed..86492e52f 100644 --- a/tests/hlsl/nointerpolation.shader_test +++ b/tests/hlsl/nointerpolation.shader_test @@ -23,5 +23,5 @@ float4 main(nointerpolation float4 t : texcoord) : sv_target }
[test] -draw triangle list 3 +todo(sm>=6) draw triangle list 3 probe all rgba (0.0, 1.0, 0.0, 1.0) diff --git a/tests/hlsl/normalize.shader_test b/tests/hlsl/normalize.shader_test index 359a7590d..0fe0dea3c 100644 --- a/tests/hlsl/normalize.shader_test +++ b/tests/hlsl/normalize.shader_test @@ -8,7 +8,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.272165537, 0.408248305, 0.544331074, 0.680413842) 2
[pixel shader] @@ -21,7 +21,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 4.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.371390700, 0.557086051, 0.742781401, 0.0) 1
[pixel shader] @@ -34,7 +34,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 3.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.554700196, 0.832050323, 0.0, 0.0) 1
[pixel shader] @@ -47,7 +47,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -60,7 +60,7 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 2.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader fail] diff --git a/tests/hlsl/numeric-types.shader_test b/tests/hlsl/numeric-types.shader_test index 7504f95aa..dfdd7a538 100644 --- a/tests/hlsl/numeric-types.shader_test +++ b/tests/hlsl/numeric-types.shader_test @@ -38,7 +38,7 @@ vector main() : sv_target return ret; }
-[pixel shader fail] +[pixel shader fail(sm<6)] vector main() : sv_target { vector<float> ret = vector(1.0, 2.0, 3.0, 4.0); @@ -71,7 +71,7 @@ float4 main() : sv_target draw quad probe all rgba (5.0, 6.0, 7.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { matrix m = matrix<float>(1.0, 2.0, 3.0, 4.0, @@ -81,7 +81,7 @@ float4 main() : sv_target return m[1]; }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : sv_target { matrix m = matrix<float, 4>(1.0, 2.0, 3.0, 4.0, diff --git a/tests/hlsl/numthreads.shader_test b/tests/hlsl/numthreads.shader_test index 404d7d763..fb11dc480 100644 --- a/tests/hlsl/numthreads.shader_test +++ b/tests/hlsl/numthreads.shader_test @@ -93,7 +93,7 @@ void main() {} [numthreads("1", 1, 1)] void main() {}
-[compute shader todo] +[compute shader todo fail(sm>=6)] static int x = 1;
[numthreads(x, 1, 1)] @@ -103,7 +103,7 @@ void main() {}
void main() {}
-[compute shader fail] +[compute shader fail(sm<6)]
[NumThreads(1, 1, 1)] void main() {} @@ -122,7 +122,7 @@ void main() {} [numthreads(1, 1, 1)] void main();
-[compute shader fail] +[compute shader fail(sm<6)]
void main();
@@ -153,7 +153,7 @@ static int x = 1; [numthreads((x = 2), 1, 1)] void main() {}
-[compute shader] +[compute shader fail(sm>=6)]
static int x = 1;
@@ -185,7 +185,7 @@ void main(uint2 id : sv_dispatchthreadid) }
[test] -dispatch 1 1 1 +todo(sm>=6) dispatch 1 1 1 probe uav 0 (0, 0) r (2.0) probe uav 0 (0, 1) r (1.0) probe uav 0 (1, 0) r (2.0) diff --git a/tests/hlsl/object-field-offsets.shader_test b/tests/hlsl/object-field-offsets.shader_test index 8afd9af7d..d1741c3e4 100644 --- a/tests/hlsl/object-field-offsets.shader_test +++ b/tests/hlsl/object-field-offsets.shader_test @@ -19,7 +19,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 0.0)
@@ -45,7 +45,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 5.0, 0.0)
@@ -66,5 +66,5 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 3.0 4.0 uniform 4 float4 5.0 6.0 7.0 8.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 5.0, 0.0) diff --git a/tests/hlsl/object-parameters.shader_test b/tests/hlsl/object-parameters.shader_test index c6109aef7..d5bf69a0f 100644 --- a/tests/hlsl/object-parameters.shader_test +++ b/tests/hlsl/object-parameters.shader_test @@ -7,6 +7,11 @@ float4 main(out Texture2D tex : TEXTURE) : sv_target }
+% dxcompiler crashes. +[require] +shader model < 6.0 + + [pixel shader fail todo] struct params { @@ -23,7 +28,7 @@ float4 main(inout params x) : sv_target shader model >= 5.0
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] uniform float global;
struct apple @@ -89,7 +94,7 @@ filter linear linear linear address clamp clamp clamp
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] struct apple { Texture2D unused; // must reserve t1 @@ -113,7 +118,7 @@ todo draw quad todo probe all rgba (416.0, 416.0, 416.0, 111.0)
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] Texture2D tex;
struct apple @@ -157,7 +162,7 @@ filter point point point address clamp clamp clamp
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] Texture2D tex; sampler sam0; // must reserve s3
diff --git a/tests/hlsl/object-references.shader_test b/tests/hlsl/object-references.shader_test index 5ed4dcd63..e7b2bef06 100644 --- a/tests/hlsl/object-references.shader_test +++ b/tests/hlsl/object-references.shader_test @@ -46,7 +46,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (77.77, 77.77, 77.77, 77.77)
@@ -73,7 +73,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8) probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1) @@ -111,7 +111,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (312, 312, 312, 111)
@@ -134,11 +134,11 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2132, 2132, 2132, 1111)
-[pixel shader fail] +[pixel shader fail(sm<6)] Texture2D tex[3]; uniform int n;
@@ -158,7 +158,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Note: Only valid in shader model 5.1 Texture2D tex[3]; uniform int n; @@ -169,7 +169,7 @@ float4 main() : sv_target }
-[pixel shader fail] +[pixel shader fail(sm<6)] // Note: Only valid in shader model 5.1 RWTexture2D<float4> tex[3]; uniform int n; @@ -202,7 +202,7 @@ float4 main() : sv_target
[test] uniform 0 float 10.0 -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (11.0, 12.0, 13.0, 11.0)
@@ -223,7 +223,7 @@ shader model >= 5.0 size (1, 1) 1.0 2.0 3.0 4.0
-[pixel shader todo] +[pixel shader todo fail(sm>=6)] struct apple { Texture2D tex; float4 fo : COLOR; diff --git a/tests/hlsl/pow.shader_test b/tests/hlsl/pow.shader_test index 1bb3bd944..7eca556d1 100644 --- a/tests/hlsl/pow.shader_test +++ b/tests/hlsl/pow.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return float4(pow(u.y, 3), pow(u.xy, u.zw), pow(0.5, u.w)); @@ -6,7 +6,7 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 0.4 0.8 2.5 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.512, 0.101192884, 0.64, 0.25) 4
diff --git a/tests/hlsl/reflect.shader_test b/tests/hlsl/reflect.shader_test index 02488589b..808b4b772 100644 --- a/tests/hlsl/reflect.shader_test +++ b/tests/hlsl/reflect.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.1, -0.5, 0.5, -0.7) 4
[pixel shader] @@ -27,7 +27,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 0.0 0.0 0.0 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.52, -0.18, 1.01, -1.2) 4
[pixel shader] @@ -44,7 +44,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.3 uniform 4 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.148, -0.748, -0.448, -0.348) 4
[pixel shader] @@ -62,7 +62,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 0.0 0.0 0.0 uniform 4 float4 0.6 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.14, 0.14, 0.14, 0.14) 4
[pixel shader] @@ -79,7 +79,7 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.0 0.0 uniform 4 float4 0.6 0.4 -0.3 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.188, -0.308, 0.0, 0.0) 4
[pixel shader] @@ -97,5 +97,5 @@ float4 main() : sv_target [test] uniform 0 float4 0.5 -0.1 0.2 0.0 uniform 4 float4 0.6 0.4 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.188, -0.308, 0.0, 0.0) 4 diff --git a/tests/hlsl/register-reservations.shader_test b/tests/hlsl/register-reservations.shader_test index 7e109ecad..a587d1915 100644 --- a/tests/hlsl/register-reservations.shader_test +++ b/tests/hlsl/register-reservations.shader_test @@ -34,7 +34,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (41.0, 41.0, 41.0, 1089.0)
@@ -50,7 +50,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 99.0)
@@ -65,7 +65,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 99.0)
@@ -80,12 +80,12 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 99.0)
% Register reservation with incorrect register type. -[pixel shader] +[pixel shader fail(sm>=6)] sampler2D unused : register(t0); Texture2D tex;
@@ -109,7 +109,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 4.0, 4.0, 99.0)
@@ -125,7 +125,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 99.0)
@@ -140,7 +140,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 99.0)
@@ -154,5 +154,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 2.0, 2.0, 99.0) diff --git a/tests/hlsl/return-implicit-conversion.shader_test b/tests/hlsl/return-implicit-conversion.shader_test index 1767748be..7070b28ae 100644 --- a/tests/hlsl/return-implicit-conversion.shader_test +++ b/tests/hlsl/return-implicit-conversion.shader_test @@ -165,7 +165,7 @@ float4 main() : sv_target draw quad probe all rgba (0.4, 0.3, 0.2, 0.0)
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo] float3x1 func() { return float4(0.4, 0.3, 0.2, 0.1); diff --git a/tests/hlsl/return.shader_test b/tests/hlsl/return.shader_test index 9f800d1a7..b8ebac0a1 100644 --- a/tests/hlsl/return.shader_test +++ b/tests/hlsl/return.shader_test @@ -38,10 +38,10 @@ float4 main() : sv_target
[test] uniform 0 float 0.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8)
[pixel shader] @@ -65,10 +65,10 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.3, 0.4, 0.5, 0.6) uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4)
[pixel shader] @@ -92,13 +92,13 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) 1 uniform 0 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.4, 0.5) 1 uniform 0 float 0.9 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8) 1
[pixel shader] @@ -119,13 +119,13 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) 1 uniform 0 float 0.5 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.8) 1 uniform 0 float 0.9 -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.5, 0.6, 0.7) 1
[pixel shader] @@ -166,23 +166,23 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.1, 0.1, 0.1) 1
uniform 0 float 0.1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.2, 0.2) 1
uniform 0 float 0.3 -draw quad +todo(sm>=6) draw quad probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 0 float 0.7 -draw quad +todo(sm>=6) draw quad probe all rgba (0.8, 0.8, 0.8, 0.8) 1
uniform 0 float 0.9 -draw quad +todo(sm>=6) draw quad probe all rgba (0.9, 0.9, 0.9, 0.9) 1
[pixel shader] @@ -211,10 +211,10 @@ void main(out float4 ret : sv_target)
[test] uniform 0 float 0.2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.2, 0.2) uniform 0 float 0.8 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.5, 0.5, 0.5)
[pixel shader todo] diff --git a/tests/hlsl/round.shader_test b/tests/hlsl/round.shader_test index 5e40dc6dd..f8cb7c9cd 100644 --- a/tests/hlsl/round.shader_test +++ b/tests/hlsl/round.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return round(u); @@ -6,12 +6,12 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.4 -6.6 7.6 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, -7.0, 8.0, 3.0) 4
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { float a = round(u.r); @@ -22,12 +22,12 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.4 -6.6 7.6 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-7.0, 8.0, 0.0, 3.0) 4
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { int4 i = u; @@ -36,5 +36,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -1 0 2 10 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 0.0, 2.0, 10.0) 4 diff --git a/tests/hlsl/sample-bias.shader_test b/tests/hlsl/sample-bias.shader_test index 08e506965..e56945d06 100644 --- a/tests/hlsl/sample-bias.shader_test +++ b/tests/hlsl/sample-bias.shader_test @@ -31,13 +31,13 @@ float4 main(float2 coord : texcoord) : sv_target
[test] uniform 0 float4 6.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (10.0, 0.0, 10.0, 0.0)
uniform 0 float4 7.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 0.0, 10.0, 0.0)
uniform 0 float4 8.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 10.0, 0.0) diff --git a/tests/hlsl/sample-grad.shader_test b/tests/hlsl/sample-grad.shader_test index c37da299c..298037a77 100644 --- a/tests/hlsl/sample-grad.shader_test +++ b/tests/hlsl/sample-grad.shader_test @@ -26,11 +26,11 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 float4 1.0 1.0 1.0 1.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) uniform 0 float4 2.0 2.0 2.0 2.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/sample-level.shader_test b/tests/hlsl/sample-level.shader_test index ec7c7e2a2..c91c65493 100644 --- a/tests/hlsl/sample-level.shader_test +++ b/tests/hlsl/sample-level.shader_test @@ -26,11 +26,11 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.0, 1.0, 0.0) uniform 0 float4 0.5 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.0, 1.0, 0.0) uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/sampler-offset.shader_test b/tests/hlsl/sampler-offset.shader_test index 6f8357dfa..498a8ed3a 100644 --- a/tests/hlsl/sampler-offset.shader_test +++ b/tests/hlsl/sampler-offset.shader_test @@ -22,7 +22,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.5, 0.0)
@@ -36,7 +36,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.2, 0.0, 0.4)
@@ -50,5 +50,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.2, 0.0, 0.4) diff --git a/tests/hlsl/sampler.shader_test b/tests/hlsl/sampler.shader_test index c4b38b327..caff7b2fa 100644 --- a/tests/hlsl/sampler.shader_test +++ b/tests/hlsl/sampler.shader_test @@ -17,7 +17,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.25, 0, 0.25, 0)
[pixel shader] @@ -30,7 +30,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (0.25, 0, 0.25, 0)
[pixel shader fail] @@ -53,7 +53,7 @@ float4 main() : sv_target [require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)] samplerCUBE s;
float4 main() : sv_target @@ -61,7 +61,7 @@ float4 main() : sv_target return texCUBE(s, float3(0.0, 0.0, 0.0)); }
-[pixel shader] +[pixel shader fail(sm>=6)] sampler1D s;
float4 main() : sv_target diff --git a/tests/hlsl/saturate.shader_test b/tests/hlsl/saturate.shader_test index 41ccc62ae..5928b2c45 100644 --- a/tests/hlsl/saturate.shader_test +++ b/tests/hlsl/saturate.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float2 u) : sv_target { return float4(saturate(u), saturate(u.x + 0.5), saturate(-1.2)); @@ -6,10 +6,10 @@ float4 main(uniform float2 u) : sv_target
[test] uniform 0 float4 0.7 -0.1 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.7, 0.0, 1.0, 0.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { int4 i = u; @@ -18,5 +18,5 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -2 0 2 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 0.0) diff --git a/tests/hlsl/shader-interstage-interface.shader_test b/tests/hlsl/shader-interstage-interface.shader_test index 584b88cf9..271eb3bbe 100644 --- a/tests/hlsl/shader-interstage-interface.shader_test +++ b/tests/hlsl/shader-interstage-interface.shader_test @@ -52,5 +52,5 @@ void main(float4 position : SV_Position, float2 t0 : TEXCOORD0, }
[test] -draw triangle strip 4 +todo(sm>=6) draw triangle strip 4 probe all rgba (10.0, 8.0, 7.0, 3.0) diff --git a/tests/hlsl/side-effects.shader_test b/tests/hlsl/side-effects.shader_test index 8e4557f02..f41e98510 100644 --- a/tests/hlsl/side-effects.shader_test +++ b/tests/hlsl/side-effects.shader_test @@ -27,6 +27,11 @@ draw quad probe all rgba (11.0, 11.0, 11.0, 11.0)
+% dxcompiler performs the first call to func() before the array index call. +[require] +shader model < 6.0 + + [pixel shader] float4 func(void) { diff --git a/tests/hlsl/sign.shader_test b/tests/hlsl/sign.shader_test index 7ed632dbe..c56d90823 100644 --- a/tests/hlsl/sign.shader_test +++ b/tests/hlsl/sign.shader_test @@ -8,13 +8,13 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0) uniform 0 float4 -1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, -1.0, -1.0, -1.0) uniform 0 float4 0.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
[pixel shader] @@ -27,7 +27,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -41,7 +41,7 @@ float4 main() : sv_target [test] uniform 0 float4 1.0 2.0 0.0 0.0 uniform 4 float4 3.0 4.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 1.0, 1.0, 1.0)
[pixel shader] @@ -54,13 +54,13 @@ float4 main() : sv_target
[test] uniform 0 int4 1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1) uniform 0 int4 -1 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (-1, -1, -1, -1) uniform 0 int4 0 0 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (0, 0, 0, 0)
[pixel shader] @@ -73,7 +73,7 @@ float4 main() : sv_target
[test] uniform 0 int4 1 2 3 4 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1)
[pixel shader] @@ -87,5 +87,5 @@ float4 main() : sv_target [test] uniform 0 int4 1 2 0 0 uniform 4 int4 3 4 0 0 -draw quad +todo(sm>=6) draw quad probe all rgba (1, 1, 1, 1) diff --git a/tests/hlsl/smoothstep.shader_test b/tests/hlsl/smoothstep.shader_test index 63755b081..971f6d5d8 100644 --- a/tests/hlsl/smoothstep.shader_test +++ b/tests/hlsl/smoothstep.shader_test @@ -27,7 +27,7 @@ float4 main() : sv_target
[test] draw quad -probe all rgba (0, 0.104, 0.896, 1.000000) 5 +probe all rgba (0, 0.104, 0.896, 1.000000) 6
[pixel shader] diff --git a/tests/hlsl/sqrt.shader_test b/tests/hlsl/sqrt.shader_test index 78d89d38f..73ecba899 100644 --- a/tests/hlsl/sqrt.shader_test +++ b/tests/hlsl/sqrt.shader_test @@ -8,7 +8,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 9.0 32.3 46.5 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 3.0, 5.683309, 6.819091) 1
[pixel shader] @@ -21,5 +21,5 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 9.0 4.0 16.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 0.33333333, 0.5, 0.25) 1 diff --git a/tests/hlsl/state-block-syntax.shader_test b/tests/hlsl/state-block-syntax.shader_test index 26853bf40..7df3ae7c9 100644 --- a/tests/hlsl/state-block-syntax.shader_test +++ b/tests/hlsl/state-block-syntax.shader_test @@ -1,4 +1,4 @@ -[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo = float; @@ -9,7 +9,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s = sampler_state { foo = float; @@ -20,7 +20,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { 2 = 3; @@ -31,7 +31,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { 2; @@ -42,7 +42,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo; @@ -53,7 +53,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] sampler s { foo = bar @@ -104,7 +104,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (sampler)2; @@ -115,7 +115,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (faketype)2; @@ -126,7 +126,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = (sampler)bar; @@ -137,7 +137,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float f { foo = bar(); diff --git a/tests/hlsl/static-initializer.shader_test b/tests/hlsl/static-initializer.shader_test index 8415d851a..fefcd47f4 100644 --- a/tests/hlsl/static-initializer.shader_test +++ b/tests/hlsl/static-initializer.shader_test @@ -16,7 +16,7 @@ draw quad probe all rgba (0.8, 0.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] static uint i;
float4 main() : sv_target @@ -146,7 +146,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4)
@@ -162,7 +162,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (1, 2, 3, 4)
diff --git a/tests/hlsl/step.shader_test b/tests/hlsl/step.shader_test index e201e15f9..b857f00b2 100644 --- a/tests/hlsl/step.shader_test +++ b/tests/hlsl/step.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 5.0 -2.6 3.0 2.0 uniform 4 float4 1.0 -4.3 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 0.0, 1.0, 1.0)
diff --git a/tests/hlsl/storage-qualifiers.shader_test b/tests/hlsl/storage-qualifiers.shader_test index 00e7b8367..b1eb1f1bd 100644 --- a/tests/hlsl/storage-qualifiers.shader_test +++ b/tests/hlsl/storage-qualifiers.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] void sub2(in uniform float4 i, out float4 o) { o = i; @@ -17,5 +17,5 @@ void main(in uniform float4 a, uniform float4 b, out float4 o : sv_target) [test] uniform 0 float4 0.1 0.0 0.0 0.0 uniform 4 float4 0.2 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.1, 0.2, 0.3, 0.4) diff --git a/tests/hlsl/struct-array.shader_test b/tests/hlsl/struct-array.shader_test index aff0a677a..4097f3835 100644 --- a/tests/hlsl/struct-array.shader_test +++ b/tests/hlsl/struct-array.shader_test @@ -18,5 +18,5 @@ float4 main() : sv_target uniform 0 float4 0.1 0.2 0.0 0.0 uniform 4 float4 0.3 0.4 0.0 0.0 uniform 8 float4 0.5 0.6 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.2, 0.3, 0.6, 0.5) diff --git a/tests/hlsl/swizzle-constant-prop.shader_test b/tests/hlsl/swizzle-constant-prop.shader_test index 357a3496e..a0ec18e45 100644 --- a/tests/hlsl/swizzle-constant-prop.shader_test +++ b/tests/hlsl/swizzle-constant-prop.shader_test @@ -25,7 +25,7 @@ float4 main() : sv_target
[test] uniform 0 int 4 -draw quad +todo(sm>=6) draw quad probe all rgba (110, 210, 410, 410)
@@ -43,7 +43,7 @@ float4 main() : sv_target
[test] uniform 0 int 3 -draw quad +todo(sm>=6) draw quad probe all rgba (105, 5, 305, 305)
@@ -59,5 +59,5 @@ float4 main() : sv_target
[test] uniform 0 int 1 -draw quad +todo(sm>=6) draw quad probe all rgba (14.0, 14.0, 14.0, 14.0) diff --git a/tests/hlsl/swizzle-matrix.shader_test b/tests/hlsl/swizzle-matrix.shader_test index bc2814ebb..005522759 100644 --- a/tests/hlsl/swizzle-matrix.shader_test +++ b/tests/hlsl/swizzle-matrix.shader_test @@ -9,7 +9,7 @@ float4 main() : sv_target [test] uniform 0 float4 11 21 31 -1 uniform 4 float4 12 22 32 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (21.0, 31.0, 11.0, 12.0)
@@ -24,7 +24,7 @@ float4 main() : sv_target [test] uniform 0 float4 11 21 31 -1 uniform 4 float4 12 22 32 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 31.0, 12.0, 32.0)
@@ -40,7 +40,7 @@ float4 main() : sv_target uniform 0 float4 11 12 -1 -1 uniform 4 float4 21 22 -1 -1 uniform 8 float4 31 32 -1 -1 -draw quad +todo(sm>=6) draw quad probe all rgba (11.0, 31.0, 12.0, 32.0)
diff --git a/tests/hlsl/swizzles.shader_test b/tests/hlsl/swizzles.shader_test index c3d3343f3..ddfc09fc9 100644 --- a/tests/hlsl/swizzles.shader_test +++ b/tests/hlsl/swizzles.shader_test @@ -11,7 +11,7 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0101, 0.0303, 0.0202, 0.0404)
@@ -149,7 +149,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 3.0, 4.0)
@@ -166,5 +166,5 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 4.0, 2.0, 3.0) diff --git a/tests/hlsl/ternary.shader_test b/tests/hlsl/ternary.shader_test index 91f49e0e9..587b3d556 100644 --- a/tests/hlsl/ternary.shader_test +++ b/tests/hlsl/ternary.shader_test @@ -8,10 +8,10 @@ float4 main() : sv_target
[test] uniform 0 float4 2.0 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (2.0, 3.0, 4.0, 5.0) uniform 0 float4 0.0 10.0 11.0 12.0 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 9.0, 10.0, 11.0)
[pixel shader] @@ -29,7 +29,7 @@ float4 main() : sv_target
[test] uniform 0 float4 1.1 3.0 4.0 5.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.1, 2.0, 0.0, 0.0)
[pixel shader] @@ -44,10 +44,10 @@ float4 main() : sv_target
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 x, y, z;
float4 main() : sv_target diff --git a/tests/hlsl/texture-load-offset.shader_test b/tests/hlsl/texture-load-offset.shader_test index 52b6a5f93..f32b2191f 100644 --- a/tests/hlsl/texture-load-offset.shader_test +++ b/tests/hlsl/texture-load-offset.shader_test @@ -18,7 +18,7 @@ float4 main(float4 pos : sv_position) : sv_target
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0, 1, 0, 1) probe (1, 0) rgba (1, 1, 0, 1) probe (0, 1) rgba (0, 2, 0, 1) @@ -35,7 +35,7 @@ float4 main(float4 pos : sv_position) : sv_target
[test] -draw quad +todo(sm>=6) draw quad probe (3, 0) rgba (1, 0, 0, 1) probe (4, 0) rgba (2, 0, 0, 1) probe (3, 1) rgba (1, 1, 0, 1) diff --git a/tests/hlsl/texture-load-typed.shader_test b/tests/hlsl/texture-load-typed.shader_test index c92273373..f964463f4 100644 --- a/tests/hlsl/texture-load-typed.shader_test +++ b/tests/hlsl/texture-load-typed.shader_test @@ -36,7 +36,7 @@ size (1, 1)
4294967295 123
-[pixel shader] +[pixel shader fail(sm>=6)] typedef int myint_t; texture2D<float> f1; Texture2D<myint_t> i1; diff --git a/tests/hlsl/texture-load.shader_test b/tests/hlsl/texture-load.shader_test index 362e1d2e3..8609828b8 100644 --- a/tests/hlsl/texture-load.shader_test +++ b/tests/hlsl/texture-load.shader_test @@ -15,7 +15,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.5, 0.7, 0.6, 0.8) probe (0, 1) rgba (0.6, 0.5, 0.2, 0.1) @@ -30,7 +30,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1) probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8) @@ -46,7 +46,7 @@ float4 main(float4 pos : sv_position) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe (0, 0) rgba (0.1, 0.2, 0.3, 0.4) probe (1, 0) rgba (0.6, 0.5, 0.2, 0.1) probe (0, 1) rgba (0.5, 0.7, 0.6, 0.8) diff --git a/tests/hlsl/texture-ordering.shader_test b/tests/hlsl/texture-ordering.shader_test index 2291ddf88..00583f8a0 100644 --- a/tests/hlsl/texture-ordering.shader_test +++ b/tests/hlsl/texture-ordering.shader_test @@ -86,7 +86,7 @@ size (1, 1) [require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)] // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // sam_arr_10 sampler NA NA s0 1 @@ -133,13 +133,13 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (450, 139, 876, 333)
% Same as the first test, but inverting the declaration order. % Regarding textures, only the allocation of those that are not created from samplers is affected. -[pixel shader] +[pixel shader fail(sm>=6)] // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // sam_arr_11 sampler NA NA s0 2 @@ -186,13 +186,13 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (450, 138, 796, 333)
% Same as the first test, but inverting the resource loads order. % Regarding textures, only the allocation of those that are created from samplers is affected. -[pixel shader] +[pixel shader fail(sm>=6)] // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // sam_arr_10 sampler NA NA s0 1 @@ -239,14 +239,14 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (478, 913, 256, 333)
% We can conclude that for declared texture arrays, if they are used, the "allocation size" is the % whole array. % On the other hand, for textures generated from samplers. the "allocation size" is the "bind count". -[pixel shader] +[pixel shader fail(sm>=6)] // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // sam_arr sampler NA NA s0 2 @@ -272,12 +272,12 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (215, 215, 215, 111)
% Test that textures created from SM1-style samples allocation order is in decreasing "bind count". -[pixel shader] +[pixel shader fail(sm>=6)] // Name Type Format Dim HLSL Bind Count // ------------------------------ ---------- ------- ----------- -------------- ------ // tex_100 sampler NA NA s0 1 @@ -302,5 +302,5 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe all rgba (5, 4, 2, 0) diff --git a/tests/hlsl/trigonometry.shader_test b/tests/hlsl/trigonometry.shader_test index f283c538c..f52d01dea 100644 --- a/tests/hlsl/trigonometry.shader_test +++ b/tests/hlsl/trigonometry.shader_test @@ -12,7 +12,7 @@ float4 main(float tex : texcoord) : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe ( 0, 0) rgba ( 0.00000000, 1.00000000, 0.00000000, 0.0) probe ( 1, 0) rgba ( 0.84147098, 0.54030231, 1.55740772, 0.0) 1024 probe ( 2, 0) rgba ( 0.90929743, -0.41614684, -2.18503986, 0.0) 1024 @@ -41,7 +41,7 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.52359877 2.61799387 3.14159265 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 500.0, 500.0, 0.0)
@@ -55,7 +55,7 @@ float4 main() : sv_target
[test] uniform 0 float4 0.0 0.78539816 1.57079632 2.35619449 -draw quad +todo(sm>=6) draw quad probe all rgba (1000.0, 707.0, -0.0, -707.0)
@@ -71,5 +71,5 @@ float4 main() : sv_target % tan(pi/2) is an asymtote and therefore undefined % so check 0, pi/4, 3pi/4, pi uniform 0 float4 0.0 0.78539816 2.35619449 3.14159265 -draw quad +todo(sm>=6) draw quad probe all rgba (0, 1000, -1000.0, 0) diff --git a/tests/hlsl/trunc.shader_test b/tests/hlsl/trunc.shader_test index 419608fb0..6df4cce25 100644 --- a/tests/hlsl/trunc.shader_test +++ b/tests/hlsl/trunc.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { return trunc(u); @@ -6,13 +6,13 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 6.0, 7.0, 3.0) uniform 0 float4 -1.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (-1.0, 6.0, 7.0, 3.0)
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform float4 u) : sv_target { float a = trunc(u.r); @@ -23,13 +23,13 @@ float4 main(uniform float4 u) : sv_target
[test] uniform 0 float4 -0.5 6.5 7.5 3.4 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, 0.0, 3.0)
[require] shader model >= 4.0
-[pixel shader] +[pixel shader fail(sm>=6)] float4 main(uniform int4 u) : sv_target { float a = trunc(u.r); @@ -40,5 +40,5 @@ float4 main(uniform int4 u) : sv_target
[test] uniform 0 int4 -1 6 7 3 -draw quad +todo(sm>=6) draw quad probe all rgba (6.0, 7.0, -1.0, 3.0) diff --git a/tests/hlsl/type-names.shader_test b/tests/hlsl/type-names.shader_test index f382ffae6..6e88fd285 100644 --- a/tests/hlsl/type-names.shader_test +++ b/tests/hlsl/type-names.shader_test @@ -1,4 +1,4 @@ -[pixel shader] +[pixel shader fail(sm>=6)] typedef float2 Dword; typedef float3 dWord; typedef float2 fLoat; @@ -73,7 +73,7 @@ float4 main() : sv_target return float4(0, 0, 0, 0); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 f() { typedef float2 matrix; @@ -85,7 +85,7 @@ float4 main() : SV_TARGET return f(); }
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 f() { typedef float2 vector; diff --git a/tests/hlsl/uav-load.shader_test b/tests/hlsl/uav-load.shader_test index fe6350e0c..9088ffa0d 100644 --- a/tests/hlsl/uav-load.shader_test +++ b/tests/hlsl/uav-load.shader_test @@ -23,7 +23,7 @@ void main() }
[test] -dispatch 1 1 1 +todo(sm>=6) dispatch 1 1 1 probe uav 0 (0, 0) r (0.6) probe uav 0 (1, 0) r (0.6) probe uav 0 (2, 0) r (0.6) diff --git a/tests/hlsl/uav-out-param.shader_test b/tests/hlsl/uav-out-param.shader_test index f31344748..796c4bf1f 100644 --- a/tests/hlsl/uav-out-param.shader_test +++ b/tests/hlsl/uav-out-param.shader_test @@ -26,7 +26,7 @@ void main() }
[test] -dispatch 1 1 1 +todo(sm>=6) dispatch 1 1 1 probe uav 0 (0, 0) rgba (0.4, 0.1, 0.2, 0.3)
[uav 0] @@ -51,5 +51,5 @@ void main() }
[test] -dispatch 1 1 1 +todo(sm>=6) dispatch 1 1 1 probe uav 0 (0, 0) r (0.2) diff --git a/tests/hlsl/uav-rwbuffer.shader_test b/tests/hlsl/uav-rwbuffer.shader_test index 1a7fcf1e8..b476c7854 100644 --- a/tests/hlsl/uav-rwbuffer.shader_test +++ b/tests/hlsl/uav-rwbuffer.shader_test @@ -41,7 +41,7 @@ float4 main() : sv_target1 return 0; }
-[pixel shader fail todo] +[pixel shader fail(sm<6) todo] RWBuffer<double3> u;
float4 main() : sv_target1 @@ -58,7 +58,7 @@ float4 main() : sv_target1 }
% Array type -[pixel shader fail] +[pixel shader fail(sm<6)] typedef float arr[2]; RWBuffer<arr> u;
@@ -68,7 +68,7 @@ float4 main() : sv_target1 }
% Object types -[pixel shader fail] +[pixel shader fail(sm<6)] RWBuffer<Texture2D> u;
float4 main() : sv_target1 @@ -103,5 +103,5 @@ float4 main() : sv_target1 }
[test] -draw quad +todo(sm>=6) draw quad probe buffer uav 2 (0, 0) rgba (11.1, 12.2, 13.3, 14.4) diff --git a/tests/hlsl/uav-rwstructuredbuffer.shader_test b/tests/hlsl/uav-rwstructuredbuffer.shader_test index 5ea673299..904d15514 100644 --- a/tests/hlsl/uav-rwstructuredbuffer.shader_test +++ b/tests/hlsl/uav-rwstructuredbuffer.shader_test @@ -36,7 +36,7 @@ float4 main() : sv_target1 }
% Object types -[pixel shader fail] +[pixel shader fail(sm<6)] RWStructuredBuffer<Texture2D> u;
float4 main() : sv_target1 diff --git a/tests/hlsl/uav-rwtexture.shader_test b/tests/hlsl/uav-rwtexture.shader_test index 07c28cb84..bfa2b4413 100644 --- a/tests/hlsl/uav-rwtexture.shader_test +++ b/tests/hlsl/uav-rwtexture.shader_test @@ -1,7 +1,7 @@ [require] shader model >= 5.0
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u;
float4 main() : sv_target @@ -49,7 +49,7 @@ float4 main() : sv_target }
[test] -draw quad +todo(sm>=6) draw quad probe uav 1 (0, 0) r (0.5) probe uav 1 (0, 1) r (0.6) probe uav 1 (1, 0) r (0.2) @@ -71,7 +71,7 @@ size (1, 1)
0.1 0.2 0.3 0.4
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u : register(u0);
float4 main() : sv_target1 @@ -80,7 +80,7 @@ float4 main() : sv_target1 return 0; }
-[pixel shader fail] +[pixel shader fail(sm<6)] RWTexture2D<float4> u : register(u1);
float4 main() : sv_target1 @@ -99,7 +99,7 @@ float4 main() : sv_target1 }
[test] -draw quad +todo(sm>=6) draw quad probe uav 2 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
@@ -118,7 +118,7 @@ float4 main() : sv_target1 }
[test] -draw quad +todo(sm>=6) draw quad probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
% Uppercase register set name @@ -132,7 +132,7 @@ float4 main() : sv_target1 }
[test] -draw quad +todo(sm>=6) draw quad probe uav 3 (0, 0) rgba (0.9, 0.8, 0.7, 0.6)
% Test that we can declare and use an array of UAVs. @@ -158,12 +158,12 @@ float4 main() : sv_target1 }
[test] -draw quad +todo(sm>=6) draw quad probe uav 2 (0, 0) rgba (1.1, 1.2, 1.3, 1.4) probe uav 3 (0, 0) rgba (2.1, 2.2, 2.3, 2.4)
% RWTexture1D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; @@ -181,7 +181,7 @@ float4 main() : sv_target1 }
% RWTexture2D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; @@ -199,7 +199,7 @@ float4 main() : sv_target1 }
% RWTexture3D types -[pixel shader] +[pixel shader fail(sm>=6)] struct s { float3 a; diff --git a/tests/hlsl/uniform-semantics.shader_test b/tests/hlsl/uniform-semantics.shader_test index 1125117fe..86e3b83f9 100644 --- a/tests/hlsl/uniform-semantics.shader_test +++ b/tests/hlsl/uniform-semantics.shader_test @@ -10,7 +10,7 @@ float4 main() : sv_target
[test] uniform 0 float 3.5 -draw quad +todo(sm>=6) draw quad probe all rgba (3.5, 3.5, 3.5, 3.5)
@@ -24,5 +24,5 @@ float4 main() : sv_target
[test] uniform 0 float4 4.0 5.0 6.0 7.0 -draw quad +todo(sm>=6) draw quad probe all rgba (4.0, 5.0, 4.0, 5.0) diff --git a/tests/hlsl/vector-indexing-uniform.shader_test b/tests/hlsl/vector-indexing-uniform.shader_test index e5ffbdd02..3501f3af7 100644 --- a/tests/hlsl/vector-indexing-uniform.shader_test +++ b/tests/hlsl/vector-indexing-uniform.shader_test @@ -12,5 +12,5 @@ float4 main() : SV_TARGET
[test] uniform 0 float 2 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.3, 0.8, 0.2) diff --git a/tests/hlsl/vector-indexing.shader_test b/tests/hlsl/vector-indexing.shader_test index 1542d358a..71a4ca26d 100644 --- a/tests/hlsl/vector-indexing.shader_test +++ b/tests/hlsl/vector-indexing.shader_test @@ -23,11 +23,11 @@ float4 main() : SV_TARGET
[test] uniform 0 float4 1.0 2.0 3.0 4.0 -draw quad +todo(sm>=6) draw quad probe all rgba (1.0, 2.0, 2.0, 3.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET { float4 vec = {0, 1, 2, 3}; diff --git a/tests/hlsl/writemask-assignop-0.shader_test b/tests/hlsl/writemask-assignop-0.shader_test index 374a38bb4..fa8ecc2e4 100644 --- a/tests/hlsl/writemask-assignop-0.shader_test +++ b/tests/hlsl/writemask-assignop-0.shader_test @@ -11,5 +11,5 @@ float4 main() : SV_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (-0.4697, -0.02, 0.57, 0.3202) 2 diff --git a/tests/hlsl/writemask-assignop-1.shader_test b/tests/hlsl/writemask-assignop-1.shader_test index 61993257c..3bebcce61 100644 --- a/tests/hlsl/writemask-assignop-1.shader_test +++ b/tests/hlsl/writemask-assignop-1.shader_test @@ -12,5 +12,5 @@ float4 main() : SV_target
[test] uniform 0 float4 0.0303 0.08 0.07 0.0202 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5697, -0.08, -0.27, -0.4202) diff --git a/tests/shader_runner.c b/tests/shader_runner.c index bec08d7e7..2ec40ffe8 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -60,6 +60,7 @@ typedef int HRESULT; #include "vkd3d_d3dcompiler.h" #include "vkd3d_test.h" #include "shader_runner.h" +#include "dxcompiler.h"
struct test_options test_options = {0};
@@ -129,9 +130,11 @@ static bool match_directive_substring(const char *line, const char *token, const
static void parse_require_directive(struct shader_runner *runner, const char *line) { + bool less_than = false; unsigned int i;
- if (match_string(line, "shader model >=", &line)) + if (match_string(line, "shader model >=", &line) + || (less_than = match_string(line, "shader model <", &line))) { static const char *const model_strings[] = { @@ -141,13 +144,23 @@ static void parse_require_directive(struct shader_runner *runner, const char *li [SHADER_MODEL_4_1] = "4.1", [SHADER_MODEL_5_0] = "5.0", [SHADER_MODEL_5_1] = "5.1", + [SHADER_MODEL_6_0] = "6.0", };
for (i = 0; i < ARRAY_SIZE(model_strings); ++i) { if (match_string(line, model_strings[i], &line)) { - runner->minimum_shader_model = i; + if (less_than) + { + if (!i) + fatal_error("Shader model < '%s' is invalid.\n", line); + runner->maximum_shader_model = min(runner->maximum_shader_model, i - 1); + } + else + { + runner->minimum_shader_model = max(runner->minimum_shader_model, i); + } return; } } @@ -485,6 +498,10 @@ static void parse_test_directive(struct shader_runner *runner, const char *line)
if (match_string(line, "todo", &line)) runner->is_todo = true; + else if (match_string(line, "todo(sm<6)", &line)) + runner->is_todo = runner->minimum_shader_model < SHADER_MODEL_6_0; + else if (match_string(line, "todo(sm>=6)", &line)) + runner->is_todo = runner->minimum_shader_model >= SHADER_MODEL_6_0;
if (match_string(line, "dispatch", &line)) { @@ -802,9 +819,125 @@ const char *shader_type_string(enum shader_type type) return shader_types[type]; }
-static void compile_shader(struct shader_runner *runner, const char *source, size_t len, enum shader_type type, - HRESULT expect) +/* Avoid issues with calling convention mismatch and different methods for string + * retrieval by copying all IDxcBlob objects to a new ID3D10Blob. */ + +static void d3d10_blob_from_dxc_blob_utf8(IDxcBlobUtf8 *blob, ID3D10Blob **blob_out) +{ + ID3D10Blob *d3d_blob; + size_t size; + HRESULT hr; + + size = IDxcBlobUtf8_GetStringLength(blob) + 1; + if (FAILED(hr = D3DCreateBlob(size, (ID3DBlob **)&d3d_blob))) + { + trace("Failed to create blob, hr %#x.\n", hr); + return; + } + + memcpy(ID3D10Blob_GetBufferPointer(d3d_blob), IDxcBlobUtf8_GetStringPointer(blob), size); + *blob_out = d3d_blob; +} + +static HRESULT d3d10_blob_from_dxc_blob(IDxcBlob *blob, ID3D10Blob **blob_out) +{ + ID3D10Blob *d3d_blob; + size_t size; + HRESULT hr; + + size = IDxcBlob_GetBufferSize(blob); + if (FAILED(hr = D3DCreateBlob(size, (ID3DBlob **)&d3d_blob))) + { + trace("Failed to create blob, hr %#x.\n", hr); + return hr; + } + + memcpy(ID3D10Blob_GetBufferPointer(d3d_blob), IDxcBlob_GetBufferPointer(blob), size); + *blob_out = d3d_blob; + + return S_OK; +} + +HRESULT dxc_compiler_compile_shader(void *dxc_compiler, enum shader_type type, unsigned int compile_options, + const char *hlsl, ID3D10Blob **blob_out, ID3D10Blob **errors_out) +{ + DxcBuffer src_buf = {hlsl, strlen(hlsl), 65001}; + IDxcCompiler3 *compiler = dxc_compiler; + HRESULT hr, compile_hr; + IDxcBlobUtf8 *errors; + IDxcResult *result; + size_t arg_count; + IDxcBlob *blob; + + static const WCHAR *const shader_profiles[] = + { + [SHADER_TYPE_CS] = L"cs_6_0", + [SHADER_TYPE_PS] = L"ps_6_0", + [SHADER_TYPE_VS] = L"vs_6_0", + }; + const WCHAR *args[] = + { + L"/T", + shader_profiles[type], + L"/Qstrip_reflect", + L"/Qstrip_debug", + L"/flegacy-macro-expansion", + L"/flegacy-resource-reservation", + NULL, + NULL, + NULL, + }; + + *blob_out = NULL; + *errors_out = NULL; + + arg_count = ARRAY_SIZE(args) - 3; + if (compile_options & D3DCOMPILE_PACK_MATRIX_ROW_MAJOR) + args[arg_count++] = L"/Zpr"; + if (compile_options & D3DCOMPILE_PACK_MATRIX_COLUMN_MAJOR) + args[arg_count++] = L"/Zpc"; + if (compile_options & D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY) + args[arg_count++] = L"/Gec"; + + if (FAILED(hr = IDxcCompiler3_Compile(compiler, &src_buf, args, arg_count, NULL, &IID_IDxcResult, (void **)&result))) + { + trace("Failed to compile shader, hr %#x.\n", hr); + return hr; + } + + if (IDxcResult_HasOutput(result, DXC_OUT_ERRORS) + && SUCCEEDED(hr = IDxcResult_GetOutput(result, DXC_OUT_ERRORS, &IID_IDxcBlobUtf8, (void **)&errors, NULL))) + { + if (IDxcBlobUtf8_GetStringLength(errors)) + d3d10_blob_from_dxc_blob_utf8(errors, errors_out); + IDxcBlobUtf8_Release(errors); + } + + if (FAILED(hr = IDxcResult_GetStatus(result, &compile_hr)) || FAILED((hr = compile_hr))) + { + if (hr == DXC_E_LLVM_CAST_ERROR) + hr = E_FAIL; + goto result_release; + } + + if (FAILED(hr = IDxcResult_GetOutput(result, DXC_OUT_OBJECT, &IID_IDxcBlob, (void **)&blob, NULL))) + goto result_release; + + IDxcResult_Release(result); + + hr = d3d10_blob_from_dxc_blob(blob, blob_out); + IDxcBlob_Release(blob); + return hr; + +result_release: + IDxcResult_Release(result); + return hr; +} + +static void compile_shader(struct shader_runner *runner, IDxcCompiler3 *dxc_compiler, const char *source, size_t len, + enum shader_type type, HRESULT expect) { + bool use_dxcompiler = runner->minimum_shader_model >= SHADER_MODEL_6_0; ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; HRESULT hr; @@ -817,10 +950,19 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz [SHADER_MODEL_4_1] = "4_1", [SHADER_MODEL_5_0] = "5_0", [SHADER_MODEL_5_1] = "5_1", + [SHADER_MODEL_6_0] = "6_0", };
- sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); - hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); + if (use_dxcompiler) + { + assert(dxc_compiler); + hr = dxc_compiler_compile_shader(dxc_compiler, type, runner->compile_options, source, &blob, &errors); + } + else + { + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]); + hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors); + } hr = map_unidentified_hrs(hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) @@ -845,8 +987,11 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum { while (*src && *src != ']') { + /* 'todo' is not meaningful when dxcompiler is in use, so it has no '(sm<6) qualifier. */ if (match_directive_substring(src, "todo", &src)) { + if (runner->minimum_shader_model >= SHADER_MODEL_6_0) + continue; if (state == STATE_SHADER_COMPUTE) state = STATE_SHADER_COMPUTE_TODO; else if (state == STATE_SHADER_PIXEL) @@ -858,9 +1003,20 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum { *expect_hr = E_FAIL; } - else if (match_directive_substring(src, "notimpl", &src)) + else if (match_directive_substring(src, "fail(sm<6)", &src)) { - *expect_hr = E_NOTIMPL; + if (runner->minimum_shader_model < SHADER_MODEL_6_0) + *expect_hr = E_FAIL; + } + else if (match_directive_substring(src, "fail(sm>=6)", &src)) + { + if (runner->minimum_shader_model >= SHADER_MODEL_6_0) + *expect_hr = E_FAIL; + } + else if (match_directive_substring(src, "notimpl(sm<6)", &src)) + { + if (runner->minimum_shader_model < SHADER_MODEL_6_0) + *expect_hr = E_NOTIMPL; } else { @@ -874,7 +1030,8 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum return state; }
-void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops) +void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops, void *dxc_compiler, + enum shader_model minimum_shader_model, enum shader_model maximum_shader_model) { size_t shader_source_size = 0, shader_source_len = 0; struct resource_params current_resource; @@ -895,7 +1052,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
memset(runner, 0, sizeof(*runner)); runner->ops = ops; - runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->minimum_shader_model = minimum_shader_model; + runner->maximum_shader_model = maximum_shader_model;
for (;;) { @@ -931,7 +1089,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_COMPUTE_TODO) - compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_CS, expect_hr); + compile_shader(runner, dxc_compiler, shader_source, shader_source_len, SHADER_TYPE_CS, + expect_hr); } free(runner->cs_source); runner->cs_source = shader_source; @@ -945,7 +1104,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_PIXEL_TODO) - compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_PS, expect_hr); + compile_shader(runner, dxc_compiler, shader_source, shader_source_len, SHADER_TYPE_PS, + expect_hr); } free(runner->ps_source); runner->ps_source = shader_source; @@ -959,7 +1119,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o if (!skip_tests) { todo_if (state == STATE_SHADER_VERTEX_TODO) - compile_shader(runner, shader_source, shader_source_len, SHADER_TYPE_VS, expect_hr); + compile_shader(runner, dxc_compiler, shader_source, shader_source_len, SHADER_TYPE_VS, + expect_hr); } free(runner->vs_source); runner->vs_source = shader_source; @@ -1047,7 +1208,8 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o else if (!strcmp(line, "[require]\n")) { state = STATE_REQUIRE; - runner->minimum_shader_model = SHADER_MODEL_2_0; + runner->minimum_shader_model = minimum_shader_model; + runner->maximum_shader_model = maximum_shader_model; runner->compile_options = 0; skip_tests = false; } @@ -1208,7 +1370,10 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break;
case STATE_TEST: - if (!skip_tests) + assert(SUCCEEDED(expect_hr) || runner->minimum_shader_model >= SHADER_MODEL_6_0); + /* Compilation which fails with dxcompiler is not 'todo', therefore the tests are + * not 'todo' either. They cannot run, so skip them entirely. */ + if (!skip_tests && SUCCEEDED(expect_hr)) parse_test_directive(runner, line); break; } @@ -1284,8 +1449,47 @@ out: } #endif
+#if defined(SONAME_LIBDXCOMPILER) && !defined(VKD3D_CROSSTEST) +static IDxcCompiler3 *dxcompiler_create() +{ + DxcCreateInstanceProc create_instance; + IDxcCompiler3 *compiler; + HRESULT hr; + void *dll; + + if (!(dll = vkd3d_dlopen(SONAME_LIBDXCOMPILER))) + { + trace("Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); + return NULL; + } + + if (!(create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"))) + { + trace("Failed to get DxcCreateInstance() pointer.\n"); + return NULL; + } + + if (FAILED(hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler))) + { + trace("Failed to create instance, hr %#x.\n", hr); + return NULL; + } + + return compiler; +} +#elif !defined(VKD3D_CROSSTEST) +static IDxcCompiler3 *dxcompiler_create() +{ + return NULL; +} +#endif + START_TEST(shader_runner) { +#ifndef VKD3D_CROSSTEST + IDxcCompiler3 *dxc_compiler; +#endif + parse_args(argc, argv);
#if defined(VKD3D_CROSSTEST) @@ -1298,7 +1502,7 @@ START_TEST(shader_runner) run_shader_tests_d3d11();
trace("Compiling shaders with d3dcompiler_47.dll and executing with d3d12.dll\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1);
print_dll_version("d3dcompiler_47.dll"); print_dll_version("dxgi.dll"); @@ -1315,7 +1519,15 @@ START_TEST(shader_runner) run_shader_tests_d3d11();
trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if ((dxc_compiler = dxcompiler_create())) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); + IDxcCompiler3_Release(dxc_compiler); + print_dll_version(SONAME_LIBDXCOMPILER); + }
print_dll_version("d3d9.dll"); print_dll_version("d3d11.dll"); @@ -1326,6 +1538,13 @@ START_TEST(shader_runner) run_shader_tests_vulkan();
trace("Compiling shaders with vkd3d-shader and executing with vkd3d\n"); - run_shader_tests_d3d12(); + run_shader_tests_d3d12(NULL, SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if ((dxc_compiler = dxcompiler_create())) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(dxc_compiler, SHADER_MODEL_6_0, SHADER_MODEL_6_0); + IDxcCompiler3_Release(dxc_compiler); + } #endif } diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 6591143e6..3efbcf362 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -36,6 +36,7 @@ enum shader_model SHADER_MODEL_4_1, SHADER_MODEL_5_0, SHADER_MODEL_5_1, + SHADER_MODEL_6_0, };
enum shader_type @@ -118,6 +119,7 @@ struct shader_runner char *ps_source; char *cs_source; enum shader_model minimum_shader_model; + enum shader_model maximum_shader_model;
bool last_render_failed;
@@ -158,8 +160,11 @@ void fatal_error(const char *format, ...) VKD3D_NORETURN VKD3D_PRINTF_FUNC(1, 2)
unsigned int get_vb_stride(const struct shader_runner *runner, unsigned int slot); void init_resource(struct resource *resource, const struct resource_params *params); +HRESULT dxc_compiler_compile_shader(void *dxc_compiler, enum shader_type type, unsigned int compile_options, + const char *hlsl, ID3D10Blob **blob_out, ID3D10Blob **errors_out);
-void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops); +void run_shader_tests(struct shader_runner *runner, const struct shader_runner_ops *ops, void *dxc_compiler, + enum shader_model minimum_shader_model, enum shader_model maximum_shader_model);
#ifdef _WIN32 void run_shader_tests_d3d9(void); @@ -167,4 +172,5 @@ void run_shader_tests_d3d11(void); #else void run_shader_tests_vulkan(void); #endif -void run_shader_tests_d3d12(void); +void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader_model, + enum shader_model maximum_shader_model); diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index 25b585b14..bd9d363ce 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -747,7 +747,7 @@ void run_shader_tests_d3d11(void) init_adapter_info(); if (init_test_context(&runner)) { - run_shader_tests(&runner.r, &d3d11_runner_ops); + run_shader_tests(&runner.r, &d3d11_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_5_1); destroy_test_context(&runner); } } diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 925bdca99..909481d96 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -23,6 +23,7 @@ #define VKD3D_TEST_NO_DEFS #include "d3d12_crosstest.h" #include "shader_runner.h" +#include "dxcompiler.h"
struct d3d12_resource { @@ -49,6 +50,8 @@ struct d3d12_shader_runner ID3D12CommandQueue *compute_queue; ID3D12CommandAllocator *compute_allocator; ID3D12GraphicsCommandList *compute_list; + + IDxcCompiler3 *dxc_compiler; };
static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r) @@ -70,10 +73,19 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons [SHADER_MODEL_4_1] = "4_1", [SHADER_MODEL_5_0] = "5_0", [SHADER_MODEL_5_1] = "5_1", + [SHADER_MODEL_6_0] = "6_0", };
- sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); - hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); + if (runner->r.minimum_shader_model >= SHADER_MODEL_6_0) + { + assert(runner->dxc_compiler); + hr = dxc_compiler_compile_shader(runner->dxc_compiler, type, runner->r.compile_options, source, &blob, &errors); + } + else + { + sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->r.minimum_shader_model]); + hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, runner->r.compile_options, 0, &blob, &errors); + } ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob); if (errors) { @@ -84,6 +96,13 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons return blob; }
+static bool d3d12_runner_check_requirements(struct shader_runner *r) +{ + struct d3d12_shader_runner *runner = d3d12_shader_runner(r); + + return runner->r.maximum_shader_model >= runner->r.minimum_shader_model; +} + #define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params) @@ -311,7 +330,7 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig size_t i;
cs_code = compile_shader(runner, runner->r.cs_source, SHADER_TYPE_CS); - todo_if (runner->r.is_todo) ok(cs_code, "Failed to compile shader.\n"); + todo_if(runner->r.is_todo && runner->r.minimum_shader_model < SHADER_MODEL_6_0) ok(cs_code, "Failed to compile shader.\n"); if (!cs_code) return false;
@@ -319,8 +338,16 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig
cs.pShaderBytecode = ID3D10Blob_GetBufferPointer(cs_code); cs.BytecodeLength = ID3D10Blob_GetBufferSize(cs_code); + todo_if(runner->r.is_todo) pso = create_compute_pipeline_state(device, root_signature, cs); ID3D10Blob_Release(cs_code); + + if (!pso) + { + ID3D12RootSignature_Release(root_signature); + return false; + } + add_pso(test_context, pso);
ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, root_signature); @@ -387,7 +414,8 @@ static bool d3d12_runner_draw(struct shader_runner *r,
ps_code = compile_shader(runner, runner->r.ps_source, SHADER_TYPE_PS); vs_code = compile_shader(runner, runner->r.vs_source, SHADER_TYPE_VS); - todo_if (runner->r.is_todo) ok(ps_code && vs_code, "Failed to compile shaders.\n"); + todo_if(runner->r.is_todo && runner->r.minimum_shader_model < SHADER_MODEL_6_0) + ok(ps_code && vs_code, "Failed to compile shaders.\n");
if (!ps_code || !vs_code) { @@ -445,10 +473,14 @@ static bool d3d12_runner_draw(struct shader_runner *r,
hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc, &IID_ID3D12PipelineState, (void **)&pso); - ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr); + todo_if(runner->r.is_todo) ok(hr == S_OK, "Failed to create state, hr %#x.\n", hr); ID3D10Blob_Release(vs_code); ID3D10Blob_Release(ps_code); free(input_element_descs); + + if (FAILED(hr)) + return false; + add_pso(test_context, pso);
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, test_context->root_signature); @@ -542,6 +574,7 @@ static void d3d12_runner_release_readback(struct shader_runner *r, struct resour
static const struct shader_runner_ops d3d12_runner_ops = { + .check_requirements = d3d12_runner_check_requirements, .create_resource = d3d12_runner_create_resource, .destroy_resource = d3d12_runner_destroy_resource, .dispatch = d3d12_runner_dispatch, @@ -550,7 +583,8 @@ static const struct shader_runner_ops d3d12_runner_ops = .release_readback = d3d12_runner_release_readback, };
-void run_shader_tests_d3d12(void) +void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader_model, + enum shader_model maximum_shader_model) { static const struct test_context_desc desc = { @@ -569,6 +603,8 @@ void run_shader_tests_d3d12(void) return; device = runner.test_context.device;
+ runner.dxc_compiler = dxc_compiler; + runner.compute_queue = create_command_queue(device, D3D12_COMMAND_LIST_TYPE_COMPUTE, D3D12_COMMAND_QUEUE_PRIORITY_NORMAL);
@@ -580,7 +616,7 @@ void run_shader_tests_d3d12(void) runner.compute_allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&runner.compute_list); ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
- run_shader_tests(&runner.r, &d3d12_runner_ops); + run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, minimum_shader_model, maximum_shader_model);
ID3D12GraphicsCommandList_Release(runner.compute_list); ID3D12CommandAllocator_Release(runner.compute_allocator); diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index 0c6d37884..0b33c1c53 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -541,7 +541,7 @@ void run_shader_tests_d3d9(void)
init_adapter_info(); init_test_context(&runner); - run_shader_tests(&runner.r, &d3d9_runner_ops); + run_shader_tests(&runner.r, &d3d9_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_3_0); destroy_test_context(&runner); } FreeLibrary(d3d9_module); diff --git a/tests/shader_runner_vulkan.c b/tests/shader_runner_vulkan.c index 60c473a45..ebb15eba9 100644 --- a/tests/shader_runner_vulkan.c +++ b/tests/shader_runner_vulkan.c @@ -1381,7 +1381,7 @@ void run_shader_tests_vulkan(void) if (!init_vulkan_runner(&runner)) return;
- run_shader_tests(&runner.r, &vulkan_runner_ops); + run_shader_tests(&runner.r, &vulkan_runner_ops, NULL, SHADER_MODEL_2_0, SHADER_MODEL_5_1);
cleanup_vulkan_runner(&runner); }
Zebediah Figura (@zfigura) commented about tests/hlsl/abs.shader_test:
-[pixel shader] +[pixel shader fail(sm>=6)]
So this is apparently because sm6 doesn't let you put uniforms in the entry point parameter list anymore. Rather than marking it as fail, I'd just move the uniform to a global.
(We should keep at least one test for uniforms in parameter lists, but that would then be its dedicated purpose.)
It probably wouldn't hurt to make some of these compatibility tweaks their own commit, since this one is huge and hard to review, but I won't insist on it.
Zebediah Figura (@zfigura) commented about tests/hlsl/arithmetic-int.shader_test:
draw quad probe all rgba (0.0, 0.0, 0.0, 0.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] float4 main() : SV_TARGET
Ah, so sm6 doesn't forbid you from dividing by zero anymore. What do these return? Can we add a [test] section for cases like this? (I assume it's INF, but still.)
I wouldn't mind if it's a follow-up patch, but in cases like this the compilation is likely to be non-obvious, so I'd like to see it actually tested.
Zebediah Figura (@zfigura) commented about tests/hlsl/arithmetic-int.shader_test:
[require] shader model >= 4.0 +% dxcompiler performs this calculation on unsigned values and emits zero. +shader model < 6.0
This is fine for now, but it'd eventually probably be nice to be able to annotate probe directives in the same way.
Zebediah Figura (@zfigura) commented about tests/hlsl/array-dimension.shader_test:
% Test what kinds of expressions are valid array dimensions.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
Which declaration fails on sm6? Can we separate that part out to validate that the rest still work?
Zebediah Figura (@zfigura) commented about tests/hlsl/array-parameters.shader_test:
% Implicit size arrays are not allowed. -[pixel shader fail] +[pixel shader fail(sm<6)]
Oh wow, sm6 allows these? We should probably do tests at some point to see what the semantics are...
Zebediah Figura (@zfigura) commented about tests/hlsl/cbuffer.shader_test:
uniform 4 float4 4.0 5.0 6.0 7.0 uniform 8 float4 8.0 9.0 10.0 11.0 uniform 12 float4 12.0 13.0 14.0 15.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.0, 4.0, 5.0, 6.0)
-[pixel shader fail] +[pixel shader fail(sm<6)] // Elements cannot overlap if buffer is used.
Hrm, this I'd definitely like to see tests for. Do they alias? Can you assign to them, and do they alias in that case? (I think sm6 might forbid storing to uniforms, though; I think sm4 forbids it unless you have the backwards compatibility flag.)
Zebediah Figura (@zfigura) commented about tests/hlsl/combined-samplers.shader_test:
[require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)]
Do combined samplers work at all in sm6? If not we should just put it in the [require] section, I think.
(Also, we have fail(sm>=6) but also todo(sm>=6) for some of these...?)
Zebediah Figura (@zfigura) commented about tests/hlsl/duplicate-modifiers.shader_test:
+% Returns (0.1, 0.3, 0.2, 0.4) with dxcompiler +[require] +shader model < 6.0
Wow, I guess this is a dxcompiler bug.
I managed reduce it down to this minimal case:
float4 main() : sv_target { const row_major float2x2 mat = float2x2(1.0, 2.0, 3.0, 4.0); return mat; }
The bug really needs "const" or it doesn't manifest. It also doesn't manifest if you use a braced initializer instead of a constructor.
Also, even better, if you change "float2x2" to "float4" you get an ICE :D
Zebediah Figura (@zfigura) commented about tests/hlsl/function-cast.shader_test:
% As above, but cast "x" to float4 first.
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
Ah. I suspect that what's happening here is that a cast implicitly promotes the type to const. The actual error message is:
``` C:\local\Temp\2387cbc9-503b-47ce-a11f-204822c74f45.hlsl:12:5: error: no matching function for call to 'func' func((float4)x); ^~~~ C:\local\Temp\2387cbc9-503b-47ce-a11f-204822c74f45.hlsl:4:6: note: candidate function void func(out float4 o) ^ ```
You get the same error if you remove the cast and declare "x" as const. I think it's rejecting the function because "o" is an output parameter in that case.
Not that this particularly matters in terms of review, but I was curious what was causing that error. Maybe it could be marked in a comment.
Zebediah Figura (@zfigura) commented about tests/hlsl/intrinsic-override.shader_test:
-[pixel shader] +[pixel shader fail(sm>=6)]
float2 max(float2 a, float2 b)
So these fail because max(0.1, 0.2) is a float1 rather than a float2, but this doesn't say anything about whether the user-defined max() function is *ever* matched. It turns out that, surprisingly, it isn't, so it might be nice to rewrite the tests to show that explicitly.
Zebediah Figura (@zfigura) commented about tests/hlsl/function.shader_test:
% Recursion is forbidden.
-[pixel shader notimpl] +[pixel shader notimpl(sm<6) fail(sm>=6)]
Does dxcompiler ever return E_NOTIMPL? I wonder if we should just map E_NOTIMPL to E_FAIL in the backend and avoid the test diff.
Zebediah Figura (@zfigura) commented about tests/hlsl/object-parameters.shader_test:
shader model >= 5.0
-[pixel shader todo] +[pixel shader todo fail(sm>=6)]
This has a [require] but also fail(); should we just get rid of the latter?
Zebediah Figura (@zfigura) commented about tests/hlsl/side-effects.shader_test:
probe all rgba (11.0, 11.0, 11.0, 11.0)
+% dxcompiler performs the first call to func() before the array index call. +[require] +shader model < 6.0
This is another case where we'll ideally want to (eventually) annotate the probe directive instead of skipping the test.
Zebediah Figura (@zfigura) commented about tests/hlsl/ternary.shader_test:
[test] uniform 0 float4 1.0 0.0 0.0 0.0 -draw quad +todo(sm>=6) draw quad probe all rgba (0.5, 0.6, 0.7, 0.0)
-[pixel shader] +[pixel shader fail(sm>=6)]
This one doesn't seem to fail with sm6, at least not when I run it directly through dxc...?
Zebediah Figura (@zfigura) commented about tests/hlsl/texture-load-typed.shader_test:
4294967295 123
-[pixel shader] +[pixel shader fail(sm>=6)]
This is only because sm6 doesn't handle texture2D with a lowercase 't', so I think we should separate that into its own block and let the rest of the test remain valid.
Zebediah Figura (@zfigura) commented about tests/hlsl/texture-ordering.shader_test:
[require] options: backcompat
-[pixel shader] +[pixel shader fail(sm>=6)]
This file is mostly about testing tex2D() [I think?], which simply isn't supported for sm6, so I'd just filter it out in the [require] section.
Zebediah Figura (@zfigura) commented about tests/hlsl/type-names.shader_test:
-[pixel shader] +[pixel shader fail(sm>=6)]
Copying down a list of differences here for posterity:
* "float" is apparently now a keyword, or at least, it can't be used as a variable/type identifier anymore. * "dword" is still a built-in typedef (to "float" I assume but haven't verified) but it is now case-sensitive * "matrix" and "vector" still exist but are also case sensitive * "matrix" and "vector" are no longer keywords; they can be redefined but not in global scope
Zebediah Figura (@zfigura) commented about tests/dxcompiler.idl:
- modify it under the terms of the GNU Lesser General Public
- License as published by the Free Software Foundation; either
- version 2.1 of the License, or (at your option) any later version.
- This library is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- Lesser General Public License for more details.
- You should have received a copy of the GNU Lesser General Public
- License along with this library; if not, write to the Free Software
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
- */
+import "vkd3d_windows.h"; +#include "vkd3d_unknown.idl"
#include, not import?
Zebediah Figura (@zfigura) commented about tests/dxcompiler.idl:
+/* The linux build of dxcompiler does not apply the ms_abi calling convention to its COM interfaces,
- so they default to sysv_abi. The '__stdcall' macro is set in vkd3d_windows.h to ms_abi, and widl
- emits STDMETHODCALLTYPE for COM interfaces, so '__stdcall' must be temporarily undefined. Doing
- this in a PE build (x86 or x64) is unnecessary since the default calling convention is identical.
- A 32-bit linux release of dxcompiler is not available.
- TODO: modily widl to optionally omit STDMETHODCALLTYPE? */
+cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)") +cpp_quote("# pragma push_macro("__stdcall")") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif")
+static const HRESULT DXC_E_LLVM_CAST_ERROR = 0x80aa001d;
+cpp_quote("DEFINE_GUID(CLSID_DxcCompiler, 0x73e22d93, 0xe6ce, 0x47f3, 0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0);")
This is an IDL, so we can do this with a "coclass" block.
Zebediah Figura (@zfigura) commented about tests/dxcompiler.idl:
- TODO: modily widl to optionally omit STDMETHODCALLTYPE? */
+cpp_quote("#if defined(__x86_64__) && !defined(_WIN32)") +cpp_quote("# pragma push_macro("__stdcall")") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif")
+static const HRESULT DXC_E_LLVM_CAST_ERROR = 0x80aa001d;
+cpp_quote("DEFINE_GUID(CLSID_DxcCompiler, 0x73e22d93, 0xe6ce, 0x47f3, 0xb5, 0xbf, 0xf0, 0x66, 0x4f, 0x39, 0xc1, 0xb0);")
+[
- uuid(8ba5fb08-5195-40e2-ac58-0d989c3a0102),
- object,
- local,
- pointer_default(unique)
Not really important, but pointer_default(unique) is already the default, and also meaningless for local interfaces.
Zebediah Figura (@zfigura) commented about tests/shader_runner_d3d12.c:
return blob;
}
+static bool d3d12_runner_check_requirements(struct shader_runner *r) +{
- struct d3d12_shader_runner *runner = d3d12_shader_runner(r);
- return runner->r.maximum_shader_model >= runner->r.minimum_shader_model;
I see what this check is trying to accomplish, but I'm not much of a fan of the way it's written, and I especially don't like that it's not in common code.
Zebediah Figura (@zfigura) commented about Makefile.am:
tests_d3d12_invalid_usage_LDADD = $(LDADD) @DL_LIBS@ tests_hlsl_d3d12_LDADD = $(LDADD) @DL_LIBS@ tests_shader_runner_LDADD = $(LDADD) @DL_LIBS@ +tests_shader_runner_CFLAGS = $(AM_CFLAGS) -I$(builddir)/tests tests_shader_runner_SOURCES = \
- tests/dxcompiler.idl \
I don't think IDLs should go in _SOURCES unless we're going to define an implicit rule for them? At least it doesn't make sense for them to be in a specific _SOURCES *and* BUILT_SOURCES.
Zebediah Figura (@zfigura) commented about tests/shader_runner.c:
-static void compile_shader(struct shader_runner *runner, const char *source, size_t len, const char *type, HRESULT expect) +const char *shader_type_string(enum shader_type type) +{
- static const char *const shader_types[] =
- {
[SHADER_TYPE_CS] = "cs",
[SHADER_TYPE_PS] = "ps",
[SHADER_TYPE_VS] = "vs",
- };
- assert(type < ARRAY_SIZE(shader_types));
- return shader_types[type];
+}
+static void compile_shader(struct shader_runner *runner, const char *source, size_t len, enum shader_type type,
HRESULT expect)
Why do we need this change? Doesn't sm6 use the same shader type prefixes?