From d510baa4b8fc239cc096178e4c348bdab2b6f3f8 Mon Sep 17 00:00:00 2001 From: Jeroen Bakker Date: Mon, 13 Oct 2025 09:06:11 +0200 Subject: [PATCH] Fix #147815: Vulkan: Performance NVIDIA An oversight in b9dcc087a9 where textures aren't allocated correctly leading to performance issues. Pull Request: https://projects.blender.org/blender/blender/pulls/147959 --- source/blender/gpu/vulkan/vk_memory_pool.cc | 4 ++-- source/blender/gpu/vulkan/vk_texture.cc | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/source/blender/gpu/vulkan/vk_memory_pool.cc b/source/blender/gpu/vulkan/vk_memory_pool.cc index 0d9a9898723..be596264331 100644 --- a/source/blender/gpu/vulkan/vk_memory_pool.cc +++ b/source/blender/gpu/vulkan/vk_memory_pool.cc @@ -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_UNKNOWN; + allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; 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_UNKNOWN; + allocation_create_info.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; uint32_t memory_type_index; vmaFindMemoryTypeIndexForBufferInfo(device.mem_allocator_get(), &buffer_create_info, diff --git a/source/blender/gpu/vulkan/vk_texture.cc b/source/blender/gpu/vulkan/vk_texture.cc index 204f00f545b..61254882c91 100644 --- a/source/blender/gpu/vulkan/vk_texture.cc +++ b/source/blender/gpu/vulkan/vk_texture.cc @@ -699,7 +699,7 @@ bool VKTexture::allocate() VK_STRUCTURE_TYPE_EXTERNAL_MEMORY_IMAGE_CREATE_INFO, nullptr, 0}; VmaAllocationCreateInfo allocCreateInfo = {}; - allocCreateInfo.usage = VMA_MEMORY_USAGE_UNKNOWN; + allocCreateInfo.usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE; allocCreateInfo.priority = memory_priority(texture_usage); if (bool(texture_usage & GPU_TEXTURE_USAGE_MEMORY_EXPORT)) {