tests: Add a basic shader test for compute shaders.

This commit is contained in:
Zebediah Figura
2021-08-13 16:37:31 -05:00
committed by Alexandre Julliard
parent 6f1f14d97a
commit 75494a4ae6
Notes: Alexandre Julliard 2022-10-19 22:07:47 +02: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/30
11 changed files with 405 additions and 92 deletions

View File

@@ -874,6 +874,26 @@ static ID3D12PipelineState *create_pipeline_state_(unsigned int line, ID3D12Devi
return SUCCEEDED(hr) ? pipeline_state : NULL;
}
#define create_compute_pipeline_state(a, b, c) create_compute_pipeline_state_(__LINE__, a, b, c)
static inline ID3D12PipelineState *create_compute_pipeline_state_(unsigned int line, ID3D12Device *device,
ID3D12RootSignature *root_signature, const D3D12_SHADER_BYTECODE cs)
{
D3D12_COMPUTE_PIPELINE_STATE_DESC pipeline_state_desc;
ID3D12PipelineState *pipeline_state = NULL;
HRESULT hr;
memset(&pipeline_state_desc, 0, sizeof(pipeline_state_desc));
pipeline_state_desc.pRootSignature = root_signature;
pipeline_state_desc.CS = cs;
pipeline_state_desc.NodeMask = 0;
pipeline_state_desc.Flags = D3D12_PIPELINE_STATE_FLAG_NONE;
hr = ID3D12Device_CreateComputePipelineState(device, &pipeline_state_desc,
&IID_ID3D12PipelineState, (void **)&pipeline_state);
ok_(line)(SUCCEEDED(hr), "Failed to create compute pipeline state, hr %#x.\n", hr);
return pipeline_state;
}
struct test_context_desc
{
unsigned int rt_width, rt_height, rt_array_size;