This goes on top of MR 320.
-- v11: tests/shader-runner: Add a '--dump-dxil' command line switch. tests/shader-runner: Test shaders with dxcompiler. tests/shader-runner: Do not apply todo to result probes. tests/shader-runner: Replace immediate shader type strings with an enum. tests/shader-runner: Do not exit if a 'require' directive is not met. tests/shader-runner: Handle individual keywords in shader directives. vkd3d-shader/dxil: Convert into an error the warning for an unhandled instrinsic. vkd3d-shader/dxil: Do not compile compute shaders. vkd3d-shader/dxil: Do not access null code blocks on failure.
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/dxil.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index e3a04f26..85608d43 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2522,11 +2522,11 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const struct sm6_function *function) { struct vkd3d_shader_instruction *ins; + size_t i, block_idx, block_count; const struct dxil_record *record; bool ret_found, is_terminator; struct sm6_block *code_block; struct sm6_value *dst; - size_t i, block_idx;
if (sm6->function_count) { @@ -2552,12 +2552,12 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const return VKD3D_ERROR_INVALID_SHADER; }
- if (!(function->block_count = block->records[0]->operands[0])) + if (!(block_count = block->records[0]->operands[0])) { WARN("Function contains no blocks.\n"); return VKD3D_ERROR_INVALID_SHADER; } - if (function->block_count > 1) + if (block_count > 1) { FIXME("Branched shaders are not supported yet.\n"); return VKD3D_ERROR_INVALID_SHADER; @@ -2568,6 +2568,7 @@ static enum vkd3d_result sm6_parser_function_init(struct sm6_parser *sm6, const ERR("Failed to allocate code block.\n"); return VKD3D_ERROR_OUT_OF_MEMORY; } + function->block_count = block_count; code_block = function->blocks[0];
sm6->cur_max_value = function->value_count;
From: Conor McCarthy cmccarthy@codeweavers.com
The thread group size is not yet emitted. --- libs/vkd3d-shader/dxil.c | 5 +++++ 1 file changed, 5 insertions(+)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 85608d43..56746f3d 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2865,6 +2865,11 @@ static enum vkd3d_result sm6_parser_init(struct sm6_parser *sm6, const uint32_t vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_SHADER_TYPE, "Unknown shader type %#x.", version.type); } + if (version.type == VKD3D_SHADER_TYPE_COMPUTE) + { + FIXME("Compute shader compilation is not implemented yet.\n"); + return VKD3D_ERROR_INVALID_SHADER; + }
version.major = VKD3D_SM6_VERSION_MAJOR(version_token); version.minor = VKD3D_SM6_VERSION_MINOR(version_token);
From: Conor McCarthy cmccarthy@codeweavers.com
--- libs/vkd3d-shader/dxil.c | 2 +- libs/vkd3d-shader/vkd3d_shader_private.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/libs/vkd3d-shader/dxil.c b/libs/vkd3d-shader/dxil.c index 56746f3d..c5586d70 100644 --- a/libs/vkd3d-shader/dxil.c +++ b/libs/vkd3d-shader/dxil.c @@ -2407,7 +2407,7 @@ static void sm6_parser_decode_dx_op(struct sm6_parser *sm6, struct sm6_block *co if (op >= ARRAY_SIZE(sm6_dx_op_table) || !sm6_dx_op_table[op].operand_info) { FIXME("Unhandled dx intrinsic function id %u, '%s'.\n", op, name); - vkd3d_shader_parser_warning(&sm6->p, VKD3D_SHADER_WARNING_DXIL_UNHANDLED_INTRINSIC, + vkd3d_shader_parser_error(&sm6->p, VKD3D_SHADER_ERROR_DXIL_UNHANDLED_INTRINSIC, "Call to intrinsic function %s is unhandled.", name); sm6_parser_emit_unhandled(sm6, ins, dst); return; diff --git a/libs/vkd3d-shader/vkd3d_shader_private.h b/libs/vkd3d-shader/vkd3d_shader_private.h index 6bc5f6d1..999b9d10 100644 --- a/libs/vkd3d-shader/vkd3d_shader_private.h +++ b/libs/vkd3d-shader/vkd3d_shader_private.h @@ -175,13 +175,13 @@ enum vkd3d_shader_error VKD3D_SHADER_ERROR_DXIL_INVALID_TYPE_ID = 8010, VKD3D_SHADER_ERROR_DXIL_INVALID_MODULE = 8011, VKD3D_SHADER_ERROR_DXIL_INVALID_OPERAND = 8012, + VKD3D_SHADER_ERROR_DXIL_UNHANDLED_INTRINSIC = 8013,
VKD3D_SHADER_WARNING_DXIL_UNKNOWN_MAGIC_NUMBER = 8300, VKD3D_SHADER_WARNING_DXIL_UNKNOWN_SHADER_TYPE = 8301, VKD3D_SHADER_WARNING_DXIL_INVALID_BLOCK_LENGTH = 8302, VKD3D_SHADER_WARNING_DXIL_INVALID_MODULE_LENGTH = 8303, VKD3D_SHADER_WARNING_DXIL_IGNORING_OPERANDS = 8304, - VKD3D_SHADER_WARNING_DXIL_UNHANDLED_INTRINSIC = 8305,
VKD3D_SHADER_ERROR_VSIR_NOT_IMPLEMENTED = 9000, VKD3D_SHADER_ERROR_VSIR_INVALID_HANDLER = 9001,
From: Conor McCarthy cmccarthy@codeweavers.com
Matching all possible combinations of keywords becomes too complex if more keywords are added. --- tests/shader_runner.c | 129 +++++++++++++++++++++--------------------- 1 file changed, 65 insertions(+), 64 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 05edf5da..65011f86 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,11 +885,12 @@ 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;
- if (!ret || line[0] == '[') + if (!ret || *line == '[') { switch (state) { @@ -953,63 +1006,25 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o break; }
- if (line[0] == '[') + if (*line == '[') { 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,9 +1133,9 @@ 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') + else if (*line != '%' && *line != '\n') { switch (state) {
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 65011f86..4f0c785b 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 4f0c785b..1312c44b 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 0844943d..6591143e 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 d620f1e2..925bdca9 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
Test shaders do not touch upon any unimplemented features in vkd3d-shader and/or vkd3d, and vkd3d-shader should not emit incorrect SPIR-V. If a situation arises where probes are expected to fail, a 'todo' in a 'probe' line should set a different bool flag to be applied to the readback check only. --- tests/hlsl/array-index-expr.shader_test | 16 ++++++++-------- tests/hlsl/combined-samplers.shader_test | 2 +- tests/hlsl/function-return.shader_test | 10 +++++----- tests/hlsl/matrix-indexing.shader_test | 2 +- tests/hlsl/object-parameters.shader_test | 6 +++--- tests/hlsl/object-references.shader_test | 2 +- tests/hlsl/return.shader_test | 10 +++++----- tests/hlsl/swizzle-matrix.shader_test | 4 ++-- tests/shader_runner.c | 4 ++-- 9 files changed, 28 insertions(+), 28 deletions(-)
diff --git a/tests/hlsl/array-index-expr.shader_test b/tests/hlsl/array-index-expr.shader_test index 0a83080c..705e0020 100644 --- a/tests/hlsl/array-index-expr.shader_test +++ b/tests/hlsl/array-index-expr.shader_test @@ -13,16 +13,16 @@ 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 0 0 0 0 todo draw quad -todo probe all rgba (1.0, 2.0, 3.0, 4.0) +probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 12 float4 1 0 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 12 float4 0 1 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 12 float4 1 1 0 0 todo draw quad -todo probe all rgba (9.0, 10.0, 11.0, 12.0) +probe all rgba (9.0, 10.0, 11.0, 12.0)
[pixel shader] @@ -87,13 +87,13 @@ float4 main() : sv_target [test] uniform 0 float4 0 0 0 0 todo draw quad -todo probe all rgba (1.0, 2.0, 3.0, 4.0) +probe all rgba (1.0, 2.0, 3.0, 4.0) uniform 0 float4 1 0 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 0 float4 0 1 0 0 todo draw quad -todo probe all rgba (5.0, 6.0, 7.0, 8.0) +probe all rgba (5.0, 6.0, 7.0, 8.0) uniform 0 float4 1 1 0 0 todo draw quad -todo probe all rgba (9.0, 10.0, 11.0, 12.0) +probe all rgba (9.0, 10.0, 11.0, 12.0) diff --git a/tests/hlsl/combined-samplers.shader_test b/tests/hlsl/combined-samplers.shader_test index 465c11cb..f9528640 100644 --- a/tests/hlsl/combined-samplers.shader_test +++ b/tests/hlsl/combined-samplers.shader_test @@ -152,4 +152,4 @@ float4 main() : sv_target
[test] todo draw quad -todo probe all rgba (10, 10, 10, 11) +probe all rgba (10, 10, 10, 11) diff --git a/tests/hlsl/function-return.shader_test b/tests/hlsl/function-return.shader_test index cbd29749..cd996c6a 100644 --- a/tests/hlsl/function-return.shader_test +++ b/tests/hlsl/function-return.shader_test @@ -296,20 +296,20 @@ uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.1 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.3, 0.2, 0.6, 0.6) 1 +probe all rgba (0.3, 0.2, 0.6, 0.6) 1
uniform 4 float4 0.35 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.3, 0.3, 0.6, 0.6) 1 +probe all rgba (0.3, 0.3, 0.6, 0.6) 1
uniform 8 float4 0.5 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.3, 0.5, 0.6, 0.6) 1 +probe all rgba (0.3, 0.5, 0.6, 0.6) 1
uniform 0 float4 1.0 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.3, 0.5, 0.6, 0.6) 1 +probe all rgba (0.3, 0.5, 0.6, 0.6) 1
uniform 4 float4 2.0 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.4, 0.1, 0.6, 0.6) 1 +probe all rgba (0.4, 0.1, 0.6, 0.6) 1 diff --git a/tests/hlsl/matrix-indexing.shader_test b/tests/hlsl/matrix-indexing.shader_test index a57d8fb8..7a56c085 100644 --- a/tests/hlsl/matrix-indexing.shader_test +++ b/tests/hlsl/matrix-indexing.shader_test @@ -137,4 +137,4 @@ float4 main() : sv_target [test] uniform 0 float 3 todo draw quad -todo probe all rgba (12, 13, 14, 15) +probe all rgba (12, 13, 14, 15) diff --git a/tests/hlsl/object-parameters.shader_test b/tests/hlsl/object-parameters.shader_test index c6109aef..a469542c 100644 --- a/tests/hlsl/object-parameters.shader_test +++ b/tests/hlsl/object-parameters.shader_test @@ -110,7 +110,7 @@ float4 main(struct apple input) : sv_target
[test] todo draw quad -todo probe all rgba (416.0, 416.0, 416.0, 111.0) +probe all rgba (416.0, 416.0, 416.0, 111.0)
[pixel shader todo] @@ -133,7 +133,7 @@ float4 main(struct apple input, sampler samp) : sv_target
[test] todo draw quad -todo probe all rgba (1.0, 1.0, 0.5, 0.5) +probe all rgba (1.0, 1.0, 0.5, 0.5)
[sampler 0] @@ -179,4 +179,4 @@ float4 main(struct apple input, sampler samp) : sv_target
[test] todo draw quad -todo probe all rgba (0.5, 1.0, 0.5, 1.0) +probe all rgba (0.5, 1.0, 0.5, 1.0) diff --git a/tests/hlsl/object-references.shader_test b/tests/hlsl/object-references.shader_test index 5ed4dcd6..8e3d71c4 100644 --- a/tests/hlsl/object-references.shader_test +++ b/tests/hlsl/object-references.shader_test @@ -237,4 +237,4 @@ float4 main(struct apple input) : sv_target
[test] todo draw quad -todo probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) +probe (0, 0) rgba (1.0, 2.0, 3.0, 4.0) diff --git a/tests/hlsl/return.shader_test b/tests/hlsl/return.shader_test index 9f800d1a..81c436cd 100644 --- a/tests/hlsl/return.shader_test +++ b/tests/hlsl/return.shader_test @@ -244,20 +244,20 @@ uniform 0 float4 0.3 0.0 0.0 0.0 uniform 4 float4 0.0 0.0 0.0 0.0 uniform 8 float4 0.1 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.1, 0.1, 0.1, 0.1) 1 +probe all rgba (0.1, 0.1, 0.1, 0.1) 1
uniform 4 float4 0.35 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.2, 0.2, 0.2, 0.2) 1 +probe all rgba (0.2, 0.2, 0.2, 0.2) 1
uniform 8 float4 0.5 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.4, 0.4, 0.4, 0.4) 1 +probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 0 float4 1.0 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.4, 0.4, 0.4, 0.4) 1 +probe all rgba (0.4, 0.4, 0.4, 0.4) 1
uniform 4 float4 2.0 0.0 0.0 0.0 todo draw quad -todo probe all rgba (0.9, 0.9, 0.9, 0.9) 1 +probe all rgba (0.9, 0.9, 0.9, 0.9) 1 diff --git a/tests/hlsl/swizzle-matrix.shader_test b/tests/hlsl/swizzle-matrix.shader_test index bc2814eb..82112858 100644 --- a/tests/hlsl/swizzle-matrix.shader_test +++ b/tests/hlsl/swizzle-matrix.shader_test @@ -170,7 +170,7 @@ float4 main() : sv_target [test] uniform 0 float4 20 30 40 -1 todo draw quad -todo probe all rgba (10.0, 20.0, 30.0, 40.0) +probe all rgba (10.0, 20.0, 30.0, 40.0)
[pixel shader todo] @@ -188,7 +188,7 @@ float4 main() : sv_target [test] uniform 0 float4 20 30 80 -1 todo draw quad -todo probe all rgba (80.0, 30.0, 20.0, 10.0) +probe all rgba (80.0, 30.0, 20.0, 10.0)
% Cannot repeat components when assigning to a swizzle. diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 1312c44b..7d73094b 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -663,7 +663,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 5) ulps = 0; - todo_if(runner->is_todo) check_readback_data_vec4(rb, &rect, &v, ulps); + check_readback_data_vec4(rb, &rect, &v, ulps); } else if (match_string(line, "r", &line)) { @@ -674,7 +674,7 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) fatal_error("Malformed probe arguments '%s'.\n", line); if (ret < 2) ulps = 0; - todo_if(runner->is_todo) check_readback_data_float(rb, &rect, expect, ulps); + check_readback_data_float(rb, &rect, expect, ulps); } else {
From: Conor McCarthy cmccarthy@codeweavers.com
The location of dxcompiler should be set 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 | 9 + tests/dxcompiler.idl | 160 +++++++++++++++ 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 | 10 +- 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 | 5 + 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 | 52 +++-- 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 | 12 +- 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 | 13 +- 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 | 4 + 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 | 192 ++++++++++++++++-- tests/shader_runner.h | 11 +- tests/shader_runner_d3d11.c | 2 +- tests/shader_runner_d3d12.c | 40 +++- tests/shader_runner_d3d9.c | 2 +- tests/shader_runner_vulkan.c | 2 +- 130 files changed, 938 insertions(+), 516 deletions(-) create mode 100644 tests/dxcompiler.idl
diff --git a/Makefile.am b/Makefile.am index 744e4612..cab9345f 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 cb9d6615..11898701 100644 --- a/README +++ b/README @@ -83,6 +83,15 @@ commas or semicolons.
* VKD3D_TEST_BUG - set to 0 to disable bug_if() conditions in tests.
+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/tests/dxcompiler.idl b/tests/dxcompiler.idl new file mode 100644 index 00000000..19ef2494 --- /dev/null +++ b/tests/dxcompiler.idl @@ -0,0 +1,160 @@ +/* + * 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" + +/* Strip __attribute__((ms_abi)) defined in vkd3d_windows.h as dxcompiler does not use it. */ +cpp_quote("#ifdef __x86_64__") +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); diff --git a/tests/hlsl/abs.shader_test b/tests/hlsl/abs.shader_test index 6fa6d1ca..14b444d1 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 7bdb0dc8..564cc5b0 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 f2298d3a..9b8b922c 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 f022ac79..8aaca621 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 73bd627c..71835082 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 b2bf720f..726a191a 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 c9702209..6a84574b 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 f1801b9c..8b9c2bc9 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 4e8bc12f..4bdf5f01 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 705e0020..d17f8925 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 6e866ceb..28a3c599 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 1fd4e262..55af741d 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 9c0d9373..04e2e1a5 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 633a543a..fdef0915 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 cb6c2b5e..fd9c087a 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 09ca12e2..dc75ea37 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 bcbd9f9b..d8df96a2 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 da55628b..8ad21d12 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 4a25f6dd..bb1c26fe 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 f0910020..4e786f59 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 81d6bc5d..6e391699 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 fe8c79a3..53cf99f7 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 93862a36..b25e682f 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 83397c18..bd814bef 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 1320c3dd..1edd4c0c 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 f9859e1b..d7473c99 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 f9528640..67c7c151 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 6d2f698c..2f2af9fc 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 b3b18dc1..0e4bfe94 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 ed5899f6..17427c38 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 101db607..2ed721d9 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 e31ef61c..08e7dbf7 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 4986c233..ba7215ca 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 f543f877..b52894ea 100644 --- a/tests/hlsl/discard.shader_test +++ b/tests/hlsl/discard.shader_test @@ -1,3 +1,7 @@ +[require] +shader model < 6.0 + + [pixel shader] uniform float4 x;
diff --git a/tests/hlsl/distance.shader_test b/tests/hlsl/distance.shader_test index 3f544645..6527c218 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 15f120f7..bb71919c 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 6491701a..bf1d9c1b 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 32cd43c2..265b4f61 100644 --- a/tests/hlsl/entry-point-semantics.shader_test +++ b/tests/hlsl/entry-point-semantics.shader_test @@ -205,7 +205,7 @@ 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)
@@ -277,14 +277,14 @@ 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 1d188997..38f8750f 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 3dcc5727..1816c6eb 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 c111f98b..0ceb1d24 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 9eb69c3b..f56750fa 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 b6896981..3dd01d86 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 f54f3fe8..2ac9b530 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 e6a5a96b..5a8e2bd6 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 099f63f3..c5a30b16 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 cd996c6a..94a653bf 100644 --- a/tests/hlsl/function-return.shader_test +++ b/tests/hlsl/function-return.shader_test @@ -32,6 +32,11 @@ float4 main() : sv_target draw quad probe all rgba (0.2, 0.1, 0.8, 0.5);
+ +[require] +shader model < 6.0 + + [pixel shader]
uniform float f; diff --git a/tests/hlsl/function.shader_test b/tests/hlsl/function.shader_test index 0db0477e..ac531124 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 fail(sm>=6)]
void bar();
@@ -246,7 +246,7 @@ float4 main() : sv_target return 0; }
-[pixel shader notimpl] +[pixel shader notimpl 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 51e6a6b6..6360d1fc 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 28fd6f9a..9cfc2d59 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 4d781b32..01d12f87 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 38c8234c..ff3bc646 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 { @@ -24,6 +28,8 @@ float4 main() : sv_target draw quad probe all rgba (5.0, 6.0, 7.0, 8.0)
+[require] +
[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,67 @@ 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; }
+[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 d9c0bc91..514a7ceb 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 55a23f21..a88392a6 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 ad062652..815c8674 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 11447d26..162d4e63 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 f8ad40d8..2db62406 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 d5a708e2..8653942e 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 15e90cef..27c45fe7 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 cbfffb4e..ede927fc 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 0f64bd5d..9df2f01f 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 b0f405d1..2f7d5c7c 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 75a31f7a..2f70b1dc 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 808313e7..f7baa90b 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 4ab385a5..63e5d298 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 1460e9a0..fa62dd5f 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 6bd9656d..f4b07103 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 7a56c085..9e9ec3e0 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 b704dc1a..082c69c0 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 3a5c3125..d56d1cca 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 66ae93e1..b7aeec44 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 8f15be6e..86492e52 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 359a7590..0fe0dea3 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 7504f95a..dfdd7a53 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 404d7d76..fb11dc48 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 8afd9af7..d1741c3e 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 a469542c..9eb3c9a8 100644 --- a/tests/hlsl/object-parameters.shader_test +++ b/tests/hlsl/object-parameters.shader_test @@ -7,6 +7,10 @@ float4 main(out Texture2D tex : TEXTURE) : sv_target }
+[require] +shader model < 6.0 + + [pixel shader fail todo] struct params { @@ -23,7 +27,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 +93,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 +117,7 @@ todo draw quad 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 +161,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 8e3d71c4..ba8f9ce9 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 1bb3bd94..7eca556d 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 02488589..808b4b77 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 7e109eca..a587d191 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 1767748b..7070b28a 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 81c436cd..e5d71bee 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,12 +65,17 @@ 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)
+ +[require] +shader model < 6.0 + + [pixel shader]
uniform float f; diff --git a/tests/hlsl/round.shader_test b/tests/hlsl/round.shader_test index 5e40dc6d..f8cb7c9c 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 08e50696..e56945d0 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 c37da299..298037a7 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 ec7c7e2a..c91c6549 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 6f8357df..498a8ed3 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 c4b38b32..caff7b2f 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 41ccc62a..5928b2c4 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 584b88cf..271eb3bb 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 8e4557f0..f41e9851 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 7ed632db..c56d9082 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 63755b08..971f6d5d 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 78d89d38..73ecba89 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 26853bf4..7df3ae7c 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 8415d851..fefcd47f 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 e201e15f..b857f00b 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 00e7b836..b1eb1f1b 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 aff0a677..4097f383 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 357a3496..a0ec18e4 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 82112858..76f318a2 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 c3d3343f..ddfc09fc 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 91f49e0e..9bb94ec1 100644 --- a/tests/hlsl/ternary.shader_test +++ b/tests/hlsl/ternary.shader_test @@ -1,3 +1,7 @@ +[require] +shader model < 6.0 + + [pixel shader] uniform float4 x;
diff --git a/tests/hlsl/texture-load-offset.shader_test b/tests/hlsl/texture-load-offset.shader_test index 52b6a5f9..f32b2191 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 c9227337..f964463f 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 362e1d2e..8609828b 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 2291ddf8..00583f8a 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 f283c538..f52d01de 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 419608fb..6df4cce2 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 f382ffae..6e88fd28 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 fe6350e0..9088ffa0 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 f3134474..796c4bf1 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 1a7fcf1e..b476c785 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 5ea67329..904d1551 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 07c28cb8..bfa2b441 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 1125117f..86e3b83f 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 e5ffbdd0..3501f3af 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 1542d358..71a4ca26 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 374a38bb..fa8ecc2e 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 61993257..3bebcce6 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 7d73094b..26b16545 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -47,6 +47,9 @@ typedef int HRESULT; #endif
+/* Prevents a glitch in the ID3D10Blob_Release() macro when applied to an IDxcBlob. */ +#define WIDL_C_INLINE_WRAPPERS + #define COBJMACROS #define CONST_VTABLE #include "config.h" @@ -60,6 +63,8 @@ typedef int HRESULT; #include "vkd3d_d3dcompiler.h" #include "vkd3d_test.h" #include "shader_runner.h" +/* dxcompiler.h must strip the definition of __stdcall on x86_64, so include it last. */ +#include "dxcompiler.h"
struct test_options test_options = {0};
@@ -129,9 +134,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 +148,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; } } @@ -482,9 +499,17 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) int ret;
runner->is_todo = false; + runner->is_todo_pipeline = false;
if (match_string(line, "todo", &line)) + { + runner->is_todo = runner->minimum_shader_model < SHADER_MODEL_6_0; + runner->is_todo_pipeline = runner->minimum_shader_model >= SHADER_MODEL_6_0; + } + else if (match_string(line, "todo(sm<6)", &line) && runner->minimum_shader_model < SHADER_MODEL_6_0) runner->is_todo = true; + else if (match_string(line, "todo(sm>=6)", &line) && runner->minimum_shader_model >= SHADER_MODEL_6_0) + runner->is_todo_pipeline = true;
if (match_string(line, "dispatch", &line)) { @@ -802,9 +827,105 @@ const char *shader_type_string(enum shader_type type) return shader_types[type]; }
+#ifdef _WIN32 +static const char dxcompiler_name[] = "dxcompiler.dll"; +#else +static const char dxcompiler_name[] = "libdxcompiler.so"; +#endif + +HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D10Blob **blob_out, + ID3D10Blob **errors_out) +{ + DxcBuffer src_buf = {hlsl, strlen(hlsl), 65001}; + DxcCreateInstanceProc create_instance; + IDxcCompiler3 *compiler; + HRESULT hr, compile_hr; + IDxcBlobUtf8 *errors; + IDxcResult *result; + IDxcBlob *blob; + void *dll; + + 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", + }; + + *blob_out = NULL; + *errors_out = NULL; + + if (!(dll = vkd3d_dlopen(dxcompiler_name))) + { + trace("Failed to load dxcompiler library, %s.\n", vkd3d_dlerror()); + return E_FAIL; + } + create_instance = (DxcCreateInstanceProc)vkd3d_dlsym(dll, "DxcCreateInstance"); + + if (!create_instance) + { + trace("Failed to get DxcCreateInstance() pointer.\n"); + return E_FAIL; + } + + if (FAILED(hr = create_instance(&CLSID_DxcCompiler, &IID_IDxcCompiler3, (void **)&compiler))) + { + trace("Failed to create instance, hr %#x.\n", hr); + return hr; + } + + if (FAILED(hr = IDxcCompiler3_Compile(compiler, &src_buf, args, ARRAY_SIZE(args), NULL, &IID_IDxcResult, (void **)&result))) + { + trace("Failed to compile shader, hr %#x.\n", hr); + goto compiler_release; + } + + if (IDxcResult_HasOutput(result, DXC_OUT_ERRORS) + && SUCCEEDED(hr = IDxcResult_GetOutput(result, DXC_OUT_ERRORS, &IID_IDxcBlobUtf8, (void **)&errors, NULL))) + { + if (IDxcBlobUtf8_GetStringLength(errors)) + *errors_out = (ID3D10Blob *)errors; + else + IDxcBlobUtf8_Release(errors); + } + + if (FAILED(hr = IDxcOperationResult_GetStatus((IDxcOperationResult *)result, &compile_hr)) + || FAILED((hr = compile_hr))) + { + if (hr == DXC_E_LLVM_CAST_ERROR) + hr = E_FAIL; + goto result_release; + } + + hr = IDxcResult_GetOutput(result, DXC_OUT_OBJECT, &IID_IDxcBlob, (void **)&blob, NULL); + IDxcResult_Release(result); + if (FAILED(hr)) + goto compiler_release; + + IDxcCompiler3_Release(compiler); + *blob_out = (ID3D10Blob *)blob; + return S_OK; + +result_release: + IDxcResult_Release(result); +compiler_release: + IDxcCompiler3_Release(compiler); + return hr; +} + static void compile_shader(struct shader_runner *runner, 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 +938,18 @@ 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) + { + hr = dxcompiler_compile_shader(type, 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) @@ -835,7 +964,11 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz if (errors) { if (vkd3d_test_state.debug_level) - trace("%s\n", (char *)ID3D10Blob_GetBufferPointer(errors)); + { + /* GetBufferPointer() on an IDxcBlob returns null for string blobs. */ + trace("%s\n", use_dxcompiler ? IDxcBlobUtf8_GetStringPointer((IDxcBlobUtf8*)errors) + : (char *)ID3D10Blob_GetBufferPointer(errors)); + } ID3D10Blob_Release(errors); } } @@ -845,8 +978,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 +994,20 @@ static enum parse_state read_shader_directive(struct shader_runner *runner, enum { *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, "fail(sm>=6)", &src)) + { + if (runner->minimum_shader_model >= SHADER_MODEL_6_0) + *expect_hr = E_FAIL; + } else if (match_directive_substring(src, "notimpl", &src)) { - *expect_hr = E_NOTIMPL; + if (runner->minimum_shader_model < SHADER_MODEL_6_0) + *expect_hr = E_NOTIMPL; } else { @@ -874,7 +1021,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, + 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 +1043,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 (;;) { @@ -1047,7 +1196,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 +1358,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; } @@ -1298,7 +1451,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(SHADER_MODEL_4_0, SHADER_MODEL_5_1);
print_dll_version("d3dcompiler_47.dll"); print_dll_version("dxgi.dll"); @@ -1315,7 +1468,14 @@ 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(SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (vkd3d_dlopen(dxcompiler_name)) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(SHADER_MODEL_6_0, SHADER_MODEL_6_0); + print_dll_version("dxcompiler.dll"); + }
print_dll_version("d3d9.dll"); print_dll_version("d3d11.dll"); @@ -1326,6 +1486,12 @@ 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(SHADER_MODEL_4_0, SHADER_MODEL_5_1); + + if (vkd3d_dlopen(dxcompiler_name)) + { + trace("Compiling shaders with dxcompiler and executing with vkd3d\n"); + run_shader_tests_d3d12(SHADER_MODEL_6_0, SHADER_MODEL_6_0); + } #endif } diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 6591143e..8c4d8c37 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 @@ -113,11 +114,14 @@ struct shader_runner const struct shader_runner_ops *ops;
bool is_todo; + /* Indicates shader conversion, and therefore pipeline creation, is expected to fail. */ + bool is_todo_pipeline;
char *vs_source; char *ps_source; char *cs_source; enum shader_model minimum_shader_model; + enum shader_model maximum_shader_model;
bool last_render_failed;
@@ -158,8 +162,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 dxcompiler_compile_shader(enum shader_type type, 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, + enum shader_model minimum_shader_model, enum shader_model maximum_shader_model);
#ifdef _WIN32 void run_shader_tests_d3d9(void); @@ -167,4 +174,4 @@ 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(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 25b585b1..1542ab02 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, 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 925bdca9..59458cff 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -23,6 +23,8 @@ #define VKD3D_TEST_NO_DEFS #include "d3d12_crosstest.h" #include "shader_runner.h" +/* dxcompiler.h must strip the definition of __stdcall on x86_64, so include it last. */ +#include "dxcompiler.h"
struct d3d12_resource { @@ -70,10 +72,18 @@ 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) + { + hr = dxcompiler_compile_shader(type, 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 +94,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 >= SHADER_MODEL_6_0; +} + #define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params) @@ -319,8 +336,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_pipeline) 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); @@ -445,10 +470,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_pipeline) 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 +571,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 +580,7 @@ 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(enum shader_model minimum_shader_model, enum shader_model maximum_shader_model) { static const struct test_context_desc desc = { @@ -580,7 +610,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, 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 0c6d3788..239afc7b 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, 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 60c473a4..b395c66a 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, SHADER_MODEL_2_0, SHADER_MODEL_5_1);
cleanup_vulkan_runner(&runner); }
From: Conor McCarthy cmccarthy@codeweavers.com
Dumps DXIL disassembly when shaders are compiled with dxcompiler. --- tests/shader_runner.c | 19 ++++++++++++++++++- tests/utils.h | 3 +++ 2 files changed, 21 insertions(+), 1 deletion(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 26b16545..7bdb2e22 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -838,9 +838,9 @@ HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D1 { DxcBuffer src_buf = {hlsl, strlen(hlsl), 65001}; DxcCreateInstanceProc create_instance; + IDxcBlobUtf8 *errors, *disassembly; IDxcCompiler3 *compiler; HRESULT hr, compile_hr; - IDxcBlobUtf8 *errors; IDxcResult *result; IDxcBlob *blob; void *dll; @@ -911,6 +911,23 @@ HRESULT dxcompiler_compile_shader(enum shader_type type, const char *hlsl, ID3D1 if (FAILED(hr)) goto compiler_release;
+ if (test_options.dump_dxil) + { + src_buf.Ptr = IDxcBlob_GetBufferPointer(blob); + src_buf.Size = IDxcBlob_GetBufferSize(blob); + src_buf.Encoding = 0; + + if (SUCCEEDED(hr = IDxcCompiler3_Disassemble(compiler, &src_buf, &IID_IDxcResult, (void **)&result))) + { + if (SUCCEEDED(hr = IDxcResult_GetOutput(result, DXC_OUT_DISASSEMBLY, &IID_IDxcBlobUtf8, (void **)&disassembly, NULL))) + { + trace("dxcompiler disassembly:\n%s\n", IDxcBlobUtf8_GetStringPointer(disassembly)); + IDxcBlobUtf8_Release(disassembly); + } + IDxcResult_Release(result); + } + } + IDxcCompiler3_Release(compiler); *blob_out = (ID3D10Blob *)blob; return S_OK; diff --git a/tests/utils.h b/tests/utils.h index 67094190..8de930bd 100644 --- a/tests/utils.h +++ b/tests/utils.h @@ -215,6 +215,7 @@ struct test_options bool enable_debug_layer; bool enable_gpu_based_validation; const char *filename; + bool dump_dxil; };
extern struct test_options test_options; @@ -233,6 +234,8 @@ static inline void parse_args(int argc, char **argv) test_options.enable_debug_layer = true; else if (!strcmp(argv[i], "--gbv")) test_options.enable_gpu_based_validation = true; + else if (!strcmp(argv[i], "--dump-dxil")) + test_options.dump_dxil = true; else if (argv[i][0] != '-') test_options.filename = argv[i]; }
I renamed `is_todo_6` to `is_todo_pipeline` to reflect that it has a different meaning than `is_todo`.
I added a new patch to remove the application of `is_todo` to result probes. The reasoning in explained in the commit.
dxcompiler sometimes emits a binary on failure. In some cases it reflects the erroneous HLSL, e.g. when `numthreads[(0, 1, 1)]` is used, but in others the binary does something else, e.g. when uniforms are used in the `main()` parameter list it loads them as signature inputs. The `IDxcResult` parent `IDxcOperationResult` interface contains a `GetStatus()` function which returns correct failure information.
Many shaders use uniform parameters, so these now have `fail(sm>=6)` tags. A later patch should probably move all of these uniforms out of the parameter list, and add a single test file to test uniform parameters in SM < 6. We don't need this yet as uniforms require loading of resource info and implementation of cbuffer loads.
This MR now depends on MR 345, mainly to make it unnecessary to have todos on result probes where DX intrinsics are unimplemented (i.e. where `emit_unhandled()` is called).
A test in `entry-point-semantics.shader_test` fails because it depends on the DXIL shader signature. We could skip it or wait for the next MR which will load signatures.
I suppose that's fine. I wonder though, does this need to be specific to DXIL? If this is useful, I don't think there's a reason we couldn't support dumping disassembly for shaders compiled by d3dcompiler or vkd3d-shader as well?
It's especially useful for DXIL because it's under development. Maybe that could apply to d3dbc too, but I don't think plumbing a shader dump for other binaries would be simple enough to be part of this MR.
Subject: [PATCH 7/9] tests/shader-runner: Do not apply todo to result probes. Test shaders do not touch upon any unimplemented features in vkd3d-shader and/or vkd3d, and vkd3d-shader should not emit incorrect SPIR-V. If a situation arises where probes are expected to fail, a 'todo' in a 'probe' line should set a different bool flag to be applied to the readback check only.
Removing the todo's is not wrong, but that commit message could have fooled me. What's actually happening is that since commit 26b89cc338c88e766d032f0ee3b6c9995dad02e8, probes are skipped when the corresponding draw fails; there's no point in probing after a failed draw, and if the render target contains uninitialised data it's just going to cause spurious failures. That means these todo's are now redundant.
I don't think that necessarily justifies removing the ability to set a todo on probes though.
+/* Strip __attribute__((ms_abi)) defined in vkd3d_windows.h as dxcompiler does not use it. */ +cpp_quote("#ifdef __x86_64__") +cpp_quote("# undef __stdcall") +cpp_quote("# define __stdcall") +cpp_quote("#endif")
Our actual issue is with STDMETHODCALLTYPE in the generated header, right? We could potentially use #pragma push_macro/pop_macro for this, although perhaps ideally widl would have a way to deal with this.
+/* Prevents a glitch in the ID3D10Blob_Release() macro when applied to an IDxcBlob. */ +#define WIDL_C_INLINE_WRAPPERS
Why is that? Is it because IDxcBlob has a different calling convention than ID3DBlob (we got rid of "ms_abi", after all), and the wrapper papers over the issue by causing the caller to put the blob pointer in the correct register?
@@ -482,9 +499,17 @@ static void parse_test_directive(struct shader_runner *runner, const char *line) int ret; runner->is_todo = false; + runner->is_todo_pipeline = false; if (match_string(line, "todo", &line)) + { + runner->is_todo = runner->minimum_shader_model < SHADER_MODEL_6_0; + runner->is_todo_pipeline = runner->minimum_shader_model >= SHADER_MODEL_6_0; + } + else if (match_string(line, "todo(sm<6)", &line) && runner->minimum_shader_model < SHADER_MODEL_6_0) runner->is_todo = true; + else if (match_string(line, "todo(sm>=6)", &line) && runner->minimum_shader_model >= SHADER_MODEL_6_0) + runner->is_todo_pipeline = true; if (match_string(line, "dispatch", &line)) {
I'm sorry, but it's still a mystery to me what this is trying to achieve. Why is the meaning of "todo" inverted for shader model 6.0+? Why do we need the separate "is_todo_pipeline" flag? Is this somehow related to not applying todo's to HLSL compilation when vkd3d-shader is not used for that? Couldn't we handle that with some minor adjustments to the corresponding "todo_if" conditions?
I suppose that's fine. I wonder though, does this need to be specific to DXIL? If this is useful, I don't think there's a reason we couldn't support dumping disassembly for shaders compiled by d3dcompiler or vkd3d-shader as well?
It's especially useful for DXIL because it's under development. Maybe that could apply to d3dbc too, but I don't think plumbing a shader dump for other binaries would be simple enough to be part of this MR.
Well, sure. You could even make an argument that "--dump-dxil" isn't all that critical to this MR either. It should largely just be a matter of calling D3DDisassemble() though. We don't have an implementation of that for vkd3d-utils yet, but we should, and we can largely just adopt the fairly straightforward implementation from Wine's d3dcompiler.