<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Wed, Jan 11, 2017 at 5:55 PM, Nanley Chery <span dir="ltr"><<a href="mailto:nanleychery@gmail.com" target="_blank">nanleychery@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Signed-off-by: Nanley Chery <<a href="mailto:nanley.g.chery@intel.com">nanley.g.chery@intel.com</a>><br>
---<br>
src/intel/vulkan/anv_image.c | 17 +++++++++++++----<br>
src/intel/vulkan/genX_cmd_<wbr>buffer.c | 10 ++++------<br>
2 files changed, 17 insertions(+), 10 deletions(-)<br>
<br>
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
index d821629191..f8a21c2982 100644<br>
--- a/src/intel/vulkan/anv_image.c<br>
+++ b/src/intel/vulkan/anv_image.c<br>
@@ -182,6 +182,14 @@ make_surface(const struct anv_device *dev,<br>
*/<br>
if (!(image->usage & VK_IMAGE_USAGE_DEPTH_STENCIL_<wbr>ATTACHMENT_BIT)) {<br>
/* It will never be used as an attachment, HiZ is pointless. */<br>
+ } else if (image->usage & VK_IMAGE_USAGE_INPUT_<wbr>ATTACHMENT_BIT) {<br>
+ /* It will never have a layout of<br>
+ * VK_IMAGE_LAYOUT_DEPTH_STENCIL_<wbr>ATTACHMENT_OPTIMAL, so HiZ is<br>
+ * currently pointless. If transfer operations learn to use the HiZ<br>
+ * buffer, we can enable HiZ for VK_IMAGE_LAYOUT_GENERAL and support<br>
+ * input attachments.<br>
+ */<br></blockquote><div><br></div><div>>From the 1.0.37 spec:<br><br>"An attachment used as an input attachment and depth/stencil attachment <span class="gmail-normative">must</span>
be in either <code class="gmail-code">VK_IMAGE_LAYOUT_GENERAL</code> or
<code class="gmail-code">VK_IMAGE_LAYOUT_DEPTH_STENCIL_READ_ONLY_OPTIMAL</code>."<br><br></div><div>So it can happen. Since gen8 can texture from HiZ, this shouldn't be a problem. I think we'll need this for gen7 though.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
+ anv_finishme("Implement HiZ for input attachments");<br>
} else if (!env_var_as_boolean("INTEL_<wbr>VK_HIZ", dev->info.gen >= 8)) {<br>
anv_finishme("Implement gen7 HiZ");<br>
} else if (vk_info->mipLevels > 1) {<br>
@@ -529,14 +537,15 @@ anv_CreateImageView(VkDevice _device,<br>
if (surf_usage == ISL_AUX_USAGE_HIZ)<br>
surf_usage = ISL_AUX_USAGE_NONE;<br>
<br>
- /* Input attachment surfaces for color or depth are allocated and filled<br>
+ /* Input attachment surfaces for color are allocated and filled<br>
* out at BeginRenderPass time because they need compression information.<br>
- * Stencil image do not support compression so we just use the texture<br>
- * surface from the image view.<br>
+ * Compression is not yet enabled for depth textures and stencil doesn't<br>
+ * allow compression so we can just use the texture surface state from the<br>
+ * view.<br>
*/<br>
if (image->usage & VK_IMAGE_USAGE_SAMPLED_BIT ||<br>
(image->usage & VK_IMAGE_USAGE_INPUT_<wbr>ATTACHMENT_BIT &&<br>
- (iview->aspect_mask & VK_IMAGE_ASPECT_STENCIL_BIT))) {<br>
+ !(iview->aspect_mask & VK_IMAGE_ASPECT_COLOR_BIT))) {<br>
iview->sampler_surface_state = alloc_surface_state(device);<br>
<br>
struct isl_view view = iview->isl;<br>
diff --git a/src/intel/vulkan/genX_cmd_<wbr>buffer.c b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
index baa932e517..1793c4df26 100644<br>
--- a/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
+++ b/src/intel/vulkan/genX_cmd_<wbr>buffer.c<br>
@@ -303,11 +303,11 @@ need_input_attachment_state(<wbr>const struct anv_render_pass_attachment *att)<br>
if (!(att->usage & VK_IMAGE_USAGE_INPUT_<wbr>ATTACHMENT_BIT))<br>
return false;<br>
<br>
- /* We only allocate input attachment states for color and depth surfaces.<br>
- * Stencil doesn't allow compression so we can just use the texture surface<br>
- * state from the view<br>
+ /* We only allocate input attachment states for color surfaces. Compression<br>
+ * is not yet enabled for depth textures and stencil doesn't allow<br>
+ * compression so we can just use the texture surface state from the view.<br>
*/<br>
- return vk_format_is_color(att-><wbr>format) || vk_format_has_depth(att-><wbr>format);<br>
+ return vk_format_is_color(att-><wbr>format);<br>
}<br>
<br>
static enum isl_aux_usage<br>
@@ -518,8 +518,6 @@ genX(cmd_buffer_setup_<wbr>attachments)(struct anv_cmd_buffer *cmd_buffer,<br>
const struct isl_surf *surf;<br>
if (att_aspects == VK_IMAGE_ASPECT_COLOR_BIT) {<br>
surf = &iview->image->color_surface.<wbr>isl;<br>
- } else {<br>
- surf = &iview->image->depth_surface.<wbr>isl;<br>
}<br>
<br>
struct isl_view view = iview->isl;<br>
<span class="gmail-HOEnZb"><font color="#888888">--<br>
2.11.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>
</font></span></blockquote></div><br></div></div>