From 5fd28bf007c920b3b07ea6d7638f201a72a9be52 Mon Sep 17 00:00:00 2001 From: Rye Mutt <rye@alchemyviewer.org> Date: Sat, 18 Sep 2021 01:40:22 -0400 Subject: [PATCH] Dead uniform cleanup --- indra/llrender/llrender.cpp | 5 ----- indra/llrender/llshadermgr.cpp | 16 +--------------- indra/llrender/llshadermgr.h | 15 --------------- .../shaders/class1/deferred/cloudShadowF.glsl | 1 - .../shaders/class1/deferred/cofF.glsl | 2 -- .../shaders/class1/deferred/multiSpotLightF.glsl | 2 -- .../shaders/class1/deferred/spotLightF.glsl | 2 -- .../shaders/class1/deferred/underWaterF.glsl | 1 - .../shaders/class1/deferred/waterF.glsl | 3 +-- .../shaders/class1/environment/underWaterF.glsl | 1 - .../shaders/class1/environment/waterF.glsl | 3 +-- .../shaders/class1/windlight/cloudShadowF.glsl | 1 - .../shaders/class2/deferred/multiSpotLightF.glsl | 2 -- .../shaders/class2/deferred/spotLightF.glsl | 2 -- indra/newview/lldrawpoolwater.cpp | 6 +----- indra/newview/pipeline.cpp | 4 ---- 16 files changed, 4 insertions(+), 62 deletions(-) diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp index 703c2e76bd2..3eafd9334cf 100644 --- a/indra/llrender/llrender.cpp +++ b/indra/llrender/llrender.cpp @@ -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); diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp index 8b2a74c231b..e620fe31628 100644 --- a/indra/llrender/llshadermgr.cpp +++ b/indra/llrender/llshadermgr.cpp @@ -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"); diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h index cf92a6b2d28..86fb7f0e65c 100644 --- a/indra/llrender/llshadermgr.h +++ b/indra/llrender/llshadermgr.h @@ -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" diff --git a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl index 0157d166e0d..e69bc6b0790 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cloudShadowF.glsl @@ -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) diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index 079d8458c93..f4ae98e81aa 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl index b80ff45b0c3..0de7c36bbb6 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/multiSpotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl index 22e079cec6b..50fecc3725b 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/spotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl index a49d0e85074..4710918bac9 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/underWaterF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl index 2977d8f4144..628a1f5224e 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/waterF.glsl @@ -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 * sunAngle2; + color.a = spec * sunAngle; vec3 screenspacewavef = normalize((norm_mat*vec4(wavef, 1.0)).xyz); diff --git a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl index cec489f5e23..8c7d600f6e3 100644 --- a/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/underWaterF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl index f65987a57e5..d51517baa2f 100644 --- a/indra/newview/app_settings/shaders/class1/environment/waterF.glsl +++ b/indra/newview/app_settings/shaders/class1/environment/waterF.glsl @@ -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 * sunAngle2; + color.a = spec * sunAngle; frag_color = color; diff --git a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl index 82fad4db5a6..075ae6ea998 100644 --- a/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl +++ b/indra/newview/app_settings/shaders/class1/windlight/cloudShadowF.glsl @@ -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) diff --git a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl index 2ddecd5aef6..c4c03343b69 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/multiSpotLightF.glsl @@ -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; diff --git a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl index 9f0ae224b7e..b8edd71bc97 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/spotLightF.glsl @@ -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; diff --git a/indra/newview/lldrawpoolwater.cpp b/indra/newview/lldrawpoolwater.cpp index fae63b4d108..660a0b6da01 100644 --- a/indra/newview/lldrawpoolwater.cpp +++ b/indra/newview/lldrawpoolwater.cpp @@ -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.1f + 0.2f*sunAngle); + shader->uniform1f(LLShaderMgr::WATER_SUN_ANGLE, 0.1f + 0.2f * 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(); } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index 21718dbc69f..f8526426605 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -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)); } } -- GitLab