Skip to content

Commit 0a6847d

Browse files
committed
tr_shader: do not load heatHaze map when heatHaze is disabled
1 parent 4f72207 commit 0a6847d

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/engine/renderer/tr_shader.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3276,6 +3276,13 @@ static bool ParseStage( shaderStage_t *stage, const char **text )
32763276
// compute state bits
32773277
stage->stateBits = colorMaskBits | depthMaskBits | blendSrcBits | blendDstBits | atestBits | depthFuncBits | polyModeBits;
32783278

3279+
// Do not load heatHaze maps when r_heatHaze is disabled.
3280+
if ( stage->type == stageType_t::ST_HEATHAZEMAP && !r_heatHaze->integer )
3281+
{
3282+
stage->active = false;
3283+
return true;
3284+
}
3285+
32793286
// load image
32803287
if ( loadMap && !LoadMap( stage, buffer, stage->type ) )
32813288
{
@@ -5180,7 +5187,6 @@ static void FinishStages()
51805187
switch ( stage->type )
51815188
{
51825189
case stageType_t::ST_HEATHAZEMAP:
5183-
stage->active = r_heatHaze->integer;
51845190
stage->stateBits &= ~( GLS_ATEST_BITS | GLS_DEPTHMASK_TRUE );
51855191
break;
51865192

0 commit comments

Comments
 (0)