From d9af6e0447345b0f646feeaa171071cdc711ad07 Mon Sep 17 00:00:00 2001 From: Hans-Kristian Arntzen Date: Thu, 18 Jul 2024 17:07:26 +0200 Subject: [PATCH] Move layout compat check outside the loop. --- vulkan/command_buffer.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vulkan/command_buffer.cpp b/vulkan/command_buffer.cpp index 3852d0bd..87782dc7 100644 --- a/vulkan/command_buffer.cpp +++ b/vulkan/command_buffer.cpp @@ -2106,13 +2106,13 @@ void CommandBuffer::set_program_layout(const PipelineLayout *layout) } else { + uint32_t first_push_set = + std::min(layout->get_push_set_index(), pipeline_state.layout->get_push_set_index()); + bool push_set_delta = layout->get_push_set_index() != pipeline_state.layout->get_push_set_index(); + // Find the first set whose descriptor set layout differs. for (unsigned set = 0; set < VULKAN_NUM_DESCRIPTOR_SETS; set++) { - uint32_t first_push_set = - std::min(layout->get_push_set_index(), pipeline_state.layout->get_push_set_index()); - bool push_set_delta = layout->get_push_set_index() != pipeline_state.layout->get_push_set_index(); - if (layout->get_allocator(set) != pipeline_state.layout->get_allocator(set) || (push_set_delta && first_push_set == set)) {