<p dir="ltr">My patch to fix partial draws makes us use full_surface_op for HiZ resolves as well so this patch (and maybe the next one?) are probably moot.</p>
<div class="gmail_extra"><br><div class="gmail_quote">On Oct 10, 2016 3:33 PM, "Nanley Chery" <<a href="mailto:nanleychery@gmail.com">nanleychery@gmail.com</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Delay the assignment of some variables until we know they will be used.<br>
<br>
Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
 src/intel/vulkan/gen8_cmd_<wbr>buffer.c | 32 +++++++++++++++++-------------<wbr>--<br>
 1 file changed, 17 insertions(+), 15 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/gen8_cmd_<wbr>buffer.c b/src/intel/vulkan/gen8_cmd_<wbr>buffer.c<br>
index 02c2d7c..e88ab02 100644<br>
--- a/src/intel/vulkan/gen8_cmd_<wbr>buffer.c<br>
+++ b/src/intel/vulkan/gen8_cmd_<wbr>buffer.c<br>
@@ -410,7 +410,6 @@ void<br>
 genX(cmd_buffer_emit_hz_op)(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
                           enum blorp_hiz_op op)<br>
 {<br>
-   struct anv_cmd_state *cmd_state = &cmd_buffer->state;<br>
    const struct anv_image_view *iview =<br>
       anv_cmd_buffer_get_depth_<wbr>stencil_view(cmd_buffer);<br>
<br>
@@ -421,21 +420,9 @@ genX(cmd_buffer_emit_hz_op)(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
    if (cmd_buffer->state.pass-><wbr>subpass_count > 1)<br>
       return;<br>
<br>
+   struct anv_cmd_state *cmd_state = &cmd_buffer->state;<br>
    const uint32_t ds = cmd_state->subpass->depth_<wbr>stencil_attachment;<br>
-<br>
-   /* Section 7.4. of the Vulkan 1.0.27 spec states:<br>
-    *<br>
-    *   "The render area must be contained within the framebuffer dimensions."<br>
-    *<br>
-    * Therefore, the only way the extent of the render area can match that of<br>
-    * the image view is if the render area offset equals (0, 0).<br>
-    */<br>
-   const bool full_surface_op =<br>
-             cmd_state->render_area.extent.<wbr>width == iview->extent.width &&<br>
-             cmd_state->render_area.extent.<wbr>height == iview->extent.height;<br>
-   if (full_surface_op)<br>
-      assert(cmd_state->render_area.<wbr>offset.x == 0 &&<br>
-             cmd_state->render_area.offset.<wbr>y == 0);<br>
+   bool full_surface_op;<br>
<br>
    /* This variable corresponds to the Pixel Dim column in the table below */<br>
    struct isl_extent2d px_dim;<br>
@@ -447,6 +434,21 @@ genX(cmd_buffer_emit_hz_op)(<wbr>struct anv_cmd_buffer *cmd_buffer,<br>
           VK_ATTACHMENT_LOAD_OP_CLEAR)<br>
          return;<br>
<br>
+      /* Section 7.4. of the Vulkan 1.0.27 spec states:<br>
+       *<br>
+       *   "The render area must be contained within the framebuffer dimensions."<br>
+       *<br>
+       * Therefore, the only way the extent of the render area can match that of<br>
+       * the image view is if the render area offset equals (0, 0).<br>
+       */<br>
+      full_surface_op =<br>
+             cmd_state->render_area.extent.<wbr>width == iview->extent.width &&<br>
+             cmd_state->render_area.extent.<wbr>height == iview->extent.height;<br>
+      if (full_surface_op)<br>
+         assert(cmd_state->render_area.<wbr>offset.x == 0 &&<br>
+                cmd_state->render_area.offset.<wbr>y == 0);<br>
+<br>
+<br>
       /* Apply alignment restrictions. Despite the BDW PRM mentioning this is<br>
        * only needed for a depth buffer surface type of D16_UNORM, testing<br>
        * showed it to be necessary for other depth formats as well<br>
--<br>
2.10.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</blockquote></div></div>