- always ensure that the global index buffer is not empty.

This needs to be valid for Vulkan, even if it isn't used.
This commit is contained in:
Christoph Oelckers 2021-04-05 16:17:13 +02:00
parent f6b46e9f63
commit ec460df2c0

View file

@ -80,6 +80,8 @@ FFlatVertexBuffer::FFlatVertexBuffer(int width, int height)
mVertexBuffer = screen->CreateVertexBuffer();
mIndexBuffer = screen->CreateIndexBuffer();
int data[4] = {};
mIndexBuffer->SetData(4, data); // On Vulkan this may not be empty, so set some dummy defaults to avoid crashes.
unsigned int bytesize = BUFFER_SIZE * sizeof(FFlatVertex);
mVertexBuffer->SetData(bytesize, nullptr, false);