Fix #35074: Image editor shows color banding on rendered images (even with dither...
authorSergey Sharybin <sergey.vfx@gmail.com>
Thu, 25 Apr 2013 12:02:56 +0000 (12:02 +0000)
committerSergey Sharybin <sergey.vfx@gmail.com>
Thu, 25 Apr 2013 12:02:56 +0000 (12:02 +0000)
Mistake in one of changes to GLSL display function,
missed fallback mode in case dither is non-zero,

source/blender/editors/screen/glutil.c

index 932ff9b48873d9e3af007b0b9688c7fef5ff1212..44d7c8d0114638306be7f61acd23d711dac0a92c 100644 (file)
@@ -1043,15 +1043,15 @@ void glaDrawImBuf_glsl(ImBuf *ibuf, float x, float y, int zoomfilter,
                return;
 
        /* Dithering is not supported on GLSL yet */
-       // force_fallback = ibuf->dither != 0.0f;
+       force_fallback |= ibuf->dither != 0.0f;
 
        /* Single channel images could not be transformed using GLSL yet */
-       // force_fallback = ibuf->channels == 1;
+       force_fallback |= ibuf->channels == 1;
 
        /* If user decided not to use GLSL, fallback to glaDrawPixelsAuto */
-       force_fallback = !ELEM(U.image_draw_method,
-                              IMAGE_DRAW_METHOD_AUTO,
-                              IMAGE_DRAW_METHOD_GLSL);
+       force_fallback |= !ELEM(U.image_draw_method,
+                               IMAGE_DRAW_METHOD_AUTO,
+                               IMAGE_DRAW_METHOD_GLSL);
 
        /* This is actually lots of crap, but currently not sure about
         * more clear way to bypass partial buffer update crappyness