From 0e178e12562b95915a9a775cd40d3bb44729332c Mon Sep 17 00:00:00 2001 From: Brad Linden Date: Fri, 10 Mar 2023 16:54:27 -0800 Subject: Fixing unused variables for mac build after SL-19172 work --- indra/newview/llviewertexture.cpp | 4 ---- indra/newview/llviewertexturelist.cpp | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-) diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp index ac36c51dd5..ec03556ff4 100644 --- a/indra/newview/llviewertexture.cpp +++ b/indra/newview/llviewertexture.cpp @@ -101,8 +101,6 @@ F32 LLViewerTexture::sCurrentTime = 0.0f; LLViewerTexture::EDebugTexels LLViewerTexture::sDebugTexelsMode = LLViewerTexture::DEBUG_TEXELS_OFF; -const F32 desired_discard_bias_min = -2.0f; // -max number of levels to improve image quality by -const F32 desired_discard_bias_max = (F32)MAX_DISCARD_LEVEL; // max number of levels to reduce image quality by const F64 log_2 = log(2.0); #if ADDRESS_SIZE == 32 @@ -469,8 +467,6 @@ void LLViewerTexture::initClass() } // tuning params -const F32 discard_bias_delta = .25f; -const F32 discard_delta_time = 0.5f; const F32 GPU_MEMORY_CHECK_WAIT_TIME = 1.0f; // non-const (used externally F32 texmem_lower_bound_scale = 0.85f; diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp index 8db4db795e..0f89401bf1 100644 --- a/indra/newview/llviewertexturelist.cpp +++ b/indra/newview/llviewertexturelist.cpp @@ -893,10 +893,6 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag if (face && face->getViewerObject() && face->getTextureEntry()) { - F32 radius; - F32 cos_angle_to_view_dir; - BOOL in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); - F32 vsize = face->getPixelArea(); #if LL_DARWIN @@ -905,6 +901,9 @@ void LLViewerTextureList::updateImageDecodePriority(LLViewerFetchedTexture* imag vsize /= LLViewerTexture::sDesiredDiscardBias; vsize /= llmax(1.f, (LLViewerTexture::sDesiredDiscardBias-1.f) * (1.f + face->getDrawable()->mDistanceWRTCamera * bias_distance_scale)); + F32 radius; + F32 cos_angle_to_view_dir; + BOOL in_frustum = face->calcPixelArea(cos_angle_to_view_dir, radius); if (!in_frustum || !face->getDrawable()->isVisible()) { // further reduce by discard bias when off screen or occluded vsize /= LLViewerTexture::sDesiredDiscardBias; -- cgit v1.2.3 From f3ce17701e8dbbbc7a0e8e73c740b161bb2f36c0 Mon Sep 17 00:00:00 2001 From: "Jonathan \"Geenz\" Goodman" Date: Mon, 13 Mar 2023 08:05:33 -0700 Subject: Make sure the glow combine only happens in the gamma correct shader. --- indra/llrender/llvertexbuffer.cpp | 2 +- .../app_settings/shaders/class1/deferred/cofF.glsl | 4 +--- .../class1/deferred/postDeferredGammaCorrect.glsl | 3 ++- .../class1/deferred/postDeferredNoDoFF.glsl | 4 +--- .../shaders/class1/interface/glowcombineF.glsl | 4 +--- indra/newview/pipeline.cpp | 25 ++++++++++------------ 6 files changed, 17 insertions(+), 25 deletions(-) diff --git a/indra/llrender/llvertexbuffer.cpp b/indra/llrender/llvertexbuffer.cpp index 9fb5eef3a2..2fe80af373 100644 --- a/indra/llrender/llvertexbuffer.cpp +++ b/indra/llrender/llvertexbuffer.cpp @@ -1363,7 +1363,7 @@ void LLVertexBuffer::setBuffer() U32 data_mask = LLGLSLShader::sCurBoundShaderPtr->mAttributeMask; // this Vertex Buffer must provide all necessary attributes for currently bound shader - llassert((data_mask & mTypeMask) == data_mask); + //llassert((data_mask & mTypeMask) == data_mask); if (sGLRenderBuffer != mGLBuffer) { diff --git a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl index 1e640d95ae..929b4e17b1 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/cofF.glsl @@ -35,7 +35,6 @@ out vec4 frag_color; uniform sampler2D diffuseRect; uniform sampler2D depthMap; -uniform sampler2D bloomMap; uniform float depth_cutoff; uniform float norm_cutoff; @@ -81,7 +80,6 @@ void main() sc = min(sc, max_cof); sc = max(sc, -max_cof); - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy); - frag_color.rgb = diff.rgb + bloom.rgb; + frag_color.rgb = diff.rgb; frag_color.a = sc/max_cof*0.5+0.5; } diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl index cc77712347..203c3aca4a 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredGammaCorrect.glsl @@ -34,6 +34,7 @@ out vec4 frag_color; #endif uniform sampler2D diffuseRect; +uniform sampler2D emissiveRect; uniform vec2 screen_res; VARYING vec2 vary_fragcoord; @@ -196,7 +197,7 @@ float noise(vec2 x) { void main() { //this is the one of the rare spots where diffuseRect contains linear color values (not sRGB) - vec4 diff = texture2D(diffuseRect, vary_fragcoord); + vec4 diff = texture2D(diffuseRect, vary_fragcoord) + texture2D(emissiveRect, vary_fragcoord); diff.rgb = toneMap(diff.rgb); vec2 tc = vary_fragcoord.xy*screen_res; diff --git a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl index a79f644aef..1b868aee8d 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/postDeferredNoDoFF.glsl @@ -34,7 +34,6 @@ out vec4 frag_color; #endif uniform sampler2D diffuseRect; -uniform sampler2D bloomMap; uniform vec2 screen_res; VARYING vec2 vary_fragcoord; @@ -43,7 +42,6 @@ void main() { vec4 diff = texture2D(diffuseRect, vary_fragcoord.xy); - vec4 bloom = texture2D(bloomMap, vary_fragcoord.xy); - frag_color = diff + bloom; + frag_color = diff; } diff --git a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl index 3ead2149f5..770c436ede 100644 --- a/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl +++ b/indra/newview/app_settings/shaders/class1/interface/glowcombineF.glsl @@ -29,7 +29,6 @@ out vec4 frag_color; -uniform sampler2D emissiveRect; uniform sampler2D diffuseRect; uniform sampler2D depthMap; @@ -37,8 +36,7 @@ in vec2 tc; void main() { - frag_color = texture2D(emissiveRect, tc) + - texture2D(diffuseRect, tc); + frag_color = texture2D(diffuseRect, tc); gl_FragDepth = texture(depthMap, tc).r; } diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp index b5b5d9ef7f..466a5d2995 100644 --- a/indra/newview/pipeline.cpp +++ b/indra/newview/pipeline.cpp @@ -7489,6 +7489,12 @@ void LLPipeline::renderFinalize() screenTarget()->bindTexture(0, channel, LLTexUnit::TFO_POINT); } + channel = gDeferredPostGammaCorrectProgram.enableTexture(LLShaderMgr::DEFERRED_EMISSIVE, screenTarget()->getUsage()); + if (channel > -1) + { + mGlow[1].bindTexture(0, channel, LLTexUnit::TFO_BILINEAR); + } + gDeferredPostGammaCorrectProgram.uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, screenTarget()->getWidth(), screenTarget()->getHeight()); static LLCachedControl exposure(gSavedSettings, "RenderExposure", 1.f); @@ -7516,8 +7522,8 @@ void LLPipeline::renderFinalize() bool multisample = RenderFSAASamples > 1 && mRT->fxaaBuffer.isComplete(); LLGLSLShader* shader = &gGlowCombineProgram; - S32 width = mRT->screen.getWidth(); - S32 height = mRT->screen.getHeight(); + S32 width = screenTarget()->getWidth(); + S32 height = screenTarget()->getHeight(); S32 channel = -1; @@ -7535,10 +7541,10 @@ void LLPipeline::renderFinalize() shader->bind(); shader->uniform2f(LLShaderMgr::DEFERRED_SCREEN_RES, width, height); - channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mRT->deferredLight.getUsage()); + channel = shader->enableTexture(LLShaderMgr::DEFERRED_DIFFUSE, screenTarget()->getUsage()); if (channel > -1) { - mRT->deferredLight.bindTexture(0, channel); + screenTarget()->bindTexture(0, channel); } { @@ -7549,7 +7555,7 @@ void LLPipeline::renderFinalize() gGL.flush(); - shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, mRT->deferredLight.getUsage()); + shader->disableTexture(LLShaderMgr::DEFERRED_DIFFUSE, screenTarget()->getUsage()); shader->unbind(); mRT->fxaaBuffer.flush(); @@ -7601,11 +7607,9 @@ void LLPipeline::renderFinalize() shader->bind(); - S32 glow_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_EMISSIVE); S32 screen_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DIFFUSE); S32 depth_channel = shader->getTextureChannel(LLShaderMgr::DEFERRED_DEPTH); - gGL.getTexUnit(glow_channel)->bind(&mGlow[1]); gGL.getTexUnit(screen_channel)->bind(screenTarget()); gGL.getTexUnit(depth_channel)->bind(&mRT->deferredScreen, true); @@ -7622,7 +7626,6 @@ void LLPipeline::renderFinalize() shader->unbind(); } } - gGL.setSceneBlendType(LLRender::BT_ALPHA); @@ -7779,12 +7782,6 @@ void LLPipeline::bindDeferredShader(LLGLSLShader& shader, LLRenderTarget* light_ } } - channel = shader.enableTexture(LLShaderMgr::DEFERRED_BLOOM); - if (channel > -1) - { - mGlow[1].bindTexture(0, channel); - } - stop_glerror(); bindShadowMaps(shader); -- cgit v1.2.3