tests/shader-runner: Introduce an 'int64' requirement directive.

This commit is contained in:
Conor McCarthy 2023-11-23 13:17:54 +10:00 committed by Alexandre Julliard
parent 0610867334
commit 95c48eb98e
Notes: Alexandre Julliard 2023-12-12 23:15:46 +01:00
Approved-by: Giovanni Mascellani (@giomasce)
Approved-by: Henri Verbeet (@hverbeet)
Approved-by: Alexandre Julliard (@julliard)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/489
4 changed files with 26 additions and 0 deletions

View File

@ -20,6 +20,7 @@ probe all rgba (-4.5, 8.5, 2.0, 2.0)
[require]
shader model >= 6.0
int64
[pixel shader]
uniform uint64_t2 l;

View File

@ -191,6 +191,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li
runner->compile_options |= options[i].option;
}
}
else if (match_string(line, "int64", &line))
{
runner->require_int64 = true;
}
else
{
fatal_error("Unknown require directive '%s'.\n", line);
@ -1311,6 +1315,7 @@ void run_shader_tests(struct shader_runner *runner, const struct shader_runner_o
state = STATE_REQUIRE;
runner->minimum_shader_model = minimum_shader_model;
runner->maximum_shader_model = maximum_shader_model;
runner->require_int64 = false;
runner->compile_options = 0;
skip_tests = false;
}

View File

@ -122,6 +122,7 @@ struct shader_runner
char *fx_source;
enum shader_model minimum_shader_model;
enum shader_model maximum_shader_model;
bool require_int64;
bool last_render_failed;

View File

@ -52,6 +52,8 @@ struct d3d12_shader_runner
ID3D12GraphicsCommandList *compute_list;
IDxcCompiler3 *dxc_compiler;
D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1;
};
static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r)
@ -96,6 +98,16 @@ static ID3D10Blob *compile_shader(const struct d3d12_shader_runner *runner, cons
return blob;
}
static bool d3d12_runner_check_requirements(struct shader_runner *r)
{
struct d3d12_shader_runner *runner = d3d12_shader_runner(r);
if (runner->r.require_int64 && !runner->options1.Int64ShaderOps)
return false;
return true;
}
#define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params)
@ -561,6 +573,7 @@ static void d3d12_runner_release_readback(struct shader_runner *r, struct resour
static const struct shader_runner_ops d3d12_runner_ops =
{
.check_requirements = d3d12_runner_check_requirements,
.create_resource = d3d12_runner_create_resource,
.destroy_resource = d3d12_runner_destroy_resource,
.dispatch = d3d12_runner_dispatch,
@ -602,6 +615,12 @@ void run_shader_tests_d3d12(void *dxc_compiler, enum shader_model minimum_shader
runner.compute_allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&runner.compute_list);
ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
hr = ID3D12Device_CheckFeatureSupport(device, D3D12_FEATURE_D3D12_OPTIONS1,
&runner.options1, sizeof(runner.options1));
ok(hr == S_OK, "Failed to check feature options1 support, hr %#x.\n", hr);
if (maximum_shader_model >= SHADER_MODEL_6_0)
trace("Int64ShaderOps: %u.\n", runner.options1.Int64ShaderOps);
run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, minimum_shader_model, maximum_shader_model);
ID3D12GraphicsCommandList_Release(runner.compute_list);