tests: Use the vulkan runner to run SM1 compilation tests.

At the current moment this is a little odd because for SM1 [test]
directives are skipped, and the [shader] directives are not executed by
the shader_runner_vulkan.c:compile_shader() but by the general
shader_runner.c:compile_shader(). So in principle it is a little weird
that we go through the vulkan runner.

But fret not, because in the future we plan to make the parser agnostic
to the language of the tests, so we will get rid of the general
shader_runner.c:compile_shader() function and instead call a
runner->compile_shader() function, defined for each runner. Granted,
most of these may call a generic implementation that uses native
compiler in Windows, and vkd3d-shader on Linux, but it would be more
conceptually correct.
This commit is contained in:
Francisco Casas
2023-11-15 17:41:33 -03:00
committed by Alexandre Julliard
parent b92f6c448a
commit 1c73513425
Notes: Alexandre Julliard 2024-01-24 22:53:52 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/514
47 changed files with 313 additions and 307 deletions

View File

@@ -968,8 +968,13 @@ unsigned int get_vb_stride(const struct shader_runner *runner, unsigned int slot
return stride;
}
static HRESULT map_unidentified_hrs(HRESULT hr)
static HRESULT map_special_hrs(HRESULT hr)
{
if (hr == 0x88760b59)
{
trace("Mapping hr %#x (D3DXERR_INVALIDDATA) as %#x.\n", hr, E_FAIL);
return E_FAIL;
}
if (hr == 0x80010064)
{
trace("Mapping unidentified hr %#x as %#x.\n", hr, E_FAIL);
@@ -1116,8 +1121,8 @@ static void compile_shader(struct shader_runner *runner, IDxcCompiler3 *dxc_comp
static const char *const shader_models[] =
{
[SHADER_MODEL_2_0] = "4_0",
[SHADER_MODEL_3_0] = "4_0",
[SHADER_MODEL_2_0] = "2_0",
[SHADER_MODEL_3_0] = "3_0",
[SHADER_MODEL_4_0] = "4_0",
[SHADER_MODEL_4_1] = "4_1",
[SHADER_MODEL_5_0] = "5_0",
@@ -1146,7 +1151,7 @@ static void compile_shader(struct shader_runner *runner, IDxcCompiler3 *dxc_comp
sprintf(profile, "%s_%s", shader_type_string(type), shader_models[runner->minimum_shader_model]);
hr = D3DCompile(source, len, NULL, NULL, NULL, "main", profile, runner->compile_options, 0, &blob, &errors);
}
hr = map_unidentified_hrs(hr);
hr = map_special_hrs(hr);
ok(hr == expect, "Got unexpected hr %#x.\n", hr);
if (hr == S_OK)
{