Issue/1447 (#1451)

* Fixed missing calls to OpenGL cache system.
This commit is contained in:
Jonathas Costa
2021-01-12 04:28:49 -05:00
committed by GitHub
parent 50bae273fb
commit 65803e134d
8 changed files with 27 additions and 133 deletions

View File

@@ -860,7 +860,7 @@ void RenderableStars::loadPSFTexture() {
void RenderableStars::renderPSFToTexture() {
// Saves current FBO first
GLint defaultFBO;
glGetIntegerv(GL_FRAMEBUFFER_BINDING, &defaultFBO);
defaultFBO = global::renderEngine->openglStateCache().defaultFramebuffer();
// GLint m_viewport[4];
// global::renderEngine.openglStateCache().viewPort(m_viewport);
@@ -973,24 +973,6 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) {
return;
}
// Saving current OpenGL state
GLenum blendEquationRGB;
GLenum blendEquationAlpha;
GLenum blendDestAlpha;
GLenum blendDestRGB;
GLenum blendSrcAlpha;
GLenum blendSrcRGB;
GLboolean depthMask;
glGetIntegerv(GL_BLEND_EQUATION_RGB, &blendEquationRGB);
glGetIntegerv(GL_BLEND_EQUATION_ALPHA, &blendEquationAlpha);
glGetIntegerv(GL_BLEND_DST_ALPHA, &blendDestAlpha);
glGetIntegerv(GL_BLEND_DST_RGB, &blendDestRGB);
glGetIntegerv(GL_BLEND_SRC_ALPHA, &blendSrcAlpha);
glGetIntegerv(GL_BLEND_SRC_RGB, &blendSrcRGB);
glGetBooleanv(GL_DEPTH_WRITEMASK, &depthMask);
glBlendFunc(GL_SRC_ALPHA, GL_ONE);
glDepthMask(false);
@@ -1093,13 +1075,9 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) {
glBindVertexArray(0);
_program->deactivate();
glDepthMask(true);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
// Restores OpenGL blending state
glBlendEquationSeparate(blendEquationRGB, blendEquationAlpha);
glBlendFuncSeparate(blendSrcRGB, blendDestRGB, blendSrcAlpha, blendDestAlpha);
glDepthMask(depthMask);
global::renderEngine->openglStateCache().resetBlendState();
global::renderEngine->openglStateCache().resetDepthState();
}
void RenderableStars::update(const UpdateData&) {