Fix use-after-free on temporary vector

This commit is contained in:
baldurk
2021-07-28 11:37:13 +01:00
parent d0acc2a349
commit 08b0a1d7ea
+4 -4
View File
@@ -412,13 +412,13 @@ void main()
VkDescriptorSet descset = allocateDescriptorSet(setlayout);
std::vector<VkWriteDescriptorSet> writes;
std::vector<VkDescriptorImageInfo> imInfo = {
vkh::DescriptorImageInfo(dummyView, VK_IMAGE_LAYOUT_GENERAL),
};
for(int i = 0; i < 64; i++)
{
writes.push_back(
vkh::WriteDescriptorSet(descset, 0, i, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE,
{
vkh::DescriptorImageInfo(dummyView, VK_IMAGE_LAYOUT_GENERAL),
}));
vkh::WriteDescriptorSet(descset, 0, i, VK_DESCRIPTOR_TYPE_SAMPLED_IMAGE, imInfo));
}
vkh::updateDescriptorSets(device, writes);