[Bf-blender-cvs] [e00455381f5] draw-colormanagement: Cleanup: OpenColorIO: Remove state tracking
Clément Foucault
noreply at git.blender.org
Wed Jan 22 19:39:44 CET 2020
Commit: e00455381f55154e5c336cd496e0cb855c520ea8
Author: Clément Foucault
Date: Wed Jan 22 17:05:01 2020 +0100
Branches: draw-colormanagement
https://developer.blender.org/rBe00455381f55154e5c336cd496e0cb855c520ea8
Cleanup: OpenColorIO: Remove state tracking
Theses are useless. Better assume the state is has been changed.
===================================================================
M intern/opencolorio/ocio_impl_glsl.cc
===================================================================
diff --git a/intern/opencolorio/ocio_impl_glsl.cc b/intern/opencolorio/ocio_impl_glsl.cc
index 45bb4ae27a7..54854c93833 100644
--- a/intern/opencolorio/ocio_impl_glsl.cc
+++ b/intern/opencolorio/ocio_impl_glsl.cc
@@ -138,8 +138,6 @@ typedef struct OCIO_GLSLDrawState {
OCIO_GLSLCacheHandle shader_cache[SHADER_CACHE_SIZE];
OCIO_GLSLCacheHandle lut3d_cache[SHADER_CACHE_SIZE];
OCIO_GLSLCacheHandle curvemap_cache[SHADER_CACHE_SIZE];
- /* Previous OpenGL state. */
- GLint last_texture, last_texture_unit;
} OCIO_GLSLDrawState;
static OCIO_GLSLDrawState *allocateOpenGLState(void)
@@ -582,11 +580,6 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
*state_r = allocateOpenGLState();
state = *state_r;
- /* TODO(fclem) These two glGetIntegerv should be removed, and just assume the state needs
- * to be cleared after this function call. */
- glGetIntegerv(GL_TEXTURE_BINDING_2D, &state->last_texture);
- glGetIntegerv(GL_ACTIVE_TEXTURE, &state->last_texture_unit);
-
/* Compute cache IDs. */
GpuShaderDesc shaderDesc;
shaderDesc.setLanguage(GPU_LANGUAGE_GLSL_1_3);
@@ -653,19 +646,13 @@ bool OCIOImpl::setupGLSLDraw(OCIO_GLSLDrawState **state_r,
return true;
}
- else {
- glActiveTexture(state->last_texture_unit);
- glBindTexture(GL_TEXTURE_2D, state->last_texture);
- return false;
- }
+ return false;
}
void OCIOImpl::finishGLSLDraw(OCIO_GLSLDrawState *state)
{
- /* TODO(fclem) Remove thoses state changes. */
- glActiveTexture(state->last_texture_unit);
- glBindTexture(GL_TEXTURE_2D, state->last_texture);
+ (void)state;
immUnbindProgram();
}
More information about the Bf-blender-cvs
mailing list