diff --git a/engine/Makefile b/engine/Makefile index 3083f133..36a907dd 100644 --- a/engine/Makefile +++ b/engine/Makefile @@ -48,7 +48,7 @@ ifndef BUILD_AUTOUPDATER # DON'T build unless you mean to! endif # ioquake3 git commit that this is based on -IOQ3_REVISION = b1e6ef14 +IOQ3_REVISION = 972635ea ############################################################################# # @@ -1090,7 +1090,6 @@ endif ifneq ($(HAVE_VM_COMPILED),true) BASE_CFLAGS += -DNO_VM_COMPILED - BUILD_GAME_QVM=0 endif TARGETS = diff --git a/engine/code/renderergl2/tr_backend.c b/engine/code/renderergl2/tr_backend.c index ba3e2abb..7387101b 100644 --- a/engine/code/renderergl2/tr_backend.c +++ b/engine/code/renderergl2/tr_backend.c @@ -342,9 +342,7 @@ void RB_BeginDrawingView (void) { { FBO_t *fbo = backEnd.viewParms.targetFbo; - // FIXME: HUGE HACK: render to the screen fbo if we've already postprocessed the frame and aren't drawing more world - // drawing more world check is in case of double renders, such as skyportals - if (fbo == NULL && !(backEnd.framePostProcessed && (backEnd.refdef.rdflags & RDF_NOWORLDMODEL))) + if (fbo == NULL && (!r_postProcess->integer || !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL))) fbo = tr.renderFbo; if (tr.renderCubeFbo && fbo == tr.renderCubeFbo) @@ -708,10 +706,9 @@ void RE_StretchRaw (int x, int y, int w, int h, int cols, int rows, const byte * ri.Printf( PRINT_ALL, "qglTexSubImage2D %i, %i: %i msec\n", cols, rows, end - start ); } - // FIXME: HUGE hack if (glRefConfig.framebufferObject) { - FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo); + FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo); } RB_SetGL2D(); @@ -795,9 +792,8 @@ const void *RB_StretchPic ( const void *data ) { cmd = (const stretchPicCommand_t *)data; - // FIXME: HUGE hack if (glRefConfig.framebufferObject) - FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo); + FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo); RB_SetGL2D(); @@ -1173,6 +1169,13 @@ const void *RB_DrawSurfs( const void *data ) { qglGenerateTextureMipmapEXT(cubemap->image->texnum, GL_TEXTURE_CUBE_MAP); } + // FIXME? backEnd.viewParms doesn't get properly initialized for 2D drawing. + // r_cubeMapping 1 generates cubemaps with R_RenderCubemapSide() + // and sets isMirror = qtrue. Clear it here to prevent it from leaking + // to 2D drawing and causing the loading screen to be culled. + backEnd.viewParms.isMirror = qfalse; + backEnd.viewParms.flags = 0; + return (const void *)(cmd + 1); } @@ -1201,6 +1204,13 @@ const void *RB_DrawBuffer( const void *data ) { if ( r_clear->integer ) { qglClearColor( 1, 0, 0.5, 1 ); qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + + if (glRefConfig.framebufferObject && tr.renderFbo) { + FBO_Bind(tr.renderFbo); + + qglClearColor( 1, 0, 0.5, 1 ); + qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); + } } return (const void *)(cmd + 1); @@ -1313,14 +1323,7 @@ const void *RB_ClearDepth(const void *data) if (glRefConfig.framebufferObject) { - if (!tr.renderFbo || backEnd.framePostProcessed) - { - FBO_Bind(NULL); - } - else - { - FBO_Bind(tr.renderFbo); - } + FBO_Bind(tr.renderFbo); } qglClear(GL_DEPTH_BUFFER_BIT); @@ -1378,7 +1381,7 @@ const void *RB_SwapBuffers( const void *data ) { if (glRefConfig.framebufferObject) { - if (!backEnd.framePostProcessed) + if (!r_postProcess->integer) { if (tr.msaaResolveFbo && r_hdr->integer) { @@ -1401,7 +1404,6 @@ const void *RB_SwapBuffers( const void *data ) { GLimp_EndFrame(); - backEnd.framePostProcessed = qfalse; backEnd.projection2D = qfalse; return (const void *)(cmd + 1); @@ -1655,8 +1657,6 @@ const void *RB_PostProcess(const void *data) } #endif - backEnd.framePostProcessed = qtrue; - return (const void *)(cmd + 1); } diff --git a/engine/code/renderergl2/tr_fbo.c b/engine/code/renderergl2/tr_fbo.c index 26f50c3f..b0a9478f 100644 --- a/engine/code/renderergl2/tr_fbo.c +++ b/engine/code/renderergl2/tr_fbo.c @@ -170,9 +170,13 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample) } absent = *pRenderBuffer == 0; - if (absent) + if (absent) { qglGenRenderbuffers(1, pRenderBuffer); + // workaround AMD Windows driver requiring bind to create renderbuffer + GL_BindRenderbuffer(*pRenderBuffer); + } + if (multisample && glRefConfig.framebufferMultisample) qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height); else diff --git a/engine/code/renderergl2/tr_local.h b/engine/code/renderergl2/tr_local.h index 668dbbdd..adbb3d59 100644 --- a/engine/code/renderergl2/tr_local.h +++ b/engine/code/renderergl2/tr_local.h @@ -1472,7 +1472,6 @@ typedef struct { FBO_t *last2DFBO; qboolean colorMask[4]; - qboolean framePostProcessed; qboolean depthFill; } backEndState_t;