Skip to content

Commit

Permalink
GPU: Prevent GE_PRIM_INVALID on flush.
Browse files Browse the repository at this point in the history
Wasn't enough to set prim temporarily here.
  • Loading branch information
unknownbrackets committed Dec 18, 2022
1 parent e5dbdba commit 6e8aad7
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 6e8aad7

Please sign in to comment.