Move anisotropic filtering support check to a function
authorVihanakangas <venni.ihanakangas@siru.fi>
Mon, 4 Oct 2021 10:52:27 +0000 (13:52 +0300)
committerVenni Ihanakangas <venni.ihanakangas@siru.fi>
Mon, 11 Oct 2021 13:01:43 +0000 (13:01 +0000)
Support check for anisotropic filtering was done inside of iterate.
This change moves that check inside of a function for consistency
and performance.

Affects:

dEQP-VK.texture.filtering_anisotropy.*

Components: Vulkan

VK-GL-CTS issue: 3068

Change-Id: I3a1c0a1acff96b6f6b291bb53d3d9dc0bd122c17
(cherry picked from commit 522f4ba64beee8828030320591d20faa027a8e0a)

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

index c9582b0..113a54e 100644 (file)
@@ -99,10 +99,6 @@ public:
 
        tcu::TestStatus iterate (void)
        {
-               // Check device for anisotropic filtering support
-               if (!m_context.getDeviceFeatures().samplerAnisotropy)
-                       TCU_THROW(NotSupportedError, "Skipping anisotropic tests since the device does not support anisotropic filtering.");
-
                TextureRenderer renderer        (m_context, VK_SAMPLE_COUNT_1_BIT, ANISOTROPY_TEST_RESOLUTION, ANISOTROPY_TEST_RESOLUTION);
                TestTexture2DSp texture         = TestTexture2DSp(new pipeline::TestTexture2D(vk::mapVkFormat(VK_FORMAT_R8G8B8A8_UNORM), ANISOTROPY_TEST_RESOLUTION, ANISOTROPY_TEST_RESOLUTION));
 
@@ -176,6 +172,14 @@ public:
        {
                return new FilteringAnisotropyInstance(context, m_refParams);
        }
+
+       virtual void    checkSupport                            (Context&       context) const
+       {
+               // Check device for anisotropic filtering support.
+               if (!context.getDeviceFeatures().samplerAnisotropy)
+                       TCU_THROW(NotSupportedError, "Skipping anisotropic tests since the device does not support anisotropic filtering.");
+       }
+
 private :
        const AnisotropyParams  m_refParams;
 };