diff options
author | Pedro J. Estébanez <pedrojrulez@gmail.com> | 2023-04-11 12:31:18 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-05-12 12:10:35 +0200 |
commit | 813fc0940d40bfc6425b7e29833ca554effcf5dc (patch) | |
tree | d1de0d7ae7e06ea154debfb2d7914f2d1211ec85 | |
parent | 64b15c8ec1d3764c5b56f351ae663cd4ac705b9d (diff) |
Allow creation of rendering buffers at any time
(cherry picked from commit d4c46f15ae9f0cbc42151dc045f4435997576176)
-rw-r--r-- | drivers/vulkan/rendering_device_vulkan.cpp | 20 |
1 files changed, 0 insertions, 20 deletions
diff --git a/drivers/vulkan/rendering_device_vulkan.cpp b/drivers/vulkan/rendering_device_vulkan.cpp index f6cc2ae4f1..cb71c00eb8 100644 --- a/drivers/vulkan/rendering_device_vulkan.cpp +++ b/drivers/vulkan/rendering_device_vulkan.cpp @@ -4326,10 +4326,6 @@ RID RenderingDeviceVulkan::vertex_buffer_create(uint32_t p_size_bytes, const Vec _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); uint32_t usage = VK_BUFFER_USAGE_TRANSFER_SRC_BIT | VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_VERTEX_BUFFER_BIT; if (p_use_as_storage) { @@ -4467,10 +4463,6 @@ RID RenderingDeviceVulkan::vertex_array_create(uint32_t p_vertex_count, VertexFo RID RenderingDeviceVulkan::index_buffer_create(uint32_t p_index_count, IndexBufferFormat p_format, const Vector<uint8_t> &p_data, bool p_use_restart_indices) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); ERR_FAIL_COND_V(p_index_count == 0, RID()); @@ -5153,10 +5145,6 @@ RID RenderingDeviceVulkan::uniform_buffer_create(uint32_t p_size_bytes, const Ve _THREAD_SAFE_METHOD_ ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); Buffer buffer; Error err = _buffer_allocate(&buffer, p_size_bytes, VK_BUFFER_USAGE_TRANSFER_DST_BIT | VK_BUFFER_USAGE_UNIFORM_BUFFER_BIT, VMA_MEMORY_USAGE_AUTO_PREFER_DEVICE, 0); @@ -5176,10 +5164,6 @@ RID RenderingDeviceVulkan::uniform_buffer_create(uint32_t p_size_bytes, const Ve RID RenderingDeviceVulkan::storage_buffer_create(uint32_t p_size_bytes, const Vector<uint8_t> &p_data, BitField<StorageBufferUsage> p_usage) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); ERR_FAIL_COND_V(p_data.size() && (uint32_t)p_data.size() != p_size_bytes, RID()); @@ -5202,10 +5186,6 @@ RID RenderingDeviceVulkan::storage_buffer_create(uint32_t p_size_bytes, const Ve RID RenderingDeviceVulkan::texture_buffer_create(uint32_t p_size_elements, DataFormat p_format, const Vector<uint8_t> &p_data) { _THREAD_SAFE_METHOD_ - ERR_FAIL_COND_V_MSG(draw_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); - ERR_FAIL_COND_V_MSG(compute_list != nullptr && p_data.size(), RID(), - "Creating buffers with data is forbidden during creation of a draw list"); uint32_t element_size = get_format_vertex_size(p_format); ERR_FAIL_COND_V_MSG(element_size == 0, RID(), "Format requested is not supported for texture buffers"); |