From bd84b96e9f930eadba9b2aee01bd7f2777adad42 Mon Sep 17 00:00:00 2001 From: Giovanni Mascellani Date: Mon, 22 Jan 2024 15:35:44 +0100 Subject: [PATCH] tests: Use test utils to create the pipeline state in test_ps_layer(). --- tests/d3d12.c | 14 ++------------ tests/d3d12_test_utils.h | 3 ++- 2 files changed, 4 insertions(+), 13 deletions(-) diff --git a/tests/d3d12.c b/tests/d3d12.c index c4952953..4d73702f 100644 --- a/tests/d3d12.c +++ b/tests/d3d12.c @@ -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); diff --git a/tests/d3d12_test_utils.h b/tests/d3d12_test_utils.h index 7473bbc4..e50ac45c 100644 --- a/tests/d3d12_test_utils.h +++ b/tests/d3d12_test_utils.h @@ -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; }