summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChad Versace <[email protected]>2017-07-17 15:18:51 -0700
committerChad Versace <[email protected]>2017-07-19 11:25:50 -0700
commit5d6905211355464de4885492511e5f9d936cc058 (patch)
treebbfc2e92984d54dceb75ea112b70ae757fe05035
parent80a0c9745cad25ca35ae6ea5b29363836cc21a66 (diff)
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: [email protected] Reviewed-by: Lionel Landwerlin <[email protected]>
-rw-r--r--src/intel/vulkan/anv_image.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c
index 149e1f20334..4f0057c9527 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