summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorDave Parks <davep@lindenlab.com>2023-01-20 13:00:40 -0600
committerDave Parks <davep@lindenlab.com>2023-01-20 13:00:40 -0600
commitc83e66414848e468cce01d36c1054b2e9314baf9 (patch)
tree7e30120c8ce39e7a6144aac41bed012c4484909f /indra
parent8b39e0e1a6787ae374287dc62064af8576149e86 (diff)
SL-18869 GL 3 compatibility pass and minor decruft.
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llgl.cpp16
-rw-r--r--indra/llrender/llshadermgr.cpp3
-rw-r--r--indra/llrender/llshadermgr.h1
-rw-r--r--indra/newview/app_settings/settings.xml12
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/starsF.glsl1
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl1
-rw-r--r--indra/newview/featuretable.txt1
-rw-r--r--indra/newview/featuretable_mac.txt1
-rw-r--r--indra/newview/lldrawpoolalpha.cpp12
-rw-r--r--indra/newview/llviewercontrol.cpp43
-rw-r--r--indra/newview/llviewershadermgr.cpp33
-rw-r--r--indra/newview/pipeline.cpp26
-rw-r--r--indra/newview/pipeline.h2
13 files changed, 9 insertions, 143 deletions
diff --git a/indra/llrender/llgl.cpp b/indra/llrender/llgl.cpp
index 9dfe5ef9ff..8bb83d4250 100644
--- a/indra/llrender/llgl.cpp
+++ b/indra/llrender/llgl.cpp
@@ -1018,8 +1018,6 @@ bool LLGLManager::initGL()
LL_ERRS("RenderInit") << "Calling init on LLGLManager after already initialized!" << LL_ENDL;
}
- stop_glerror();
-
#if 0 && LL_WINDOWS
if (!glGetStringi)
{
@@ -1055,8 +1053,6 @@ bool LLGLManager::initGL()
}
#endif
- stop_glerror();
-
// Extract video card strings and convert to upper case to
// work around driver-to-driver variation in capitalization.
mGLVendor = ll_safe_string((const char *)glGetString(GL_VENDOR));
@@ -1128,10 +1124,8 @@ bool LLGLManager::initGL()
mGLVendorShort = "MISC";
}
- stop_glerror();
// This is called here because it depends on the setting of mIsGF2or4MX, and sets up mHasMultitexture.
initExtensions();
- stop_glerror();
S32 old_vram = mVRAM;
mVRAM = 0;
@@ -1192,29 +1186,19 @@ bool LLGLManager::initGL()
mVRAM = old_vram;
}
- stop_glerror();
-
glGetIntegerv(GL_MAX_TEXTURE_IMAGE_UNITS, &mNumTextureImageUnits);
- stop_glerror();
glGetIntegerv(GL_MAX_COLOR_TEXTURE_SAMPLES, &mMaxColorTextureSamples);
- stop_glerror();
glGetIntegerv(GL_MAX_DEPTH_TEXTURE_SAMPLES, &mMaxDepthTextureSamples);
- stop_glerror();
glGetIntegerv(GL_MAX_INTEGER_SAMPLES, &mMaxIntegerSamples);
- stop_glerror();
glGetIntegerv(GL_MAX_SAMPLE_MASK_WORDS, &mMaxSampleMaskWords);
- stop_glerror();
glGetIntegerv(GL_MAX_SAMPLES, &mMaxSamples);
- stop_glerror();
if (mGLVersion >= 4.59f)
{
glGetFloatv(GL_MAX_TEXTURE_MAX_ANISOTROPY, &mMaxAnisotropy);
- stop_glerror();
}
initGLStates();
- stop_glerror();
return true;
}
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index ee8ac359c7..44b8ea164b 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -1320,9 +1320,8 @@ void LLShaderMgr::initAttribsAndUniforms()
mReservedUniforms.push_back("depth_cutoff");
mReservedUniforms.push_back("norm_cutoff");
mReservedUniforms.push_back("shadow_target_width");
- mReservedUniforms.push_back("view_dir"); // DEFERRED_VIEW_DIR
- llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_VIEW_DIR+1);
+ llassert(mReservedUniforms.size() == LLShaderMgr::DEFERRED_SHADOW_TARGET_WIDTH+1);
mReservedUniforms.push_back("tc_scale");
mReservedUniforms.push_back("rcp_screen_res");
diff --git a/indra/llrender/llshadermgr.h b/indra/llrender/llshadermgr.h
index 90a8c2853c..f6abfe9027 100644
--- a/indra/llrender/llshadermgr.h
+++ b/indra/llrender/llshadermgr.h
@@ -157,7 +157,6 @@ public:
DEFERRED_DEPTH_CUTOFF, // "depth_cutoff"
DEFERRED_NORM_CUTOFF, // "norm_cutoff"
DEFERRED_SHADOW_TARGET_WIDTH, // "shadow_target_width"
- DEFERRED_VIEW_DIR, // "view_dir"
FXAA_TC_SCALE, // "tc_scale"
FXAA_RCP_SCREEN_RES, // "rcp_screen_res"
diff --git a/indra/newview/app_settings/settings.xml b/indra/newview/app_settings/settings.xml
index ec4125c2bf..d262a1285f 100644
--- a/indra/newview/app_settings/settings.xml
+++ b/indra/newview/app_settings/settings.xml
@@ -9668,18 +9668,6 @@
<real>368.0</real>
</map>
- <key>RenderPBR</key>
- <map>
- <key>Comment</key>
- <string>DEPRECATED - only true supported - Use PBR rendering pipeline (Physically Based Rendering).</string>
- <key>Persist</key>
- <integer>1</integer>
- <key>Type</key>
- <string>Boolean</string>
- <key>Value</key>
- <integer>1</integer>
- </map>
-
<key>RenderDeferred</key>
<map>
<key>Comment</key>
diff --git a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
index 6376527273..152316c117 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/starsF.glsl
@@ -36,7 +36,6 @@ VARYING vec2 vary_texcoord0;
VARYING vec2 screenpos;
uniform sampler2D diffuseMap;
-uniform sampler2D altDiffuseMap;
uniform float blend_factor;
uniform float custom_alpha;
uniform float time;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
index 5f6982746b..8e4197ae77 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/softenLightF.glsl
@@ -41,7 +41,6 @@ uniform sampler2D diffuseRect;
uniform sampler2D specularRect;
uniform sampler2D normalMap;
uniform sampler2D emissiveRect; // PBR linear packed Occlusion, Roughness, Metal. See: pbropaqueF.glsl
-uniform sampler2D altDiffuseMap; // PBR: irradiance, skins/default/textures/default_irradiance.png
const float M_PI = 3.14159265;
diff --git a/indra/newview/featuretable.txt b/indra/newview/featuretable.txt
index 21babc9e5f..cf0968dfd2 100644
--- a/indra/newview/featuretable.txt
+++ b/indra/newview/featuretable.txt
@@ -62,7 +62,6 @@ Disregard128DefaultDrawDistance 1 1
Disregard96DefaultDrawDistance 1 1
RenderCompressTextures 1 1
RenderShaderLightingMaxLevel 1 3
-RenderPBR 1 1
RenderReflectionProbeCount 1 256
RenderDeferred 1 1
RenderDeferredSSAO 1 1
diff --git a/indra/newview/featuretable_mac.txt b/indra/newview/featuretable_mac.txt
index 45e3827f60..d57a0b8105 100644
--- a/indra/newview/featuretable_mac.txt
+++ b/indra/newview/featuretable_mac.txt
@@ -61,7 +61,6 @@ Disregard96DefaultDrawDistance 1 1
RenderCompressTextures 1 1
RenderShaderLightingMaxLevel 1 3
RenderDeferred 1 1
-RenderPBR 1 1
RenderDeferredSSAO 1 1
RenderUseAdvancedAtmospherics 1 0
RenderShadowDetail 1 2
diff --git a/indra/newview/lldrawpoolalpha.cpp b/indra/newview/lldrawpoolalpha.cpp
index ed952689fa..20d3818934 100644
--- a/indra/newview/lldrawpoolalpha.cpp
+++ b/indra/newview/lldrawpoolalpha.cpp
@@ -86,11 +86,6 @@ void LLDrawPoolAlpha::prerender()
// TODO: is this even necessay? These are probably set to never discard
LLViewerFetchedTexture::sFlatNormalImagep->addTextureStats(1024.f*1024.f);
LLViewerFetchedTexture::sWhiteImagep->addTextureStats(1024.f * 1024.f);
-
- if (LLPipeline::sRenderPBR)
- {
- gPipeline.setupHWLights(NULL);
- }
}
S32 LLDrawPoolAlpha::getNumPostDeferredPasses()
@@ -659,12 +654,11 @@ void LLDrawPoolAlpha::renderAlpha(U32 mask, bool depth_only, bool rigged)
LLRenderPass::applyModelMatrix(params);
LLMaterial* mat = NULL;
- LLGLTFMaterial *gltf_mat = params.mGLTFMaterial; // Also see: LLPipeline::getPoolTypeFromTE()
- bool is_pbr = LLPipeline::sRenderPBR && gltf_mat;
+ LLGLTFMaterial *gltf_mat = params.mGLTFMaterial;
- LLGLDisable cull_face(is_pbr && gltf_mat->mDoubleSided ? GL_CULL_FACE : 0);
+ LLGLDisable cull_face(gltf_mat && gltf_mat->mDoubleSided ? GL_CULL_FACE : 0);
- if (is_pbr && gltf_mat->mAlphaMode == LLGLTFMaterial::ALPHA_MODE_BLEND)
+ if (gltf_mat && gltf_mat->mAlphaMode == LLGLTFMaterial::ALPHA_MODE_BLEND)
{
target_shader = &gDeferredPBRAlphaProgram;
if (params.mAvatar != nullptr)
diff --git a/indra/newview/llviewercontrol.cpp b/indra/newview/llviewercontrol.cpp
index 364bd830f5..8b9df88fd4 100644
--- a/indra/newview/llviewercontrol.cpp
+++ b/indra/newview/llviewercontrol.cpp
@@ -152,7 +152,6 @@ static bool handleSetShaderChanged(const LLSD& newvalue)
// ALM depends onto atmospheric shaders, state might have changed
bool old_state = LLPipeline::sRenderDeferred;
LLPipeline::refreshCachedSettings();
- gPipeline.updateRenderDeferred();
if (old_state != LLPipeline::sRenderDeferred)
{
gPipeline.releaseGLBuffers();
@@ -208,7 +207,6 @@ bool handleRenderTransparentWaterChanged(const LLSD& newvalue)
if (gPipeline.isInit())
{
gPipeline.updateRenderTransparentWater();
- gPipeline.updateRenderDeferred();
gPipeline.releaseGLBuffers();
gPipeline.createGLBuffers();
gPipeline.resetVertexBuffers();
@@ -439,7 +437,6 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue)
if (gPipeline.isInit())
{
LLPipeline::refreshCachedSettings();
- gPipeline.updateRenderDeferred();
gPipeline.releaseGLBuffers();
gPipeline.createGLBuffers();
gPipeline.resetVertexBuffers();
@@ -448,46 +445,6 @@ static bool handleReflectionProbeDetailChanged(const LLSD& newvalue)
return true;
}
-#if 0 // DEPRECATED
-// NOTE: may be triggered by RenderDeferred OR RenderPBR changing, don't trust "newvalue"
-static bool handleRenderDeferredChanged(const LLSD& newvalue)
-{
- LLRenderTarget::sUseFBO = gSavedSettings.getBOOL("RenderDeferred");
- if (gPipeline.isInit())
- {
- LLPipeline::refreshCachedSettings();
- gPipeline.updateRenderDeferred();
- gPipeline.releaseGLBuffers();
- gPipeline.createGLBuffers();
- gPipeline.resetVertexBuffers();
- if (LLPipeline::sRenderDeferred == (BOOL)LLRenderTarget::sUseFBO)
- {
- LLViewerShaderMgr::instance()->setShaders();
- }
- }
- return true;
-}
-
-// This looks a great deal like handleRenderDeferredChanged because
-// Advanced Lighting (Materials) implies bumps and shiny so disabling
-// bumps should further disable that feature.
-//
-static bool handleRenderBumpChanged(const LLSD& newval)
-{
- LLRenderTarget::sUseFBO = newval.asBoolean() && gSavedSettings.getBOOL("RenderDeferred");
- if (gPipeline.isInit())
- {
- gPipeline.updateRenderBump();
- gPipeline.updateRenderDeferred();
- gPipeline.releaseGLBuffers();
- gPipeline.createGLBuffers();
- gPipeline.resetVertexBuffers();
- LLViewerShaderMgr::instance()->setShaders();
- }
- return true;
-}
-#endif
-
static bool handleRenderDebugPipelineChanged(const LLSD& newvalue)
{
gDebugPipeline = newvalue.asBoolean();
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index ebc6df22ac..e40c337f04 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -468,7 +468,6 @@ void LLViewerShaderMgr::setShaders()
gPipeline.releaseGLBuffers();
LLPipeline::sRenderGlow = gSavedSettings.getBOOL("RenderGlow");
- LLPipeline::updateRenderDeferred();
//hack to reset buffers that change behavior with shaders
gPipeline.resetVertexBuffers();
@@ -497,10 +496,8 @@ void LLViewerShaderMgr::setShaders()
//bool canRenderDeferred = true; // DEPRECATED -- LLFeatureManager::getInstance()->isFeatureAvailable("RenderDeferred");
//bool hasWindLightShaders = true; // DEPRECATED -- LLFeatureManager::getInstance()->isFeatureAvailable("WindLightUseAtmosShaders");
- S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
- bool pbr = gSavedSettings.getBOOL("RenderPBR");
+ //S32 shadow_detail = gSavedSettings.getS32("RenderShadowDetail");
bool doingWindLight = true; //DEPRECATED -- hasWindLightShaders&& gSavedSettings.getBOOL("WindLightUseAtmosShaders");
- bool useRenderDeferred = true; //DEPRECATED -- doingWindLight&& canRenderDeferred&& gSavedSettings.getBOOL("RenderDeferred");
S32 light_class = 3;
S32 interface_class = 2;
@@ -509,32 +506,7 @@ void LLViewerShaderMgr::setShaders()
S32 effect_class = 2;
S32 wl_class = 1;
S32 water_class = 3;
- S32 deferred_class = 0;
-
- if (useRenderDeferred)
- {
- //shadows
- switch (shadow_detail)
- {
- case 1:
- deferred_class = 2; // PCF shadows
- break;
-
- case 2:
- deferred_class = 2; // PCF shadows
- break;
-
- case 0:
- default:
- deferred_class = 1; // no shadows
- break;
- }
- }
-
- if (deferred_class > 0 && pbr)
- {
- deferred_class = 3;
- }
+ S32 deferred_class = 3;
if (doingWindLight)
{
@@ -3859,6 +3831,7 @@ BOOL LLViewerShaderMgr::loadShadersInterface()
{
gReflectionProbeDisplayProgram.mName = "Reflection Probe Display Shader";
gReflectionProbeDisplayProgram.mFeatures.hasReflectionProbes = true;
+ gReflectionProbeDisplayProgram.mFeatures.hasSrgb = true;
gReflectionProbeDisplayProgram.mShaderFiles.clear();
gReflectionProbeDisplayProgram.mShaderFiles.push_back(make_pair("interface/reflectionprobeV.glsl", GL_VERTEX_SHADER));
gReflectionProbeDisplayProgram.mShaderFiles.push_back(make_pair("interface/reflectionprobeF.glsl", GL_FRAGMENT_SHADER));
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index beaa3cdb69..2a55a299ac 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -326,7 +326,6 @@ bool LLPipeline::sRenderAttachedLights = true;
bool LLPipeline::sRenderAttachedParticles = true;
bool LLPipeline::sRenderDeferred = false;
bool LLPipeline::sReflectionProbesEnabled = false;
-bool LLPipeline::sRenderPBR = false;
S32 LLPipeline::sVisibleLightCount = 0;
bool LLPipeline::sRenderingHUDs;
F32 LLPipeline::sDistortionWaterClipPlaneMargin = 1.0125f;
@@ -1009,12 +1008,6 @@ void LLPipeline::updateRenderBump()
}
// static
-void LLPipeline::updateRenderDeferred()
-{
- sRenderPBR = sRenderDeferred;
-}
-
-// static
void LLPipeline::refreshCachedSettings()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_DISPLAY;
@@ -1103,11 +1096,9 @@ void LLPipeline::refreshCachedSettings()
CameraDoFResScale = gSavedSettings.getF32("CameraDoFResScale");
RenderAutoHideSurfaceAreaLimit = gSavedSettings.getF32("RenderAutoHideSurfaceAreaLimit");
RenderScreenSpaceReflections = gSavedSettings.getBOOL("RenderScreenSpaceReflections");
- sReflectionProbesEnabled = gSavedSettings.getBOOL("RenderReflectionsEnabled");
+ sReflectionProbesEnabled = LLFeatureManager::getInstance()->isFeatureAvailable("RenderReflectionsEnabled") && gSavedSettings.getBOOL("RenderReflectionsEnabled");
RenderSpotLight = nullptr;
- updateRenderDeferred();
-
if (gNonInteractive)
{
LLVOAvatar::sMaxNonImpostors = 1;
@@ -1207,7 +1198,6 @@ void LLPipeline::createGLBuffers()
stop_glerror();
assertInitialized();
- updateRenderDeferred();
if (LLPipeline::sRenderTransparentWater)
{ //water reflection texture
U32 res = (U32) llmax(gSavedSettings.getS32("RenderWaterRefResolution"), 512);
@@ -6881,10 +6871,9 @@ void LLPipeline::doResetVertexBuffers(bool forced)
LLVOPartGroup::destroyGL();
gGL.resetVertexBuffer();
- LLVertexBuffer::unbind();
+ LLVertexBuffer::unbind();
updateRenderBump();
- updateRenderDeferred();
sBakeSunlight = gSavedSettings.getBOOL("RenderBakeSunlight");
sNoAlpha = gSavedSettings.getBOOL("RenderNoAlpha");
@@ -8358,17 +8347,6 @@ void LLPipeline::renderDeferredLighting()
soften_shader.uniform1i(LLShaderMgr::SUN_UP_FACTOR, environment.getIsSunUp() ? 1 : 0);
soften_shader.uniform3fv(LLShaderMgr::LIGHTNORM, 1, environment.getClampedLightNorm().mV);
- if (!LLPipeline::sUnderWaterRender && LLPipeline::sRenderPBR)
- {
- soften_shader.bindTexture(LLShaderMgr::ALTERNATE_DIFFUSE_MAP, LLViewerFetchedTexture::sDefaultIrradiancePBRp); // PBR: irradiance
- }
-
- if(LLPipeline::sRenderPBR)
- {
- LLVector3 cameraAtAxis = LLViewerCamera::getInstance()->getAtAxis();
- soften_shader.uniform3fv(LLShaderMgr::DEFERRED_VIEW_DIR, 1, cameraAtAxis.mV);
- }
-
{
LLGLDepthTest depth(GL_FALSE);
LLGLDisable blend(GL_BLEND);
diff --git a/indra/newview/pipeline.h b/indra/newview/pipeline.h
index 689dc385ae..83d316e15f 100644
--- a/indra/newview/pipeline.h
+++ b/indra/newview/pipeline.h
@@ -428,7 +428,6 @@ public:
static void updateRenderTransparentWater();
static void updateRenderBump();
- static void updateRenderDeferred();
static void refreshCachedSettings();
void addDebugBlip(const LLVector3& position, const LLColor4& color);
@@ -648,7 +647,6 @@ public:
static bool sRenderAttachedParticles;
static bool sRenderDeferred;
static bool sReflectionProbesEnabled;
- static bool sRenderPBR;
static S32 sVisibleLightCount;
static bool sRenderingHUDs;
static F32 sDistortionWaterClipPlaneMargin;