i965/gen6+: Work around GPU hangs with logic ops on integer textures.
authorEric Anholt <eric@anholt.net>
Fri, 20 Jan 2012 21:19:10 +0000 (13:19 -0800)
committerEric Anholt <eric@anholt.net>
Wed, 25 Jan 2012 00:20:21 +0000 (16:20 -0800)
This doesn't result in correct rendering -- GL requires that logic ops
work, while the hardware specs say it doesn't do them.  I'm not sure
how we would want to handle this.

NOTE: This is a candidate for the 8.0 branch.

src/mesa/drivers/dri/i965/gen6_cc.c

index dada09ca7dd70274d1933834b8451dc49d124a35..8a805fa6d7769ed3e24e3fe6398f50bd7597e89e 100644 (file)
@@ -79,9 +79,14 @@ gen6_upload_blend_state(struct brw_context *brw)
       /* _NEW_COLOR */
       if (ctx->Color.ColorLogicOpEnabled) {
         /* Floating point RTs should have no effect from LogicOp,
-         * except for disabling of blending
+         * except for disabling of blending.
+         *
+         * From the Sandy Bridge PRM, Vol 2 Par 1, Section 8.1.11, "Logic Ops",
+         *
+         *     "Logic Ops are only supported on *_UNORM surfaces (excluding
+         *      _SRGB variants), otherwise Logic Ops must be DISABLED."
          */
-        if (rb_type != GL_FLOAT) {
+        if (rb_type == GL_UNSIGNED_NORMALIZED) {
            blend[b].blend1.logic_op_enable = 1;
            blend[b].blend1.logic_op_func =
               intel_translate_logic_op(ctx->Color.LogicOp);