vc4: Only do MSAA FB operations if the FB is MSAA.
authorEric Anholt <eric@anholt.net>
Mon, 18 Apr 2016 23:57:53 +0000 (16:57 -0700)
committerEric Anholt <eric@anholt.net>
Fri, 22 Apr 2016 18:27:11 +0000 (11:27 -0700)
I noticed this as a problem with ET:QW traces emitting coverage code when
the framebuffer was supposed to be single sampled.

src/gallium/drivers/vc4/vc4_program.c

index 02cae2d4648423feec3e6d0d6844b2100012e050..4235d265d87404fa87da2f46c191f349c6e03490 100644 (file)
@@ -2194,11 +2194,14 @@ vc4_update_compiled_fs(struct vc4_context *vc4, uint8_t prim_mode)
         } else {
                 key->logicop_func = PIPE_LOGICOP_COPY;
         }
-        key->msaa = vc4->rasterizer->base.multisample;
-        key->sample_coverage = (vc4->rasterizer->base.multisample &&
-                                vc4->sample_mask != (1 << VC4_MAX_SAMPLES) - 1);
-        key->sample_alpha_to_coverage = vc4->blend->alpha_to_coverage;
-        key->sample_alpha_to_one = vc4->blend->alpha_to_one;
+        if (vc4->msaa) {
+                key->msaa = vc4->rasterizer->base.multisample;
+                key->sample_coverage = (vc4->rasterizer->base.multisample &&
+                                        vc4->sample_mask != (1 << VC4_MAX_SAMPLES) - 1);
+                key->sample_alpha_to_coverage = vc4->blend->alpha_to_coverage;
+                key->sample_alpha_to_one = vc4->blend->alpha_to_one;
+        }
+
         if (vc4->framebuffer.cbufs[0])
                 key->color_format = vc4->framebuffer.cbufs[0]->format;