On 06/05/2017 06:50 PM, Marek Olšák wrote:
From: Marek Olšák <marek.ol...@amd.com>

_NEW_BUFFERS updates too much stuff.

Yeah, _NEW_BUFFERS is something bad.

For now, 1-4 are:

Reviewed-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>

---
  src/mesa/main/enable.c | 5 ++++-
  src/mesa/main/mtypes.h | 3 +++
  2 files changed, 7 insertions(+), 1 deletion(-)

diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index ef278a3..0e07f4c 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -251,21 +251,24 @@ _mesa_set_multisample(struct gl_context *ctx, GLboolean 
state)
/**
   * Helper function to enable or disable GL_FRAMEBUFFER_SRGB, skipping the
   * check for whether the API supports it (GLES doesn't).
   */
  void
  _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) {
        ctx->Driver.Enable(ctx, GL_FRAMEBUFFER_SRGB, state);
     }
  }
/**
   * Helper function to enable or disable state.
   *
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index 9ef1b18..b7e7612 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4390,20 +4390,23 @@ struct gl_driver_flags
/**
      * gl_context::TessCtrlProgram::patch_default_*
      */
     uint64_t NewDefaultTessLevels;
/**
      * gl_context::IntelConservativeRasterization
      */
     uint64_t NewIntelConservativeRasterization;
+
+   /** gl_context::Color::sRGBEnabled */
+   uint64_t NewFramebufferSRGB;
  };
struct gl_uniform_buffer_binding
  {
     struct gl_buffer_object *BufferObject;
     /** Start of uniform block data in the buffer */
     GLintptr Offset;
     /** Size of data allowed to be referenced from the buffer (in bytes) */
     GLsizeiptr Size;
     /**

_______________________________________________
mesa-dev mailing list
mesa-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to