<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Fri, Oct 7, 2016 at 4:45 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:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">On Sun, Sep 25, 2016 at 09:59:02AM -0700, Jason Ekstrand wrote:<br>
> Signed-off-by: Jason Ekstrand <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>><br>
> ---<br>
> src/intel/vulkan/anv_image.c | 16 ++++++++++++----<br>
> 1 file changed, 12 insertions(+), 4 deletions(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c<br>
> index f6e8672..f55c9b6 100644<br>
> --- a/src/intel/vulkan/anv_image.c<br>
> +++ b/src/intel/vulkan/anv_image.c<br>
> @@ -432,6 +432,18 @@ anv_image_view_init(struct anv_image_view *iview,<br>
> .depth = anv_minify(image->extent.depth , range->baseMipLevel),<br>
> };<br>
><br>
> + if (image->type == VK_IMAGE_TYPE_3D &&<br>
> + usage_mask != VK_IMAGE_USAGE_COLOR_<wbr>ATTACHMENT_BIT) {<br>
> + /* Meta renders to 3D texture slices. When it does so, it passes<br>
> + * usage_mask == VK_IMAGE_USAGE_COLOR_<wbr>ATTACHMENT_BIT. Since meta is the<br>
> + * only thing that uses a non-zero usage_mask, this lets us easily<br>
> + * detect the one case where we actually want an array range used for<br>
> + * 3-D textures.<br>
> + */<br>
> + isl_view.base_array_layer = 0;<br>
> + isl_view.array_len = iview->extent.depth;<br>
> + }<br>
> +<br>
<br>
</span>Any idea why we modify the array_len here instead of just looking up the<br>
depth and miplevel in isl_surf_fill_state()?<br></blockquote><div><br></div><div>Because rendering to a subrange of a 3D texture is a thing (and required by GL). In Vulkan, things are a bit simpler.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
-Nanley<br>
<span class=""><br>
> isl_surf_usage_flags_t cube_usage;<br>
> if (pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE ||<br>
> pCreateInfo->viewType == VK_IMAGE_VIEW_TYPE_CUBE_ARRAY) {<br>
> @@ -492,10 +504,6 @@ anv_image_view_init(struct anv_image_view *iview,<br>
> isl_view.usage = cube_usage | ISL_SURF_USAGE_STORAGE_BIT;<br>
> isl_view.format = isl_lower_storage_image_<wbr>format(&device->info,<br>
> isl_view.format);<br>
> - if (image->type == VK_IMAGE_TYPE_3D) {<br>
> - isl_view.base_array_layer = 0;<br>
> - isl_view.array_len = iview->extent.depth;<br>
> - }<br>
> isl_surf_fill_state(&device-><wbr>isl_dev,<br>
> iview->storage_surface_state.<wbr>map,<br>
> .surf = &surface->isl,<br>
> --<br>
> 2.5.0.400.gff86faf<br>
><br>
</span>> ______________________________<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><br></div></div>