fix vkBindImageMemory and vkFlushMappedMemoryRanges validation errors

This commit is contained in:
Zack Buhman 2026-04-15 15:16:38 -05:00
parent 6731129670
commit cdce2d64f3
2 changed files with 3 additions and 3 deletions

View File

@ -169,7 +169,7 @@ namespace collada::scene {
// copy data
void * vertexIndexMappedData;
VK_CHECK(vkMapMemory(device, vertexIndex.memory, 0, vertexIndexBufferCreateInfo.size, 0, &vertexIndexMappedData));
VK_CHECK(vkMapMemory(device, vertexIndex.memory, 0, VK_WHOLE_SIZE, 0, &vertexIndexMappedData));
memcpy((void *)(((ptrdiff_t)vertexIndexMappedData) + 0), vertexStart, vertexSize);
memcpy((void *)(((ptrdiff_t)vertexIndexMappedData) + vertexSize), indexStart, indexSize);

View File

@ -164,7 +164,7 @@ void createDepth(VkPhysicalDeviceMemoryProperties const & physicalDeviceMemoryPr
VK_CHECK(vkCreateImage(device, &imageCreateInfo, nullptr, image));
VkMemoryRequirements memoryRequirements;
vkGetImageMemoryRequirements(device, depthImage, &memoryRequirements);
vkGetImageMemoryRequirements(device, *image, &memoryRequirements);
VkMemoryPropertyFlags memoryPropertyFlags{ VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT };
VkMemoryAllocateFlags memoryAllocateFlags{ };
allocateFromMemoryRequirements(device,
@ -561,7 +561,7 @@ int main()
VK_CHECK(vkBindBufferMemory(device, vertexIndexBuffer, vertexIndexBufferMemory, 0));
void * vertexIndexMappedData;
VK_CHECK(vkMapMemory(device, vertexIndexBufferMemory, 0, vertexIndexBufferCreateInfo.size, 0, &vertexIndexMappedData));
VK_CHECK(vkMapMemory(device, vertexIndexBufferMemory, 0, VK_WHOLE_SIZE, 0, &vertexIndexMappedData));
memcpy((void *)(((ptrdiff_t)vertexIndexMappedData) + 0), vertexStart, vertexSize);
memcpy((void *)(((ptrdiff_t)vertexIndexMappedData) + vertexSize), indexStart, indexSize);