diff --git a/libs/vkd3d/state.c b/libs/vkd3d/state.c index e1df42a153..6550a8800e 100644 --- a/libs/vkd3d/state.c +++ b/libs/vkd3d/state.c @@ -2240,6 +2240,7 @@ void d3d12_pipeline_state_dec_ref(struct d3d12_pipeline_state *state) struct d3d12_device *device = state->device; const struct vkd3d_vk_device_procs *vk_procs = &device->vk_procs; ULONG refcount = InterlockedDecrement(&state->internal_refcount); + unsigned int i; if (!refcount) { @@ -2257,6 +2258,10 @@ void d3d12_pipeline_state_dec_ref(struct d3d12_pipeline_state *state) if (state->root_signature) d3d12_root_signature_dec_ref(state->root_signature); + for (i = 0; i < ARRAY_SIZE(state->hoist_template.vk_hoist_descriptor_set_layouts); i++) + VK_CALL(vkDestroyDescriptorSetLayout(device->vk_device, state->hoist_template.vk_hoist_descriptor_set_layouts[i], NULL)); + VK_CALL(vkDestroyPipelineLayout(device->vk_device, state->hoist_template.vk_hoist_descriptor_layout, NULL)); + if (state->pipeline_type == VKD3D_PIPELINE_TYPE_GRAPHICS || state->pipeline_type == VKD3D_PIPELINE_TYPE_MESH_GRAPHICS) d3d12_pipeline_state_free_cached_desc(&state->graphics.cached_desc); rwlock_destroy(&state->lock); diff --git a/libs/vkd3d/vkd3d_private.h b/libs/vkd3d/vkd3d_private.h index 8c90af7fb0..654bb73096 100644 --- a/libs/vkd3d/vkd3d_private.h +++ b/libs/vkd3d/vkd3d_private.h @@ -2040,8 +2040,8 @@ struct d3d12_descriptor_copy_template unsigned int num_entries; /* For descriptor hoisting. Each pipeline stage gets its own set. */ - VkDescriptorSetLayout vk_hoist_descriptor_sets[VKD3D_MAX_HOIST_SHADER_STAGES]; - VkPipelineLayout vk_hoist_descriptor_set_layout; + VkDescriptorSetLayout vk_hoist_descriptor_set_layouts[VKD3D_MAX_HOIST_SHADER_STAGES]; + VkPipelineLayout vk_hoist_descriptor_layout; /* On draw time if table offsets are out of date: * - Allocate descriptor_allocation_words from d3d12_command_list_descriptor_copy_batch::descriptor_buffer.