Skip to content

Commit

Permalink
Optimization for unchanged texture count.
Browse files Browse the repository at this point in the history
If asset's texture count is same as the previous one, texture-count related Vulkan stuffs (descriptor set layouts, pipeline layouts, pipelines) doesn't have to be recreated.
  • Loading branch information
stripe2933 committed Dec 29, 2024
1 parent 3b3dbc3 commit 31df1c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions interface/vulkan/SharedData.cppm
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,11 @@ namespace vk_gltf_viewer::vulkan {
}

void updateTextureCount(std::uint32_t textureCount) {
if (assetDescriptorSetLayout.descriptorCounts[2] == textureCount) {
// If texture count is same, descriptor set layouts, pipeline layouts and pipelines doesn't have to be recreated.
return;
}

// Following pipelines are dependent to the assetDescriptorSetLayout.
primitivePipelines.clear();
depthRenderer.reset();
Expand Down

0 comments on commit 31df1c9

Please sign in to comment.