From: Chad Versace Date: Mon, 17 Jul 2017 22:18:51 +0000 (-0700) Subject: anv/image: Fix VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT X-Git-Tag: upstream/18.1.0~7656 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5d6905211355464de4885492511e5f9d936cc058;p=platform%2Fupstream%2Fmesa.git anv/image: Fix VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT We incorrectly detected VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT. We looked for the bit in VkImageCreateInfo::usage, but it's actually in VkImageCreateInfo::flags. Found by assertion failures while enabling VK_ANDROID_native_buffer. Cc: mesa-stable@lists.freedesktop.org Reviewed-by: Lionel Landwerlin --- diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 149e1f2..4f0057c 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -37,7 +37,8 @@ * Exactly one bit must be set in \a aspect. */ static isl_surf_usage_flags_t -choose_isl_surf_usage(VkImageUsageFlags vk_usage, +choose_isl_surf_usage(VkImageCreateFlags vk_create_flags, + VkImageUsageFlags vk_usage, VkImageAspectFlags aspect) { isl_surf_usage_flags_t isl_usage = 0; @@ -51,7 +52,7 @@ choose_isl_surf_usage(VkImageUsageFlags vk_usage, if (vk_usage & VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT) isl_usage |= ISL_SURF_USAGE_RENDER_TARGET_BIT; - if (vk_usage & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) + if (vk_create_flags & VK_IMAGE_CREATE_CUBE_COMPATIBLE_BIT) isl_usage |= ISL_SURF_USAGE_CUBE_BIT; /* Even if we're only using it for transfer operations, clears to depth and @@ -168,7 +169,7 @@ make_surface(const struct anv_device *dev, .samples = vk_info->samples, .min_alignment = 0, .row_pitch = anv_info->stride, - .usage = choose_isl_surf_usage(image->usage, aspect), + .usage = choose_isl_surf_usage(vk_info->flags, image->usage, aspect), .tiling_flags = tiling_flags); /* isl_surf_init() will fail only if provided invalid input. Invalid input