Skip to content

Commit

Permalink
Fix depal/indexed rendering in core profile.
Browse files Browse the repository at this point in the history
Oops, this needs to be bound after we apply the texture.
  • Loading branch information
unknownbrackets committed May 21, 2016
1 parent bb7dd90 commit 7f1ed07
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions GPU/GLES/DrawEngineGLES.cpp
Expand Up @@ -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()) {
Expand All @@ -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);

Expand Down

0 comments on commit 7f1ed07

Please sign in to comment.