summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <ian.d.romanick@intel.com>2021-04-06 14:39:31 -0700
committerIan Romanick <ian.d.romanick@intel.com>2021-04-06 14:39:33 -0700
commit430b2a694a28e7372c9bfceb01079e6d5c18c5e5 (patch)
tree400dda5483b76bccc0ae8722a7d884293423f4c7
parent4e4739afe625100f0e98fe694c9de43605127f50 (diff)
anv: Packed, subsampled formats are not disjointyuv-formats
The driver treats them as having multiple planes, but from the API perspective, they are not disjoint.
-rw-r--r--src/intel/vulkan/anv_formats.c4
-rw-r--r--src/intel/vulkan/anv_image.c1
2 files changed, 4 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_formats.c b/src/intel/vulkan/anv_formats.c
index 0f6a85a26ef..1ed87b84106 100644
--- a/src/intel/vulkan/anv_formats.c
+++ b/src/intel/vulkan/anv_formats.c
@@ -756,8 +756,10 @@ anv_get_image_format_features(const struct gen_device_info *devinfo,
}
}
- if (anv_format->n_planes > 1)
+ if (anv_format->n_planes > 1 &&
+ !anv_is_y_plane_and_uv_plane_same_memory(anv_format->vk_format)) {
flags |= VK_FORMAT_FEATURE_DISJOINT_BIT;
+ }
/* Almost all YCbCr formats either have multiple planes, are subsampled,
* or have weird bit-pattern usages (e.g., Y412). There are a couple
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 07ddda53e3b..642d33aff15 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -979,6 +979,7 @@ anv_image_create(VkDevice _device,
* with the VK_IMAGE_CREATE_DISJOINT_BIT bit set.
*/
image->disjoint = image->format->n_planes > 1 &&
+ !anv_is_y_plane_and_uv_plane_same_memory(image->vk_format) &&
(pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT);
const isl_tiling_flags_t isl_tiling_flags =