From ec460df2c007329f2445f73e64f38df3d68ffd1a Mon Sep 17 00:00:00 2001 From: Christoph Oelckers Date: Mon, 5 Apr 2021 16:17:13 +0200 Subject: [PATCH] - always ensure that the global index buffer is not empty. This needs to be valid for Vulkan, even if it isn't used. --- source/common/rendering/hwrenderer/data/flatvertices.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/common/rendering/hwrenderer/data/flatvertices.cpp b/source/common/rendering/hwrenderer/data/flatvertices.cpp index 47ae19ec3..5bc37bcb7 100644 --- a/source/common/rendering/hwrenderer/data/flatvertices.cpp +++ b/source/common/rendering/hwrenderer/data/flatvertices.cpp @@ -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);