GL3: Only use FBO if under water

because on some systems (like RPi4 with my experimental GLES3 branch)
the overhead of a FBO is really noticeable, so no reason to pay for it
when it's not needed
This commit is contained in:
Daniel Gibson 2022-04-26 04:06:42 +02:00
parent 3d619a1441
commit c6145b4e6a

View file

@ -1357,7 +1357,9 @@ SetupGL(void)
// set up the FBO accordingly, but only if actually rendering the world
// (=> don't use FBO when rendering the playermodel in the player menu)
if (gl3_usefbo->value && (gl3_newrefdef.rdflags & RDF_NOWORLDMODEL) == 0 && gl3state.ppFBO != 0)
// also, only do this when under water, because this has a noticeable overhead on some systems
if (gl3_usefbo->value && gl3state.ppFBO != 0
&& (gl3_newrefdef.rdflags & (RDF_NOWORLDMODEL|RDF_UNDERWATER)) == RDF_UNDERWATER)
{
glBindFramebuffer(GL_FRAMEBUFFER, gl3state.ppFBO);
gl3state.ppFBObound = true;