Skip to content

Commit 7552d3c

Browse files
committed
Don't recalculate deform index for every shader stage
1 parent def3c4a commit 7552d3c

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/engine/renderer/tr_local.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1145,7 +1145,7 @@ enum class realtimeLightingRenderer_t { LEGACY, TILED };
11451145

11461146
bool isCubeMap;
11471147

1148-
int deformIndex;
1148+
int deformIndex; // FIXME: should be on the shader level, not per-stage
11491149
bool overrideNoPicMip; // for images that must always be full resolution
11501150
bool overrideFilterType; // for console fonts, 2D elements, etc.
11511151
filterType_t filterType;

src/engine/renderer/tr_shader.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5210,13 +5210,15 @@ static void FinishStages()
52105210

52115211
GroupActiveStages();
52125212

5213+
int deformIndex = shader.numDeforms > 0
5214+
? gl_shaderManager.getDeformShaderIndex( shader.deforms, shader.numDeforms )
5215+
: 0;
5216+
52135217
for ( size_t s = 0; s < numStages; s++ )
52145218
{
52155219
shaderStage_t *stage = &stages[ s ];
52165220

5217-
if ( shader.numDeforms > 0 ) {
5218-
stage->deformIndex = gl_shaderManager.getDeformShaderIndex( shader.deforms, shader.numDeforms );
5219-
}
5221+
stage->deformIndex = deformIndex;
52205222

52215223
// We should cancel overbright if there is no light stage.
52225224
stage->cancelOverBright = shaderHasNoLight;

0 commit comments

Comments
 (0)