diff options
author | Campbell Barton <ideasman42@gmail.com> | 2016-06-07 21:03:25 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2016-06-07 21:13:21 +0300 |
commit | f3d33a1a0f1dd4092d35760027f495bc21d1e4be (patch) | |
tree | 404db0cfdc9a1ac70622567077014cb299a9d916 /source/blender/editors/screen/glutil.c | |
parent | cf8a0d08b034dd59624a8657ab79f51b64708ab1 (diff) |
GPU: Fix for glDrawPixels drawing w/ glsl shader
The basic shader needs to be temporarily disabled in this case.
Add macros for temp store/restoring the state.
Diffstat (limited to 'source/blender/editors/screen/glutil.c')
-rw-r--r-- | source/blender/editors/screen/glutil.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/screen/glutil.c b/source/blender/editors/screen/glutil.c index cbf87062955..014268262c4 100644 --- a/source/blender/editors/screen/glutil.c +++ b/source/blender/editors/screen/glutil.c @@ -579,6 +579,10 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo draw_h = min_ii(img_h - off_y, ceil((scissor[3] - rast_y) / yzoom)); if (draw_w > 0 && draw_h > 0) { + + int bound_options; + GPU_BASIC_SHADER_DISABLE_AND_STORE(bound_options); + /* Don't use safe RasterPos (slower) if we can avoid it. */ if (rast_x >= 0 && rast_y >= 0) { glRasterPos2f(rast_x, rast_y); @@ -610,6 +614,8 @@ void glaDrawPixelsSafe(float x, float y, int img_w, int img_h, int row_w, int fo } glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); + + GPU_BASIC_SHADER_ENABLE_AND_RESTORE(bound_options); } } |