From 3aa575daef1f269c6ee33036cba55524c159f487 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Henrik=20Rydg=C3=A5rd?= Date: Sun, 26 Jan 2020 15:29:45 +0100 Subject: [PATCH] OpenGL: Call ApplyDrawState before SoftwareTransform --- GPU/GLES/DrawEngineGLES.cpp | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index a934a25790..2f272def84 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -562,15 +562,18 @@ rotateVBO: if (vertexCount > 0x10000 / 3) vertexCount = 0x10000 / 3; #endif + + if (textureNeedsApply) + textureCache_->ApplyTexture(); + + // Need to ApplyDrawState after ApplyTexture because depal can launch a render pass and that wrecks the state. + ApplyDrawState(prim); + SoftwareTransform( prim, vertexCount, dec_->VertexType(), inds, GE_VTYPE_IDX_16BIT, dec_->GetDecVtxFmt(), maxIndex, drawBuffer, numTrans, drawIndexed, ¶ms, &result); - if (textureNeedsApply) - textureCache_->ApplyTexture(); - - ApplyDrawState(prim); ApplyDrawStateLate(result.setStencil, result.stencilValue); LinkedShader *program = shaderManager_->ApplyFragmentShader(vsid, vshader, lastVType_, prim);