i965/blorp: fix release build unused variable warning
[mesa.git] / src / mesa / state_tracker / st_atom_blend.c
index 064e0c14f1f195f1808109887b74e849775e3fa8..b8d65bde29ebf48ace9f6835932924a453604952 100644 (file)
@@ -175,7 +175,7 @@ static GLboolean
 blend_per_rt(const struct gl_context *ctx)
 {
    if (ctx->Color.BlendEnabled &&
-      (ctx->Color.BlendEnabled != ((1 << ctx->Const.MaxDrawBuffers) - 1))) {
+      (ctx->Color.BlendEnabled != ((1U << ctx->Const.MaxDrawBuffers) - 1))) {
       /* This can only happen if GL_EXT_draw_buffers2 is enabled */
       return GL_TRUE;
    }
@@ -265,9 +265,12 @@ update_blend( struct st_context *st )
 
    blend->dither = ctx->Color.DitherFlag;
 
-   if (ctx->Multisample.Enabled) {
-      /* unlike in gallium/d3d10 these operations are only performed
-         if msaa is enabled */
+   if (ctx->Multisample.Enabled &&
+       ctx->DrawBuffer->Visual.sampleBuffers > 0 &&
+       !(ctx->DrawBuffer->_IntegerBuffers & 0x1)) {
+      /* Unlike in gallium/d3d10 these operations are only performed
+       * if both msaa is enabled and we have a multisample buffer.
+       */
       blend->alpha_to_coverage = ctx->Multisample.SampleAlphaToCoverage;
       blend->alpha_to_one = ctx->Multisample.SampleAlphaToOne;
    }
@@ -283,10 +286,5 @@ update_blend( struct st_context *st )
 
 
 const struct st_tracked_state st_update_blend = {
-   "st_update_blend",                                  /* name */
-   {                                                   /* dirty */
-      (_NEW_COLOR | _NEW_MULTISAMPLE),  /* XXX _NEW_BLEND someday? */  /* mesa */
-      0,                                               /* st */
-   },
    update_blend,                                       /* update */
 };