diff options
-rw-r--r-- | source/blender/editors/include/BIF_glutil.h | 1 | ||||
-rw-r--r-- | source/blender/editors/screen/glutil.c | 7 |
2 files changed, 7 insertions, 1 deletions
diff --git a/source/blender/editors/include/BIF_glutil.h b/source/blender/editors/include/BIF_glutil.h index 1477d20f7f1..3184ebee4d9 100644 --- a/source/blender/editors/include/BIF_glutil.h +++ b/source/blender/editors/include/BIF_glutil.h @@ -71,6 +71,7 @@ typedef struct IMMDrawPixelsTexState { struct GPUShader *shader; unsigned int pos; unsigned int texco; + bool do_shader_unbind; } IMMDrawPixelsTexState; /* To be used before calling immDrawPixelsTex diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index 8bf269f74fa..b284800d510 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -159,6 +159,7 @@ IMMDrawPixelsTexState immDrawPixelsTexSetup(int builtin) /* Shader will be unbind by immUnbindProgram in immDrawPixelsTexScaled_clipping */ immBindBuiltinProgram(builtin); immUniform1i("image", 0); + state.do_shader_unbind = true; return state; } @@ -318,7 +319,9 @@ void immDrawPixelsTexScaled_clipping(IMMDrawPixelsTexState *state, } } - immUnbindProgram(); + if (state->do_shader_unbind) { + immUnbindProgram(); + } glBindTexture(GL_TEXTURE_2D, 0); glPixelStorei(GL_UNPACK_ROW_LENGTH, unpack_row_length); @@ -571,6 +574,8 @@ void glaDrawImBuf_glsl_clipping(ImBuf *ibuf, float x, float y, int zoomfilter, int ok; IMMDrawPixelsTexState state = {0}; + /* We want GLSL state to be fully handled by OCIO. */ + state.do_shader_unbind = false; immDrawPixelsTexSetupAttributes(&state); if (ibuf->rect_float) { |