From 6e8aad727b7f11700be07e34c229df31cc68f8e1 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 18 Dec 2022 07:23:58 -0800 Subject: [PATCH] GPU: Prevent GE_PRIM_INVALID on flush. Wasn't enough to set prim temporarily here. --- GPU/Common/DrawEngineCommon.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 762acf066851..f675a255b63c 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -790,9 +790,13 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti DispatchFlush(); } - // TODO: Is this the right thing to do? + // This isn't exactly right, if we flushed, since prims can straddle previous calls. + // But it generally works for common usage. if (prim == GE_PRIM_KEEP_PREVIOUS) { - prim = prevPrim_ != GE_PRIM_INVALID ? prevPrim_ : GE_PRIM_POINTS; + // Has to be set to something, let's assume POINTS (0) if no previous. + if (prevPrim_ == GE_PRIM_INVALID) + prevPrim_ = GE_PRIM_POINTS; + prim = prevPrim_; } else { prevPrim_ = prim; }