From ee6ffac28eb82ee4f33212f468ea3849a78a24a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 1 Nov 2023 20:07:40 -0600 Subject: [PATCH] Ignore triangle strips with less than 3 vertices. Should fix the new issue reported in #18273 --- GPU/Common/IndexGenerator.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/GPU/Common/IndexGenerator.cpp b/GPU/Common/IndexGenerator.cpp index 679fdc259c..261cd18470 100644 --- a/GPU/Common/IndexGenerator.cpp +++ b/GPU/Common/IndexGenerator.cpp @@ -115,6 +115,9 @@ alignas(16) static const uint16_t offsets_counter_clockwise[24] = { void IndexGenerator::AddStrip(int numVerts, int indexOffset, bool clockwise) { int numTris = numVerts - 2; + if (numTris <= 0) { + return; + } #ifdef _M_SSE // In an SSE2 register we can fit 8 16-bit integers. // However, we need to output a multiple of 3 indices.