From 7f1ed0737e68de4b62694b2a94610c9683472728 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sat, 21 May 2016 15:30:54 -0700 Subject: [PATCH] Fix depal/indexed rendering in core profile. Oops, this needs to be bound after we apply the texture. --- GPU/GLES/DrawEngineGLES.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/GPU/GLES/DrawEngineGLES.cpp b/GPU/GLES/DrawEngineGLES.cpp index f13b061dc01c..0663d2d013db 100644 --- a/GPU/GLES/DrawEngineGLES.cpp +++ b/GPU/GLES/DrawEngineGLES.cpp @@ -847,13 +847,6 @@ void DrawEngineGLES::DoFlush() { prim = indexGen.Prim(); } - if (gstate_c.Supports(GPU_SUPPORTS_VAO) && vbo == 0) { - vbo = BindBuffer(decoded, dec_->GetDecVtxFmt().stride * indexGen.MaxIndex()); - if (useElements) { - ebo = BindElementBuffer(decIndex, sizeof(short) * indexGen.VertexCount()); - } - } - VERBOSE_LOG(G3D, "Flush prim %i! %i verts in one go", prim, vertexCount); bool hasColor = (lastVType_ & GE_VTYPE_COL_MASK) != GE_VTYPE_COL_NONE; if (gstate.isModeThrough()) { @@ -863,6 +856,14 @@ void DrawEngineGLES::DoFlush() { } ApplyDrawStateLate(); + + if (gstate_c.Supports(GPU_SUPPORTS_VAO) && vbo == 0) { + vbo = BindBuffer(decoded, dec_->GetDecVtxFmt().stride * indexGen.MaxIndex()); + if (useElements) { + ebo = BindElementBuffer(decIndex, sizeof(short) * indexGen.VertexCount()); + } + } + LinkedShader *program = shaderManager_->ApplyFragmentShader(vsid, vshader, lastVType_, prim); SetupDecFmtForDraw(program, dec_->GetDecVtxFmt(), vbo ? 0 : decoded);