mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Pass D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY when compiling with the shader-runner.
This commit is contained in:
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
@ -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)
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
@ -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)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user