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
This commit is contained in:
2022-10-19 14:40:27 +02:00
parent f0fba1a2d8
commit 3ac2f15a04

View File

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