mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
vulkan: fix crash when creating compute shaders
If the size of the default uniform block ends up being 0, there will be a crash since creating a buffer of size 0 is invalid. A simple if-statement fixes this issue
This commit is contained in:
@@ -1023,7 +1023,9 @@ void Shader::createDescriptorPoolSizes()
|
||||
|
||||
void Shader::createStreamBuffers()
|
||||
{
|
||||
streamBuffers.push_back(new StreamBuffer(vgfx, BUFFERUSAGE_UNIFORM, STREAMBUFFER_DEFAULT_SIZE * uniformBufferSizeAligned));
|
||||
size_t size = STREAMBUFFER_DEFAULT_SIZE * uniformBufferSizeAligned;
|
||||
if (size > 0)
|
||||
streamBuffers.push_back(new StreamBuffer(vgfx, BUFFERUSAGE_UNIFORM, size));
|
||||
}
|
||||
|
||||
void Shader::setVideoTextures(graphics::Texture *ytexture, graphics::Texture *cbtexture, graphics::Texture *crtexture)
|
||||
|
||||
Reference in New Issue
Block a user