ioquake3 resync to commit 972635ea from b1e6ef14

Build QVMs even if there is no QVM JIT
OpenGL2: Fix border for cg_viewsize using HDR/FB-MSAA w/postProcess
OpenGL2: Fix r_clear when using HDR/FB-MSAA
OpenGL2: Fix FB-MSAA on AMD Windows driver
OpenGL2: Fix updating the loading screen with r_cubeMapping 1
This commit is contained in:
Zack Middleton 2023-12-18 20:48:31 -06:00
parent a19b0be747
commit 91aebdd96f
4 changed files with 25 additions and 23 deletions

View file

@ -48,7 +48,7 @@ ifndef BUILD_AUTOUPDATER # DON'T build unless you mean to!
endif endif
# ioquake3 git commit that this is based on # ioquake3 git commit that this is based on
IOQ3_REVISION = b1e6ef14 IOQ3_REVISION = 972635ea
############################################################################# #############################################################################
# #
@ -1090,7 +1090,6 @@ endif
ifneq ($(HAVE_VM_COMPILED),true) ifneq ($(HAVE_VM_COMPILED),true)
BASE_CFLAGS += -DNO_VM_COMPILED BASE_CFLAGS += -DNO_VM_COMPILED
BUILD_GAME_QVM=0
endif endif
TARGETS = TARGETS =

View file

@ -342,9 +342,7 @@ void RB_BeginDrawingView (void) {
{ {
FBO_t *fbo = backEnd.viewParms.targetFbo; 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 if (fbo == NULL && (!r_postProcess->integer || !(backEnd.refdef.rdflags & RDF_NOWORLDMODEL)))
// drawing more world check is in case of double renders, such as skyportals
if (fbo == NULL && !(backEnd.framePostProcessed && (backEnd.refdef.rdflags & RDF_NOWORLDMODEL)))
fbo = tr.renderFbo; fbo = tr.renderFbo;
if (tr.renderCubeFbo && fbo == tr.renderCubeFbo) 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 ); ri.Printf( PRINT_ALL, "qglTexSubImage2D %i, %i: %i msec\n", cols, rows, end - start );
} }
// FIXME: HUGE hack
if (glRefConfig.framebufferObject) if (glRefConfig.framebufferObject)
{ {
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo); FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
} }
RB_SetGL2D(); RB_SetGL2D();
@ -795,9 +792,8 @@ const void *RB_StretchPic ( const void *data ) {
cmd = (const stretchPicCommand_t *)data; cmd = (const stretchPicCommand_t *)data;
// FIXME: HUGE hack
if (glRefConfig.framebufferObject) if (glRefConfig.framebufferObject)
FBO_Bind(backEnd.framePostProcessed ? NULL : tr.renderFbo); FBO_Bind(r_postProcess->integer ? NULL : tr.renderFbo);
RB_SetGL2D(); RB_SetGL2D();
@ -1173,6 +1169,13 @@ const void *RB_DrawSurfs( const void *data ) {
qglGenerateTextureMipmapEXT(cubemap->image->texnum, GL_TEXTURE_CUBE_MAP); 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); return (const void *)(cmd + 1);
} }
@ -1201,6 +1204,13 @@ const void *RB_DrawBuffer( const void *data ) {
if ( r_clear->integer ) { if ( r_clear->integer ) {
qglClearColor( 1, 0, 0.5, 1 ); qglClearColor( 1, 0, 0.5, 1 );
qglClear( GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT ); 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); return (const void *)(cmd + 1);
@ -1312,16 +1322,9 @@ const void *RB_ClearDepth(const void *data)
RB_ShowImages(); RB_ShowImages();
if (glRefConfig.framebufferObject) 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); qglClear(GL_DEPTH_BUFFER_BIT);
@ -1378,7 +1381,7 @@ const void *RB_SwapBuffers( const void *data ) {
if (glRefConfig.framebufferObject) if (glRefConfig.framebufferObject)
{ {
if (!backEnd.framePostProcessed) if (!r_postProcess->integer)
{ {
if (tr.msaaResolveFbo && r_hdr->integer) if (tr.msaaResolveFbo && r_hdr->integer)
{ {
@ -1401,7 +1404,6 @@ const void *RB_SwapBuffers( const void *data ) {
GLimp_EndFrame(); GLimp_EndFrame();
backEnd.framePostProcessed = qfalse;
backEnd.projection2D = qfalse; backEnd.projection2D = qfalse;
return (const void *)(cmd + 1); return (const void *)(cmd + 1);
@ -1655,8 +1657,6 @@ const void *RB_PostProcess(const void *data)
} }
#endif #endif
backEnd.framePostProcessed = qtrue;
return (const void *)(cmd + 1); return (const void *)(cmd + 1);
} }

View file

@ -170,9 +170,13 @@ void FBO_CreateBuffer(FBO_t *fbo, int format, int index, int multisample)
} }
absent = *pRenderBuffer == 0; absent = *pRenderBuffer == 0;
if (absent) if (absent) {
qglGenRenderbuffers(1, pRenderBuffer); qglGenRenderbuffers(1, pRenderBuffer);
// workaround AMD Windows driver requiring bind to create renderbuffer
GL_BindRenderbuffer(*pRenderBuffer);
}
if (multisample && glRefConfig.framebufferMultisample) if (multisample && glRefConfig.framebufferMultisample)
qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height); qglNamedRenderbufferStorageMultisampleEXT(*pRenderBuffer, multisample, format, fbo->width, fbo->height);
else else

View file

@ -1472,7 +1472,6 @@ typedef struct {
FBO_t *last2DFBO; FBO_t *last2DFBO;
qboolean colorMask[4]; qboolean colorMask[4];
qboolean framePostProcessed;
qboolean depthFill; qboolean depthFill;
} backEndState_t; } backEndState_t;