Fix VK_AMD_shader_trinary_minmax feature checks
authorRicardo Garcia <rgarcia@igalia.com>
Mon, 22 Jun 2020 16:26:01 +0000 (18:26 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 2 Jul 2020 06:57:42 +0000 (02:57 -0400)
Avoid using Vulkan 1.2-specific structures when checking features
required for VK_AMD_shader_trinary_minmax tests.

Affected tests:
dEQP-VK.spirv_assembly.instruction.amd_trinary_minmax.*

Components: Vulkan
VK-GL-CTS issue: 2158

Change-Id: I991eb6d0f3982cf40dc5487c7742ce7b03152698

external/vulkancts/modules/vulkan/spirv_assembly/vktSpvAsmTrinaryMinMaxTests.cpp

index ea5e02d..8c95e6c 100644 (file)
@@ -450,33 +450,31 @@ void TrinaryMinMaxCase::checkSupport (Context& context) const
        context.requireDeviceFunctionality("VK_KHR_storage_buffer_storage_class");
        context.requireDeviceFunctionality("VK_AMD_shader_trinary_minmax");
 
-       const auto&     vki                             = context.getInstanceInterface();
-       const auto      physicalDevice  = context.getPhysicalDevice();
-
-       const auto devFeatures  = vk::getPhysicalDeviceFeatures(vki, physicalDevice);
-       const auto vk11Features = vk::getPhysicalDeviceVulkan11Features(vki, physicalDevice);
-       const auto vk12Features = vk::getPhysicalDeviceVulkan12Features(vki, physicalDevice);
+       const auto devFeatures                  = context.getDeviceFeatures();
+       const auto storage16BitFeatures = context.get16BitStorageFeatures();
+       const auto storage8BitFeatures  = context.get8BitStorageFeatures();
+       const auto shaderFeatures               = context.getShaderFloat16Int8Features();
 
        // Storage features.
        if (m_params.typeSize == TypeSize::SIZE_8BIT)
        {
                // We will be using 8-bit types in storage buffers.
                context.requireDeviceFunctionality("VK_KHR_8bit_storage");
-               if (!vk12Features.storageBuffer8BitAccess)
+               if (!storage8BitFeatures.storageBuffer8BitAccess)
                        TCU_THROW(NotSupportedError, "8-bit storage buffer access not supported");
        }
        else if (m_params.typeSize == TypeSize::SIZE_16BIT)
        {
                // We will be using 16-bit types in storage buffers.
                context.requireDeviceFunctionality("VK_KHR_16bit_storage");
-               if (!vk11Features.storageBuffer16BitAccess)
+               if (!storage16BitFeatures.storageBuffer16BitAccess)
                        TCU_THROW(NotSupportedError, "16-bit storage buffer access not supported");
        }
 
        // Shader type features.
        if (m_params.baseType == BaseType::TYPE_INT || m_params.baseType == BaseType::TYPE_UINT)
        {
-               if (m_params.typeSize == TypeSize::SIZE_8BIT && !vk12Features.shaderInt8)
+               if (m_params.typeSize == TypeSize::SIZE_8BIT && !shaderFeatures.shaderInt8)
                        TCU_THROW(NotSupportedError, "8-bit integers not supported in shaders");
                else if (m_params.typeSize == TypeSize::SIZE_16BIT && !devFeatures.shaderInt16)
                        TCU_THROW(NotSupportedError, "16-bit integers not supported in shaders");
@@ -486,7 +484,7 @@ void TrinaryMinMaxCase::checkSupport (Context& context) const
        else // BaseType::TYPE_FLOAT
        {
                DE_ASSERT(m_params.typeSize != TypeSize::SIZE_8BIT);
-               if (m_params.typeSize == TypeSize::SIZE_16BIT && !vk12Features.shaderFloat16)
+               if (m_params.typeSize == TypeSize::SIZE_16BIT && !shaderFeatures.shaderFloat16)
                        TCU_THROW(NotSupportedError, "16-bit floats not supported in shaders");
                else if (m_params.typeSize == TypeSize::SIZE_64BIT && !devFeatures.shaderFloat64)
                        TCU_THROW(NotSupportedError, "64-bit floats not supported in shaders");