tests: Add test file syntax to specify compiler options.

Signed-off-by: Nikolay Sivov <nsivov@codeweavers.com>
This commit is contained in:
Nikolay Sivov
2023-07-13 07:41:14 +02:00
committed by Alexandre Julliard
parent bd3d4a6c06
commit 01faf6ad9e
Notes: Alexandre Julliard 2023-07-24 22:55:13 +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/261
6 changed files with 65 additions and 19 deletions

View File

@@ -58,9 +58,9 @@ static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r)
static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, const char *source, const char *type)
{
UINT flags = runner->r.compile_options | D3DCOMPILE_ENABLE_BACKWARDS_COMPATIBILITY;
ID3D10Blob *blob = NULL, *errors = NULL;
char profile[7];
UINT flags = 0;
HRESULT hr;
static const char *const shader_models[] =
@@ -73,7 +73,6 @@ 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, flags, 0, &blob, &errors);
ok(FAILED(hr) == !blob, "Got unexpected hr %#x, blob %p.\n", hr, blob);