Skip to content

Commit bf8fe39

Browse files
committed
NUKE unused shader uniforms
1 parent ccbee97 commit bf8fe39

File tree

10 files changed

+2
-58
lines changed

10 files changed

+2
-58
lines changed

src/engine/renderer/Material.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1138,8 +1138,6 @@ void BindShaderSkybox( Material* material ) {
11381138
gl_skyboxShaderMaterial->BindProgram( material->deformIndex );
11391139

11401140
// Set shader uniforms.
1141-
gl_skyboxShaderMaterial->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin );
1142-
gl_skyboxShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
11431141
gl_skyboxShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );
11441142
}
11451143

@@ -1156,7 +1154,6 @@ void BindShaderHeatHaze( Material* material ) {
11561154
gl_heatHazeShaderMaterial->BindProgram( material->deformIndex );
11571155

11581156
// Set shader uniforms.
1159-
gl_heatHazeShaderMaterial->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
11601157
gl_heatHazeShaderMaterial->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[glState.stackIndex] );
11611158

11621159
gl_heatHazeShaderMaterial->SetUniform_ModelViewMatrixTranspose( glState.modelViewMatrix[glState.stackIndex] );

src/engine/renderer/gl_shader.cpp

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2553,7 +2553,6 @@ GLShader_shadowFill::GLShader_shadowFill( GLShaderManager *manager ) :
25532553
GLShader( "shadowFill", ATTR_POSITION | ATTR_TEXCOORD | ATTR_QTANGENT, manager ),
25542554
u_ColorMap( this ),
25552555
u_TextureMatrix( this ),
2556-
u_ViewOrigin( this ),
25572556
u_AlphaThreshold( this ),
25582557
u_LightOrigin( this ),
25592558
u_LightRadius( this ),
@@ -2633,11 +2632,9 @@ GLShader_skybox::GLShader_skybox( GLShaderManager *manager ) :
26332632
u_ColorMapCube( this ),
26342633
u_CloudMap( this ),
26352634
u_TextureMatrix( this ),
2636-
u_ViewOrigin( this ),
26372635
u_CloudHeight( this ),
26382636
u_UseCloudMap( this ),
26392637
u_AlphaThreshold( this ),
2640-
u_ModelMatrix( this ),
26412638
u_ModelViewProjectionMatrix( this )
26422639
{
26432640
}
@@ -2653,11 +2650,9 @@ GLShader_skyboxMaterial::GLShader_skyboxMaterial( GLShaderManager* manager ) :
26532650
u_ColorMapCube( this ),
26542651
u_CloudMap( this ),
26552652
u_TextureMatrix( this ),
2656-
u_ViewOrigin( this ),
26572653
u_CloudHeight( this ),
26582654
u_UseCloudMap( this ),
26592655
u_AlphaThreshold( this ),
2660-
u_ModelMatrix( this ),
26612656
u_ModelViewProjectionMatrix( this )
26622657
{}
26632658

@@ -2708,13 +2703,10 @@ GLShader_fogGlobal::GLShader_fogGlobal( GLShaderManager *manager ) :
27082703
GLShader( "fogGlobal", ATTR_POSITION, manager ),
27092704
u_ColorMap( this ),
27102705
u_DepthMap( this ),
2711-
u_ViewOrigin( this ),
2712-
u_ViewMatrix( this ),
27132706
u_ModelViewProjectionMatrix( this ),
27142707
u_UnprojectMatrix( this ),
27152708
u_Color( this ),
2716-
u_FogDistanceVector( this ),
2717-
u_FogDepthVector( this )
2709+
u_FogDistanceVector( this )
27182710
{
27192711
}
27202712

@@ -2730,15 +2722,10 @@ GLShader_heatHaze::GLShader_heatHaze( GLShaderManager *manager ) :
27302722
u_NormalMap( this ),
27312723
u_HeightMap( this ),
27322724
u_TextureMatrix( this ),
2733-
u_ViewOrigin( this ),
2734-
u_ViewUp( this ),
27352725
u_DeformMagnitude( this ),
2736-
u_ModelMatrix( this ),
27372726
u_ModelViewProjectionMatrix( this ),
27382727
u_ModelViewMatrixTranspose( this ),
27392728
u_ProjectionMatrixTranspose( this ),
2740-
u_ColorModulate( this ),
2741-
u_Color( this ),
27422729
u_Bones( this ),
27432730
u_NormalScale( this ),
27442731
u_VertexInterpolation( this ),
@@ -2761,16 +2748,11 @@ GLShader_heatHazeMaterial::GLShader_heatHazeMaterial( GLShaderManager* manager )
27612748
u_NormalMap( this ),
27622749
u_HeightMap( this ),
27632750
u_TextureMatrix( this ),
2764-
u_ViewOrigin( this ),
2765-
u_ViewUp( this ),
27662751
u_DeformEnable( this ),
27672752
u_DeformMagnitude( this ),
2768-
u_ModelMatrix( this ),
27692753
u_ModelViewProjectionMatrix( this ),
27702754
u_ModelViewMatrixTranspose( this ),
27712755
u_ProjectionMatrixTranspose( this ),
2772-
u_ColorModulate( this ),
2773-
u_Color( this ),
27742756
u_NormalScale( this ),
27752757
GLDeformStage( this )
27762758
{
@@ -2837,7 +2819,6 @@ GLShader_cameraEffects::GLShader_cameraEffects( GLShaderManager *manager ) :
28372819
u_ColorModulate( this ),
28382820
u_TextureMatrix( this ),
28392821
u_ModelViewProjectionMatrix( this ),
2840-
u_DeformMagnitude( this ),
28412822
u_InverseGamma( this )
28422823
{
28432824
}

src/engine/renderer/gl_shader.h

Lines changed: 1 addition & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4240,7 +4240,6 @@ class GLShader_shadowFill :
42404240
public GLShader,
42414241
public u_ColorMap,
42424242
public u_TextureMatrix,
4243-
public u_ViewOrigin,
42444243
public u_AlphaThreshold,
42454244
public u_LightOrigin,
42464245
public u_LightRadius,
@@ -4311,11 +4310,9 @@ class GLShader_skybox :
43114310
public u_ColorMapCube,
43124311
public u_CloudMap,
43134312
public u_TextureMatrix,
4314-
public u_ViewOrigin,
43154313
public u_CloudHeight,
43164314
public u_UseCloudMap,
43174315
public u_AlphaThreshold,
4318-
public u_ModelMatrix,
43194316
public u_ModelViewProjectionMatrix
43204317
{
43214318
public:
@@ -4328,11 +4325,9 @@ class GLShader_skyboxMaterial :
43284325
public u_ColorMapCube,
43294326
public u_CloudMap,
43304327
public u_TextureMatrix,
4331-
public u_ViewOrigin,
43324328
public u_CloudHeight,
43334329
public u_UseCloudMap,
43344330
public u_AlphaThreshold,
4335-
public u_ModelMatrix,
43364331
public u_ModelViewProjectionMatrix {
43374332
public:
43384333
GLShader_skyboxMaterial( GLShaderManager* manager );
@@ -4378,13 +4373,10 @@ class GLShader_fogGlobal :
43784373
public GLShader,
43794374
public u_ColorMap,
43804375
public u_DepthMap,
4381-
public u_ViewOrigin,
4382-
public u_ViewMatrix,
43834376
public u_ModelViewProjectionMatrix,
43844377
public u_UnprojectMatrix,
43854378
public u_Color,
4386-
public u_FogDistanceVector,
4387-
public u_FogDepthVector
4379+
public u_FogDistanceVector
43884380
{
43894381
public:
43904382
GLShader_fogGlobal( GLShaderManager *manager );
@@ -4397,15 +4389,10 @@ class GLShader_heatHaze :
43974389
public u_NormalMap,
43984390
public u_HeightMap,
43994391
public u_TextureMatrix,
4400-
public u_ViewOrigin,
4401-
public u_ViewUp,
44024392
public u_DeformMagnitude,
4403-
public u_ModelMatrix,
44044393
public u_ModelViewProjectionMatrix,
44054394
public u_ModelViewMatrixTranspose,
44064395
public u_ProjectionMatrixTranspose,
4407-
public u_ColorModulate,
4408-
public u_Color,
44094396
public u_Bones,
44104397
public u_NormalScale,
44114398
public u_VertexInterpolation,
@@ -4424,16 +4411,11 @@ class GLShader_heatHazeMaterial :
44244411
public u_NormalMap,
44254412
public u_HeightMap,
44264413
public u_TextureMatrix,
4427-
public u_ViewOrigin,
4428-
public u_ViewUp,
44294414
public u_DeformEnable,
44304415
public u_DeformMagnitude,
4431-
public u_ModelMatrix,
44324416
public u_ModelViewProjectionMatrix,
44334417
public u_ModelViewMatrixTranspose,
44344418
public u_ProjectionMatrixTranspose,
4435-
public u_ColorModulate,
4436-
public u_Color,
44374419
public u_NormalScale,
44384420
public GLDeformStage
44394421
{
@@ -4490,7 +4472,6 @@ class GLShader_cameraEffects :
44904472
public u_ColorModulate,
44914473
public u_TextureMatrix,
44924474
public u_ModelViewProjectionMatrix,
4493-
public u_DeformMagnitude,
44944475
public u_InverseGamma
44954476
{
44964477
public:

src/engine/renderer/glsl_source/depthtile1_fp.glsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,6 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
3737
uniform sampler2D u_DepthMap;
3838
IN(flat) vec3 unprojectionParams;
3939

40-
uniform vec3 u_zFar;
41-
4240
const vec2 pixelScale = 1 / r_FBufSize;
4341

4442
DECLARE_OUTPUT(vec4)

src/engine/renderer/glsl_source/fogGlobal_fp.glsl

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,11 +25,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2525
uniform sampler2D u_ColorMap; // fog texture
2626
uniform sampler2D u_DepthMap;
2727

28-
uniform vec3 u_ViewOrigin;
2928
uniform vec4 u_FogDistanceVector;
30-
uniform vec4 u_FogDepthVector;
3129
uniform vec4 u_Color;
32-
uniform mat4 u_ViewMatrix;
3330
uniform mat4 u_UnprojectMatrix;
3431

3532
#if __VERSION__ > 120

src/engine/renderer/glsl_source/fogQuake3_vp.glsl

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2626
#insert vertexSkinning_vp
2727
#insert vertexAnimation_vp
2828

29-
uniform vec3 u_ViewOrigin;
30-
3129
uniform float u_Time;
3230

3331
uniform vec4 u_ColorModulate;

src/engine/renderer/glsl_source/heatHaze_fp.glsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2727
#define HEATHAZE_GLSL
2828

2929
uniform sampler2D u_CurrentMap;
30-
uniform float u_AlphaThreshold;
3130

3231
#if defined(USE_MATERIAL_SYSTEM)
3332
uniform float u_DeformEnable;

src/engine/renderer/glsl_source/reflection_CB_fp.glsl

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
2828

2929
uniform samplerCube u_ColorMapCube;
3030
uniform vec3 u_ViewOrigin;
31-
uniform mat4 u_ModelMatrix;
3231

3332
IN(smooth) vec3 var_Position;
3433
IN(smooth) vec2 var_TexCoords;

src/engine/renderer/tr_backend.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2983,8 +2983,6 @@ void RB_RenderGlobalFog()
29832983
// go back to the world modelview matrix
29842984
backEnd.orientation = backEnd.viewParms.world;
29852985

2986-
gl_fogGlobalShader->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin ); // world space
2987-
29882986
{
29892987
fog_t *fog;
29902988

@@ -3014,7 +3012,6 @@ void RB_RenderGlobalFog()
30143012
gl_fogGlobalShader->SetUniform_Color( fog->color );
30153013
}
30163014

3017-
gl_fogGlobalShader->SetUniform_ViewMatrix( backEnd.viewParms.world.viewMatrix );
30183015
gl_fogGlobalShader->SetUniform_UnprojectMatrix( backEnd.viewParms.unprojectionMatrix );
30193016

30203017
// bind u_ColorMap

src/engine/renderer/tr_shade.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1977,9 +1977,6 @@ void Render_skybox( shaderStage_t *pStage )
19771977

19781978
gl_skyboxShader->BindProgram( pStage->deformIndex );
19791979

1980-
gl_skyboxShader->SetUniform_ViewOrigin( backEnd.viewParms.orientation.origin ); // in world space
1981-
1982-
gl_skyboxShader->SetUniform_ModelMatrix( backEnd.orientation.transformMatrix );
19831980
gl_skyboxShader->SetUniform_ModelViewProjectionMatrix( glState.modelViewProjectionMatrix[ glState.stackIndex ] );
19841981

19851982
// bind u_ColorMap

0 commit comments

Comments
 (0)