diff --git a/src/gfxstream/codegen/scripts/cereal/functable.py b/src/gfxstream/codegen/scripts/cereal/functable.py index 20906fe279d..a718babede8 100644 --- a/src/gfxstream/codegen/scripts/cereal/functable.py +++ b/src/gfxstream/codegen/scripts/cereal/functable.py @@ -392,8 +392,7 @@ class VulkanFuncTable(VulkanWrapperGenerator): cgen.stmt("%s = %s.size()" % (countParamName, nestedOutName)) else: # Standard translation - cgen.stmt("%s.reserve(%s)" % (nestedOutName, countParamName)) - cgen.stmt("memset(&%s[0], 0, sizeof(%s) * %s)" % (nestedOutName, member.typeName, countParamName)) + cgen.stmt("%s.resize(%s)" % (nestedOutName, countParamName)) if not nextLoopVar: nextLoopVar = getNextLoopVar() internalArray = genInternalArray(member, countParamName, nestedOutName, inArrayName, nextLoopVar) diff --git a/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp b/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp index 2ccf87e031d..1aa2b8ab46d 100644 --- a/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp +++ b/src/gfxstream/guest/vulkan/gfxstream_vk_device.cpp @@ -714,7 +714,7 @@ static std::vector transformDescriptorSetList( outDescriptorSet = srcDescriptorSet; bufferInfos.push_back(std::vector()); - bufferInfos[i].reserve(descriptorCount); + bufferInfos[i].resize(descriptorCount); memset(&bufferInfos[i][0], 0, sizeof(VkDescriptorBufferInfo) * descriptorCount); for (uint32_t j = 0; j < descriptorCount; ++j) { const auto* srcBufferInfo = srcDescriptorSet.pBufferInfo;