anv/pipeline: Unconditionally emit PS_BLEND on gen8+
authorJason Ekstrand <jason.ekstrand@intel.com>
Tue, 8 Mar 2016 18:25:00 +0000 (10:25 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Tue, 8 Mar 2016 23:40:11 +0000 (15:40 -0800)
Special-casing the PS_BLEND packet wasn't really gaining us anything.  It's
defined to be more-or-less the contents of blend state entry 0 only without
the indirection.  We can just copy-and-paste the contents.  If there are no
valid color targets, then blend state 0 will be 0-initialized anyway so
it's basically the same as the special case we had before.

src/intel/vulkan/gen8_pipeline.c

index 71705d23200379aa2d443f05fc30bc24b44c4663..b8b29d46b8ab4483e3fb6c012c8fc2370f423888 100644 (file)
@@ -189,24 +189,20 @@ emit_cb_state(struct anv_pipeline *pipeline,
       }
    }
 
-   if (info->attachmentCount > 0) {
-      struct GENX(BLEND_STATE_ENTRY) *bs = &blend_state.Entry[0];
-
-      anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_BLEND),
-                     .AlphaToCoverageEnable = blend_state.AlphaToCoverageEnable,
-                     .HasWriteableRT = has_writeable_rt,
-                     .ColorBufferBlendEnable = bs->ColorBufferBlendEnable,
-                     .SourceAlphaBlendFactor = bs->SourceAlphaBlendFactor,
-                     .DestinationAlphaBlendFactor =
-                        bs->DestinationAlphaBlendFactor,
-                     .SourceBlendFactor = bs->SourceBlendFactor,
-                     .DestinationBlendFactor = bs->DestinationBlendFactor,
-                     .AlphaTestEnable = false,
-                     .IndependentAlphaBlendEnable =
-                        blend_state.IndependentAlphaBlendEnable);
-   } else {
-      anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_BLEND));
-   }
+   struct GENX(BLEND_STATE_ENTRY) *bs0 = &blend_state.Entry[0];
+
+   anv_batch_emit(&pipeline->batch, GENX(3DSTATE_PS_BLEND),
+                  .AlphaToCoverageEnable = blend_state.AlphaToCoverageEnable,
+                  .HasWriteableRT = has_writeable_rt,
+                  .ColorBufferBlendEnable = bs0->ColorBufferBlendEnable,
+                  .SourceAlphaBlendFactor = bs0->SourceAlphaBlendFactor,
+                  .DestinationAlphaBlendFactor =
+                     bs0->DestinationAlphaBlendFactor,
+                  .SourceBlendFactor = bs0->SourceBlendFactor,
+                  .DestinationBlendFactor = bs0->DestinationBlendFactor,
+                  .AlphaTestEnable = false,
+                  .IndependentAlphaBlendEnable =
+                     blend_state.IndependentAlphaBlendEnable);
 
    GENX(BLEND_STATE_pack)(NULL, pipeline->blend_state.map, &blend_state);
    if (!device->info.has_llc)