Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save HansKristian-Work/023d04a9dc91cd452171c30d9f0dbca4 to your computer and use it in GitHub Desktop.

Select an option

Save HansKristian-Work/023d04a9dc91cd452171c30d9f0dbca4 to your computer and use it in GitHub Desktop.
else if (program.get_pipeline_layout()->get_hash() != current_layout->get_hash())
{
auto &new_layout = program.get_pipeline_layout()->get_resource_layout();
auto &old_layout = current_layout->get_resource_layout();
// If the push constant layout changes, all descriptor sets
// are invalidated.
if (new_layout.push_constant_layout_hash != old_layout.push_constant_layout_hash)
{
dirty_sets = ~0u;
set_dirty(COMMAND_BUFFER_DIRTY_PUSH_CONSTANTS_BIT);
}
else
{
// Find the first set whose descriptor set layout differs.
auto *new_pipe_layout = program.get_pipeline_layout();
for (unsigned set = 0; set < VULKAN_NUM_DESCRIPTOR_SETS; set++)
{
if (new_pipe_layout->get_allocator(set) != current_layout->get_allocator(set))
{
dirty_sets |= ~((1u << set) - 1);
break;
}
}
}
current_layout = program.get_pipeline_layout();
current_pipeline_layout = current_layout->get_layout();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment