From 7be9c43f286671893ff0a9dee13d721a6731255b Mon Sep 17 00:00:00 2001 From: Brad Linden <46733234+brad-linden@users.noreply.github.com> Date: Tue, 19 Nov 2024 10:49:09 -0800 Subject: brad/2744 handle shader errors (#3105) * Partial solution to secondlife/viewer#2744 crash with better error handling. Handles shader compile errors better, and should turn crash into an LL_ERRS assertion failure. Strengthed more assertions and improved shader error line numbers * Even more error handling to get a handle on crash secondlife/viewer#2744 * Improved GLSL correctness on Intel chips that lack OpenGL 4.6 support. secondlife/viewer#2744 * Removed non-working fallback code for gDeferredPostProgram * Fixed incorrect llmax call --- indra/newview/app_settings/shaders/class1/deferred/CASF.glsl | 2 +- indra/newview/app_settings/shaders/class1/interface/radianceGenF.glsl | 2 +- .../app_settings/shaders/class3/deferred/screenSpaceReflPostF.glsl | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'indra/newview/app_settings/shaders') 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; -- cgit v1.2.3