- 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 96fb96617f
commit f2dd4ceaab
1 changed files with 2 additions and 0 deletions

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);