mesa: add gl_driver_flags::NewFramebufferSRGB
authorMarek Olšák <marek.olsak@amd.com>
Sun, 4 Jun 2017 21:08:07 +0000 (23:08 +0200)
committerMarek Olšák <marek.olsak@amd.com>
Wed, 7 Jun 2017 16:46:21 +0000 (18:46 +0200)
_NEW_BUFFERS updates too much stuff.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
src/mesa/main/enable.c
src/mesa/main/mtypes.h

index ef278a318a1bd2dfc329290dd6287c74ed55c976..0e07f4c3b9a403c55078b6f0d520a11e8a605d51 100644 (file)
@@ -258,7 +258,10 @@ _mesa_set_framebuffer_srgb(struct gl_context *ctx, GLboolean state)
 {
    if (ctx->Color.sRGBEnabled == state)
       return;
-   FLUSH_VERTICES(ctx, _NEW_BUFFERS);
+
+   /* TODO: Switch i965 to the new flag and remove the conditional */
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewFramebufferSRGB ? 0 : _NEW_BUFFERS);
+   ctx->NewDriverState |= ctx->DriverFlags.NewFramebufferSRGB;
    ctx->Color.sRGBEnabled = state;
 
    if (ctx->Driver.Enable) {
index 7ec012321fc30be76a253d82288becfeed044e04..9ac2711197458aefec8239c6f759f80430e12aa8 100644 (file)
@@ -4402,6 +4402,9 @@ struct gl_driver_flags
     * gl_context::Scissor::WindowRects
     */
    uint64_t NewWindowRectangles;
+
+   /** gl_context::Color::sRGBEnabled */
+   uint64_t NewFramebufferSRGB;
 };
 
 struct gl_uniform_buffer_binding