[Mesa-dev] [PATCH 16/31] mesa: don't flag _NEW_COLOR for st/mesa if possible

Marek Olšák maraeo at gmail.com
Mon Jun 12 16:55:41 UTC 2017


From: Marek Olšák <marek.olsak at amd.com>

---
 src/mesa/main/blend.c               | 29 ++++++++++++++++++-----------
 src/mesa/main/blend.h               | 20 ++++++++++++++++++++
 src/mesa/main/enable.c              | 17 +++++++++++------
 src/mesa/main/mtypes.h              | 12 ++++++++++++
 src/mesa/state_tracker/st_context.c |  7 ++++---
 5 files changed, 65 insertions(+), 20 deletions(-)

diff --git a/src/mesa/main/blend.c b/src/mesa/main/blend.c
index e042b5e..881e9c8 100644
--- a/src/mesa/main/blend.c
+++ b/src/mesa/main/blend.c
@@ -252,21 +252,22 @@ _mesa_BlendFuncSeparate( GLenum sfactorRGB, GLenum dfactorRGB,
 
    if (!changed)
       return;
 
    if (!validate_blend_factors(ctx, "glBlendFuncSeparate",
                                sfactorRGB, dfactorRGB,
                                sfactorA, dfactorA)) {
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
 
    for (buf = 0; buf < numBuffers; buf++) {
       ctx->Color.Blend[buf].SrcRGB = sfactorRGB;
       ctx->Color.Blend[buf].DstRGB = dfactorRGB;
       ctx->Color.Blend[buf].SrcA = sfactorA;
       ctx->Color.Blend[buf].DstA = dfactorA;
    }
 
    update_uses_dual_src(ctx, 0);
    for (buf = 1; buf < numBuffers; buf++) {
@@ -324,21 +325,22 @@ blend_func_separatei(GLuint buf, GLenum sfactorRGB, GLenum dfactorRGB,
        ctx->Color.Blend[buf].SrcA == sfactorA &&
        ctx->Color.Blend[buf].DstA == dfactorA)
       return; /* no change */
 
    if (!no_error && !validate_blend_factors(ctx, "glBlendFuncSeparatei",
                                             sfactorRGB, dfactorRGB,
                                             sfactorA, dfactorA)) {
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
 
    ctx->Color.Blend[buf].SrcRGB = sfactorRGB;
    ctx->Color.Blend[buf].DstRGB = dfactorRGB;
    ctx->Color.Blend[buf].SrcA = sfactorA;
    ctx->Color.Blend[buf].DstA = dfactorA;
    update_uses_dual_src(ctx, buf);
    ctx->Color._BlendFuncPerBuffer = GL_TRUE;
 }
 
 
@@ -470,21 +472,21 @@ _mesa_BlendEquation( GLenum mode )
 
    if (!changed)
       return;
 
 
    if (!legal_simple_blend_equation(ctx, mode) && !advanced_mode) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquation");
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   _mesa_flush_vertices_for_blend_state(ctx);
 
    for (buf = 0; buf < numBuffers; buf++) {
       ctx->Color.Blend[buf].EquationRGB = mode;
       ctx->Color.Blend[buf].EquationA = mode;
    }
    ctx->Color._BlendEquationPerBuffer = GL_FALSE;
    ctx->Color._AdvancedBlendMode = advanced_mode;
 
    if (ctx->Driver.BlendEquationSeparate)
       ctx->Driver.BlendEquationSeparate(ctx, mode, mode);
@@ -512,21 +514,21 @@ _mesa_BlendEquationiARB(GLuint buf, GLenum mode)
 
    if (!legal_simple_blend_equation(ctx, mode) && !advanced_mode) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationi");
       return;
    }
 
    if (ctx->Color.Blend[buf].EquationRGB == mode &&
        ctx->Color.Blend[buf].EquationA == mode)
       return;  /* no change */
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   _mesa_flush_vertices_for_blend_state(ctx);
    ctx->Color.Blend[buf].EquationRGB = mode;
    ctx->Color.Blend[buf].EquationA = mode;
    ctx->Color._BlendEquationPerBuffer = GL_TRUE;
 
    if (buf == 0)
       ctx->Color._AdvancedBlendMode = advanced_mode;
 }
 
 
 void GLAPIENTRY
@@ -578,21 +580,21 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
    if (!legal_simple_blend_equation(ctx, modeRGB)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeRGB)");
       return;
    }
 
    if (!legal_simple_blend_equation(ctx, modeA)) {
       _mesa_error(ctx, GL_INVALID_ENUM, "glBlendEquationSeparateEXT(modeA)");
       return;
    }
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   _mesa_flush_vertices_for_blend_state(ctx);
 
    for (buf = 0; buf < numBuffers; buf++) {
       ctx->Color.Blend[buf].EquationRGB = modeRGB;
       ctx->Color.Blend[buf].EquationA = modeA;
    }
    ctx->Color._BlendEquationPerBuffer = GL_FALSE;
    ctx->Color._AdvancedBlendMode = BLEND_NONE;
 
    if (ctx->Driver.BlendEquationSeparate)
       ctx->Driver.BlendEquationSeparate(ctx, modeRGB, modeA);
@@ -600,21 +602,21 @@ _mesa_BlendEquationSeparate( GLenum modeRGB, GLenum modeA )
 
 
 static void
 blend_equation_separatei(struct gl_context *ctx, GLuint buf, GLenum modeRGB,
                          GLenum modeA)
 {
    if (ctx->Color.Blend[buf].EquationRGB == modeRGB &&
        ctx->Color.Blend[buf].EquationA == modeA)
       return;  /* no change */
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   _mesa_flush_vertices_for_blend_state(ctx);
    ctx->Color.Blend[buf].EquationRGB = modeRGB;
    ctx->Color.Blend[buf].EquationA = modeA;
    ctx->Color._BlendEquationPerBuffer = GL_TRUE;
    ctx->Color._AdvancedBlendMode = BLEND_NONE;
 }
 
 
 void GLAPIENTRY
 _mesa_BlendEquationSeparateiARB_no_error(GLuint buf, GLenum modeRGB,
                                          GLenum modeA)
@@ -684,21 +686,22 @@ _mesa_BlendColor( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha )
    GET_CURRENT_CONTEXT(ctx);
 
    tmp[0] = red;
    tmp[1] = green;
    tmp[2] = blue;
    tmp[3] = alpha;
 
    if (TEST_EQ_4V(tmp, ctx->Color.BlendColorUnclamped))
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlendColor ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewBlendColor;
    COPY_4FV( ctx->Color.BlendColorUnclamped, tmp );
 
    ctx->Color.BlendColor[0] = CLAMP(tmp[0], 0.0F, 1.0F);
    ctx->Color.BlendColor[1] = CLAMP(tmp[1], 0.0F, 1.0F);
    ctx->Color.BlendColor[2] = CLAMP(tmp[2], 0.0F, 1.0F);
    ctx->Color.BlendColor[3] = CLAMP(tmp[3], 0.0F, 1.0F);
 
    if (ctx->Driver.BlendColor)
       ctx->Driver.BlendColor(ctx, ctx->Color.BlendColor);
 }
@@ -789,37 +792,39 @@ _mesa_LogicOp( GLenum opcode )
       case GL_OR_INVERTED:
 	 break;
       default:
          _mesa_error( ctx, GL_INVALID_ENUM, "glLogicOp" );
 	 return;
    }
 
    if (ctx->Color.LogicOp == opcode)
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
    ctx->Color.LogicOp = opcode;
 
    if (ctx->Driver.LogicOpcode)
       ctx->Driver.LogicOpcode( ctx, opcode );
 }
 
 
 void GLAPIENTRY
 _mesa_IndexMask( GLuint mask )
 {
    GET_CURRENT_CONTEXT(ctx);
 
    if (ctx->Color.IndexMask == mask)
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
    ctx->Color.IndexMask = mask;
 }
 
 
 /**
  * Enable or disable writing of frame buffer color components.
  *
  * \param red whether to mask writing of the red color component.
  * \param green whether to mask writing of the green color component.
  * \param blue whether to mask writing of the blue color component.
@@ -849,21 +854,22 @@ _mesa_ColorMask( GLboolean red, GLboolean green,
     */
    tmp[RCOMP] = red    ? 0xff : 0x0;
    tmp[GCOMP] = green  ? 0xff : 0x0;
    tmp[BCOMP] = blue   ? 0xff : 0x0;
    tmp[ACOMP] = alpha  ? 0xff : 0x0;
 
    flushed = GL_FALSE;
    for (i = 0; i < ctx->Const.MaxDrawBuffers; i++) {
       if (!TEST_EQ_4V(tmp, ctx->Color.ColorMask[i])) {
          if (!flushed) {
-            FLUSH_VERTICES(ctx, _NEW_COLOR);
+            FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+            ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
          }
          flushed = GL_TRUE;
          COPY_4UBV(ctx->Color.ColorMask[i], tmp);
       }
    }
 
    if (ctx->Driver.ColorMask)
       ctx->Driver.ColorMask( ctx, red, green, blue, alpha );
 }
 
@@ -891,21 +897,22 @@ _mesa_ColorMaski( GLuint buf, GLboolean red, GLboolean green,
     * -- should probably store these as the native booleans:
     */
    tmp[RCOMP] = red    ? 0xff : 0x0;
    tmp[GCOMP] = green  ? 0xff : 0x0;
    tmp[BCOMP] = blue   ? 0xff : 0x0;
    tmp[ACOMP] = alpha  ? 0xff : 0x0;
 
    if (TEST_EQ_4V(tmp, ctx->Color.ColorMask[buf]))
       return;
 
-   FLUSH_VERTICES(ctx, _NEW_COLOR);
+   FLUSH_VERTICES(ctx, ctx->DriverFlags.NewColorMask ? 0 : _NEW_COLOR);
+   ctx->NewDriverState |= ctx->DriverFlags.NewColorMask;
    COPY_4UBV(ctx->Color.ColorMask[buf], tmp);
 }
 
 
 void GLAPIENTRY
 _mesa_ClampColor(GLenum target, GLenum clamp)
 {
    GET_CURRENT_CONTEXT(ctx);
 
    /* Check for both the extension and the GL version, since the Intel driver
diff --git a/src/mesa/main/blend.h b/src/mesa/main/blend.h
index 54b9ce6..675e50d 100644
--- a/src/mesa/main/blend.h
+++ b/src/mesa/main/blend.h
@@ -27,21 +27,23 @@
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
 
 #ifndef BLEND_H
 #define BLEND_H
 
 
 #include "glheader.h"
+#include "context.h"
 #include "formats.h"
+#include "extensions.h"
 
 struct gl_context;
 struct gl_framebuffer;
 
 
 extern void GLAPIENTRY
 _mesa_BlendFunc( GLenum sfactor, GLenum dfactor );
 
 
 extern void GLAPIENTRY
@@ -129,11 +131,29 @@ _mesa_update_clamp_fragment_color(struct gl_context *ctx,
 extern void
 _mesa_update_clamp_vertex_color(struct gl_context *ctx,
                                 const struct gl_framebuffer *drawFb);
 
 extern mesa_format
 _mesa_get_render_format(const struct gl_context *ctx, mesa_format format);
 
 extern void  
 _mesa_init_color( struct gl_context * ctx );
 
+
+static inline void
+_mesa_flush_vertices_for_blend_state(struct gl_context *ctx)
+{
+   /* The advanced blend mode needs _NEW_COLOR to update the state constant,
+    * so we have to set it. This is inefficient.
+    * This should only be done for states that affect the state constant.
+    * It shouldn't be done for other blend states.
+    */
+   if (_mesa_has_KHR_blend_equation_advanced(ctx) ||
+       !ctx->DriverFlags.NewBlend) {
+      FLUSH_VERTICES(ctx, _NEW_COLOR);
+   } else {
+      FLUSH_VERTICES(ctx, 0);
+   }
+   ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
+}
+
 #endif
diff --git a/src/mesa/main/enable.c b/src/mesa/main/enable.c
index e1eb95f..66160a4 100644
--- a/src/mesa/main/enable.c
+++ b/src/mesa/main/enable.c
@@ -22,20 +22,21 @@
  * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
  * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
  * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
  * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
  * OTHER DEALINGS IN THE SOFTWARE.
  */
 
 
 #include "glheader.h"
+#include "blend.h"
 #include "clip.h"
 #include "context.h"
 #include "debug_output.h"
 #include "enable.h"
 #include "errors.h"
 #include "light.h"
 #include "mtypes.h"
 #include "enums.h"
 #include "texstate.h"
 
@@ -304,21 +305,21 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          if (ctx->Eval.AutoNormal == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_EVAL);
          ctx->Eval.AutoNormal = state;
          break;
       case GL_BLEND:
          {
             GLbitfield newEnabled =
                state * ((1 << ctx->Const.MaxDrawBuffers) - 1);
             if (newEnabled != ctx->Color.BlendEnabled) {
-               FLUSH_VERTICES(ctx, _NEW_COLOR);
+               _mesa_flush_vertices_for_blend_state(ctx);
                ctx->Color.BlendEnabled = newEnabled;
             }
          }
          break;
       case GL_CLIP_DISTANCE0: /* aka GL_CLIP_PLANE0 */
       case GL_CLIP_DISTANCE1:
       case GL_CLIP_DISTANCE2:
       case GL_CLIP_DISTANCE3:
       case GL_CLIP_DISTANCE4:
       case GL_CLIP_DISTANCE5:
@@ -371,21 +372,22 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          ctx->NewDriverState |= ctx->DriverFlags.NewDepth;
          ctx->Depth.Test = state;
          break;
       case GL_DEBUG_OUTPUT:
       case GL_DEBUG_OUTPUT_SYNCHRONOUS_ARB:
          _mesa_set_debug_state_int(ctx, cap, state);
          break;
       case GL_DITHER:
          if (ctx->Color.DitherFlag == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+         ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
          ctx->Color.DitherFlag = state;
          break;
       case GL_FOG:
          if (ctx->API != API_OPENGL_COMPAT && ctx->API != API_OPENGLES)
             goto invalid_enum_error;
          if (ctx->Fog.Enabled == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_FOG);
          ctx->Fog.Enabled = state;
          ctx->Fog._PackedEnabledMode = state ? ctx->Fog._PackedMode : FOG_NONE;
@@ -433,39 +435,41 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          if (ctx->Line.StippleFlag == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_LINE);
          ctx->Line.StippleFlag = state;
          break;
       case GL_INDEX_LOGIC_OP:
          if (ctx->API != API_OPENGL_COMPAT)
             goto invalid_enum_error;
          if (ctx->Color.IndexLogicOpEnabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+         ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
          ctx->Color.IndexLogicOpEnabled = state;
          break;
       case GL_CONSERVATIVE_RASTERIZATION_INTEL:
          if (!_mesa_has_INTEL_conservative_rasterization(ctx))
             goto invalid_enum_error;
          if (ctx->IntelConservativeRasterization == state)
             return;
          FLUSH_VERTICES(ctx, 0);
          ctx->NewDriverState |=
             ctx->DriverFlags.NewIntelConservativeRasterization;
          ctx->IntelConservativeRasterization = state;
          break;
       case GL_COLOR_LOGIC_OP:
          if (!_mesa_is_desktop_gl(ctx) && ctx->API != API_OPENGLES)
             goto invalid_enum_error;
          if (ctx->Color.ColorLogicOpEnabled == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewLogicOp ? 0 : _NEW_COLOR);
+         ctx->NewDriverState |= ctx->DriverFlags.NewLogicOp;
          ctx->Color.ColorLogicOpEnabled = state;
          break;
       case GL_MAP1_COLOR_4:
          if (ctx->API != API_OPENGL_COMPAT)
             goto invalid_enum_error;
          if (ctx->Eval.Map1Color4 == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_EVAL);
          ctx->Eval.Map1Color4 = state;
          break;
@@ -1033,21 +1037,22 @@ _mesa_set_enable(struct gl_context *ctx, GLenum cap, GLboolean state)
          if (ctx->Multisample.SampleMask == state)
             return;
          FLUSH_VERTICES(ctx, _NEW_MULTISAMPLE);
          ctx->Multisample.SampleMask = state;
          break;
 
       case GL_BLEND_ADVANCED_COHERENT_KHR:
          CHECK_EXTENSION(KHR_blend_equation_advanced_coherent, cap);
          if (ctx->Color.BlendCoherent == state)
             return;
-         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         FLUSH_VERTICES(ctx, ctx->DriverFlags.NewBlend ? 0 : _NEW_COLOR);
+         ctx->NewDriverState |= ctx->DriverFlags.NewBlend;
          ctx->Color.BlendCoherent = state;
          break;
 
       default:
          goto invalid_enum_error;
    }
 
    if (ctx->Driver.Enable) {
       ctx->Driver.Enable( ctx, cap, state );
    }
@@ -1099,21 +1104,21 @@ _mesa_set_enablei(struct gl_context *ctx, GLenum cap,
    case GL_BLEND:
       if (!ctx->Extensions.EXT_draw_buffers2) {
          goto invalid_enum_error;
       }
       if (index >= ctx->Const.MaxDrawBuffers) {
          _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
                      state ? "glEnableIndexed" : "glDisableIndexed", index);
          return;
       }
       if (((ctx->Color.BlendEnabled >> index) & 1) != state) {
-         FLUSH_VERTICES(ctx, _NEW_COLOR);
+         _mesa_flush_vertices_for_blend_state(ctx);
          if (state)
             ctx->Color.BlendEnabled |= (1 << index);
          else
             ctx->Color.BlendEnabled &= ~(1 << index);
       }
       break;
    case GL_SCISSOR_TEST:
       if (index >= ctx->Const.MaxViewports) {
          _mesa_error(ctx, GL_INVALID_VALUE, "%s(index=%u)",
                      state ? "glEnablei" : "glDisablei", index);
diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h
index d3afc65..17b5543 100644
--- a/src/mesa/main/mtypes.h
+++ b/src/mesa/main/mtypes.h
@@ -4399,23 +4399,35 @@ struct gl_driver_flags
 
    /** gl_context::Scissor::EnableFlags */
    uint64_t NewScissorTest;
 
    /** gl_context::Scissor::ScissorArray */
    uint64_t NewScissorRect;
 
    /** gl_context::Color::Alpha* */
    uint64_t NewAlphaTest;
 
+   /** gl_context::Color::Blend/Dither */
+   uint64_t NewBlend;
+
+   /** gl_context::Color::BlendColor */
+   uint64_t NewBlendColor;
+
+   /** gl_context::Color::Color/Index */
+   uint64_t NewColorMask;
+
    /** gl_context::Depth */
    uint64_t NewDepth;
 
+   /** gl_context::Color::LogicOp/ColorLogicOp/IndexLogicOp */
+   uint64_t NewLogicOp;
+
    /** gl_context::Stencil */
    uint64_t NewStencil;
 };
 
 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) */
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index d3d06fe..6dc3f35 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -229,23 +229,20 @@ st_invalidate_state(struct gl_context * ctx)
                        _NEW_POLYGON |
                        _NEW_TRANSFORM))
          st->dirty |= ST_NEW_RASTERIZER;
    }
 
    if (new_state & (_NEW_PROJECTION |
                     _NEW_TRANSFORM) &&
        st_user_clip_planes_enabled(ctx))
       st->dirty |= ST_NEW_CLIP_STATE;
 
-   if (new_state & _NEW_COLOR)
-      st->dirty |= ST_NEW_BLEND;
-
    if (new_state & _NEW_PIXEL)
       st->dirty |= ST_NEW_PIXEL_TRANSFER;
 
    if (new_state & _NEW_CURRENT_ATTRIB)
       st->dirty |= ST_NEW_VERTEX_ARRAYS;
 
    /* Update the vertex shader if ctx->Light._ClampVertexColor was changed. */
    if (st->clamp_vert_color_in_shader && (new_state & _NEW_LIGHT))
       st->dirty |= ST_NEW_VS_STATE;
 
@@ -510,21 +507,25 @@ static void st_init_driver_flags(struct st_context *st)
    f->NewDefaultTessLevels = ST_NEW_TESS_STATE;
    f->NewTextureBuffer = ST_NEW_SAMPLER_VIEWS;
    f->NewAtomicBuffer = ST_NEW_ATOMIC_BUFFER;
    f->NewShaderStorageBuffer = ST_NEW_STORAGE_BUFFER;
    f->NewImageUnits = ST_NEW_IMAGE_UNITS;
    f->NewWindowRectangles = ST_NEW_WINDOW_RECTANGLES;
    f->NewFramebufferSRGB = ST_NEW_FRAMEBUFFER;
    f->NewScissorRect = ST_NEW_SCISSOR;
    f->NewScissorTest = ST_NEW_SCISSOR | ST_NEW_RASTERIZER;
    f->NewAlphaTest = ST_NEW_DSA;
+   f->NewBlend = ST_NEW_BLEND;
+   f->NewBlendColor = ST_NEW_BLEND; /* TODO: add an atom for blend color */
+   f->NewColorMask = ST_NEW_BLEND;
    f->NewDepth = ST_NEW_DSA;
+   f->NewLogicOp = ST_NEW_BLEND;
    f->NewStencil = ST_NEW_DSA;
 }
 
 struct st_context *st_create_context(gl_api api, struct pipe_context *pipe,
                                      const struct gl_config *visual,
                                      struct st_context *share,
                                      const struct st_config_options *options)
 {
    struct gl_context *ctx;
    struct gl_context *shareCtx = share ? share->ctx : NULL;
-- 
2.7.4



More information about the mesa-dev mailing list