Skip to content

RFC: panvk: Fix 2DMSArray image support

Boris Brezillon requested to merge bbrezillon/mesa:panvk-2dms-array into main

What does this MR do and why?

While working on the vk_meta_copy transition I noticed 2DMSArray image support is broken, but fixing it is not simple because the AttributeBuffer descriptor, which we use to expose images, only allows you to define a surface stride, which we already use to address sample layers. Unfortunately, the array stride doesn't match the sample layer stride with the image layout currently encoded in pan_layout.c.

There are two options here:

  1. rework the layout to embed arrays inside MIP levels instead of the other way around, but I suspect there's a good reason to do it the other way around (see how MIP levels are embedded in array layers in this doc https://docs.vulkan.org/spec/latest/chapters/sparsemem.html#sparsememory-miptail).
  2. make the image sample_count times higher than the original image, and use the Y coordinate to address the right sample plane. The downside is that it effectively limits the maximum image height (4kpixels instead of 64kpixels for 16 samples for instance).

None of these options are ideal, so I went for the least invasive one: options 2. Not convinced this is the right option, but maybe someone has a better idea...

/cc @nanokatze @kusma @marysaka

Merge request reports