mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-07 20:08:06 +02:00
panvk: Use vk_image_can_be_aliased_to_yuv_plane() helper
Signed-off-by: Rebecca Mckeever <rebecca.mckeever@collabora.com> Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33460>
This commit is contained in:
parent
f419a0bc4e
commit
55f4da7bbf
1 changed files with 1 additions and 27 deletions
|
|
@ -45,32 +45,6 @@
|
|||
#include "vk_object.h"
|
||||
#include "vk_util.h"
|
||||
|
||||
static bool
|
||||
can_be_aliased_to_yuv_plane(const struct panvk_image *image)
|
||||
{
|
||||
if (!(image->vk.create_flags & VK_IMAGE_CREATE_ALIAS_BIT))
|
||||
return false;
|
||||
|
||||
VkFormat format = image->vk.format;
|
||||
|
||||
if (vk_format_is_depth_or_stencil(format) ||
|
||||
vk_format_is_alpha(format) ||
|
||||
vk_format_get_blockwidth(format) != 1 ||
|
||||
vk_format_get_blockheight(format) != 1)
|
||||
return false;
|
||||
|
||||
unsigned block_size = vk_format_get_blocksize(format);
|
||||
|
||||
switch (block_size) {
|
||||
case 1:
|
||||
case 2:
|
||||
case 4:
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool
|
||||
panvk_image_can_use_mod(struct panvk_image *image, uint64_t mod)
|
||||
{
|
||||
|
|
@ -134,7 +108,7 @@ panvk_image_can_use_mod(struct panvk_image *image, uint64_t mod)
|
|||
* don't allow U-interleaving for those either.
|
||||
*/
|
||||
if (vk_format_get_plane_count(image->vk.format) > 1 ||
|
||||
can_be_aliased_to_yuv_plane(image))
|
||||
vk_image_can_be_aliased_to_yuv_plane(&image->vk))
|
||||
return false;
|
||||
|
||||
/* If we're dealing with a compressed format that requires non-compressed
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue