i965/msaa: Only do multisample rasterization if GL_MULTISAMPLE enabled.
[profile/ivi/mesa.git] / src / mesa / drivers / dri / i965 / gen6_sf_state.c
index e0aaa90..aeed369 100644 (file)
@@ -122,9 +122,9 @@ upload_sf_state(struct brw_context *brw)
    int i;
    /* _NEW_BUFFER */
    bool render_to_fbo = _mesa_is_user_fbo(brw->intel.ctx.DrawBuffer);
-   bool multisampled = false;
+   bool multisampled_fbo = false;
    if (ctx->DrawBuffer->_ColorDrawBuffers[0])
-      multisampled = ctx->DrawBuffer->_ColorDrawBuffers[0]->NumSamples > 0;
+      multisampled_fbo = ctx->DrawBuffer->_ColorDrawBuffers[0]->NumSamples > 0;
 
    int attr = 0, input_index = 0;
    int urb_entry_read_offset = 1;
@@ -242,7 +242,8 @@ upload_sf_state(struct brw_context *brw)
       dw3 |= GEN6_SF_LINE_AA_MODE_TRUE;
       dw3 |= GEN6_SF_LINE_END_CAP_WIDTH_1_0;
    }
-   if (multisampled)
+   /* _NEW_MULTISAMPLE */
+   if (multisampled_fbo && ctx->Multisample.Enabled)
       dw3 |= GEN6_SF_MSRAST_ON_PATTERN;
 
    /* _NEW_PROGRAM | _NEW_POINT */
@@ -349,7 +350,8 @@ const struct brw_tracked_state gen6_sf_state = {
                _NEW_LINE |
                _NEW_SCISSOR |
                _NEW_BUFFERS |
-               _NEW_POINT),
+               _NEW_POINT |
+                _NEW_MULTISAMPLE),
       .brw   = (BRW_NEW_CONTEXT |
                BRW_NEW_FRAGMENT_PROGRAM),
       .cache = CACHE_NEW_VS_PROG