diff options
author | ziga-lunarg <ziga@lunarg.com> | 2023-04-26 18:50:14 +0200 |
---|---|---|
committer | Piotr Byszewski <piotr.byszewski@mobica.com> | 2023-05-11 17:53:37 +0000 |
commit | 4c7e4e98f9e577ecd5bf2d922cd756aadc02701a (patch) | |
tree | 354fece485c05adcca94306cc952f5ac181d3b51 | |
parent | b22e6d94f66c7d78b89ceb620f9ee945f2371080 (diff) | |
download | deqp-4c7e4e98f9e577ecd5bf2d922cd756aadc02701a.tar.gz |
Fix api invariance test using pvrtc formats
A check if format is supported is missing before using it
Components: Vulkan
VK-GL-CTS issue: 4430
Affected test:
dEQP-VK.api.invariance.random
Change-Id: I8fb1c3f7e4325e3f9d86fd454e886591a77dd1a4
3 files changed, 25 insertions, 0 deletions
diff --git a/external/vulkancts/framework/vulkan/vkImageUtil.cpp b/external/vulkancts/framework/vulkan/vkImageUtil.cpp index 563b955b8..606dc94bd 100644 --- a/external/vulkancts/framework/vulkan/vkImageUtil.cpp +++ b/external/vulkancts/framework/vulkan/vkImageUtil.cpp @@ -357,6 +357,26 @@ bool isYCbCr422Format (VkFormat format) } } +bool isPvrtcFormat (VkFormat format) +{ + switch (format) + { +#ifndef CTS_USES_VULKANSC + case VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG: + case VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG: + case VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG: + case VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG: + case VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG: + case VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG: + case VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG: + case VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG: + return true; +#endif + default: + return false; + } +} + const std::map<VkFormat, std::string> spirvFormats = { { VK_FORMAT_R32G32B32A32_SFLOAT, "Rgba32f" }, { VK_FORMAT_R32G32_SFLOAT, "Rg32f" }, diff --git a/external/vulkancts/framework/vulkan/vkImageUtil.hpp b/external/vulkancts/framework/vulkan/vkImageUtil.hpp index 4770e37df..e5aad43e3 100644 --- a/external/vulkancts/framework/vulkan/vkImageUtil.hpp +++ b/external/vulkancts/framework/vulkan/vkImageUtil.hpp @@ -137,6 +137,7 @@ struct PlanarFormatDescription bool isYCbCrFormat (VkFormat format); bool isYCbCrExtensionFormat (VkFormat format); bool isYCbCrConversionFormat (VkFormat format); +bool isPvrtcFormat (VkFormat format); PlanarFormatDescription getPlanarFormatDescription (VkFormat format); int getPlaneCount (VkFormat format); deUint32 getMipmapCount (VkFormat format, diff --git a/external/vulkancts/modules/vulkan/api/vktApiMemoryRequirementInvarianceTests.cpp b/external/vulkancts/modules/vulkan/api/vktApiMemoryRequirementInvarianceTests.cpp index 3577488a9..d47ff3874 100644 --- a/external/vulkancts/modules/vulkan/api/vktApiMemoryRequirementInvarianceTests.cpp +++ b/external/vulkancts/modules/vulkan/api/vktApiMemoryRequirementInvarianceTests.cpp @@ -259,6 +259,7 @@ tcu::TestStatus InvarianceInstance::iterate (void) const deBool isDedicatedAllocationSupported = m_context.isDeviceFunctionalitySupported("VK_KHR_dedicated_allocation"); const deBool isYcbcrSupported = m_context.isDeviceFunctionalitySupported("VK_KHR_sampler_ycbcr_conversion"); const deBool isYcbcrExtensionSupported = m_context.isDeviceFunctionalitySupported("VK_EXT_ycbcr_2plane_444_formats"); + const deBool isPvrtcSupported = m_context.isDeviceFunctionalitySupported("VK_IMG_format_pvrtc"); std::vector<int> optimalFormats; std::vector<int> linearFormats; std::vector<int> memoryTypes; @@ -511,6 +512,9 @@ tcu::TestStatus InvarianceInstance::iterate (void) if (isYCbCrExtensionFormat((VkFormat)formatlist[i]) && !isYcbcrExtensionSupported) continue; + if (isPvrtcFormat((VkFormat)formatlist[i]) && !isPvrtcSupported) + continue; + vk::VkImageFormatProperties imageformatprops; // Check for support in linear tiling mode |