anv/gen7_pipeline: Set WriteDisable = true if we have no color attachments
authorJason Ekstrand <jason.ekstrand@intel.com>
Wed, 17 Feb 2016 20:05:03 +0000 (12:05 -0800)
committerJason Ekstrand <jason.ekstrand@intel.com>
Thu, 18 Feb 2016 02:04:39 +0000 (18:04 -0800)
src/vulkan/gen7_pipeline.c

index e329c8f42ab9de0d5adeb762360058c55171b740..c4f7a369598145ca06fe8ad01d8bf7978a674c18 100644 (file)
@@ -113,15 +113,15 @@ gen7_emit_cb_state(struct anv_pipeline *pipeline,
 {
    struct anv_device *device = pipeline->device;
 
-   if (info->pAttachments == NULL) {
+   if (info == NULL || info->attachmentCount == 0) {
       pipeline->blend_state =
          anv_state_pool_emit(&device->dynamic_state_pool,
             GEN7_BLEND_STATE, 64,
             .ColorBufferBlendEnable = false,
-            .WriteDisableAlpha = false,
-            .WriteDisableRed = false,
-            .WriteDisableGreen = false,
-            .WriteDisableBlue = false);
+            .WriteDisableAlpha = true,
+            .WriteDisableRed = true,
+            .WriteDisableGreen = true,
+            .WriteDisableBlue = true);
    } else {
       /* FIXME-GEN7: All render targets share blend state settings on gen7, we
        * can't implement this.