Skip to content

Commit ab2349a

Browse files
committed
Use tess.vboVertexAnimation instead of glState.vertexAttribsInterpolation to check for vertex animation
1 parent cbdec03 commit ab2349a

File tree

3 files changed

+8
-12
lines changed

3 files changed

+8
-12
lines changed

src/engine/renderer/GeometryOptimiser.cpp

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,6 @@ void MarkShaderBuild( const shader_t* shader, const int lightMapNum, const bool
129129

130130
tess.vboVertexSkinning = vertexSkinning;
131131
tess.vboVertexAnimation = vertexAnimation;
132-
/* Fuck knows why there are 2 different ways of setting the vertex animation global (through tess and through glState),
133-
but that's what we have */
134-
glState.vertexAttribsInterpolation = vertexAnimation ? 1.0f : 0.0f;
135132

136133
for ( const shaderStage_t* pStage = shader->stages; pStage < shader->lastStage; pStage++ ) {
137134
pStage->shaderBuildMarker( pStage );
@@ -142,7 +139,6 @@ void MarkShaderBuild( const shader_t* shader, const int lightMapNum, const bool
142139

143140
tess.vboVertexSkinning = false;
144141
tess.vboVertexAnimation = false;
145-
glState.vertexAttribsInterpolation = 0.0f;
146142
}
147143

148144
static void CoreResetSurfaceViewCounts( bspSurface_t** rendererSurfaces, int numSurfaces ) {

src/engine/renderer/tr_backend.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -677,7 +677,7 @@ void GL_VertexAttribPointers( uint32_t attribBits )
677677

678678
if ( ( attribBits & bit ) != 0 &&
679679
( !( glState.vertexAttribPointersSet & bit ) ||
680-
glState.vertexAttribsInterpolation >= 0 ||
680+
tess.vboVertexAnimation ||
681681
glState.currentVBO == tess.vbo ) )
682682
{
683683
const vboAttributeLayout_t *layout = &glState.currentVBO->attribs[ i ];

src/engine/renderer/tr_shade.cpp

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -876,12 +876,12 @@ void ProcessShaderReflection( const shaderStage_t* pStage ) {
876876
gl_reflectionShader->SetReliefMapping( pStage->enableReliefMapping );
877877

878878
gl_reflectionShader->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
879-
gl_reflectionShader->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
879+
gl_reflectionShader->SetVertexAnimation( tess.vboVertexAnimation );
880880
}
881881

882882
void ProcessShaderHeatHaze( const shaderStage_t* ) {
883883
gl_heatHazeShader->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
884-
gl_heatHazeShader->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
884+
gl_heatHazeShader->SetVertexAnimation( tess.vboVertexAnimation );
885885
}
886886

887887
void ProcessShaderLiquid( const shaderStage_t* pStage ) {
@@ -900,7 +900,7 @@ void ProcessShaderLiquid( const shaderStage_t* pStage ) {
900900

901901
void ProcessShaderFog( const shaderStage_t* ) {
902902
gl_heatHazeShader->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
903-
gl_heatHazeShader->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
903+
gl_heatHazeShader->SetVertexAnimation( tess.vboVertexAnimation );
904904
}
905905

906906
void Render_NONE( shaderStage_t * )
@@ -1300,7 +1300,7 @@ static void Render_shadowFill( shaderStage_t *pStage )
13001300
GL_State( stateBits );
13011301

13021302
gl_shadowFillShader->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
1303-
gl_shadowFillShader->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
1303+
gl_shadowFillShader->SetVertexAnimation( tess.vboVertexAnimation );
13041304

13051305
gl_shadowFillShader->SetMacro_LIGHT_DIRECTIONAL( backEnd.currentLight->l.rlType == refLightType_t::RL_DIRECTIONAL );
13061306

@@ -1374,7 +1374,7 @@ static void Render_forwardLighting_DBS_omni( shaderStage_t *pStage,
13741374

13751375
// choose right shader program ----------------------------------
13761376
gl_forwardLightingShader_omniXYZ->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
1377-
gl_forwardLightingShader_omniXYZ->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
1377+
gl_forwardLightingShader_omniXYZ->SetVertexAnimation( tess.vboVertexAnimation );
13781378

13791379
gl_forwardLightingShader_omniXYZ->SetHeightMapInNormalMap( pStage->hasHeightMapInNormalMap );
13801380

@@ -1549,7 +1549,7 @@ static void Render_forwardLighting_DBS_proj( shaderStage_t *pStage,
15491549

15501550
// choose right shader program ----------------------------------
15511551
gl_forwardLightingShader_projXYZ->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
1552-
gl_forwardLightingShader_projXYZ->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
1552+
gl_forwardLightingShader_projXYZ->SetVertexAnimation( tess.vboVertexAnimation );
15531553

15541554
gl_forwardLightingShader_projXYZ->SetHeightMapInNormalMap( pStage->hasHeightMapInNormalMap );
15551555

@@ -1725,7 +1725,7 @@ static void Render_forwardLighting_DBS_directional( shaderStage_t *pStage, trRef
17251725

17261726
// choose right shader program ----------------------------------
17271727
gl_forwardLightingShader_directionalSun->SetVertexSkinning( glConfig2.vboVertexSkinningAvailable && tess.vboVertexSkinning );
1728-
gl_forwardLightingShader_directionalSun->SetVertexAnimation( glState.vertexAttribsInterpolation > 0 );
1728+
gl_forwardLightingShader_directionalSun->SetVertexAnimation( tess.vboVertexAnimation );
17291729

17301730
gl_forwardLightingShader_directionalSun->SetHeightMapInNormalMap( pStage->hasHeightMapInNormalMap );
17311731

0 commit comments

Comments
 (0)