mesa/main: fix meta caller of _mesa_ClampColor
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Mon, 16 Jan 2017 11:13:50 +0000 (12:13 +0100)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Thu, 19 Jan 2017 08:13:25 +0000 (09:13 +0100)
Since _mesa_ClampColor properly checks for support of the API function
now, it's meta callers need to check support as well.

Fixes: 963311b71f ("mesa/main: fix version/extension checks in _mesa_ClampColor")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99401
Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Cc: "17.0" <mesa-stable@lists.freedesktop.org>
src/mesa/main/attrib.c

index 9c7f5ed0e5886ca7c8dc0b19c22a0324c9678b48..ada2203ec0b4decec7ace23a070ff49f8409f784 100644 (file)
@@ -1071,7 +1071,8 @@ _mesa_PopAttrib(void)
                if (ctx->Extensions.ARB_color_buffer_float)
                   _mesa_ClampColor(GL_CLAMP_FRAGMENT_COLOR_ARB,
                                    color->ClampFragmentColor);
-               _mesa_ClampColor(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
+               if (ctx->Extensions.ARB_color_buffer_float || ctx->Version >= 30)
+                  _mesa_ClampColor(GL_CLAMP_READ_COLOR_ARB, color->ClampReadColor);
 
                /* GL_ARB_framebuffer_sRGB / GL_EXT_framebuffer_sRGB */
                if (ctx->Extensions.EXT_framebuffer_sRGB)