Clearing FBOs on bind was a bit too aggressive an optimization.

This commit is contained in:
Henrik Rydgard 2013-01-23 08:31:29 +01:00
parent dbdd461a53
commit a7bc2ea120

View File

@ -415,10 +415,12 @@ void GLES_GPU::SetRenderFrameBuffer() {
gstate_c.textureChanged = true;
fbo_bind_as_render_target(vfb->fbo);
// Tiled renderers benefit IMMENSELY from clearing an FBO before rendering
// to it. Let's hope this doesn't break too many things...
#ifdef USING_GLES2
glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
// Tiled renderers benefit IMMENSELY from clearing an FBO before rendering
// to it. Let's hope this doesn't break too many things...
// It did, will have to find a better solution like clearing only if this is
// the first time the buffer is bound on this frame.
// glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT | GL_STENCIL_BUFFER_BIT);
#endif
glstate.viewport.set(0, 0, renderWidth_, renderHeight_);
currentRenderVfb_ = vfb;