Skip to content

Commit

Permalink
- always ensure that the global index buffer is not empty.
Browse files Browse the repository at this point in the history
This needs to be valid for Vulkan, even if it isn't used.
  • Loading branch information
coelckers committed Apr 5, 2021
1 parent 96fb966 commit f2dd4ce
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions source/common/rendering/hwrenderer/data/flatvertices.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit f2dd4ce

Please sign in to comment.