summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTapani Pälli <tapani.palli@intel.com>2021-07-28 10:52:46 +0300
committerTapani Pälli <tapani.palli@intel.com>2021-08-09 05:38:50 +0300
commite08370dc37ecd6bb81edf897bf52a6abc938e9cc (patch)
tree20e7c55c29e4cac8b3c48258270c64984fe2a027
parentd75502be33669ab296937f1cbadbf77fef4e27f7 (diff)
anv: disable aux for exportable images without modifiers
This makes import easier on different gfx generations and we don't have to lock down on a certain aux layout just yet. Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Nanley Chery <nanley.g.chery@intel.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10609>
-rw-r--r--src/intel/vulkan/anv_image.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index a93542ba244..bd5305b8758 100644
--- a/src/intel/vulkan/anv_image.c
+++ b/src/intel/vulkan/anv_image.c
@@ -1020,11 +1020,17 @@ add_all_surfaces_implicit_layout(
const VkImageFormatListCreateInfo *format_list_info,
uint32_t stride,
isl_tiling_flags_t isl_tiling_flags,
- isl_surf_usage_flags_t isl_extra_usage_flags)
+ const struct anv_image_create_info *create_info)
{
const struct intel_device_info *devinfo = &device->info;
+ isl_surf_usage_flags_t isl_extra_usage_flags =
+ create_info->isl_extra_usage_flags;
VkResult result;
+ const VkExternalMemoryImageCreateInfo *ext_mem_info =
+ vk_find_struct_const(create_info->vk_info->pNext,
+ EXTERNAL_MEMORY_IMAGE_CREATE_INFO);
+
u_foreach_bit(b, image->aspects) {
VkImageAspectFlagBits aspect = 1 << b;
uint32_t plane = anv_image_aspect_to_plane(image->aspects, aspect);
@@ -1061,6 +1067,11 @@ add_all_surfaces_implicit_layout(
return result;
}
+ /* Disable aux if image supports export without modifiers. */
+ if (ext_mem_info && ext_mem_info->handleTypes != 0 &&
+ image->tiling != VK_IMAGE_TILING_DRM_FORMAT_MODIFIER_EXT)
+ continue;
+
result = add_aux_surface_if_supported(device, image, plane, plane_format,
format_list_info,
ANV_OFFSET_IMPLICIT, stride,
@@ -1371,7 +1382,7 @@ anv_image_create(VkDevice _device,
} else {
r = add_all_surfaces_implicit_layout(device, image, fmt_list, 0,
isl_tiling_flags,
- create_info->isl_extra_usage_flags);
+ create_info);
}
if (r != VK_SUCCESS)