diff options
| author | Dave Houlton <daveh@lunarg.com> | 2018-01-19 12:17:05 -0700 |
|---|---|---|
| committer | Dave Houlton <daveh@lunarg.com> | 2018-01-19 16:14:12 -0700 |
| commit | 29c01176bf7e37c55fbf9fa232baebafc5ab9530 (patch) | |
| tree | 5c4e7d771be7383d831af733ce58c0ba1a3fee9f /layers/vk_format_utils.cpp | |
| parent | 1f3398da497171e6e9ef56abc83245b848e00304 (diff) | |
| download | usermoji-29c01176bf7e37c55fbf9fa232baebafc5ab9530.tar.xz | |
layers: Add GetImgSubrscLayout multi-planar VUIDs
Adds new VUIDs defined in the VK_KHR_sampler_ycbcr_conversion
extension to vkGetImageSubresourceLayouts(), and corrects the
false positive error reported in GH issue #2350.
Change-Id: Ia2814291291c7109fabd33af6119a9209e08dd51
Diffstat (limited to 'layers/vk_format_utils.cpp')
| -rw-r--r-- | layers/vk_format_utils.cpp | 34 |
1 files changed, 33 insertions, 1 deletions
diff --git a/layers/vk_format_utils.cpp b/layers/vk_format_utils.cpp index f8bfdcf2..93481e85 100644 --- a/layers/vk_format_utils.cpp +++ b/layers/vk_format_utils.cpp @@ -866,6 +866,38 @@ VK_LAYER_EXPORT VkExtent3D FormatCompressedTexelBlockExtent(VkFormat format) { return block_size; } +VK_LAYER_EXPORT uint32_t FormatPlaneCount(VkFormat format) { + switch (format) { + case VK_FORMAT_G8_B8_R8_3PLANE_420_UNORM_KHR: + case VK_FORMAT_G8_B8_R8_3PLANE_422_UNORM_KHR: + case VK_FORMAT_G8_B8_R8_3PLANE_444_UNORM_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6_R10X6_3PLANE_444_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4_R12X4_3PLANE_444_UNORM_3PACK16_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_420_UNORM_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_422_UNORM_KHR: + case VK_FORMAT_G16_B16_R16_3PLANE_444_UNORM_KHR: + return 3u; + break; + case VK_FORMAT_G8_B8R8_2PLANE_420_UNORM_KHR: + case VK_FORMAT_G8_B8R8_2PLANE_422_UNORM_KHR: + case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G10X6_B10X6R10X6_2PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_420_UNORM_3PACK16_KHR: + case VK_FORMAT_G12X4_B12X4R12X4_2PLANE_422_UNORM_3PACK16_KHR: + case VK_FORMAT_G16_B16R16_2PLANE_420_UNORM_KHR: + case VK_FORMAT_G16_B16R16_2PLANE_422_UNORM_KHR: + return 2u; + break; + default: + return 1u; + break; + } +} + // Return format class of the specified format VK_LAYER_EXPORT VkFormatCompatibilityClass FormatCompatibilityClass(VkFormat format) { auto item = vk_format_table.find(format); @@ -885,7 +917,7 @@ VK_LAYER_EXPORT size_t FormatSize(VkFormat format) { } // Return the number of channels for a given format -unsigned int FormatChannelCount(VkFormat format) { +uint32_t FormatChannelCount(VkFormat format) { auto item = vk_format_table.find(format); if (item != vk_format_table.end()) { return item->second.channel_count; |
