From e61b6570b15e5d7843712ea65e11c3df42bf4f81 Mon Sep 17 00:00:00 2001 From: Dave Parks Date: Wed, 14 Sep 2022 18:53:16 -0500 Subject: SL-17701 Fix for crash on AMD WHQL drivers. --- indra/llrender/llglslshader.cpp | 7 +++++-- .../app_settings/shaders/class1/deferred/pbralphaF.glsl | 15 +-------------- 2 files changed, 6 insertions(+), 16 deletions(-) diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index bc349c2015..7cc5d33c49 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -977,8 +977,11 @@ BOOL LLGLSLShader::mapUniforms(const vector * uniforms) static const GLuint BLOCKBINDING = 1; //picked by us //Get the index, similar to a uniform location GLuint UBOBlockIndex = glGetUniformBlockIndex(mProgramObject, "ReflectionProbes"); - //Set this index to a binding index - glUniformBlockBinding(mProgramObject, UBOBlockIndex, BLOCKBINDING); + if (UBOBlockIndex != GL_INVALID_INDEX) + { + //Set this index to a binding index + glUniformBlockBinding(mProgramObject, UBOBlockIndex, BLOCKBINDING); + } } unbind(); diff --git a/indra/newview/app_settings/shaders/class1/deferred/pbralphaF.glsl b/indra/newview/app_settings/shaders/class1/deferred/pbralphaF.glsl index a7dc5f22c8..9d3339f607 100644 --- a/indra/newview/app_settings/shaders/class1/deferred/pbralphaF.glsl +++ b/indra/newview/app_settings/shaders/class1/deferred/pbralphaF.glsl @@ -268,20 +268,7 @@ void main() vec3 light = vec3(0); // Punctual lights -#define LIGHT_LOOP(i) light += calcPointLightOrSpotLight( \ - reflect0, \ - reflect90, \ - alphaRough, \ - c_diff, \ - light_diffuse[i].rgb, \ - base.rgb, \ - pos.xyz, \ - v, \ - n, \ - light_position[i], \ - light_direction[i].xyz, \ - light_deferred_attenuation[i].x, light_deferred_attenuation[i].y, \ - light_attenuation[i].z, light_attenuation[i].w ); +#define LIGHT_LOOP(i) light += calcPointLightOrSpotLight( reflect0, reflect90, alphaRough, c_diff, light_diffuse[i].rgb, base.rgb, pos.xyz, v, n, light_position[i], light_direction[i].xyz, light_deferred_attenuation[i].x, light_deferred_attenuation[i].y, light_attenuation[i].z, light_attenuation[i].w ); LIGHT_LOOP(1) LIGHT_LOOP(2) -- cgit v1.2.3