Created
April 20, 2018 12:06
-
-
Save HansKristian-Work/023d04a9dc91cd452171c30d9f0dbca4 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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