i915: Disable color buffer writes if no color buffer is attached
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Mon, 9 Jun 2008 14:17:35 +0000 (16:17 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Mon, 9 Jun 2008 14:33:28 +0000 (16:33 +0200)
src/gallium/drivers/i915simple/i915_state_immediate.c

index 704ea4d838c0ce292151e45156e2ea227ca6c9e3..2501f2d7cb864a3d1e84abc2540356ab42254001 100644 (file)
@@ -156,8 +156,12 @@ const struct i915_tracked_state i915_upload_S5 = {
  */
 static void upload_S6( struct i915_context *i915 )
 {
-   unsigned LIS6 = (S6_COLOR_WRITE_ENABLE |
-                 (2 << S6_TRISTRIP_PV_SHIFT));
+   unsigned LIS6 = (2 << S6_TRISTRIP_PV_SHIFT);
+
+   /* I915_NEW_FRAMEBUFFER
+    */
+   if (i915->framebuffer.cbufs[0])
+      LIS6 |= S6_COLOR_WRITE_ENABLE;
 
    /* I915_NEW_BLEND
     */
@@ -174,7 +178,7 @@ static void upload_S6( struct i915_context *i915 )
 }
 
 const struct i915_tracked_state i915_upload_S6 = {
-   I915_NEW_BLEND | I915_NEW_DEPTH_STENCIL,
+   I915_NEW_BLEND | I915_NEW_DEPTH_STENCIL | I915_NEW_FRAMEBUFFER,
    upload_S6
 };