Skip to content

Commit 29c5ad6

Browse files
committed
Fix uninitialised mips in contrast and bloom textures
1 parent 356efc5 commit 29c5ad6

File tree

1 file changed

+8
-13
lines changed

1 file changed

+8
-13
lines changed

src/engine/renderer/tr_image.cpp

Lines changed: 8 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2538,14 +2538,12 @@ static void R_CreateContrastRenderFBOImage()
25382538
return;
25392539
}
25402540

2541-
int width, height;
2542-
2543-
width = glConfig.vidWidth * 0.25f;
2544-
height = glConfig.vidHeight * 0.25f;
2541+
const int width = glConfig.vidWidth * 0.25f;
2542+
const int height = glConfig.vidHeight * 0.25f;
25452543

25462544
imageParams_t imageParams = {};
25472545
imageParams.bits = IF_NOPICMIP;
2548-
imageParams.filterType = filterType_t::FT_DEFAULT;
2546+
imageParams.filterType = filterType_t::FT_LINEAR;
25492547
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
25502548

25512549
tr.contrastRenderFBOImage = R_CreateImage( "_contrastRenderFBO", nullptr, width, height, 1, imageParams );
@@ -2558,20 +2556,17 @@ static void R_CreateBloomRenderFBOImages()
25582556
return;
25592557
}
25602558

2561-
int i;
2562-
int width, height;
2563-
2564-
width = glConfig.vidWidth * 0.25f;
2565-
height = glConfig.vidHeight * 0.25f;
2559+
const int width = glConfig.vidWidth * 0.25f;
2560+
const int height = glConfig.vidHeight * 0.25f;
25662561

2567-
for ( i = 0; i < 2; i++ )
2562+
for ( int i = 0; i < 2; i++ )
25682563
{
25692564
imageParams_t imageParams = {};
25702565
imageParams.bits = IF_NOPICMIP;
2571-
imageParams.filterType = filterType_t::FT_DEFAULT;
2566+
imageParams.filterType = filterType_t::FT_LINEAR;
25722567
imageParams.wrapType = wrapTypeEnum_t::WT_CLAMP;
25732568

2574-
tr.bloomRenderFBOImage[ i ] = R_CreateImage( va( "_bloomRenderFBO%d", i ), nullptr, width, height, 1, imageParams );
2569+
tr.bloomRenderFBOImage[i] = R_CreateImage( va( "_bloomRenderFBO%d", i ), nullptr, width, height, 1, imageParams );
25752570
}
25762571
}
25772572

0 commit comments

Comments
 (0)