GPU: Prevent GE_PRIM_INVALID on flush.

Wasn't enough to set prim temporarily here.
This commit is contained in:
Unknown W. Brackets 2022-12-18 07:23:58 -08:00
parent e5dbdba638
commit 6e8aad727b

View file

@ -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;
}