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
path: root/source
diff options
context:
space:
mode:
authorClément Foucault <foucault.clem@gmail.com>2022-10-19 15:40:27 +0300
committerClément Foucault <foucault.clem@gmail.com>2022-10-19 15:40:42 +0300
commit3ac2f15a04c5c5425e086427170b5d1b2f559e82 (patch)
tree14de9bdf05f90a03b16421b2019d168c28d11331 /source
parentf0fba1a2d8deb7e92ccb217361a378f8fcc29d9b (diff)
GL: Fix incorrect shader state after shader interface creation
The interface needs to bind the shaders for some parameter setup. This program change wasn't reflected in the GPUContext. This was then conflicting with the next shader bind if the next shader was the same as the shader bound before the interface creation. Setting the state to the correct shader ensures a rebind if needed. Fix T101792 New hair curves do not render properly first time in EEVEE with motion blur enabled
Diffstat (limited to 'source')
-rw-r--r--source/blender/gpu/opengl/gl_shader.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/source/blender/gpu/opengl/gl_shader.cc b/source/blender/gpu/opengl/gl_shader.cc
index dafcf4dbf33..f6f14932de7 100644
--- a/source/blender/gpu/opengl/gl_shader.cc
+++ b/source/blender/gpu/opengl/gl_shader.cc
@@ -1004,6 +1004,11 @@ bool GLShader::finalize(const shader::ShaderCreateInfo *info)
else {
interface = new GLShaderInterface(shader_program_);
}
+ /**
+ * WORKAROUND: Creating the shader interface changes the active program.
+ * Make sure to update the context, otherwise we might have a missing bind.
+ */
+ Context::get()->shader = this;
return true;
}