vulkan: record actual memory properties during buffer creation (#24326)

This commit is contained in:
Winston Ma
2026-06-17 11:14:48 +02:00
committed by GitHub
parent ea21e03955
commit 558e221b70
+1 -1
View File
@@ -3008,13 +3008,13 @@ static vk_buffer ggml_vk_create_buffer(vk_device& device, size_t size, const std
if (memory_type_indices.empty()) { if (memory_type_indices.empty()) {
continue; continue;
} }
buf->memory_property_flags = req_flags;
bool done = false; bool done = false;
for (auto mtype_it = memory_type_indices.begin(); mtype_it != memory_type_indices.end(); mtype_it++) { for (auto mtype_it = memory_type_indices.begin(); mtype_it != memory_type_indices.end(); mtype_it++) {
try { try {
buf->device_memory = device->device.allocateMemory({ mem_req.size, *mtype_it, &mem_flags_info }); buf->device_memory = device->device.allocateMemory({ mem_req.size, *mtype_it, &mem_flags_info });
buf->memory_property_flags = mem_props.memoryTypes[*mtype_it].propertyFlags;
done = true; done = true;
break; break;
} catch (const vk::SystemError& e) { } catch (const vk::SystemError& e) {