Skip to content

Commit

Permalink
Make sure we never end up with a null vertex decoder.
Browse files Browse the repository at this point in the history
  • Loading branch information
hrydgard committed May 3, 2023
1 parent 214d1d2 commit 0e2fb13
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion GPU/Common/DrawEngineCommon.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ VertexDecoder *DrawEngineCommon::GetVertexDecoder(u32 vtype) {
if (dec)
return dec;
dec = new VertexDecoder();
_assert_(dec);
dec->SetVertexType(vtype, decOptions_, decJitCache_);
decoderMap_.Insert(vtype, dec);
return dec;
Expand Down Expand Up @@ -809,7 +810,7 @@ void DrawEngineCommon::SubmitPrim(const void *verts, const void *inds, GEPrimiti
}

// If vtype has changed, setup the vertex decoder.
if (vertTypeID != lastVType_) {
if (vertTypeID != lastVType_ || !dec_) {
dec_ = GetVertexDecoder(vertTypeID);
lastVType_ = vertTypeID;
}
Expand Down

0 comments on commit 0e2fb13

Please sign in to comment.