i965: Fix negation in the new FS backend.
[mesa.git] / src / mesa / drivers / dri / i965 / brw_wm_state.c
index c1cf4db1caeba957d7a1f010861d60a0c727f376..6699d0a73e6501bb3a688c4fdb7a2dfb0ac21a85 100644 (file)
@@ -104,8 +104,22 @@ wm_unit_populate_key(struct brw_context *brw, struct brw_wm_unit_key *key)
    key->uses_kill = fp->UsesKill || ctx->Color.AlphaEnabled;
    key->is_glsl = bfp->isGLSL;
 
-   /* temporary sanity check assertion */
-   ASSERT(bfp->isGLSL == brw_wm_is_glsl(fp));
+   /* If using the fragment shader backend, the program is always
+    * 8-wide.
+    */
+   if (ctx->Shader.CurrentProgram) {
+      int i;
+
+      for (i = 0; i < ctx->Shader.CurrentProgram->_NumLinkedShaders; i++) {
+        struct brw_shader *shader =
+           (struct brw_shader *)ctx->Shader.CurrentProgram->_LinkedShaders[i];;
+
+        if (shader->base.Type == GL_FRAGMENT_SHADER &&
+            shader->ir != NULL) {
+           key->is_glsl = GL_TRUE;
+        }
+      }
+   }
 
    /* _NEW_DEPTH */
    key->stats_wm = intel->stats_wm;