From 0e2fb13c61eae70cda0486e78bd65b80da43ccfc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Wed, 3 May 2023 22:22:54 +0200 Subject: [PATCH] Make sure we never end up with a null vertex decoder. --- GPU/Common/DrawEngineCommon.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/GPU/Common/DrawEngineCommon.cpp b/GPU/Common/DrawEngineCommon.cpp index 45353bcbc8..ac0d368b22 100644 --- a/GPU/Common/DrawEngineCommon.cpp +++ b/GPU/Common/DrawEngineCommon.cpp @@ -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; @@ -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; }