OCIO: GLSL: Avoid undefined behavior
Set ubo binding after shaderinterface creation as GPU_shaderinterface_create will call glUniformBlockBinding.
This commit is contained in:
@@ -264,14 +264,14 @@ static void updateGLSLShader(OCIO_GLSLShader *shader,
|
||||
|
||||
glUseProgram(shader->program);
|
||||
|
||||
/* Set UBO binding location. */
|
||||
GLuint index = glGetUniformBlockIndex(shader->program, "OCIO_GLSLCurveMappingParameters");
|
||||
glUniformBlockBinding(shader->program, index, UBO_BIND_LOC);
|
||||
|
||||
/* TODO(fclem) Remove this. Make caller always assume viewport space and
|
||||
* specify texco via vertex attribs. */
|
||||
shader->interface = GPU_shaderinterface_create(shader->program);
|
||||
|
||||
/* Set UBO binding location. */
|
||||
GLuint index = glGetUniformBlockIndex(shader->program, "OCIO_GLSLCurveMappingParameters");
|
||||
glUniformBlockBinding(shader->program, index, UBO_BIND_LOC);
|
||||
|
||||
/* Set texture bind point uniform once. This is saved by the shader. */
|
||||
glUniform1i(glGetUniformLocation(shader->program, "image_texture"), 0);
|
||||
glUniform1i(glGetUniformLocation(shader->program, "lut3d_texture"), 2);
|
||||
|
Reference in New Issue
Block a user