Fix error when baking a map with no lights in it

This commit is contained in:
dpjudas 2021-11-12 05:07:57 +01:00
parent 9b6cd720dd
commit f44e73d8d0

View file

@ -388,6 +388,9 @@ void GPURaytracer::CreateVertexAndIndexBuffers()
lights.push_back(info); lights.push_back(info);
} }
if (lights.empty()) // vulkan doesn't support zero byte buffers
lights.push_back(LightInfo());
size_t vertexbuffersize = (size_t)mesh->MeshVertices.Size() * sizeof(Vec3); size_t vertexbuffersize = (size_t)mesh->MeshVertices.Size() * sizeof(Vec3);
size_t indexbuffersize = (size_t)mesh->MeshElements.Size() * sizeof(uint32_t); size_t indexbuffersize = (size_t)mesh->MeshElements.Size() * sizeof(uint32_t);
size_t surfaceindexbuffersize = (size_t)mesh->MeshSurfaces.Size() * sizeof(uint32_t); size_t surfaceindexbuffersize = (size_t)mesh->MeshSurfaces.Size() * sizeof(uint32_t);