Vulkan AHB - fix incorrect structure definition
authorTony Zlatinski <tzlatinski@nvidia.com>
Thu, 16 Aug 2018 13:17:28 +0000 (08:17 -0500)
committerChris Forbes <chrisforbes@google.com>
Thu, 16 Aug 2018 19:02:18 +0000 (19:02 +0000)
Fix a missing VkComponentMapping field of the VkAndroidHardwareBufferFormatPropertiesANDROID
structure. This is causing incorrect values to be populated to the
structure, as well as, a stack overwrite of other stack-located locals.

Affects:
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r8g8b8a8_unorm
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r5g6b5_unorm_pack16
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.r16g16b16a16_sfloat
dEQP-VK.api.external.memory.android_hardware_buffer.image_formats.a2b10g10r10_unorm_pack32

Components: Vulkan
VK-GL-CTS issue: 1305
VK-GL-CTS issue: 1316
Bug: b/112705952

Change-Id: I81eb1cc605912bf0adebe67b65d7ccdd31236ec9
(cherry picked from Khronos commit 0116a17ddb4eb4f25624698bc0ba1c68e51a6950)

external/vulkancts/framework/vulkan/vkStrUtilImpl.inl
external/vulkancts/framework/vulkan/vkStructTypes.inl
external/vulkancts/modules/vulkan/api/vktApiExternalMemoryTests.cpp
external/vulkancts/scripts/src/vulkan.h.in

index c4e3ba1..8b46485 100644 (file)
@@ -5976,6 +5976,7 @@ std::ostream& operator<< (std::ostream& s, const VkAndroidHardwareBufferFormatPr
        s << "\tformat = " << value.format << '\n';
        s << "\texternalFormat = " << value.externalFormat << '\n';
        s << "\tformatFeatures = " << getFormatFeatureFlagsStr(value.formatFeatures) << '\n';
+       s << "\tsamplerYcbcrConversionComponents = " << value.samplerYcbcrConversionComponents << '\n';
        s << "\tsuggestedYcbcrModel = " << value.suggestedYcbcrModel << '\n';
        s << "\tsuggestedYcbcrRange = " << value.suggestedYcbcrRange << '\n';
        s << "\tsuggestedXChromaOffset = " << value.suggestedXChromaOffset << '\n';
index 3dc2aaa..b307ea3 100644 (file)
@@ -2797,6 +2797,7 @@ struct VkAndroidHardwareBufferFormatPropertiesANDROID
        VkFormat                                                format;
        deUint64                                                externalFormat;
        VkFormatFeatureFlags                    formatFeatures;
+       VkComponentMapping                              samplerYcbcrConversionComponents;
        VkSamplerYcbcrModelConversion   suggestedYcbcrModel;
        VkSamplerYcbcrRange                             suggestedYcbcrRange;
        VkChromaLocation                                suggestedXChromaOffset;
index 6186423..d4a75e0 100644 (file)
@@ -3814,6 +3814,7 @@ bool ValidateAHardwareBuffer(vk::VkFormat format, deUint64 requiredAhbUsage, con
                vk::VK_FORMAT_UNDEFINED,
                0u,
                0u,
+               { vk::VK_COMPONENT_SWIZZLE_IDENTITY, vk::VK_COMPONENT_SWIZZLE_IDENTITY, vk::VK_COMPONENT_SWIZZLE_IDENTITY, vk::VK_COMPONENT_SWIZZLE_IDENTITY },
                vk::VK_SAMPLER_YCBCR_MODEL_CONVERSION_RGB_IDENTITY,
                vk::VK_SAMPLER_YCBCR_RANGE_ITU_FULL,
                vk::VK_CHROMA_LOCATION_COSITED_EVEN,
index 92e48a5..00cc5a8 100644 (file)
@@ -7446,6 +7446,7 @@ typedef struct VkAndroidHardwareBufferFormatPropertiesANDROID {
     VkFormat                         format;
     uint64_t                         externalFormat;
     VkFormatFeatureFlags             formatFeatures;
+    VkComponentMapping               samplerYcbcrConversionComponents;
     VkSamplerYcbcrModelConversion    suggestedYcbcrModel;
     VkSamplerYcbcrRange              suggestedYcbcrRange;
     VkChromaLocation                 suggestedXChromaOffset;