Vulkan: Ensure Minimum Size of VKBuffer #107731

Merged
Jeroen Bakker merged 4 commits from Jeroen-Bakker/blender:vulkan-vkbuffer-create into main 2023-05-09 10:21:02 +02:00
1 changed files with 2 additions and 6 deletions
Showing only changes of commit fcd15ec5fa - Show all commits

View File

@ -55,12 +55,8 @@ bool VKBuffer::create(int64_t size_in_bytes,
create_info.sType = VK_STRUCTURE_TYPE_BUFFER_CREATE_INFO;
create_info.flags = 0;
/*

Add reasoning

Add reasoning
* Vulkan doesn't allow empty buffers. There are areas that can still request to create empty
* buffers, like:
* - DrawManager (instance drawing)
* - PyGPU
*
* Best to create a buffer of a single byte.
* Vulkan doesn't allow empty buffers but some areas (DrawManager Instance data, PyGPU) create
* them.
*/
create_info.size = max_ii(size_in_bytes, 1);
create_info.usage = buffer_usage;