mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-26 08:08:09 +02:00
This format was already supported on Bifrost as a single plane format. Valhall doesn't support this interleaved D32_S8, so we add support for multiplanar D32_S8 and move Bifrost to this layout too, as it's more memory efficient than the interleaved layout. Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/32275>
45 lines
927 B
C
45 lines
927 B
C
/*
|
|
* Copyright © 2021 Collabora Ltd.
|
|
* SPDX-License-Identifier: MIT
|
|
*/
|
|
|
|
#ifndef PANVK_IMAGE_H
|
|
#define PANVK_IMAGE_H
|
|
|
|
#include "vk_image.h"
|
|
|
|
#include "pan_texture.h"
|
|
|
|
#define PANVK_MAX_PLANES 3
|
|
|
|
struct panvk_image {
|
|
struct vk_image vk;
|
|
|
|
/* TODO: See if we can rework the synchronization logic so we don't need to
|
|
* pass BOs around.
|
|
*/
|
|
struct pan_kmod_bo *bo;
|
|
|
|
uint8_t plane_count;
|
|
struct pan_image planes[PANVK_MAX_PLANES];
|
|
};
|
|
|
|
VK_DEFINE_NONDISP_HANDLE_CASTS(panvk_image, vk.base, VkImage,
|
|
VK_OBJECT_TYPE_IMAGE)
|
|
|
|
static inline unsigned
|
|
panvk_plane_index(VkFormat format, VkImageAspectFlags aspect_mask)
|
|
{
|
|
switch (aspect_mask) {
|
|
default:
|
|
return 0;
|
|
case VK_IMAGE_ASPECT_PLANE_1_BIT:
|
|
return 1;
|
|
case VK_IMAGE_ASPECT_PLANE_2_BIT:
|
|
return 2;
|
|
case VK_IMAGE_ASPECT_STENCIL_BIT:
|
|
return format == VK_FORMAT_D32_SFLOAT_S8_UINT;
|
|
}
|
|
}
|
|
|
|
#endif
|