diff options
author | Lionel Landwerlin <[email protected]> | 2017-06-19 16:57:00 +0100 |
---|---|---|
committer | Lionel Landwerlin <[email protected]> | 2017-10-06 16:34:04 +0100 |
commit | b24b93d58431a4349eecddb07304f6eda648e997 (patch) | |
tree | 15aa659e15ccb60e55704f7c31bf1c9145a14a15 /src/intel/vulkan/anv_image.c | |
parent | a62a97933578a813beb0d27cc8e404850f7fd302 (diff) |
anv: enable VK_KHR_sampler_ycbcr_conversion
v2: Make GetImageMemoryRequirements2KHR() iterate over all pInfo
structs (Lionel)
Handle VkSamplerYcbcrConversionImageFormatPropertiesKHR (Andrew/Jason)
Iterator over BindImageMemory2KHR's pNext structs correctly (Jason)
v3: Revert GetImageMemoryRequirements2KHR() change from v2 (Jason)
Signed-off-by: Lionel Landwerlin <[email protected]>
Reviewed-by: Jason Ekstrand <[email protected]>
Diffstat (limited to 'src/intel/vulkan/anv_image.c')
-rw-r--r-- | src/intel/vulkan/anv_image.c | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 78daf4dc55f..487ff275940 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -516,6 +516,7 @@ anv_image_create(VkDevice _device, image->samples = pCreateInfo->samples; image->usage = pCreateInfo->usage; image->tiling = pCreateInfo->tiling; + image->disjoint = pCreateInfo->flags & VK_IMAGE_CREATE_DISJOINT_BIT_KHR; const struct anv_format *format = anv_get_format(image->vk_format); assert(format != NULL); @@ -613,9 +614,25 @@ VkResult anv_BindImageMemory2KHR( const VkBindImageMemoryInfoKHR *bind_info = &pBindInfos[i]; ANV_FROM_HANDLE(anv_device_memory, mem, bind_info->memory); ANV_FROM_HANDLE(anv_image, image, bind_info->image); - uint32_t aspect_bit; + VkImageAspectFlags aspects = image->aspects; + + vk_foreach_struct_const(s, bind_info->pNext) { + switch (s->sType) { + case VK_STRUCTURE_TYPE_BIND_IMAGE_PLANE_MEMORY_INFO_KHR: { + const VkBindImagePlaneMemoryInfoKHR *plane_info = + (const VkBindImagePlaneMemoryInfoKHR *) s; - anv_foreach_image_aspect_bit(aspect_bit, image, image->aspects) { + aspects = plane_info->planeAspect; + break; + } + default: + anv_debug_ignored_stype(s->sType); + break; + } + } + + uint32_t aspect_bit; + anv_foreach_image_aspect_bit(aspect_bit, image, aspects) { uint32_t plane = anv_image_aspect_to_plane(image->aspects, 1UL << aspect_bit); anv_image_bind_memory_plane(device, image, plane, |