diff options
author | Howard Stearns <howard.stearns@gmail.com> | 2022-09-01 16:18:14 -0700 |
---|---|---|
committer | Howard Stearns <howard.stearns@gmail.com> | 2022-09-01 16:18:14 -0700 |
commit | 88e1740d205bdfaa57d1d5dec4e6e9e755eae075 (patch) | |
tree | 7c39c5b10c627219ecb16ee3a849748b9249b4a9 | |
parent | 3cf349c4fa1c1879babab23536baff8e4e5421fc (diff) |
SL-17967 - block layout binding acceptable to apple
3 files changed, 10 insertions, 2 deletions
diff --git a/indra/llrender/llglslshader.cpp b/indra/llrender/llglslshader.cpp index db70ba0c60..7be1fd0702 100644 --- a/indra/llrender/llglslshader.cpp +++ b/indra/llrender/llglslshader.cpp @@ -965,6 +965,14 @@ BOOL LLGLSLShader::mapUniforms(const vector<LLStaticHashedString> * uniforms) } //........................................................................................................................................ + if (mFeatures.hasReflectionProbes) // Set up block binding, in a way supported by Apple (rather than binding = 1 in .glsl). + { // See slide 35 and more of https://docs.huihoo.com/apple/wwdc/2011/session_420__advances_in_opengl_for_mac_os_x_lion.pdf + static const GLuint BLOCKBINDING = 1; //picked by us + //Get the index, similar to a uniform location + GLuint UBOBlockIndex = glGetUniformBlockIndex(mProgramObject, "UBO"); + //Set this index to a binding index + glUniformBlockBinding(mProgramObject, UBOBlockIndex, BLOCKBINDING); + } unbind(); LL_DEBUGS("ShaderUniform") << "Total Uniform Size: " << mTotalUniformSize << LL_ENDL; diff --git a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl index ab5badf538..3d96fe25be 100644 --- a/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class2/deferred/reflectionProbeF.glsl @@ -32,7 +32,7 @@ uniform samplerCubeArray reflectionProbes; -layout (std140, binding = 1) uniform ReflectionProbes +layout (std140) uniform ReflectionProbes { // list of OBBs for user override probes // box is a set of 3 planes outward facing planes and the depth of the box along that plane diff --git a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl index 1f5fdde9ca..3ff039261b 100644 --- a/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl +++ b/indra/newview/app_settings/shaders/class3/deferred/reflectionProbeF.glsl @@ -33,7 +33,7 @@ uniform samplerCubeArray reflectionProbes; uniform samplerCubeArray irradianceProbes; -layout (std140, binding = 1) uniform ReflectionProbes +layout (std140) uniform ReflectionProbes { // list of OBBs for user override probes // box is a set of 3 planes outward facing planes and the depth of the box along that plane |