From 06d955ab210ae3b1e89f4016d751f911946cae4b Mon Sep 17 00:00:00 2001 From: Lionel Landwerlin Date: Sun, 2 Oct 2022 19:17:14 +0300 Subject: [PATCH] anv: remove multiple push descriptors MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit VUID-VkPipelineLayoutCreateInfo-pSetLayouts-00293 pSetLayouts must not contain more than one descriptor set layout that was created with VK_DESCRIPTOR_SET_LAYOUT_CREATE_PUSH_DESCRIPTOR_BIT_KHR set There is only one push descriptor set with all the descriptor sets, so no need to have an array. Signed-off-by: Lionel Landwerlin Reviewed-by: Emma Anholt Reviewed-by: Tapani Pälli Part-of: --- src/intel/vulkan/anv_cmd_buffer.c | 12 +++++------- src/intel/vulkan/anv_private.h | 2 +- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/intel/vulkan/anv_cmd_buffer.c b/src/intel/vulkan/anv_cmd_buffer.c index 37ac1bd..3ab9942 100644 --- a/src/intel/vulkan/anv_cmd_buffer.c +++ b/src/intel/vulkan/anv_cmd_buffer.c @@ -57,12 +57,10 @@ static void anv_cmd_pipeline_state_finish(struct anv_cmd_buffer *cmd_buffer, struct anv_cmd_pipeline_state *pipe_state) { - for (uint32_t i = 0; i < ARRAY_SIZE(pipe_state->push_descriptors); i++) { - if (pipe_state->push_descriptors[i]) { - anv_descriptor_set_layout_unref(cmd_buffer->device, - pipe_state->push_descriptors[i]->set.layout); - vk_free(&cmd_buffer->vk.pool->alloc, pipe_state->push_descriptors[i]); - } + if (pipe_state->push_descriptor) { + anv_descriptor_set_layout_unref(cmd_buffer->device, + pipe_state->push_descriptor->set.layout); + vk_free(&cmd_buffer->vk.pool->alloc, pipe_state->push_descriptor); } } @@ -877,7 +875,7 @@ anv_cmd_buffer_push_descriptor_set(struct anv_cmd_buffer *cmd_buffer, } struct anv_push_descriptor_set **push_set = - &pipe_state->push_descriptors[_set]; + &pipe_state->push_descriptor; if (*push_set == NULL) { *push_set = vk_zalloc(&cmd_buffer->vk.pool->alloc, diff --git a/src/intel/vulkan/anv_private.h b/src/intel/vulkan/anv_private.h index 3147243..b3a24bd 100644 --- a/src/intel/vulkan/anv_private.h +++ b/src/intel/vulkan/anv_private.h @@ -2433,7 +2433,7 @@ anv_gfx8_9_vb_cache_range_needs_workaround(struct anv_vb_cache_range *bound, */ struct anv_cmd_pipeline_state { struct anv_descriptor_set *descriptors[MAX_SETS]; - struct anv_push_descriptor_set *push_descriptors[MAX_SETS]; + struct anv_push_descriptor_set *push_descriptor; struct anv_push_constants push_constants; -- 2.7.4