diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc b/source/blender/gpu/opengl/gl_shader_interface.cc index 4b10780e551..0b0bd2c1ea8 100644 --- a/source/blender/gpu/opengl/gl_shader_interface.cc +++ b/source/blender/gpu/opengl/gl_shader_interface.cc @@ -529,6 +529,9 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI } } + this->sort_inputs(); + + /* Resolving builtins must happen after the inputs have been sorted. */ /* Builtin Uniforms */ for (int32_t u_int = 0; u_int < GPU_NUM_UNIFORMS; u_int++) { GPUUniformBuiltin u = static_cast(u_int); @@ -543,8 +546,6 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI builtin_blocks_[u] = (block != nullptr) ? block->binding : -1; } - this->sort_inputs(); - // this->debug_print(); glUseProgram(last_program);