Check sampler_mirror_clamp_to_edge extension in tex filter tests
authorYanjun Zhang <Yanjun.Zhang@verisilicon.com>
Mon, 24 Apr 2017 08:59:26 +0000 (01:59 -0700)
committerPyry Haulos <phaulos@google.com>
Fri, 12 May 2017 17:19:03 +0000 (13:19 -0400)
Components: Vulkan
VK-GL-CTS issue: 384

Affects:
dEQP-VK.texture.filtering.*.combinations.*_mirror_clamp_to_edge_*

Change-Id: Ie829b9247cd374e6c34ac70885e9e4421d284d1e

external/vulkancts/modules/vulkan/texture/vktTextureFilteringTests.cpp

index 7d1e94f..7c8c846 100644 (file)
@@ -119,6 +119,11 @@ Texture2DFilteringTestInstance::Texture2DFilteringTestInstance (Context& context
        const tcu::Vec4                                 cBias           = fmtInfo.valueMin;
        const tcu::Vec4                                 cScale          = fmtInfo.valueMax-fmtInfo.valueMin;
 
+       if ((testParameters.wrapS == Sampler::MIRRORED_ONCE ||
+               testParameters.wrapT == Sampler::MIRRORED_ONCE) &&
+               !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge"))
+               TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported");
+
        // Create 2 textures.
        m_textures.reserve(2);
        for (int ndx = 0; ndx < 2; ndx++)
@@ -309,6 +314,11 @@ TextureCubeFilteringTestInstance::TextureCubeFilteringTestInstance (Context& con
        const tcu::Vec4                                 cBias           = fmtInfo.valueMin;
        const tcu::Vec4                                 cScale          = fmtInfo.valueMax-fmtInfo.valueMin;
 
+       if ((testParameters.wrapS == Sampler::MIRRORED_ONCE ||
+               testParameters.wrapT == Sampler::MIRRORED_ONCE) &&
+               !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge"))
+               TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported");
+
        m_textures.reserve(2);
        for (int ndx = 0; ndx < 2; ndx++)
                m_textures.push_back(TestTextureCubeSp(new pipeline::TestTextureCube(vk::mapVkFormat(m_testParameters.format), m_testParameters.size)));
@@ -526,6 +536,11 @@ Texture2DArrayFilteringTestInstance::Texture2DArrayFilteringTestInstance (Contex
        const tcu::Vec4                                 cBias           = fmtInfo.valueMin;
        const int                                               numLevels       = deLog2Floor32(de::max(m_testParameters.width, m_testParameters.height)) + 1;
 
+       if ((testParameters.wrapS == Sampler::MIRRORED_ONCE ||
+               testParameters.wrapT == Sampler::MIRRORED_ONCE) &&
+               !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge"))
+               TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported");
+
        // Create textures.
        m_textures.reserve(2);
        for (int ndx = 0; ndx < 2; ndx++)
@@ -724,6 +739,12 @@ Texture3DFilteringTestInstance::Texture3DFilteringTestInstance (Context& context
        const tcu::Vec4                                 cBias           = fmtInfo.valueMin;
        const int                                               numLevels       = deLog2Floor32(de::max(de::max(m_testParameters.width, m_testParameters.height), m_testParameters.depth)) + 1;
 
+       if ((testParameters.wrapS == Sampler::MIRRORED_ONCE ||
+               testParameters.wrapT == Sampler::MIRRORED_ONCE ||
+               testParameters.wrapR == Sampler::MIRRORED_ONCE) &&
+               !de::contains(context.getDeviceExtensions().begin(), context.getDeviceExtensions().end(), "VK_KHR_sampler_mirror_clamp_to_edge"))
+               TCU_THROW(NotSupportedError, "VK_KHR_sampler_mirror_clamp_to_edge not supported");
+
        // Create textures.
        m_textures.reserve(2);
        for (int ndx = 0; ndx < 2; ndx++)