diff options
author | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-08 16:59:00 +0300 |
---|---|---|
committer | Sergey Sharybin <sergey.vfx@gmail.com> | 2017-05-08 16:59:00 +0300 |
commit | 81ecd3f938ee0e0d02d71f6c6c21a5c0246055d4 (patch) | |
tree | 5b11f6cf60e0c4fa3275dc0baeb0ba986fbfce81 /source/blender/editors | |
parent | 0719a1bce0bdb0e4725b749a5f31680c1b8d6d65 (diff) |
Fix OCIO shader being attmepted to be unbound twice
Diffstat (limited to 'source/blender/editors')
-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) { |