i965: Warn on a couple of workarounds in blending.
authorEric Anholt <eric@anholt.net>
Fri, 12 Oct 2012 19:53:08 +0000 (12:53 -0700)
committerEric Anholt <eric@anholt.net>
Tue, 16 Oct 2012 20:13:44 +0000 (13:13 -0700)
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/mesa/drivers/dri/i965/gen6_cc.c

index e9c7f5064df13385f548d24859e7d6139189bb3b..b61a816cd875f3807e1af98803dd824ebef17e67 100644 (file)
@@ -31,6 +31,7 @@
 #include "brw_util.h"
 #include "intel_batchbuffer.h"
 #include "main/macros.h"
+#include "main/enums.h"
 
 static void
 gen6_upload_blend_state(struct brw_context *brw)
@@ -82,13 +83,20 @@ 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, but other types should.
          *
-         * From the Sandy Bridge PRM, Vol 2 Par 1, Section 8.1.11, "Logic Ops",
+         * However, 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."
          */
+         WARN_ONCE(ctx->Color.LogicOp != GL_COPY &&
+                   rb_type != GL_UNSIGNED_NORMALIZED &&
+                   rb_type != GL_FLOAT, "Ignoring %s logic op on %s "
+                   "renderbuffer\n",
+                   _mesa_lookup_enum_by_nr(ctx->Color.LogicOp),
+                   _mesa_lookup_enum_by_nr(rb_type));
         if (rb_type == GL_UNSIGNED_NORMALIZED) {
            blend[b].blend1.logic_op_enable = 1;
            blend[b].blend1.logic_op_func =
@@ -179,6 +187,11 @@ gen6_upload_blend_state(struct brw_context *brw)
         * DWord 1, Bit 30 (AlphaToOne Enable):
         * "If Dual Source Blending is enabled, this bit must be disabled"
         */
+         WARN_ONCE(ctx->Color.Blend[b]._UsesDualSrc &&
+                   ctx->Multisample._Enabled &&
+                   ctx->Multisample.SampleAlphaToOne,
+                   "HW workaround: disabling alpha to one with dual src "
+                   "blending\n");
         if (ctx->Color.Blend[b]._UsesDualSrc)
             blend[b].blend1.alpha_to_one = false;
         else