diff --git a/texturesparseresidency/texturesparseresidency.cpp b/texturesparseresidency/texturesparseresidency.cpp index b1504520..671b325e 100644 --- a/texturesparseresidency/texturesparseresidency.cpp +++ b/texturesparseresidency/texturesparseresidency.cpp @@ -374,8 +374,8 @@ public: // Get sparse memory requirements // Count - uint32_t sparseMemoryReqsCount; - std::vector sparseMemoryReqs(32); + uint32_t sparseMemoryReqsCount = 32; + std::vector sparseMemoryReqs(sparseMemoryReqsCount); vkGetImageSparseMemoryRequirements(device, texture.image, &sparseMemoryReqsCount, sparseMemoryReqs.data()); if (sparseMemoryReqsCount == 0) {