SL-17967 - block layout binding acceptable to apple

meow-7.2.2
Howard Stearns 2022-09-01 16:18:14 -07:00
parent 3cf349c4fa
commit 88e1740d20
3 changed files with 10 additions and 2 deletions

View File

@ -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;

View File

@ -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

View File

@ -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