From bc1308c4636f5ddce5f1cab965ddacec82438b19 Mon Sep 17 00:00:00 2001 From: Josip Miskovic Date: Thu, 22 Dec 2022 17:25:55 +0100 Subject: [PATCH] Check if torus shape is cached --- src/modules/graphics/graphics.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/graphics/graphics.c b/src/modules/graphics/graphics.c index ca4aff00..c9230e5f 100644 --- a/src/modules/graphics/graphics.c +++ b/src/modules/graphics/graphics.c @@ -4935,6 +4935,10 @@ void lovrPassTorus(Pass* pass, float* transform, uint32_t segmentsT, uint32_t se .index.count = indexCount }); + if (!vertices) { + return; + } + // T and P stand for toroidal and poloidal, or theta and phi float dt = (2.f * (float) M_PI) / segmentsT; float dp = (2.f * (float) M_PI) / segmentsP;