Fix #147604, #146594: Vulkan: Crash on startup

On certain platforms Blender can crash on startup after the update of
VMA. This was because we want to select the correct memory area based on
requirements/preferences, but the overall flag was set to auto.

These options are mutual exclusive. This PR changes the flags to use the
requirements/preferences.

Pull Request: https://projects.blender.org/blender/blender/pulls/147781
This commit is contained in:
Jeroen Bakker
2025-10-10 08:42:58 +02:00
parent 74bd04e09b
commit b9dcc087a9
3 changed files with 4 additions and 4 deletions

View File

@@ -81,7 +81,7 @@ bool VKBuffer::create(size_t size_in_bytes,
vma_create_info.priority = priority;
vma_create_info.requiredFlags = required_flags;
vma_create_info.preferredFlags = preferred_flags;
vma_create_info.usage = VMA_MEMORY_USAGE_AUTO;
vma_create_info.usage = VMA_MEMORY_USAGE_UNKNOWN;
if (export_memory) {
create_info.pNext = &external_memory_create_info;

View File

@@ -45,7 +45,7 @@ void VKMemoryPools::init_external_memory_image(VKDevice &device)
VK_IMAGE_LAYOUT_UNDEFINED};
VmaAllocationCreateInfo allocation_create_info = {};
allocation_create_info.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO;
allocation_create_info.usage = VMA_MEMORY_USAGE_UNKNOWN;
uint32_t memory_type_index;
vmaFindMemoryTypeIndexForImageInfo(
device.mem_allocator_get(), &image_create_info, &allocation_create_info, &memory_type_index);
@@ -75,7 +75,7 @@ void VKMemoryPools::init_external_memory_pixel_buffer(VKDevice &device)
nullptr};
VmaAllocationCreateInfo allocation_create_info = {};
allocation_create_info.flags = VMA_ALLOCATION_CREATE_DEDICATED_MEMORY_BIT;
allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO;
allocation_create_info.usage = VMA_MEMORY_USAGE_UNKNOWN;
uint32_t memory_type_index;
vmaFindMemoryTypeIndexForBufferInfo(device.mem_allocator_get(),
&buffer_create_info,

View File

@@ -699,7 +699,7 @@ bool VKTexture::allocate()
VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, nullptr, 0};
VmaAllocationCreateInfo allocCreateInfo = {};
allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO;
allocCreateInfo.usage = VMA_MEMORY_USAGE_UNKNOWN;
allocCreateInfo.priority = memory_priority(texture_usage);
if (bool(texture_usage & GPU_TEXTURE_USAGE_MEMORY_EXPORT)) {