Assert() hit in anv_image_get_memory_requirements while importing a biplane drm buffer with modifier
assert(aspects & image->vk.aspects);
in anv_image_get_memory_requirements
is hit while importing a biplane drm buffer with modifier. Base on spec [1], VK_IMAGE_ASPECT_MEMORY_PLANE_x_BIT_EXT
should be used for vkGetImageMemoryRequirements2()
. However anv_image_get_memory_requirements
checks aspets
against image->vk.aspects
which contains VK_IMAGE_ASPECT_PLANE_x_BIT
instead of VK_IMAGE_ASPECT_MEMORY_PLANE_x_BIT_EXT
, so the assert() hit. And the next line calls image_aspect_to_binding()
which handles VK_IMAGE_ASPECT_MEMORY_PLANE_x_BIT_EXT
.
const struct anv_image_binding *binding;
if (image->disjoint) {
assert(util_bitcount(aspects) == 1);
assert(aspects & image->vk.aspects);
binding = image_aspect_to_binding(image, aspects);
} else {
assert(aspects == image->vk.aspects);
binding = &image->bindings[ANV_IMAGE_MEMORY_BINDING_MAIN];
}