Reserve capacity for image initialization barriers

This commit is contained in:
LunaDL committed 2026-11-27 02:40:08 -04:00
1 parent 0c7bd64b48
commit fabbe8137d
1 file changed
+1
@@ -372,6 +372,7 @@ void FrameGen::record(VkCommandBuffer cmd, VkImageView prevView, VkImageView cur
if (!reuseFlow) {
// Batch fresh-image transitions that share the same stage and access masks.
std::vector<VkImageMemoryBarrier> initBarriers;
initBarriers.reserve(static_cast<size_t>(4 * kLevels + 1));
auto addInitBarrier = [&](VkImage image) {
VkImageMemoryBarrier b{VK_STRUCTURE_TYPE_IMAGE_MEMORY_BARRIER};
b.oldLayout = VK_IMAGE_LAYOUT_UNDEFINED;