summaryrefslogtreecommitdiff
path: root/indra
diff options
context:
space:
mode:
authorErik Kundiman <erik@megapahit.org>2024-11-20 14:24:48 +0800
committerErik Kundiman <erik@megapahit.org>2024-11-20 14:24:48 +0800
commit9e282949a79fe56b12a4fdfa8fa4552338d8a370 (patch)
tree7cfc28e52827565f6955a0bdc9ecf20d6ff65d3b /indra
parent84240037a2c1c7032fe2fdacec7099eabdfe24ac (diff)
parent6c6b38821ef0ea452b640b31006a8ef4f2dfef55 (diff)
Merge remote-tracking branch 'secondlife/release/2024.09-ExtraFPS' into 2024.09-ExtraFPS
Diffstat (limited to 'indra')
-rw-r--r--indra/llrender/llglslshader.cpp5
-rw-r--r--indra/llrender/llrender.cpp3
-rw-r--r--indra/llrender/llshadermgr.cpp14
-rw-r--r--indra/newview/app_settings/shaders/class1/deferred/CASF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl2
-rw-r--r--indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl2
-rw-r--r--indra/newview/llfeaturemanager.cpp15
-rw-r--r--indra/newview/llviewershadermgr.cpp9
-rw-r--r--indra/newview/llviewertexture.cpp2
-rw-r--r--indra/newview/llviewertexturelist.cpp2
-rw-r--r--indra/newview/pipeline.cpp27
11 files changed, 56 insertions, 27 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp
index e79d67c5c7..f6539b8d03 100644
--- a/indra/llrender/llglslshader.cpp
+++ b/indra/llrender/llglslshader.cpp
@@ -1084,7 +1084,7 @@ void LLGLSLShader::bind()
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_SHADER;
- llassert(mProgramObject != 0);
+ llassert_always(mProgramObject != 0);
gGL.flush();
@@ -1107,6 +1107,9 @@ void LLGLSLShader::bind()
LLShaderMgr::instance()->updateShaderUniforms(this);
mUniformsDirty = false;
}
+
+ llassert_always(sCurBoundShaderPtr != nullptr);
+ llassert_always(sCurBoundShader == mProgramObject);
}
void LLGLSLShader::bind(U8 variant)
diff --git a/indra/llrender/llrender.cpp b/indra/llrender/llrender.cpp
index 9178fc16b9..d333a3fd54 100644
--- a/indra/llrender/llrender.cpp
+++ b/indra/llrender/llrender.cpp
@@ -1585,7 +1585,8 @@ void LLRender::flush()
if (mCount > 0)
{
LL_PROFILE_ZONE_SCOPED_CATEGORY_PIPELINE;
- llassert(LLGLSLShader::sCurBoundShaderPtr != nullptr);
+ llassert_always(LLGLSLShader::sCurBoundShaderPtr != nullptr);
+
if (!mUIOffset.empty())
{
sUICalls++;
diff --git a/indra/llrender/llshadermgr.cpp b/indra/llrender/llshadermgr.cpp
index 150277c8df..e02dd4771e 100644
--- a/indra/llrender/llshadermgr.cpp
+++ b/indra/llrender/llshadermgr.cpp
@@ -559,17 +559,11 @@ GLuint LLShaderMgr::loadShaderFile(const std::string& filename, S32 & shader_lev
}
else if (major_version == 3)
{
- if (minor_version < 10)
+ if (minor_version <= 29)
{
- shader_code_text[shader_code_count++] = strdup("#version 300\n");
- }
- else if (minor_version <= 19)
- {
- shader_code_text[shader_code_count++] = strdup("#version 310\n");
- }
- else if (minor_version <= 29)
- {
- shader_code_text[shader_code_count++] = strdup("#version 320\n");
+ // OpenGL 3.2 had GLSL version 1.50. anything after that the version numbers match.
+ // https://www.khronos.org/opengl/wiki/Core_Language_(GLSL)#OpenGL_and_GLSL_versions
+ shader_code_text[shader_code_count++] = strdup("#version 150\n");
}
else
{
diff --git a/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl b/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl
index e80c59b39f..017855325c 100644
--- a/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl
+++ b/indra/newview/app_settings/shaders/class1/deferred/CASF.glsl
@@ -1150,7 +1150,7 @@ vec3 linear_to_srgb(vec3 cl);
AF3 ASignedF3(AF3 m){return ASatF3(m*AF3_(A_INFN_F));}
AF4 ASignedF4(AF4 m){return ASatF4(m*AF4_(A_INFN_F));}
//------------------------------------------------------------------------------------------------------------------------------
- AF1 AGtZeroF1(AF1 m){return ASatF1(m*AF1_(A_INFP_F));}
+// #2744 avoid constant overflow AF1 AGtZeroF1(AF1 m){return ASatF1(m*AF1_(A_INFP_F));}
AF2 AGtZeroF2(AF2 m){return ASatF2(m*AF2_(A_INFP_F));}
AF3 AGtZeroF3(AF3 m){return ASatF3(m*AF3_(A_INFP_F));}
AF4 AGtZeroF4(AF4 m){return ASatF4(m*AF4_(A_INFP_F));}
diff --git a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
index feb0947649..b3964c9215 100644
--- a/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
+++ b/indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl
@@ -130,7 +130,7 @@ vec4 prefilterEnvMap(vec3 R)
float totalWeight = 0.0;
float envMapDim = float(textureSize(reflectionProbes, 0).s);
float roughness = mipLevel/max_probe_lod;
- int numSamples = max(int(PROBE_FILTER_SAMPLES*roughness), 1);
+ uint numSamples = uint(max(PROBE_FILTER_SAMPLES*roughness, 1));
float numMips = max_probe_lod+1;
diff --git a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
index 9ac389f926..dc135243a6 100644
--- a/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
+++ b/indra/newview/app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl
@@ -81,7 +81,7 @@ void main()
vec4 collectedColor = vec4(0);
- float w = tapScreenSpaceReflection(4, tc, pos, norm.xyz, collectedColor, diffuseMap, 0);
+ float w = tapScreenSpaceReflection(4, tc, pos, norm.xyz, collectedColor, diffuseMap, 0.f);
collectedColor.rgb *= specCol.rgb;
diff --git a/indra/newview/llfeaturemanager.cpp b/indra/newview/llfeaturemanager.cpp
index 88024b8390..7a99702e27 100644
--- a/indra/newview/llfeaturemanager.cpp
+++ b/indra/newview/llfeaturemanager.cpp
@@ -655,6 +655,21 @@ void LLFeatureManager::applyBaseMasks()
if (gGLManager.mIsIntel)
{
maskFeatures("Intel");
+ if (gGLManager.mGLVersion < 4.59f)
+ {
+ // if we don't have OpenGL 4.6 on intel, set it to OpenGL 3.3
+ // we also want to trigger the GL3 fallbacks on these chipsets
+ // this is expected to be mainly pre-Haswell Intel HD Graphics 4X00 and 5X00.
+ // A lot of these chips claim 4.3 or 4.4 support, but don't seem to work.
+ // https://code.blender.org/2019/04/supported-gpus-in-blender-2-80/
+ // https://docs.blender.org/manual/en/latest/troubleshooting/gpu/windows/intel.html#legacy-intel-hd-4000-5000
+ // https://www.intel.com/content/www/us/en/support/articles/000005524/graphics.html
+ // this will disable things like reflection probes, HDR, FXAA and SMAA
+ gGLManager.mGLVersion = llmin(gGLManager.mGLVersion, 3.33f);
+ // and select GLSL version for OpenGL 3.3
+ gGLManager.mGLSLVersionMajor = 3;
+ gGLManager.mGLSLVersionMinor = 30;
+ }
}
if (gGLManager.mIsApple)
{
diff --git a/indra/newview/llviewershadermgr.cpp b/indra/newview/llviewershadermgr.cpp
index f5af9cc397..cdebb08b18 100644
--- a/indra/newview/llviewershadermgr.cpp
+++ b/indra/newview/llviewershadermgr.cpp
@@ -2501,7 +2501,14 @@ bool LLViewerShaderMgr::loadShadersDeferred()
gCASProgram.mShaderFiles.push_back(make_pair("deferred/postDeferredNoTCV.glsl", GL_VERTEX_SHADER));
gCASProgram.mShaderFiles.push_back(make_pair("deferred/CASF.glsl", GL_FRAGMENT_SHADER));
gCASProgram.mShaderLevel = mShaderLevel[SHADER_DEFERRED];
- gCASProgram.createShader();
+ success = gCASProgram.createShader();
+ // llassert(success);
+ if (!success)
+ {
+ LL_WARNS() << "Failed to create shader '" << gCASProgram.mName << "', disabling!" << LL_ENDL;
+ // continue as if this shader never happened
+ success = true;
+ }
}
if (success)
diff --git a/indra/newview/llviewertexture.cpp b/indra/newview/llviewertexture.cpp
index c10e28d688..03c586b270 100644
--- a/indra/newview/llviewertexture.cpp
+++ b/indra/newview/llviewertexture.cpp
@@ -2917,7 +2917,7 @@ void LLViewerLODTexture::processTextureStats()
mDesiredDiscardLevel = 0;
}
// Generate the request priority and render priority
- else if (mDontDiscard || !mUseMipMaps)
+ else if (mDontDiscard || !mUseMipMaps || (getFTType() == FTT_MAP_TILE))
{
mDesiredDiscardLevel = 0;
if (mFullWidth > MAX_IMAGE_SIZE_DEFAULT || mFullHeight > MAX_IMAGE_SIZE_DEFAULT)
diff --git a/indra/newview/llviewertexturelist.cpp b/indra/newview/llviewertexturelist.cpp
index 538e6a6763..411190eb67 100644
--- a/indra/newview/llviewertexturelist.cpp
+++ b/indra/newview/llviewertexturelist.cpp
@@ -1071,7 +1071,7 @@ F32 LLViewerTextureList::updateImagesCreateTextures(F32 max_time)
imagep->mCreatePending = false;
mCreateTextureList.pop();
- if (imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel())
+ if (imagep->hasGLTexture() && imagep->getDiscardLevel() < imagep->getDesiredDiscardLevel())
{
LL_WARNS_ONCE("Texture") << "Texture will be downscaled immediately after loading." << LL_ENDL;
imagep->scaleDown();
diff --git a/indra/newview/pipeline.cpp b/indra/newview/pipeline.cpp
index 76b8cebf94..af0bd013b2 100644
--- a/indra/newview/pipeline.cpp
+++ b/indra/newview/pipeline.cpp
@@ -1436,15 +1436,24 @@ void LLPipeline::createLUTBuffers()
mPbrBrdfLut.allocate(512, 512, GL_RG16F);
mPbrBrdfLut.bindTarget();
- gDeferredGenBrdfLutProgram.bind();
-
- gGL.begin(LLRender::TRIANGLE_STRIP);
- gGL.vertex2f(-1, -1);
- gGL.vertex2f(-1, 1);
- gGL.vertex2f(1, -1);
- gGL.vertex2f(1, 1);
- gGL.end();
- gGL.flush();
+
+ if (gDeferredGenBrdfLutProgram.isComplete())
+ {
+ gDeferredGenBrdfLutProgram.bind();
+ llassert_always(LLGLSLShader::sCurBoundShaderPtr != nullptr);
+
+ gGL.begin(LLRender::TRIANGLE_STRIP);
+ gGL.vertex2f(-1, -1);
+ gGL.vertex2f(-1, 1);
+ gGL.vertex2f(1, -1);
+ gGL.vertex2f(1, 1);
+ gGL.end();
+ gGL.flush();
+ }
+ else
+ {
+ LL_WARNS("Brad") << gDeferredGenBrdfLutProgram.mName << " failed to load, cannot be used!" << LL_ENDL;
+ }
gDeferredGenBrdfLutProgram.unbind();
mPbrBrdfLut.flush();