mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests/shader-runner: Introduce an 'int64' requirement directive.
This commit is contained in:
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
@ -20,6 +20,7 @@ probe all rgba (-4.5, 8.5, 2.0, 2.0)
|
|||||||
|
|
||||||
[require]
|
[require]
|
||||||
shader model >= 6.0
|
shader model >= 6.0
|
||||||
|
int64
|
||||||
|
|
||||||
[pixel shader]
|
[pixel shader]
|
||||||
uniform uint64_t2 l;
|
uniform uint64_t2 l;
|
||||||
|
@ -191,6 +191,10 @@ static void parse_require_directive(struct shader_runner *runner, const char *li
|
|||||||
runner->compile_options |= options[i].option;
|
runner->compile_options |= options[i].option;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (match_string(line, "int64", &line))
|
||||||
|
{
|
||||||
|
runner->require_int64 = true;
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
fatal_error("Unknown require directive '%s'.\n", line);
|
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;
|
state = STATE_REQUIRE;
|
||||||
runner->minimum_shader_model = minimum_shader_model;
|
runner->minimum_shader_model = minimum_shader_model;
|
||||||
runner->maximum_shader_model = maximum_shader_model;
|
runner->maximum_shader_model = maximum_shader_model;
|
||||||
|
runner->require_int64 = false;
|
||||||
runner->compile_options = 0;
|
runner->compile_options = 0;
|
||||||
skip_tests = false;
|
skip_tests = false;
|
||||||
}
|
}
|
||||||
|
@ -122,6 +122,7 @@ struct shader_runner
|
|||||||
char *fx_source;
|
char *fx_source;
|
||||||
enum shader_model minimum_shader_model;
|
enum shader_model minimum_shader_model;
|
||||||
enum shader_model maximum_shader_model;
|
enum shader_model maximum_shader_model;
|
||||||
|
bool require_int64;
|
||||||
|
|
||||||
bool last_render_failed;
|
bool last_render_failed;
|
||||||
|
|
||||||
|
@ -52,6 +52,8 @@ struct d3d12_shader_runner
|
|||||||
ID3D12GraphicsCommandList *compute_list;
|
ID3D12GraphicsCommandList *compute_list;
|
||||||
|
|
||||||
IDxcCompiler3 *dxc_compiler;
|
IDxcCompiler3 *dxc_compiler;
|
||||||
|
|
||||||
|
D3D12_FEATURE_DATA_D3D12_OPTIONS1 options1;
|
||||||
};
|
};
|
||||||
|
|
||||||
static struct d3d12_shader_runner *d3d12_shader_runner(struct shader_runner *r)
|
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;
|
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)
|
#define MAX_RESOURCE_DESCRIPTORS (MAX_RESOURCES * 2)
|
||||||
|
|
||||||
static struct resource *d3d12_runner_create_resource(struct shader_runner *r, const struct resource_params *params)
|
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 =
|
static const struct shader_runner_ops d3d12_runner_ops =
|
||||||
{
|
{
|
||||||
|
.check_requirements = d3d12_runner_check_requirements,
|
||||||
.create_resource = d3d12_runner_create_resource,
|
.create_resource = d3d12_runner_create_resource,
|
||||||
.destroy_resource = d3d12_runner_destroy_resource,
|
.destroy_resource = d3d12_runner_destroy_resource,
|
||||||
.dispatch = d3d12_runner_dispatch,
|
.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);
|
runner.compute_allocator, NULL, &IID_ID3D12GraphicsCommandList, (void **)&runner.compute_list);
|
||||||
ok(hr == S_OK, "Failed to create command list, hr %#x.\n", hr);
|
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);
|
run_shader_tests(&runner.r, &d3d12_runner_ops, dxc_compiler, minimum_shader_model, maximum_shader_model);
|
||||||
|
|
||||||
ID3D12GraphicsCommandList_Release(runner.compute_list);
|
ID3D12GraphicsCommandList_Release(runner.compute_list);
|
||||||
|
Loading…
Reference in New Issue
Block a user