tests/shader_runner_d3d12: Do not keep a free list for pipeline states.

It's not very useful, since we're synchronizing with the GPU
anyway.
This commit is contained in:
Giovanni Mascellani
2025-11-12 15:23:20 +01:00
committed by Henri Verbeet
parent 544a0d1631
commit 9b7ff3dcf6
Notes: Henri Verbeet 2025-11-20 18:37:14 +01:00
Approved-by: Henri Verbeet (@hverbeet)
Merge-Request: https://gitlab.winehq.org/wine/vkd3d/-/merge_requests/1833
2 changed files with 4 additions and 24 deletions

View File

@@ -1143,8 +1143,6 @@ struct test_context
ID3D12CommandAllocator *allocator;
ID3D12GraphicsCommandList *list;
ID3D12GraphicsCommandList1 *list1;
ID3D12PipelineState **pso;
size_t pso_count, pso_capacity;
D3D12_RESOURCE_DESC render_target_desc;
ID3D12Resource *render_target;
@@ -1332,15 +1330,6 @@ static inline bool init_compute_test_context_(const char *file, unsigned int lin
return true;
}
static inline void destroy_pipeline_state_objects(struct test_context *context)
{
size_t i;
for (i = 0; i < context->pso_count; ++i)
ID3D12PipelineState_Release(context->pso[i]);
context->pso_count = 0;
}
#define destroy_test_context(context) destroy_test_context_(__FILE__, __LINE__, context)
static inline void destroy_test_context_(const char *file, unsigned int line, struct test_context *context)
{
@@ -1361,8 +1350,6 @@ static inline void destroy_test_context_(const char *file, unsigned int line, st
if (context->list1)
ID3D12GraphicsCommandList1_Release(context->list1);
ID3D12GraphicsCommandList_Release(context->list);
destroy_pipeline_state_objects(context);
free(context->pso);
if (context->device2)
ID3D12Device2_Release(context->device2);

View File

@@ -383,13 +383,6 @@ static ID3D12RootSignature *d3d12_runner_create_root_signature(struct d3d12_shad
return root_signature;
}
static void add_pso(struct test_context *test_context, ID3D12PipelineState *pso)
{
vkd3d_array_reserve((void **)&test_context->pso, &test_context->pso_capacity,
test_context->pso_count + 1, sizeof(*test_context->pso));
test_context->pso[test_context->pso_count++] = pso;
}
static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsigned int y, unsigned int z)
{
struct d3d12_shader_runner *runner = d3d12_shader_runner(r);
@@ -425,8 +418,6 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig
return false;
}
add_pso(test_context, pso);
ID3D12GraphicsCommandList_SetComputeRootSignature(command_list, root_signature);
ID3D12GraphicsCommandList_SetDescriptorHeaps(command_list, 1, &runner->heap);
if (runner->r.uniform_count)
@@ -450,6 +441,8 @@ static bool d3d12_runner_dispatch(struct shader_runner *r, unsigned int x, unsig
wait_queue_idle(device, queue);
reset_command_list(command_list, allocator);
ID3D12PipelineState_Release(pso);
return true;
}
@@ -846,8 +839,6 @@ static bool d3d12_runner_draw(struct shader_runner *r, D3D_PRIMITIVE_TOPOLOGY pr
return false;
}
add_pso(test_context, pso);
fb_width = ~0u;
fb_height = ~0u;
ID3D12GraphicsCommandList_SetGraphicsRootSignature(command_list, test_context->root_signature);
@@ -934,6 +925,8 @@ static bool d3d12_runner_draw(struct shader_runner *r, D3D_PRIMITIVE_TOPOLOGY pr
ID3D12RootSignature_Release(test_context->root_signature);
test_context->root_signature = NULL;
ID3D12PipelineState_Release(pso);
return true;
}