Add missing mandatory features
authorRicardo Garcia <rgarcia@igalia.com>
Thu, 18 Jun 2020 16:34:32 +0000 (18:34 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 26 Jun 2020 11:17:25 +0000 (07:17 -0400)
The following features are mandatory when some requirements are met and
they were not part of mandatory_features.txt:

* samplerYcbcrConversion
* drawIndirectCount
* samplerMirrorClampToEdge
* samplerFilterMinmax
* shaderOutputViewportIndex
* shaderOutputLayer

Affected tests:
dEQP-VK.info.device_mandatory_features

Components: Vulkan
VK-GL-CTS issue: 2158

Change-Id: I2401956bd7e0ee80792e146b80e130f7ac8ab8dd

external/vulkancts/framework/vulkan/vkMandatoryFeatures.inl
external/vulkancts/scripts/gen_framework.py
external/vulkancts/scripts/src/mandatory_features.txt

index 8f571e4..e8c7646 100644 (file)
@@ -186,6 +186,16 @@ bool checkMandatoryFeatures(const vkt::Context& context)
                nextPtr  = &physicalDevicePipelineExecutablePropertiesFeaturesKHR.pNext;
        }
 
+       vk::VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR physicalDeviceSamplerYcbcrConversionFeaturesKHR;
+       deMemset(&physicalDeviceSamplerYcbcrConversionFeaturesKHR, 0, sizeof(physicalDeviceSamplerYcbcrConversionFeaturesKHR));
+
+       if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_sampler_ycbcr_conversion")) )
+       {
+               physicalDeviceSamplerYcbcrConversionFeaturesKHR.sType = getStructureType<VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR>();
+               *nextPtr = &physicalDeviceSamplerYcbcrConversionFeaturesKHR;
+               nextPtr  = &physicalDeviceSamplerYcbcrConversionFeaturesKHR.pNext;
+       }
+
        vk::VkPhysicalDeviceScalarBlockLayoutFeaturesEXT physicalDeviceScalarBlockLayoutFeaturesEXT;
        deMemset(&physicalDeviceScalarBlockLayoutFeaturesEXT, 0, sizeof(physicalDeviceScalarBlockLayoutFeaturesEXT));
 
@@ -1035,6 +1045,60 @@ bool checkMandatoryFeatures(const vkt::Context& context)
                }
        }
 
+       if ( isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_sampler_ycbcr_conversion")) )
+       {
+               if ( physicalDeviceSamplerYcbcrConversionFeaturesKHR.samplerYcbcrConversion == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature samplerYcbcrConversion not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
+       if ( context.contextSupports(vk::ApiVersion(1, 2, 0)) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_draw_indirect_count")) )
+       {
+               if ( physicalDeviceVulkan12Features.drawIndirectCount == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature drawIndirectCount not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
+       if ( context.contextSupports(vk::ApiVersion(1, 2, 0)) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_KHR_sampler_mirror_clamp_to_edge")) )
+       {
+               if ( physicalDeviceVulkan12Features.samplerMirrorClampToEdge == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature samplerMirrorClampToEdge not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
+       if ( context.contextSupports(vk::ApiVersion(1, 2, 0)) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_sampler_filter_minmax")) )
+       {
+               if ( physicalDeviceVulkan12Features.samplerFilterMinmax == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature samplerFilterMinmax not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
+       if ( context.contextSupports(vk::ApiVersion(1, 2, 0)) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_shader_viewport_index_layer")) )
+       {
+               if ( physicalDeviceVulkan12Features.shaderOutputViewportIndex == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature shaderOutputViewportIndex not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
+       if ( context.contextSupports(vk::ApiVersion(1, 2, 0)) && isExtensionSupported(deviceExtensions, RequiredExtension("VK_EXT_shader_viewport_index_layer")) )
+       {
+               if ( physicalDeviceVulkan12Features.shaderOutputLayer == VK_FALSE )
+               {
+                       log << tcu::TestLog::Message << "Mandatory feature shaderOutputLayer not supported" << tcu::TestLog::EndMessage;
+                       result = false;
+               }
+       }
+
        return result;
 }
 
index 11d9baf..0d0df59 100644 (file)
@@ -1741,7 +1741,7 @@ def writeDeviceFeatures2(api, filename):
                if extension is not None:
                        condition = ' checkExtension(properties, "' + extension + '")'
                if major is not None:
-                       if condition is not '':
+                       if condition != '':
                                condition += '\t' * int((39 - len(extension)) / 4) + '|| '
                        else:
                                condition += '\t' * 17 + '   '
index 6da550c..b24d354 100644 (file)
@@ -79,3 +79,9 @@ VkPhysicalDevice16BitStorageFeaturesKHR                                       FEATURES ( storageBuffer16BitAccess
 VkPhysicalDeviceShaderFloat16Int8Features                                      FEATURES ( shaderFloat16 shaderInt8 )                                                   REQUIREMENTS ( VK_KHR_shader_float16_int8 )
 VkPhysicalDeviceFragmentShaderInterlockFeaturesEXT                     FEATURES ( fragmentShaderSampleInterlock fragmentShaderPixelInterlock fragmentShaderShadingRateInterlock )                                              REQUIREMENTS ( VK_EXT_fragment_shader_interlock )
 VkPhysicalDeviceLineRasterizationFeaturesEXT                           FEATURES ( rectangularLines bresenhamLines smoothLines stippledRectangularLines stippledBresenhamLines stippledSmoothLines )    REQUIREMENTS ( VK_EXT_line_rasterization )
+VkPhysicalDeviceSamplerYcbcrConversionFeaturesKHR                      FEATURES ( samplerYcbcrConversion )                                                             REQUIREMENTS ( VK_KHR_sampler_ycbcr_conversion )
+VkPhysicalDeviceVulkan12Features                                                       FEATURES ( drawIndirectCount )                                                                  REQUIREMENTS ( "ApiVersion(1, 2, 0)" VK_KHR_draw_indirect_count )
+VkPhysicalDeviceVulkan12Features                                                       FEATURES ( samplerMirrorClampToEdge )                                                   REQUIREMENTS ( "ApiVersion(1, 2, 0)" VK_KHR_sampler_mirror_clamp_to_edge )
+VkPhysicalDeviceVulkan12Features                                                       FEATURES ( samplerFilterMinmax )                                                                REQUIREMENTS ( "ApiVersion(1, 2, 0)" VK_EXT_sampler_filter_minmax )
+VkPhysicalDeviceVulkan12Features                                                       FEATURES ( shaderOutputViewportIndex )                                                  REQUIREMENTS ( "ApiVersion(1, 2, 0)" VK_EXT_shader_viewport_index_layer )
+VkPhysicalDeviceVulkan12Features                                                       FEATURES ( shaderOutputLayer )                                                                  REQUIREMENTS ( "ApiVersion(1, 2, 0)" VK_EXT_shader_viewport_index_layer )