diff --git a/tests/hlsl/cast-64-bit.shader_test b/tests/hlsl/cast-64-bit.shader_test index eb320b0d..f2a0468b 100644 --- a/tests/hlsl/cast-64-bit.shader_test +++ b/tests/hlsl/cast-64-bit.shader_test @@ -1,5 +1,6 @@ [require] shader model >= 5.0 +float64 [pixel shader todo] uniform double2 d; diff --git a/tests/shader_runner.c b/tests/shader_runner.c index d592d2cd..4847ec75 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -191,6 +191,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li runner->compile_options |= options[i].option; } } + else if (match_string(line, "float64", &line)) + { + runner->require_float64 = true; + } else if (match_string(line, "int64", &line)) { runner->require_int64 = true; @@ -1315,6 +1319,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o state = STATE_REQUIRE; runner->minimum_shader_model = minimum_shader_model; runner->maximum_shader_model = maximum_shader_model; + runner->require_float64 = false; runner->require_int64 = false; runner->compile_options = 0; skip_tests = false; diff --git a/tests/shader_runner.h b/tests/shader_runner.h index 1caf4bbf..16343947 100644 --- a/tests/shader_runner.h +++ b/tests/shader_runner.h @@ -122,6 +122,7 @@ struct shader_runner char *fx_source; enum shader_model minimum_shader_model; enum shader_model maximum_shader_model; + bool require_float64; bool require_int64; bool last_render_failed; diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 857f3679..d6b80d9e 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -53,6 +53,7 @@ struct d3d12_shader_runner IDxcCompiler3 *dxc_compiler; + D3D12_FEATURE_DATA_D3D12_OPTIONS options; D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1; }; @@ -102,6 +103,9 @@ static bool d3d12_runner_check_requirements(struct shader_runner *r) { struct d3d12_shader_runner *runner = d3d12_shader_runner(r); + if (runner->r.require_float64 && !runner->options.DoublePrecisionFloatShaderOps) + return false; + if (runner->r.require_int64 && !runner->options1.Int64ShaderOps) return false; @@ -615,6 +619,11 @@ void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader runner.compute_allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&runner.compute_list); ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr); + hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_D3D12_OPTIONS, + &runner.options, sizeof(runner.options)); + ok(hr == S_OK, "Failed to check feature options support, hr %#x.\n", hr); + trace("DoublePrecisionFloatShaderOps: %u.\n", runner.options.DoublePrecisionFloatShaderOps); + hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_D3D12_OPTIONS1, &runner.options1, sizeof(runner.options1)); ok(hr == S_OK, "Failed to check feature options1 support, hr %#x.\n", hr);