Skip to content

Commit

Permalink
Move layout compat check outside the loop.
Browse files Browse the repository at this point in the history
  • Loading branch information
Themaister committed Jul 18, 2024
1 parent 11e4bad commit d9af6e0
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions vulkan/command_buffer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2106,13 +2106,13 @@ void CommandBuffer::set_program_layout(const PipelineLayout *layout)
}
else
{
uint32_t first_push_set =
std::min<uint32_t>(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<uint32_t>(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))
{
Expand Down

0 comments on commit d9af6e0

Please sign in to comment.