Skip to content

Commit

Permalink
renderer: do not create bloom images when unused
Browse files Browse the repository at this point in the history
  • Loading branch information
illwieckz committed Sep 26, 2024
1 parent 71a393f commit def3c4a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/engine/renderer/tr_fbo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,7 @@ void R_InitFBOs()
R_CheckFBO( tr.portalRenderFBO );
}

if ( glConfig2.bloom )
{
width = glConfig.vidWidth * 0.25f;
height = glConfig.vidHeight * 0.25f;
Expand Down
14 changes: 12 additions & 2 deletions src/engine/renderer/tr_image.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2385,6 +2385,11 @@ static void R_CreateNoFalloffImage()

static void R_CreateContrastRenderFBOImage()
{
if ( !glConfig2.bloom)
{
return;
}

int width, height;

width = glConfig.vidWidth * 0.25f;
Expand All @@ -2398,8 +2403,13 @@ static void R_CreateContrastRenderFBOImage()
tr.contrastRenderFBOImage = R_CreateImage( "_contrastRenderFBO", nullptr, width, height, 1, imageParams );
}

static void R_CreateBloomRenderFBOImage()
static void R_CreateBloomRenderFBOImages()
{
if ( !glConfig2.bloom)
{
return;
}

int i;
int width, height;

Expand Down Expand Up @@ -2886,7 +2896,7 @@ void R_CreateBuiltinImages()
R_CreateFogImage();
R_CreateNoFalloffImage();
R_CreateContrastRenderFBOImage();
R_CreateBloomRenderFBOImage();
R_CreateBloomRenderFBOImages();
R_CreateCurrentRenderImage();
R_CreateDepthRenderImage();
R_CreatePortalRenderImage();
Expand Down

0 comments on commit def3c4a

Please sign in to comment.