tests: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when compiling with the shader-runner.

This commit is contained in:
Francisco Casas 2023-07-13 13:45:09 -04:00 committed by Alexandre Julliard
parent c58d666d1b
commit ab37b27a7d
Notes: Alexandre Julliard 2023-07-17 23:25:21 +02:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Zebediah Figura (@zfigura)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/209
4 changed files with 11 additions and 4 deletions

View File

@ -753,6 +753,7 @@ static void compile_shader(struct shader_runner *runner, const char *source, siz
{ {
ID3D10Blob *blob = NULL, *errors = NULL; ID3D10Blob *blob = NULL, *errors = NULL;
char profile[7]; char profile[7];
UINT flags = 0;
HRESULT hr; HRESULT hr;
static const char *const shader_models[] = 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", [SHADER_MODEL_5_1] = "5_1",
}; };
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
sprintf(profile, "%s_%s", type, shader_models[runner->minimum_shader_model]); 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); hr = map_unidentified_hrs(hr);
ok(hr == expect, "Got unexpected hr %#x.\n", hr); ok(hr == expect, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK) if (hr == S_OK)

View File

@ -76,6 +76,7 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha
{ {
ID3D10Blob *blob = NULL, *errors = NULL; ID3D10Blob *blob = NULL, *errors = NULL;
char profile[7]; char profile[7];
UINT flags = 0;
HRESULT hr; HRESULT hr;
static const char *const shader_models[] = 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", [SHADER_MODEL_5_1] = "5_1",
}; };
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
sprintf(profile, "%s_%s", type, shader_models[shader_model]); 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); ok(hr == S_OK, "Failed to compile shader, hr %#lx.\n", hr);
if (errors) if (errors)
{ {

View File

@ -60,6 +60,7 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons
{ {
ID3D10Blob *blob = NULL, *errors = NULL; ID3D10Blob *blob = NULL, *errors = NULL;
char profile[7]; char profile[7];
UINT flags = 0;
HRESULT hr; HRESULT hr;
static const char *const shader_models[] = 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", [SHADER_MODEL_5_1] = "5_1",
}; };
flags |= D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
sprintf(profile, "%s_%s", type, shader_models[runner->r.minimum_shader_model]); 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); ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob);
if (errors) if (errors)
{ {

View File

@ -60,6 +60,7 @@ static ID3D10Blob *compile_shader(const char *source, const char *type, enum sha
{ {
ID3D10Blob *blob = NULL, *errors = NULL; ID3D10Blob *blob = NULL, *errors = NULL;
char profile[7]; char profile[7];
UINT flags = 0;
HRESULT hr; HRESULT hr;
static const char *const shader_models[] = 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]); 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); ok(hr == S_OK, "Failed to compile shader, hr %#lx.\n", hr);
if (errors) if (errors)
{ {