Skip to content

Commit

Permalink
Merge pull request Chips-fr#19 from libretro/revert-18-master
Browse files Browse the repository at this point in the history
Revert "There is no need to make the GPU do this work"
  • Loading branch information
inactive123 authored Jul 14, 2016
2 parents fca35fe + e74e2ea commit 1e28482
Showing 1 changed file with 41 additions and 13 deletions.
54 changes: 41 additions & 13 deletions glsm/glsm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2018,22 +2018,50 @@ static void glsm_state_unbind(void)
glDisable(gl_state.cap_translate[i]);
}

gl_state.blendfunc.used = false;
gl_state.colormask.used = false;
gl_state.blendfunc_separate.used = false;
gl_state.cullface.used = false;
gl_state.depthmask.used = false;
gl_state.polygonoffset.used = false;
gl_state.scissor.used = false;
gl_state.depthrange.used = false;
gl_state.stencilmask.used = false;
gl_state.frontface.used = false;
gl_state.depthfunc.used = false;
gl_state.stencilop.used = false;
gl_state.stencilfunc.used = false;
glBlendFunc(GL_ONE, GL_ZERO);

if (gl_state.colormask.used)
glColorMask(GL_TRUE, GL_TRUE, GL_TRUE, GL_TRUE);
if (gl_state.blendfunc_separate.used)
glBlendFuncSeparate(GL_ONE, GL_ZERO, GL_ONE, GL_ZERO);

if (gl_state.cullface.used)
glCullFace(GL_BACK);

if (gl_state.depthmask.used)
glDepthMask(GL_TRUE);

if (gl_state.polygonoffset.used)
glPolygonOffset(0, 0);

glUseProgram(0);
glClearColor(0,0,0,0.0f);

if (gl_state.depthrange.used)
rglDepthRange(0, 1);

glStencilMask(1);
glFrontFace(GL_CCW);
if (gl_state.depthfunc.used)
glDepthFunc(GL_LESS);

if (gl_state.stencilop.used)
glStencilOp(GL_KEEP,GL_KEEP, GL_KEEP);

if (gl_state.stencilfunc.used)
glStencilFunc(GL_ALWAYS,0,1);

/* Clear textures */
for (i = 0; i < glsm_max_textures; i ++)
{
glActiveTexture(GL_TEXTURE0 + i);
glBindTexture(GL_TEXTURE_2D, 0);
}
glActiveTexture(GL_TEXTURE0);

for (i = 0; i < MAX_ATTRIB; i ++)
glDisableVertexAttribArray(i);

glBindFramebuffer(RARCH_GL_FRAMEBUFFER, 0);
}

Expand Down

0 comments on commit 1e28482

Please sign in to comment.