Fix joining TRIANGLE_LIST draws with a vertex count non-divisible by 3

Fixes #7503
This commit is contained in:
Henrik Rydgård committed 2026-01-23 18:54:22 +01:00
1 parent b90bb6da70
commit 8728be5455
1 file changed
+6
+6
View File
@@ -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;