From 8728be54555fde623d0bbeb341641a31aee8fa0f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Fri, 23 Jan 2026 17:20:11 +0100 Subject: [PATCH] Fix joining TRIANGLE_LIST draws with a vertex count non-divisible by 3 Fixes #7503 --- GPU/Common/DrawEngineCommon.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 0c589759be..1d2c07af71 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -711,6 +711,12 @@ bool DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti // Unfortunately we need to do this check somewhere since GetIndexBounds doesn't handle zero-length arrays. return false; } + } else if (prim == GE_PRIM_TRIANGLES) { + // Make sure the vertex count is divisible by 3, round down. See issue #7503 + const int rem = vertexCount % 3; + if (rem != 0) { + vertexCount -= rem; + } } bool applySkin = dec_->skinInDecode;