anv/meta: Initialize blend state for the right attachment
authorKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Thu, 18 Feb 2016 18:21:08 +0000 (10:21 -0800)
committerKristian Høgsberg Kristensen <kristian.h.kristensen@intel.com>
Thu, 18 Feb 2016 18:22:50 +0000 (10:22 -0800)
We were always initializing only RT 0. We need to initialize the RT
we're creating the clear pipeline for.

src/vulkan/anv_meta_clear.c

index 15e24a32a75ad57d57c0135e66e8857c4c194689..739ae09582c41ea13a4fb8c1eaf19db11c0e6972 100644 (file)
@@ -280,19 +280,20 @@ create_color_pipeline(struct anv_device *device,
       .stencilTestEnable = false,
    };
 
+   VkPipelineColorBlendAttachmentState blend_attachment_state[MAX_RTS] = { 0 };
+   blend_attachment_state[frag_output] = (VkPipelineColorBlendAttachmentState) {
+      .blendEnable = false,
+      .colorWriteMask = VK_COLOR_COMPONENT_A_BIT |
+                        VK_COLOR_COMPONENT_R_BIT |
+                        VK_COLOR_COMPONENT_G_BIT |
+                        VK_COLOR_COMPONENT_B_BIT,
+   };
+
    const VkPipelineColorBlendStateCreateInfo cb_state = {
       .sType = VK_STRUCTURE_TYPE_PIPELINE_COLOR_BLEND_STATE_CREATE_INFO,
       .logicOpEnable = false,
-      .attachmentCount = 1,
-      .pAttachments = (VkPipelineColorBlendAttachmentState []) {
-         {
-            .blendEnable = false,
-            .colorWriteMask = VK_COLOR_COMPONENT_A_BIT |
-                              VK_COLOR_COMPONENT_R_BIT |
-                              VK_COLOR_COMPONENT_G_BIT |
-                              VK_COLOR_COMPONENT_B_BIT,
-         },
-      },
+      .attachmentCount = MAX_RTS,
+      .pAttachments = blend_attachment_state
    };
 
    /* Disable repclear because we do not want the compiler to replace the