summaryrefslogtreecommitdiff
path: root/indra/newview/pipeline.cpp
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-12-06 14:03:46 +0800
committerErik Kundiman <erik@megapahit.org>2024-12-06 14:03:46 +0800
commit70e36b3ff4673888a951f1f3487176ec3ca44fe5 (patch)
tree1fffba9d0bc5a643bfa388e7ccae54332bbd4a25 /indra/newview/pipeline.cpp
parentfda6acb4be1145ac1dc6c33859d8a65dcfa8aecb (diff)
parent37f92c1698cd0cef1aa3d8a21a13cd99510e86e9 (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra/newview/pipeline.cpp')
-rw-r--r--indra/newview/pipeline.cpp19
1 files changed, 15 insertions, 4 deletions
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 2b941bce5a..47c2f2ffa9 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -349,8 +349,9 @@ bool addDeferredAttachments(LLRenderTarget& target, bool for_impostor = false)
U32 norm = GL_RGBA16F;
U32 emissive = GL_RGB16F;
- bool hdr = gSavedSettings.getBOOL("RenderHDREnabled") && gGLManager.mGLVersion > 4.05f;
- LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
+ static LLCachedControl<bool> has_emissive(gSavedSettings, "RenderEnableEmissiveBuffer", false);
+ static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
+ bool hdr = has_hdr() && gGLManager.mGLVersion > 4.05f;
if (!hdr)
{
@@ -803,7 +804,8 @@ bool LLPipeline::allocateScreenBufferInternal(U32 resX, U32 resY)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
- bool hdr = gGLManager.mGLVersion > 4.05f && gSavedSettings.getBOOL("RenderHDREnabled");
+ static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
+ bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr();
if (mRT == &mMainRT)
{ // hacky -- allocate auxillary buffer
@@ -7936,7 +7938,8 @@ void LLPipeline::renderFinalize()
gGL.setColorMask(true, true);
glClearColor(0, 0, 0, 0);
- bool hdr = gGLManager.mGLVersion > 4.05f && gSavedSettings.getBOOL("RenderHDREnabled");
+ static LLCachedControl<bool> has_hdr(gSavedSettings, "RenderHDREnabled", true);
+ bool hdr = gGLManager.mGLVersion > 4.05f && has_hdr();
if (hdr)
{
@@ -8560,6 +8563,7 @@ void LLPipeline::renderDeferredLighting()
std::list<LLVector4> fullscreen_lights;
LLDrawable::drawable_list_t spot_lights;
LLDrawable::drawable_list_t fullscreen_spot_lights;
+ LLSettingsSky::ptr_t psky = LLEnvironment::instance().getCurrentSky();
if (!gCubeSnapshot)
{
@@ -8655,6 +8659,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF));
+ gDeferredLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
+
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@@ -8715,6 +8721,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, s);
gDeferredSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, volume->getLightFalloff(DEFERRED_LIGHT_FALLOFF));
+ gDeferredSpotLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
+
gGL.syncMatrices();
mCubeVB->drawRange(LLRender::TRIANGLE_FAN, 0, 7, 8, get_box_fan_indices(camera, center));
@@ -8753,6 +8761,7 @@ void LLPipeline::renderDeferredLighting()
gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT, count, (GLfloat*)light);
gDeferredMultiLightProgram[idx].uniform4fv(LLShaderMgr::MULTI_LIGHT_COL, count, (GLfloat*)col);
gDeferredMultiLightProgram[idx].uniform1f(LLShaderMgr::MULTI_LIGHT_FAR_Z, far_z);
+ gDeferredMultiLightProgram[idx].uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
far_z = 0.f;
count = 0;
mScreenTriangleVB->setBuffer();
@@ -8790,6 +8799,8 @@ void LLPipeline::renderDeferredLighting()
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_SIZE, light_size_final);
gDeferredMultiSpotLightProgram.uniform3fv(LLShaderMgr::DIFFUSE_COLOR, 1, col.mV);
gDeferredMultiSpotLightProgram.uniform1f(LLShaderMgr::LIGHT_FALLOFF, light_falloff_final);
+ gDeferredMultiSpotLightProgram.uniform1i(LLShaderMgr::CLASSIC_MODE, (psky->canAutoAdjust()) ? 1 : 0);
+
mScreenTriangleVB->drawArrays(LLRender::TRIANGLES, 0, 3);
}