mirror of
https://gitlab.winehq.org/wine/vkd3d.git
synced 2024-11-21 16:46:41 -08:00
tests: Use test utils to create the pipeline state in test_ps_layer().
This commit is contained in:
parent
245cce02bd
commit
bd84b96e9f
Notes:
Alexandre Julliard
2024-01-22 22:53:41 +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/546
@ -28145,16 +28145,13 @@ static void test_layered_rendering(void)
|
||||
|
||||
static void test_ps_layer(void)
|
||||
{
|
||||
D3D12_GRAPHICS_PIPELINE_STATE_DESC pso_desc;
|
||||
ID3D12GraphicsCommandList *command_list;
|
||||
ID3D10Blob *vs_bytecode, *ps_bytecode;
|
||||
struct test_context_desc desc;
|
||||
D3D12_SHADER_BYTECODE vs, ps;
|
||||
struct test_context context;
|
||||
ID3D12CommandQueue *queue;
|
||||
ID3D12Device *device;
|
||||
unsigned int i;
|
||||
HRESULT hr;
|
||||
|
||||
static const float white[] = {1.0f, 1.0f, 1.0f, 1.0f};
|
||||
static const char vs_code[] =
|
||||
@ -28197,7 +28194,8 @@ static void test_ps_layer(void)
|
||||
|
||||
memset(&desc, 0, sizeof(desc));
|
||||
desc.rt_array_size = 6;
|
||||
desc.no_pipeline = true;
|
||||
desc.vs = &vs;
|
||||
desc.ps = &ps;
|
||||
if (!init_test_context(&context, &desc))
|
||||
{
|
||||
ID3D10Blob_Release(vs_bytecode);
|
||||
@ -28212,17 +28210,9 @@ static void test_ps_layer(void)
|
||||
return;
|
||||
}
|
||||
|
||||
device = context.device;
|
||||
command_list = context.list;
|
||||
queue = context.queue;
|
||||
|
||||
init_pipeline_state_desc(&pso_desc, context.root_signature,
|
||||
context.render_target_desc.Format, &vs, &ps, NULL);
|
||||
pso_desc.PrimitiveTopologyType = D3D12_PRIMITIVE_TOPOLOGY_TYPE_TRIANGLE;
|
||||
hr = ID3D12Device_CreateGraphicsPipelineState(device, &pso_desc,
|
||||
&IID_ID3D12PipelineState, (void **)&context.pipeline_state);
|
||||
ok(hr == S_OK, "Failed to create graphics pipeline state, hr %#x.\n", hr);
|
||||
|
||||
ID3D12GraphicsCommandList_ClearRenderTargetView(command_list, context.rtv, white, 0, NULL);
|
||||
|
||||
ID3D12GraphicsCommandList_OMSetRenderTargets(command_list, 1, &context.rtv, false, NULL);
|
||||
|
@ -994,6 +994,7 @@ struct test_context_desc
|
||||
bool no_render_target;
|
||||
bool no_root_signature;
|
||||
bool no_pipeline;
|
||||
const D3D12_SHADER_BYTECODE *vs;
|
||||
const D3D12_SHADER_BYTECODE *ps;
|
||||
};
|
||||
|
||||
@ -1153,7 +1154,7 @@ static inline bool init_test_context_(unsigned int line, struct test_context *co
|
||||
|
||||
context->pipeline_state = create_pipeline_state_(line, device,
|
||||
context->root_signature, context->render_target_desc.Format,
|
||||
NULL, desc ? desc->ps : NULL, NULL);
|
||||
desc ? desc->vs : NULL, desc ? desc->ps : NULL, NULL);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user