From 6deffa62fbd1e91873afa663630b788b9ffabee3 Mon Sep 17 00:00:00 2001 From: Juan Linietsky Date: Sat, 14 Sep 2019 00:37:42 -0300 Subject: Several fixes to 3D rendering, and multimesh implementation. --- drivers/vulkan/rendering_device_vulkan.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/vulkan/rendering_device_vulkan.cpp') diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index 8cc07c59b1..09b0f7113e 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -3969,7 +3969,7 @@ RID RenderingDeviceVulkan::storage_buffer_create(uint32_t p_size_bytes, const Po ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); Buffer buffer; - Error err = _buffer_allocate(&buffer, p_size_bytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VMA_MEMORY_USAGE_GPU_ONLY); + Error err = _buffer_allocate(&buffer, p_size_bytes, VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_STORAGE_BUFFER_BIT, VMA_MEMORY_USAGE_GPU_ONLY); ERR_FAIL_COND_V(err != OK, RID()); if (p_data.size()) { @@ -4600,6 +4600,8 @@ PoolVector RenderingDeviceVulkan::buffer_get_data(RID p_buffer) { buffer = index_buffer_owner.getornull(p_buffer); } else if (texture_buffer_owner.owns(p_buffer)) { buffer = &texture_buffer_owner.getornull(p_buffer)->buffer; + } else if (storage_buffer_owner.owns(p_buffer)) { + buffer = storage_buffer_owner.getornull(p_buffer); } else { ERR_FAIL_V_MSG(PoolVector(), "Buffer is either invalid or this type of buffer can't be retrieved. Only Index and Vertex buffers allow retrieving."); } -- cgit v1.2.3