diff options
Diffstat (limited to 'src/rend2/tr_backend.c')
-rw-r--r-- | src/rend2/tr_backend.c | 32 |
1 files changed, 20 insertions, 12 deletions
diff --git a/src/rend2/tr_backend.c b/src/rend2/tr_backend.c index 8c481e61..720cf1e9 100644 --- a/src/rend2/tr_backend.c +++ b/src/rend2/tr_backend.c @@ -815,7 +815,8 @@ void RB_RenderDrawSurfList( drawSurf_t *drawSurfs, int numDrawSurfs ) { } #endif - FBO_Bind(fbo); + if (glRefConfig.framebufferObject) + FBO_Bind(fbo); // go back to the world modelview matrix @@ -1193,12 +1194,12 @@ const void *RB_DrawSurfs( const void *data ) { // clear the z buffer, set the modelview, etc RB_BeginDrawingView (); - if ((backEnd.viewParms.flags & VPF_DEPTHCLAMP) && glRefConfig.depthClamp) + if (glRefConfig.framebufferObject && (backEnd.viewParms.flags & VPF_DEPTHCLAMP) && glRefConfig.depthClamp) { qglEnable(GL_DEPTH_CLAMP); } - if (!(backEnd.refdef.rdflags & RDF_NOWORLDMODEL) && (r_depthPrepass->integer || (backEnd.viewParms.flags & VPF_DEPTHSHADOW))) + if (glRefConfig.framebufferObject && !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL) && (r_depthPrepass->integer || (backEnd.viewParms.flags & VPF_DEPTHSHADOW))) { FBO_t *oldFbo = glState.currentFBO; @@ -1416,7 +1417,7 @@ const void *RB_DrawSurfs( const void *data ) { SetViewportAndScissor(); } - if ((backEnd.viewParms.flags & VPF_DEPTHCLAMP) && glRefConfig.depthClamp) + if (glRefConfig.framebufferObject && (backEnd.viewParms.flags & VPF_DEPTHCLAMP) && glRefConfig.depthClamp) { qglDisable(GL_DEPTH_CLAMP); } @@ -1435,8 +1436,8 @@ const void *RB_DrawSurfs( const void *data ) { RB_RenderFlares(); } - if (glRefConfig.framebufferObject) - FBO_Bind(NULL); + //if (glRefConfig.framebufferObject) + //FBO_Bind(NULL); return (const void *)(cmd + 1); } @@ -1453,6 +1454,9 @@ const void *RB_DrawBuffer( const void *data ) { cmd = (const drawBufferCommand_t *)data; + if (glRefConfig.framebufferObject) + FBO_Bind(NULL); + qglDrawBuffer( cmd->buffer ); // clear screen for debugging @@ -1564,14 +1568,18 @@ const void *RB_ClearDepth(const void *data) if (r_showImages->integer) RB_ShowImages(); - if (backEnd.framePostProcessed && (backEnd.refdef.rdflags & RDF_NOWORLDMODEL)) - { - FBO_Bind(tr.screenScratchFbo); - } - else + if (glRefConfig.framebufferObject) { - FBO_Bind(tr.renderFbo); + if (backEnd.framePostProcessed && (backEnd.refdef.rdflags & RDF_NOWORLDMODEL)) + { + FBO_Bind(tr.screenScratchFbo); + } + else + { + FBO_Bind(tr.renderFbo); + } } + qglClear(GL_DEPTH_BUFFER_BIT); // if we're doing MSAA, clear the depth texture for the resolve buffer |