Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-01-24 22:26:24 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-01-24 22:26:33 +0300
commit083de503ce01bd9d10745f22b351f305f3ea2c22 (patch)
tree946e1b87d606e4ea1d9353f709808df407888227 /source/blender/gpu
parent04c3b085188616c375dd5ba3a0632665629b9208 (diff)
GLShaderInterface: Fix interface from createInfo not setting bindings
This is because the `glUniform1i` calls were not preceeded by `glUseProgram` which made parameters not stick.
Diffstat (limited to 'source/blender/gpu')
-rw-r--r--source/blender/gpu/opengl/gl_shader_interface.cc3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_shader_interface.cc b/source/blender/gpu/opengl/gl_shader_interface.cc
index 2211c2fbb7c..c5a8d34c047 100644
--- a/source/blender/gpu/opengl/gl_shader_interface.cc
+++ b/source/blender/gpu/opengl/gl_shader_interface.cc
@@ -364,6 +364,9 @@ GLShaderInterface::GLShaderInterface(GLuint program, const shader::ShaderCreateI
name_buffer_ = (char *)MEM_mallocN(info.interface_names_size_, "name_buffer");
uint32_t name_buffer_offset = 0;
+ /* Necessary to make #glUniform works. TODO(fclem) Remove. */
+ glUseProgram(program);
+
/* Attributes */
for (const ShaderCreateInfo::VertIn &attr : info.vertex_inputs_) {
copy_input_name(input, attr.name, name_buffer_, name_buffer_offset);