Renderer GL: Fix hotswapping shaders

This commit is contained in:
wheremyfoodat 2024-07-14 18:20:59 +03:00 committed by GitHub
parent 398d84d13e
commit c4e45ee6b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -813,6 +813,10 @@ void RendererGL::setUbershader(const std::string& shader) {
triangleProgram.create({vert, frag});
initUbershader(triangleProgram);
glUniform1f(depthScaleLoc, oldDepthScale);
glUniform1f(depthOffsetLoc, oldDepthOffset);
glUniform1i(depthmapEnableLoc, oldDepthmapEnable);
}
void RendererGL::initUbershader(OpenGL::Program& program) {
@ -834,4 +838,4 @@ void RendererGL::initUbershader(OpenGL::Program& program) {
glUniform1i(OpenGL::uniformLocation(program, "u_tex1"), 1);
glUniform1i(OpenGL::uniformLocation(program, "u_tex2"), 2);
glUniform1i(OpenGL::uniformLocation(program, "u_tex_lighting_lut"), 3);
}
}