<div dir="auto"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On 3 Dec 2016 4:40 pm, "Jason Ekstrand" <<a href="mailto:jason@jlekstrand.net">jason@jlekstrand.net</a>> wrote:<br type="attribution"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div class="quoted-text"><div><br><div class="gmail_extra"><br><div class="gmail_quote">On Dec 3, 2016 8:27 AM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com" target="_blank">llandwerlin@gmail.com</a>> wrote:<br type="attribution"><blockquote class="m_-213009503956375208quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">That's on Haswell.<br>
I'm not sure whether a 3d image with multiple layers makes sense, but<br>
if it does, it should probably return different depth/layer pitch<br>
values?</blockquote></div></div></div><div dir="auto"><br></div></div><div dir="auto">It does not.  You can't have 3D arrays.  Haswell should probably return 0 for both array pitch and depth pitch for 3D.  We could return a sensible depth pitch for LOD0 but not for any later LOD.  Also, in not sure what isl reports for array pitch for GEN4_3D surfaces.  It's not normally a useful thing so I don't think we spent any effort trying to make it make sense.  In any case, I don't think dividing by depth is the right thing to do.</div></div></blockquote></div></div></div><div dir="auto"><br></div><div dir="auto">ISL reports the number of rows for the entire LOD which is height * depth for 3D images.</div><div dir="auto"><br></div><div dir="auto">Thanks for reminding me that the query can be per LOD. I'll try to come up with something sensible just for LOD0.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="auto"><div class="elided-text"><div dir="auto"><br></div><div dir="auto"><div class="gmail_extra"><div class="gmail_quote"><blockquote class="m_-213009503956375208quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="m_-213009503956375208elided-text">
On Sat, 2016-12-03 at 08:22 -0800, Jason Ekstrand wrote:<br>
> What hardware are you running on?  Prior to sky lake, depth pitch<br>
> makes so sense for us.  On sky lake and above it should be exactly<br>
> the same as array pitch.  One thing we should do is not report array<br>
> pitch for 3D and maybe report a depth pitch of zero on broadwell and<br>
> earlier.<br>
><br>
> On Dec 3, 2016 7:51 AM, "Lionel Landwerlin" <<a href="mailto:llandwerlin@gmail.com" target="_blank">llandwerlin@gmail.com</a>><br>
> wrote:<br>
> With a 3d image of 2x2x3, vkGetImageSubresourceLayout currently<br>
> reports :<br>
><br>
> VkSubresourceLayout = { offset = 0,<br>
>                         size = 160,<br>
>                         rowPitch = 16,<br>
>                         arrayPitch = 96,<br>
>                         depthPitch = 96 }<br>
><br>
> depthPitch should be 32.<br>
><br>
> Signed-off-by: Lionel Landwerlin <<a href="mailto:lionel.g.landwerlin@intel.com" target="_blank">lionel.g.landwerlin@intel.com</a><wbr>><br>
> ---<br>
>  src/intel/vulkan/anv_image.c | 3 ++-<br>
>  1 file changed, 2 insertions(+), 1 deletion(-)<br>
><br>
> diff --git a/src/intel/vulkan/anv_image.c<br>
> b/src/intel/vulkan/anv_image.c<br>
> index e60373a..9ef0760 100644<br>
> --- a/src/intel/vulkan/anv_image.c<br>
> +++ b/src/intel/vulkan/anv_image.c<br>
> @@ -376,7 +376,8 @@ anv_surface_get_subresource_la<wbr>yout(struct<br>
> anv_image *image,<br>
><br>
>     layout->offset = surface->offset;<br>
>     layout->rowPitch = surface->isl.row_pitch;<br>
> -   layout->depthPitch = isl_surf_get_array_pitch(&surf<wbr>ace->isl);<br>
> +   layout->depthPitch =<br>
> +      isl_surf_get_array_pitch(&surf<wbr>ace->isl) / image->extent.depth;<br>
>     layout->arrayPitch = isl_surf_get_array_pitch(&surf<wbr>ace->isl);<br>
>     layout->size = surface->isl.size;<br>
>  }<br>
> --<br>
> 2.10.2<br>
><br>
> ______________________________<wbr>_________________<br>
> mesa-dev mailing list<br>
> <a href="mailto:mesa-dev@lists.freedesktop.org" target="_blank">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>
><br>
</div></blockquote></div><br></div></div></div></div>
</blockquote></div><br></div></div></div>