Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Alchemy
Alchemy Next
Commits
5fd28bf0
Commit
5fd28bf0
authored
Sep 18, 2021
by
Rye Mutt
🍞
Browse files
Dead uniform cleanup
parent
89044138
Changes
16
Hide whitespace changes
Inline
Side-by-side
indra/llrender/llrender.cpp
View file @
5fd28bf0
...
...
@@ -1325,11 +1325,6 @@ void LLRender::syncMatrices()
shader
->
uniformMatrix3fv
(
LLShaderMgr
::
NORMAL_MATRIX
,
1
,
GL_FALSE
,
norm_mat
);
}
if
(
shader
->
getUniformLocation
(
LLShaderMgr
::
INVERSE_MODELVIEW_MATRIX
))
{
shader
->
uniformMatrix4fv
(
LLShaderMgr
::
INVERSE_MODELVIEW_MATRIX
,
1
,
GL_FALSE
,
cached_inv_mdv
.
m
);
}
//update MVP matrix
mvp_done
=
true
;
loc
=
shader
->
getUniformLocation
(
LLShaderMgr
::
MODELVIEW_PROJECTION_MATRIX
);
...
...
indra/llrender/llshadermgr.cpp
View file @
5fd28bf0
...
...
@@ -1169,7 +1169,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"projection_matrix"
);
mReservedUniforms
.
push_back
(
"inv_proj"
);
mReservedUniforms
.
push_back
(
"modelview_projection_matrix"
);
mReservedUniforms
.
push_back
(
"inv_modelview"
);
mReservedUniforms
.
push_back
(
"normal_matrix"
);
mReservedUniforms
.
push_back
(
"texture_matrix0"
);
mReservedUniforms
.
push_back
(
"texture_matrix1"
);
...
...
@@ -1195,7 +1194,6 @@ void LLShaderMgr::initAttribsAndUniforms()
//NOTE: MUST match order in eGLSLReservedUniforms
mReservedUniforms
.
push_back
(
"proj_mat"
);
mReservedUniforms
.
push_back
(
"proj_near"
);
mReservedUniforms
.
push_back
(
"proj_p"
);
mReservedUniforms
.
push_back
(
"proj_n"
);
mReservedUniforms
.
push_back
(
"proj_origin"
);
...
...
@@ -1205,9 +1203,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"shadow_fade"
);
mReservedUniforms
.
push_back
(
"proj_focus"
);
mReservedUniforms
.
push_back
(
"proj_lod"
);
mReservedUniforms
.
push_back
(
"proj_ambient_lod"
);
llassert
(
mReservedUniforms
.
size
()
==
LLShaderMgr
::
PROJECTOR_
AMBIENT_
LOD
+
1
);
llassert
(
mReservedUniforms
.
size
()
==
LLShaderMgr
::
PROJECTOR_LOD
+
1
);
mReservedUniforms
.
push_back
(
"color"
);
...
...
@@ -1284,8 +1281,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"moon_dir"
);
mReservedUniforms
.
push_back
(
"shadow_res"
);
mReservedUniforms
.
push_back
(
"proj_shadow_res"
);
mReservedUniforms
.
push_back
(
"depth_cutoff"
);
mReservedUniforms
.
push_back
(
"norm_cutoff"
);
mReservedUniforms
.
push_back
(
"shadow_target_width"
);
llassert
(
mReservedUniforms
.
size
()
==
LLShaderMgr
::
DEFERRED_SHADOW_TARGET_WIDTH
+
1
);
...
...
@@ -1333,7 +1328,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"translationPalette"
);
mReservedUniforms
.
push_back
(
"screenTex"
);
mReservedUniforms
.
push_back
(
"screenDepth"
);
mReservedUniforms
.
push_back
(
"refTex"
);
mReservedUniforms
.
push_back
(
"eyeVec"
);
mReservedUniforms
.
push_back
(
"time"
);
...
...
@@ -1352,8 +1346,6 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"fresnelOffset"
);
mReservedUniforms
.
push_back
(
"blurMultiplier"
);
mReservedUniforms
.
push_back
(
"sunAngle"
);
mReservedUniforms
.
push_back
(
"scaledAngle"
);
mReservedUniforms
.
push_back
(
"sunAngle2"
);
mReservedUniforms
.
push_back
(
"camPosLocal"
);
// [RLVa:KB] - @setsphere
...
...
@@ -1377,14 +1369,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms
.
push_back
(
"origin"
);
mReservedUniforms
.
push_back
(
"inscatter"
);
mReservedUniforms
.
push_back
(
"sun_size"
);
mReservedUniforms
.
push_back
(
"fog_color"
);
mReservedUniforms
.
push_back
(
"transmittance_texture"
);
mReservedUniforms
.
push_back
(
"scattering_texture"
);
mReservedUniforms
.
push_back
(
"single_mie_scattering_texture"
);
mReservedUniforms
.
push_back
(
"irradiance_texture"
);
mReservedUniforms
.
push_back
(
"blend_factor"
);
mReservedUniforms
.
push_back
(
"no_atmo"
);
mReservedUniforms
.
push_back
(
"moisture_level"
);
...
...
indra/llrender/llshadermgr.h
View file @
5fd28bf0
...
...
@@ -43,7 +43,6 @@ class LLShaderMgr
PROJECTION_MATRIX
,
// "projection_matrix"
INVERSE_PROJECTION_MATRIX
,
// "inv_proj"
MODELVIEW_PROJECTION_MATRIX
,
// "modelview_projection_matrix"
INVERSE_MODELVIEW_MATRIX
,
// "inv_modelview"
NORMAL_MATRIX
,
// "normal_matrix"
TEXTURE_MATRIX0
,
// "texture_matrix0"
TEXTURE_MATRIX1
,
// "texture_matrix1"
...
...
@@ -62,7 +61,6 @@ class LLShaderMgr
MULTI_LIGHT_COL
,
// "light_col"
MULTI_LIGHT_FAR_Z
,
// "far_z"
PROJECTOR_MATRIX
,
// "proj_mat"
PROJECTOR_NEAR
,
// "proj_near"
PROJECTOR_P
,
// "proj_p"
PROJECTOR_N
,
// "proj_n"
PROJECTOR_ORIGIN
,
// "proj_origin"
...
...
@@ -72,7 +70,6 @@ class LLShaderMgr
PROJECTOR_SHADOW_FADE
,
// "shadow_fade"
PROJECTOR_FOCUS
,
// "proj_focus"
PROJECTOR_LOD
,
// "proj_lod"
PROJECTOR_AMBIENT_LOD
,
// "proj_ambient_lod"
DIFFUSE_COLOR
,
// "color"
DIFFUSE_MAP
,
// "diffuseMap"
ALTERNATE_DIFFUSE_MAP
,
// "altDiffuseMap"
...
...
@@ -139,8 +136,6 @@ class LLShaderMgr
DEFERRED_MOON_DIR
,
// "moon_dir"
DEFERRED_SHADOW_RES
,
// "shadow_res"
DEFERRED_PROJ_SHADOW_RES
,
// "proj_shadow_res"
DEFERRED_DEPTH_CUTOFF
,
// "depth_cutoff"
DEFERRED_NORM_CUTOFF
,
// "norm_cutoff"
DEFERRED_SHADOW_TARGET_WIDTH
,
// "shadow_target_width"
FXAA_TC_SCALE
,
// "tc_scale"
...
...
@@ -182,7 +177,6 @@ class LLShaderMgr
AVATAR_TRANSLATION
,
// "translationPalette"
WATER_SCREENTEX
,
// "screenTex"
WATER_SCREENDEPTH
,
// "screenDepth"
WATER_REFTEX
,
// "refTex"
WATER_EYEVEC
,
// "eyeVec"
WATER_TIME
,
// "time"
...
...
@@ -201,8 +195,6 @@ class LLShaderMgr
WATER_FRESNEL_OFFSET
,
// "fresnelOffset"
WATER_BLUR_MULTIPLIER
,
// "blurMultiplier"
WATER_SUN_ANGLE
,
// "sunAngle"
WATER_SCALED_ANGLE
,
// "scaledAngle"
WATER_SUN_ANGLE2
,
// "sunAngle2"
WL_CAMPOSLOCAL
,
// "camPosLocal"
// [RLVa:KB] - @setsphere
...
...
@@ -226,15 +218,8 @@ class LLShaderMgr
SHINY_ORIGIN
,
// "origin"
INSCATTER_RT
,
// "inscatter"
SUN_SIZE
,
// "sun_size"
FOG_COLOR
,
// "fog_color"
// precomputed textures
TRANSMITTANCE_TEX
,
// "transmittance_texture"
SCATTER_TEX
,
// "scattering_texture"
SINGLE_MIE_SCATTER_TEX
,
// "single_mie_scattering_texture"
ILLUMINANCE_TEX
,
// "irradiance_texture"
BLEND_FACTOR
,
// "blend_factor"
NO_ATMO
,
// "no_atmo"
...
...
indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl
View file @
5fd28bf0
...
...
@@ -51,7 +51,6 @@ uniform float cloud_scale;
uniform
float
cloud_variance
;
uniform
vec3
camPosLocal
;
uniform
vec3
sun_dir
;
uniform
float
sun_size
;
uniform
float
far_z
;
#if !defined(DEPTH_CLAMP)
...
...
indra/newview/app_settings/shaders/class1/deferred/cofF.glsl
View file @
5fd28bf0
...
...
@@ -37,8 +37,6 @@ uniform sampler2DRect diffuseRect;
uniform
sampler2DRect
depthMap
;
uniform
sampler2D
bloomMap
;
uniform
float
depth_cutoff
;
uniform
float
norm_cutoff
;
uniform
float
focal_distance
;
uniform
float
blur_constant
;
uniform
float
tan_pixel_angle
;
...
...
indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl
View file @
5fd28bf0
...
...
@@ -43,13 +43,11 @@ uniform sampler2D projectionMap;
uniform
sampler2D
lightFunc
;
uniform
mat4
proj_mat
;
//screen space to light space
uniform
float
proj_near
;
//near clip for projection
uniform
vec3
proj_p
;
//plane projection is emitting from (in screen space)
uniform
vec3
proj_n
;
uniform
float
proj_focus
;
//distance from plane to begin blurring
uniform
float
proj_lod
;
//(number of mips in proj map)
uniform
float
proj_range
;
//range between near clip and far clip plane of projection
uniform
float
proj_ambient_lod
;
uniform
float
proj_ambiance
;
uniform
float
near_clip
;
uniform
float
far_clip
;
...
...
indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl
View file @
5fd28bf0
...
...
@@ -43,13 +43,11 @@ uniform sampler2D projectionMap;
uniform
sampler2D
lightFunc
;
uniform
mat4
proj_mat
;
//screen space to light space
uniform
float
proj_near
;
//near clip for projection
uniform
vec3
proj_p
;
//plane projection is emitting from (in screen space)
uniform
vec3
proj_n
;
uniform
float
proj_focus
;
//distance from plane to begin blurring
uniform
float
proj_lod
;
//(number of mips in proj map)
uniform
float
proj_range
;
//range between near clip and far clip plane of projection
uniform
float
proj_ambient_lod
;
uniform
float
proj_ambiance
;
uniform
float
near_clip
;
uniform
float
far_clip
;
...
...
indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl
View file @
5fd28bf0
...
...
@@ -35,7 +35,6 @@ uniform sampler2D diffuseMap;
uniform
sampler2D
bumpMap
;
uniform
sampler2D
screenTex
;
uniform
sampler2D
refTex
;
uniform
sampler2D
screenDepth
;
uniform
vec4
fogCol
;
uniform
vec3
lightDir
;
...
...
indra/newview/app_settings/shaders/class1/deferred/waterF.glsl
View file @
5fd28bf0
...
...
@@ -42,7 +42,6 @@ uniform float blend_factor;
uniform
sampler2D
screenTex
;
uniform
sampler2D
refTex
;
uniform
float
sunAngle
;
uniform
float
sunAngle2
;
uniform
vec3
lightDir
;
uniform
vec3
specular
;
uniform
float
refScale
;
...
...
@@ -159,7 +158,7 @@ void main()
color
.
rgb
=
mix
(
fb
.
rgb
,
refcol
.
rgb
,
df1
);
color
.
rgb
+=
spec
*
specular
;
color
.
a
=
spec
*
sunAngle
2
;
color
.
a
=
spec
*
sunAngle
;
vec3
screenspacewavef
=
normalize
((
norm_mat
*
vec4
(
wavef
,
1
.
0
)).
xyz
);
...
...
indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl
View file @
5fd28bf0
...
...
@@ -33,7 +33,6 @@ uniform sampler2D diffuseMap;
uniform
sampler2D
bumpMap
;
uniform
sampler2D
screenTex
;
uniform
sampler2D
refTex
;
uniform
sampler2D
screenDepth
;
uniform
vec4
fogCol
;
uniform
vec3
lightDir
;
...
...
indra/newview/app_settings/shaders/class1/environment/waterF.glsl
View file @
5fd28bf0
...
...
@@ -39,7 +39,6 @@ uniform sampler2D screenTex;
uniform
sampler2D
refTex
;
uniform
float
sunAngle
;
uniform
float
sunAngle2
;
uniform
vec3
lightDir
;
uniform
vec3
specular
;
uniform
float
refScale
;
...
...
@@ -155,7 +154,7 @@ void main()
color
.
rgb
=
atmosTransport
(
color
.
rgb
);
color
.
rgb
=
scaleSoftClip
(
color
.
rgb
);
color
.
a
=
spec
*
sunAngle
2
;
color
.
a
=
spec
*
sunAngle
;
frag_color
=
color
;
...
...
indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl
View file @
5fd28bf0
...
...
@@ -51,7 +51,6 @@ uniform float cloud_scale;
uniform
float
cloud_variance
;
uniform
vec3
camPosLocal
;
uniform
vec3
sun_dir
;
uniform
float
sun_size
;
uniform
float
far_z
;
#if !defined(DEPTH_CLAMP)
...
...
indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl
View file @
5fd28bf0
...
...
@@ -42,13 +42,11 @@ uniform sampler2D projectionMap;
uniform
sampler2D
lightFunc
;
uniform
mat4
proj_mat
;
//screen space to light space
uniform
float
proj_near
;
//near clip for projection
uniform
vec3
proj_p
;
//plane projection is emitting from (in screen space)
uniform
vec3
proj_n
;
uniform
float
proj_focus
;
//distance from plane to begin blurring
uniform
float
proj_lod
;
//(number of mips in proj map)
uniform
float
proj_range
;
//range between near clip and far clip plane of projection
uniform
float
proj_ambient_lod
;
uniform
float
proj_ambiance
;
uniform
float
near_clip
;
uniform
float
far_clip
;
...
...
indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl
View file @
5fd28bf0
...
...
@@ -42,13 +42,11 @@ uniform sampler2D projectionMap;
uniform
sampler2D
lightFunc
;
uniform
mat4
proj_mat
;
//screen space to light space
uniform
float
proj_near
;
//near clip for projection
uniform
vec3
proj_p
;
//plane projection is emitting from (in screen space)
uniform
vec3
proj_n
;
uniform
float
proj_focus
;
//distance from plane to begin blurring
uniform
float
proj_lod
;
//(number of mips in proj map)
uniform
float
proj_range
;
//range between near clip and far clip plane of projection
uniform
float
proj_ambient_lod
;
uniform
float
proj_ambiance
;
uniform
float
near_clip
;
uniform
float
far_clip
;
...
...
indra/newview/lldrawpoolwater.cpp
View file @
5fd28bf0
...
...
@@ -583,12 +583,9 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li
shader
->
uniform1f
(
LLShaderMgr
::
WATER_BLUR_MULTIPLIER
,
pwater
->
getBlurMultiplier
());
F32
sunAngle
=
llmax
(
0.
f
,
light_dir
.
mV
[
1
]);
F32
scaledAngle
=
1.
f
-
sunAngle
;
shader
->
uniform1i
(
LLShaderMgr
::
SUN_UP_FACTOR
,
environment
.
getIsSunUp
()
?
1
:
0
);
shader
->
uniform1f
(
LLShaderMgr
::
WATER_SUN_ANGLE
,
sunAngle
);
shader
->
uniform1f
(
LLShaderMgr
::
WATER_SCALED_ANGLE
,
scaledAngle
);
shader
->
uniform1f
(
LLShaderMgr
::
WATER_SUN_ANGLE2
,
0.1
f
+
0.2
f
*
sunAngle
);
shader
->
uniform1f
(
LLShaderMgr
::
WATER_SUN_ANGLE
,
0.1
f
+
0.2
f
*
sunAngle
);
LLVector4
rotated_light_direction
=
environment
.
getRotatedLightNorm
();
shader
->
uniform4fv
(
LLViewerShaderMgr
::
LIGHTNORM
,
1
,
rotated_light_direction
.
mV
);
...
...
@@ -646,7 +643,6 @@ void LLDrawPoolWater::shade2(bool edge, LLGLSLShader* shader, const LLColor3& li
shader
->
disableTexture
(
LLShaderMgr
::
BUMP_MAP
);
shader
->
disableTexture
(
LLShaderMgr
::
DIFFUSE_MAP
);
shader
->
disableTexture
(
LLShaderMgr
::
WATER_REFTEX
);
shader
->
disableTexture
(
LLShaderMgr
::
WATER_SCREENDEPTH
);
shader
->
unbind
();
}
...
...
indra/newview/pipeline.cpp
View file @
5fd28bf0
...
...
@@ -8753,8 +8753,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_
shader
.
uniform3fv
(
LLShaderMgr
::
DEFERRED_MOON_DIR
,
1
,
mTransformedMoonDir
.
mV
);
shader
.
uniform2f
(
LLShaderMgr
::
DEFERRED_SHADOW_RES
,
mShadow
[
0
].
getWidth
(),
mShadow
[
0
].
getHeight
());
shader
.
uniform2f
(
LLShaderMgr
::
DEFERRED_PROJ_SHADOW_RES
,
mShadow
[
4
].
getWidth
(),
mShadow
[
4
].
getHeight
());
shader
.
uniform1f
(
LLShaderMgr
::
DEFERRED_DEPTH_CUTOFF
,
RenderEdgeDepthCutoff
);
shader
.
uniform1f
(
LLShaderMgr
::
DEFERRED_NORM_CUTOFF
,
RenderEdgeNormCutoff
);
if
(
shader
.
getUniformLocation
(
LLShaderMgr
::
DEFERRED_NORM_MATRIX
)
>=
0
)
{
...
...
@@ -9416,7 +9414,6 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
glh
::
matrix4f
light_proj
=
gl_perspective
(
fovy
,
aspect
,
near_clip
,
far_clip
);
screen_to_light
=
trans
*
light_proj
*
screen_to_light
;
shader
.
uniformMatrix4fv
(
LLShaderMgr
::
PROJECTOR_MATRIX
,
1
,
FALSE
,
screen_to_light
.
m
);
shader
.
uniform1f
(
LLShaderMgr
::
PROJECTOR_NEAR
,
near_clip
);
shader
.
uniform3fv
(
LLShaderMgr
::
PROJECTOR_P
,
1
,
p1
.
v
);
shader
.
uniform3fv
(
LLShaderMgr
::
PROJECTOR_N
,
1
,
n
.
v
);
shader
.
uniform3fv
(
LLShaderMgr
::
PROJECTOR_ORIGIN
,
1
,
screen_origin
.
v
);
...
...
@@ -9487,7 +9484,6 @@ void LLPipeline::setupSpotLight(LLGLSLShader& shader, LLDrawable* drawablep)
shader
.
uniform1f
(
LLShaderMgr
::
PROJECTOR_FOCUS
,
focus
);
shader
.
uniform1f
(
LLShaderMgr
::
PROJECTOR_LOD
,
lod_range
);
shader
.
uniform1f
(
LLShaderMgr
::
PROJECTOR_AMBIENT_LOD
,
llclamp
((
proj_range
-
focus
)
/
proj_range
*
lod_range
,
0.
f
,
1.
f
));
}
}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment