1
0
mirror of https://github.com/godotengine/godot.git synced 2025-12-05 17:15:09 +00:00

Merge pull request #103730 from darksylinc/matias-vma-regression

Fix incorrect parameters passed to VMA
This commit is contained in:
Thaddeus Crews
2025-03-07 12:06:27 -06:00

View File

@@ -1562,6 +1562,10 @@ RDD::BufferID RenderingDeviceDriverVulkan::buffer_create(uint64_t p_size, BitFie
} break;
case MEMORY_ALLOCATION_TYPE_GPU: {
vma_usage = VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE;
if (!Engine::get_singleton()->is_extra_gpu_memory_tracking_enabled()) {
// We must set it right now or else vmaFindMemoryTypeIndexForBufferInfo will use wrong parameters.
alloc_create_info.usage = vma_usage;
}
alloc_create_info.preferredFlags = VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT;
if (p_size <= SMALL_ALLOCATION_MAX_SIZE) {
uint32_t mem_type_index = 0;