Module: vkd3d Branch: master Commit: ab37b27a7d08a5a0fbc900e434fb540ec93d255b URL: https://gitlab.winehq.org/wine/vkd3d/-/commit/ab37b27a7d08a5a0fbc900e434fb54...
Author: Francisco Casas fcasas@codeweavers.com Date: Thu Jul 13 13:45:09 2023 -0400
tests: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when compiling with the shader-runner.
---
tests/shader_runner.c | 4 +++- tests/shader_runner_d3d11.c | 4 +++- tests/shader_runner_d3d12.c | 4 +++- tests/shader_runner_d3d9.c | 3 ++- 4 files changed, 11 insertions(+), 4 deletions(-)
diff --git a/tests/shader_runner.c b/tests/shader_runner.c index 89137355..8a4b7138 100644 --- a/tests/shader_runner.c +++ b/tests/shader_runner.c @@ -753,6 +753,7 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; + UINT flags = 0; HRESULT hr;
static const char *const shader_models[] = @@ -765,8 +766,9 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz [SHADER_MODEL_5_1] = "5_1", };
+ flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; sprintf(profile, "%s_%s", type, shader_models[runner->minimum_shader_model]); - hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, 0, 0, &blob, &errors); + hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, flags, 0, &blob, &errors); hr = map_unidentified_hrs(hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr); if (hr == S_OK) diff --git a/tests/shader_runner_d3d11.c b/tests/shader_runner_d3d11.c index 3907e785..a5e0b92b 100644 --- a/tests/shader_runner_d3d11.c +++ b/tests/shader_runner_d3d11.c @@ -76,6 +76,7 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; + UINT flags = 0; HRESULT hr;
static const char *const shader_models[] = @@ -88,8 +89,9 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha [SHADER_MODEL_5_1] = "5_1", };
+ flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; sprintf(profile, "%s_%s", type, shader_models[shader_model]); - hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, 0, 0, &blob, &errors); + hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, flags, 0, &blob, &errors); ok(hr == S_OK, "Failed to compile shader, hr %#lx.\n", hr); if (errors) { diff --git a/tests/shader_runner_d3d12.c b/tests/shader_runner_d3d12.c index 6765c5ce..d95851ba 100644 --- a/tests/shader_runner_d3d12.c +++ b/tests/shader_runner_d3d12.c @@ -60,6 +60,7 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; + UINT flags = 0; HRESULT hr;
static const char *const shader_models[] = @@ -72,8 +73,9 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons [SHADER_MODEL_5_1] = "5_1", };
+ flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY; sprintf(profile, "%s_%s", type, shader_models[runner->r.minimum_shader_model]); - hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, 0, 0, &blob, &errors); + hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, flags, 0, &blob, &errors); ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob); if (errors) { diff --git a/tests/shader_runner_d3d9.c b/tests/shader_runner_d3d9.c index 15a5ab3e..4245c6e3 100644 --- a/tests/shader_runner_d3d9.c +++ b/tests/shader_runner_d3d9.c @@ -60,6 +60,7 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha { ID3D10Blob *blob = NULL, *errors = NULL; char profile[7]; + UINT flags = 0; HRESULT hr;
static const char *const shader_models[] = @@ -69,7 +70,7 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha };
sprintf(profile, "%s_%s", type, shader_models[shader_model]); - hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, 0, 0, &blob, &errors); + hr = D3DCompile(source, strlen(source), NULL, NULL, NULL, "main", profile, flags, 0, &blob, &errors); ok(hr == S_OK, "Failed to compile shader, hr %#lx.\n", hr); if (errors) {