<div dir="ltr">This patch is also needed for MSAA compression.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Feb 21, 2017 at 7:31 PM, Jason Ekstrand <span dir="ltr"><<a href="mailto:jason@jlekstrand.net" target="_blank">jason@jlekstrand.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Not all clear colors are valid.  In particular, on Broadwell and<br>
earlier, only 0/1 colors are allowed in surface state.  No CTS tests are<br>
affected outright by this because, apparently, the CTS coverage for<br>
different clear colors is pretty terrible.  However, when multisample<br>
compression is enabled, we do hit it with CTS tests and this commit<br>
prevents regressions when enabling MCS on Broadwell and earlier.<br>
<br>
Cc: "13.0 17.0" <<a href="mailto:mesa-stable@lists.freedesktop.org">mesa-stable@lists.<wbr>freedesktop.org</a>><br>
---<br>
 src/intel/vulkan/anv_blorp.c | 5 +++--<br>
 1 file changed, 3 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_blorp.c b/src/intel/vulkan/anv_blorp.c<br>
index 4e7078b..8db03e4 100644<br>
--- a/src/intel/vulkan/anv_blorp.c<br>
+++ b/src/intel/vulkan/anv_blorp.c<br>
@@ -1198,9 +1198,10 @@ anv_cmd_buffer_clear_subpass(<wbr>struct anv_cmd_buffer *cmd_buffer)<br>
       struct blorp_surf surf;<br>
       get_blorp_surf_for_anv_image(<wbr>image, VK_IMAGE_ASPECT_COLOR_BIT,<br>
                                    att_state->aux_usage, &surf);<br>
-      surf.clear_color = vk_to_isl_color(att_state-><wbr>clear_value.color);<br>
<br>
       if (att_state->fast_clear) {<br>
+         surf.clear_color = vk_to_isl_color(att_state-><wbr>clear_value.color);<br>
+<br>
          blorp_fast_clear(&batch, &surf, iview->isl.format,<br>
                           iview->isl.base_level,<br>
                           iview->isl.base_array_layer, fb->layers,<br>
@@ -1224,7 +1225,7 @@ anv_cmd_buffer_clear_subpass(<wbr>struct anv_cmd_buffer *cmd_buffer)<br>
                      render_area.offset.x, render_area.offset.y,<br>
                      render_area.offset.x + render_area.extent.width,<br>
                      render_area.offset.y + render_area.extent.height,<br>
-                     surf.clear_color, NULL);<br>
+                     vk_to_isl_color(att_state-><wbr>clear_value.color), NULL);<br>
       }<br>
<br>
       att_state->pending_clear_<wbr>aspects = 0;<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.5.0.400.gff86faf<br>
<br>
</font></span></blockquote></div><br></div>