anv: deal with isl format swizzles for buffer views

For some formats like VK_FORMAT_B5G6R5_UNORM_PACK16, we have no direct
matching HW format. We can support it by swizzling.

We already apply those swizzles for image views. We just forgot to
deal with buffer views.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6235
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17385>
This commit is contained in:
Lionel Landwerlin
2022-07-06 17:48:27 +03:00
committed by Marge Bot
parent a841300384
commit 57a8efa222
6 changed files with 37 additions and 24 deletions

View File

@@ -1965,7 +1965,6 @@ anv_descriptor_set_is_push(struct anv_descriptor_set *set)
struct anv_buffer_view {
struct vk_object_base base;
enum isl_format format; /**< VkBufferViewCreateInfo::format */
uint64_t range; /**< VkBufferViewCreateInfo::range */
struct anv_address address;
@@ -4258,6 +4257,7 @@ anv_get_image_format_features2(const struct intel_device_info *devinfo,
void anv_fill_buffer_surface_state(struct anv_device *device,
struct anv_state state,
enum isl_format format,
struct isl_swizzle swizzle,
isl_surf_usage_flags_t usage,
struct anv_address address,
uint32_t range, uint32_t stride);