[Mesa-dev] [PATCH] anv: image: report correct depthPicth for 3d images

Lionel Landwerlin llandwerlin at gmail.com
Sat Dec 3 16:48:30 UTC 2016


On 3 Dec 2016 4:40 pm, "Jason Ekstrand" <jason at jlekstrand.net> wrote:



On Dec 3, 2016 8:27 AM, "Lionel Landwerlin" <llandwerlin at gmail.com> wrote:

That's on Haswell.
I'm not sure whether a 3d image with multiple layers makes sense, but
if it does, it should probably return different depth/layer pitch
values?


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.


ISL reports the number of rows for the entire LOD which is height * depth
for 3D images.

Thanks for reminding me that the query can be per LOD. I'll try to come up
with something sensible just for LOD0.


On Sat, 2016-12-03 at 08:22 -0800, Jason Ekstrand wrote:
> What hardware are you running on?  Prior to sky lake, depth pitch
> makes so sense for us.  On sky lake and above it should be exactly
> the same as array pitch.  One thing we should do is not report array
> pitch for 3D and maybe report a depth pitch of zero on broadwell and
> earlier.
>
> On Dec 3, 2016 7:51 AM, "Lionel Landwerlin" <llandwerlin at gmail.com>
> wrote:
> With a 3d image of 2x2x3, vkGetImageSubresourceLayout currently
> reports :
>
> VkSubresourceLayout = { offset = 0,
>                         size = 160,
>                         rowPitch = 16,
>                         arrayPitch = 96,
>                         depthPitch = 96 }
>
> depthPitch should be 32.
>
> Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>
> ---
>  src/intel/vulkan/anv_image.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/intel/vulkan/anv_image.c
> b/src/intel/vulkan/anv_image.c
> index e60373a..9ef0760 100644
> --- a/src/intel/vulkan/anv_image.c
> +++ b/src/intel/vulkan/anv_image.c
> @@ -376,7 +376,8 @@ anv_surface_get_subresource_layout(struct
> anv_image *image,
>
>     layout->offset = surface->offset;
>     layout->rowPitch = surface->isl.row_pitch;
> -   layout->depthPitch = isl_surf_get_array_pitch(&surface->isl);
> +   layout->depthPitch =
> +      isl_surf_get_array_pitch(&surface->isl) / image->extent.depth;
>     layout->arrayPitch = isl_surf_get_array_pitch(&surface->isl);
>     layout->size = surface->isl.size;
>  }
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20161203/2fb36c9b/attachment-0001.html>


More information about the mesa-dev mailing list