Validate Vulkan 1.2 limits
authorBoris Zanin <boris.zanin@mobica.com>
Wed, 4 Sep 2019 11:47:37 +0000 (13:47 +0200)
committerBoris Zanin <boris.zanin@mobica.com>
Thu, 12 Sep 2019 08:11:43 +0000 (10:11 +0200)
Validate limits against Limit Requirements chapter.

Add test:
 * dEQP-VK.api.info.vulkan1p2.limits_validation

Components: vulkan

VK-GL-CTS issue: 1924

Change-Id: Ibe54ef2c6ced9864731c358172358d871d823312

android/cts/master/vk-master.txt
external/vulkancts/modules/vulkan/api/vktApiFeatureInfo.cpp
external/vulkancts/mustpass/master/vk-default-no-waivers.txt
external/vulkancts/mustpass/master/vk-default.txt

index b0e4d47..dcf6bd2 100644 (file)
@@ -1430,6 +1430,7 @@ dEQP-VK.api.info.vulkan1p2.features
 dEQP-VK.api.info.vulkan1p2.properties
 dEQP-VK.api.info.vulkan1p2.feature_extensions_consistency
 dEQP-VK.api.info.vulkan1p2.property_extensions_consistency
+dEQP-VK.api.info.vulkan1p2.limits_validation
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4_unorm_pack8
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4b4a4_unorm_pack16
 dEQP-VK.api.info.image_format_properties2.1d.optimal.b4g4r4a4_unorm_pack16
index 5b15fd1..66f8b9f 100644 (file)
@@ -509,6 +509,560 @@ bool validateFeatureLimits(VkPhysicalDeviceProperties* properties, VkPhysicalDev
        return limitsOk;
 }
 
+void validateLimitsCheckSupport (Context& context)
+{
+       if (!context.contextSupports(vk::ApiVersion(1, 2, 0)))
+               TCU_THROW(NotSupportedError, "At least Vulkan 1.2 required to run test");
+}
+
+template<typename T>
+bool validateNumericLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
+{
+       if (limitType == LIMIT_TYPE_MIN)
+       {
+               if (reportedValue < limitToCheck)
+               {
+                       log << TestLog::Message << "Limit validation failed " << limitName
+                               << " reported value is " << reportedValue
+                               << " expected MIN " << limitToCheck
+                               << TestLog::EndMessage;
+
+                       return false;
+               }
+       }
+       else if (limitType == LIMIT_TYPE_MAX)
+       {
+               if (reportedValue > limitToCheck)
+               {
+                       log << TestLog::Message << "Limit validation failed " << limitName
+                               << " reported value is " << reportedValue
+                               << " expected MAX " << limitToCheck
+                               << TestLog::EndMessage;
+
+                       return false;
+               }
+       }
+
+       return true;
+}
+
+template<typename T>
+bool validateBitmaskLimit (const T limitToCheck, const T reportedValue, const LimitType limitType, const char* limitName, TestLog& log)
+{
+       if (limitType == LIMIT_TYPE_MIN)
+       {
+               if ((reportedValue & limitToCheck) != limitToCheck)
+               {
+                       log << TestLog::Message << "Limit validation failed " << limitName
+                               << " reported value is " << reportedValue
+                               << " expected MIN " << limitToCheck
+                               << TestLog::EndMessage;
+
+                       return false;
+               }
+       }
+
+       return true;
+}
+
+tcu::TestStatus validateLimits12 (Context& context)
+{
+#ifdef PN
+#error PN defined
+#else
+#define PN(_X_)        &(_X_), (const char*)(#_X_)
+#endif
+
+#define LIM_MIN_UINT32(X)      deUint32(X),          0,               0,     0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MIN
+#define LIM_MAX_UINT32(X)      deUint32(X),          0,               0,     0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_MAX
+#define LIM_NONE_UINT32                          0,          0,               0,     0.0f, LIMIT_FORMAT_UNSIGNED_INT, LIMIT_TYPE_NONE
+#define LIM_MIN_INT32(X)                 0, deInt32(X),               0,     0.0f, LIMIT_FORMAT_SIGNED_INT,   LIMIT_TYPE_MIN
+#define LIM_MAX_INT32(X)                 0, deInt32(X),               0,     0.0f, LIMIT_FORMAT_SIGNED_INT,   LIMIT_TYPE_MAX
+#define LIM_NONE_INT32                   0,          0,               0,     0.0f, LIMIT_FORMAT_SIGNED_INT,   LIMIT_TYPE_NONE
+#define LIM_MIN_DEVSIZE(X)               0,          0, VkDeviceSize(X),     0.0f, LIMIT_FORMAT_DEVICE_SIZE,  LIMIT_TYPE_MIN
+#define LIM_MAX_DEVSIZE(X)               0,          0, VkDeviceSize(X),     0.0f, LIMIT_FORMAT_DEVICE_SIZE,  LIMIT_TYPE_MAX
+#define LIM_NONE_DEVSIZE                 0,          0,               0,     0.0f, LIMIT_FORMAT_DEVICE_SIZE,  LIMIT_TYPE_NONE
+#define LIM_MIN_FLOAT(X)                 0,          0,               0, float(X), LIMIT_FORMAT_FLOAT,        LIMIT_TYPE_MIN
+#define LIM_MAX_FLOAT(X)                 0,          0,               0, float(X), LIMIT_FORMAT_FLOAT,        LIMIT_TYPE_MAX
+#define LIM_NONE_FLOAT                   0,          0,               0,     0.0f, LIMIT_FORMAT_FLOAT,        LIMIT_TYPE_NONE
+#define LIM_MIN_BITI32(X)      deUint32(X),          0,               0,     0.0f, LIMIT_FORMAT_BITMASK,      LIMIT_TYPE_MIN
+#define LIM_MAX_BITI32(X)      deUint32(X),          0,               0,     0.0f, LIMIT_FORMAT_BITMASK,      LIMIT_TYPE_MAX
+#define LIM_NONE_BITI32                          0,          0,               0,     0.0f, LIMIT_FORMAT_BITMASK,      LIMIT_TYPE_NONE
+
+       const VkPhysicalDevice                                                                                  physicalDevice                                                  = context.getPhysicalDevice();
+       const InstanceInterface&                                                                                vki                                                                             = context.getInstanceInterface();
+       TestLog&                                                                                                                log                                                                             = context.getTestContext().getLog();
+       bool                                                                                                                    limitsOk                                                                = true;
+
+       const VkPhysicalDeviceFeatures2&                                                                features2                                                               = context.getDeviceFeatures2();
+       const VkPhysicalDeviceFeatures&                                                                 features                                                                = features2.features;
+
+       const VkPhysicalDeviceProperties2&                                                              properties2                                                             = context.getDeviceProperties2();
+       const VkPhysicalDevicePushDescriptorPropertiesKHR&                              pushDescriptorPropertiesKHR                             = context.getPushDescriptorProperties();
+       const VkPhysicalDeviceMultiviewProperties&                                              multiviewProperties                                             = context.getMultiviewProperties();
+       const VkPhysicalDeviceDiscardRectanglePropertiesEXT&                    discardRectanglePropertiesEXT                   = context.getDiscardRectanglePropertiesEXT();
+       const VkPhysicalDeviceSampleLocationsPropertiesEXT&                             sampleLocationsPropertiesEXT                    = context.getSampleLocationsPropertiesEXT();
+       const VkPhysicalDeviceExternalMemoryHostPropertiesEXT&                  externalMemoryHostPropertiesEXT                 = context.getExternalMemoryHostPropertiesEXT();
+       const VkPhysicalDeviceBlendOperationAdvancedPropertiesEXT&              blendOperationAdvancedPropertiesEXT             = context.getBlendOperationAdvancedPropertiesEXT();
+       const VkPhysicalDeviceMaintenance3Properties&                                   maintenance3Properties                                  = context.getMaintenance3Properties();
+       const VkPhysicalDeviceConservativeRasterizationPropertiesEXT&   conservativeRasterizationPropertiesEXT  = context.getConservativeRasterizationPropertiesEXT();
+       const VkPhysicalDeviceDescriptorIndexingPropertiesEXT&                  descriptorIndexingPropertiesEXT                 = context.getDescriptorIndexingProperties();
+       const VkPhysicalDeviceInlineUniformBlockPropertiesEXT&                  inlineUniformBlockPropertiesEXT                 = context.getInlineUniformBlockPropertiesEXT();
+       const VkPhysicalDeviceVertexAttributeDivisorPropertiesEXT&              vertexAttributeDivisorPropertiesEXT             = context.getVertexAttributeDivisorPropertiesEXT();
+       const VkPhysicalDeviceMeshShaderPropertiesNV&                                   meshShaderPropertiesNV                                  = context.getMeshShaderProperties();
+       const VkPhysicalDeviceTransformFeedbackPropertiesEXT&                   transformFeedbackPropertiesEXT                  = context.getTransformFeedbackPropertiesEXT();
+       const VkPhysicalDeviceFragmentDensityMapPropertiesEXT&                  fragmentDensityMapPropertiesEXT                 = context.getFragmentDensityMapPropertiesEXT();
+       const VkPhysicalDeviceRayTracingPropertiesNV&                                   rayTracingPropertiesNV                                  = context.getRayTracingProperties();
+       const VkPhysicalDeviceTimelineSemaphorePropertiesKHR&                   timelineSemaphorePropertiesKHR                  = context.getTimelineSemaphoreProperties();
+       const VkPhysicalDeviceLineRasterizationPropertiesEXT&                   lineRasterizationPropertiesEXT                  = context.getLineRasterizationPropertiesEXT();
+       const VkPhysicalDeviceVulkan12Properties                                                vulkan12Properties                                              = getPhysicalDeviceVulkan12Properties(vki, physicalDevice);
+       const VkPhysicalDeviceVulkan11Properties                                                vulkan11Properties                                              = getPhysicalDeviceVulkan11Properties(vki, physicalDevice);
+       const VkPhysicalDeviceLimits&                                                                   limits                                                                  = properties2.properties.limits;
+
+       const VkBool32                                                                                                  checkAlways                                                             = VK_TRUE;
+       const VkBool32                                                                                                  checkVulkan12Limit                                              = VK_TRUE;
+       const VkBool32                                                                                                  pushDescriptorKHR                                               = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_push_descriptor");
+       const VkBool32                                                                                                  multiviewKHR                                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_multiview");
+       const VkBool32                                                                                                  discardRectangleEXT                                             = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_discard_rectangles");
+       const VkBool32                                                                                                  sampleLocationsEXT                                              = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_sample_locations");
+       const VkBool32                                                                                                  externalMemoryHostEXT                                   = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_external_memory_host");
+       const VkBool32                                                                                                  blendOperationAdvancedEXT                               = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_blend_operation_advanced");
+       const VkBool32                                                                                                  maintenance3KHR                                                 = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_maintenance3");
+       const VkBool32                                                                                                  conservativeRasterizationEXT                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_conservative_rasterization");
+       const VkBool32                                                                                                  descriptorIndexingEXT                                   = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_descriptor_indexing");
+       const VkBool32                                                                                                  inlineUniformBlockEXT                                   = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_inline_uniform_block");
+       const VkBool32                                                                                                  vertexAttributeDivisorEXT                               = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_vertex_attribute_divisor");
+       const VkBool32                                                                                                  meshShaderNV                                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_mesh_shader");
+       const VkBool32                                                                                                  transformFeedbackEXT                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_transform_feedback");
+       const VkBool32                                                                                                  fragmentDensityMapEXT                                   = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_fragment_density_map");
+       const VkBool32                                                                                                  rayTracingNV                                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_NV_ray_tracing");
+       const VkBool32                                                                                                  timelineSemaphoreKHR                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_KHR_timeline_semaphore");
+       const VkBool32                                                                                                  lineRasterizationEXT                                    = isDeviceExtensionSupported(context.getUsedApiVersion(), context.getDeviceExtensions(), "VK_EXT_line_rasterization");
+
+       deUint32                                                                                                                shaderStages                                                    = 3;
+       deUint32                                                                                                                maxPerStageResourcesMin                                 = deMin32(128,  limits.maxPerStageDescriptorUniformBuffers              +
+                                                                                                                                                                                                                                                       limits.maxPerStageDescriptorStorageBuffers              +
+                                                                                                                                                                                                                                                       limits.maxPerStageDescriptorSampledImages               +
+                                                                                                                                                                                                                                                       limits.maxPerStageDescriptorStorageImages               +
+                                                                                                                                                                                                                                                       limits.maxPerStageDescriptorInputAttachments    +
+                                                                                                                                                                                                                                                       limits.maxColorAttachments);
+
+       if (features2.features.tessellationShader)
+       {
+               shaderStages += 2;
+       }
+
+       if (features2.features.geometryShader)
+       {
+               shaderStages++;
+       }
+
+       struct FeatureLimitTable
+       {
+               const void*             cond;
+               const char*             condName;
+               const void*             ptr;
+               const char*             name;
+               deUint32                uintVal;                        //!< Format is UNSIGNED_INT
+               deInt32                 intVal;                         //!< Format is SIGNED_INT
+               deUint64                deviceSizeVal;          //!< Format is DEVICE_SIZE
+               float                   floatVal;                       //!< Format is FLOAT
+               LimitFormat             format;
+               LimitType               type;
+       }
+       featureLimitTable[] =
+       {
+               { PN(checkAlways),                                                              PN(limits.maxImageDimension1D),                                                                                                                                 LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxImageDimension2D),                                                                                                                                 LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxImageDimension3D),                                                                                                                                 LIM_MIN_UINT32(256) },
+               { PN(checkAlways),                                                              PN(limits.maxImageDimensionCube),                                                                                                                               LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxImageArrayLayers),                                                                                                                                 LIM_MIN_UINT32(256) },
+               { PN(checkAlways),                                                              PN(limits.maxTexelBufferElements),                                                                                                                              LIM_MIN_UINT32(65536) },
+               { PN(checkAlways),                                                              PN(limits.maxUniformBufferRange),                                                                                                                               LIM_MIN_UINT32(16384) },
+               { PN(checkAlways),                                                              PN(limits.maxStorageBufferRange),                                                                                                                               LIM_MIN_UINT32((1<<27)) },
+               { PN(checkAlways),                                                              PN(limits.maxPushConstantsSize),                                                                                                                                LIM_MIN_UINT32(128) },
+               { PN(checkAlways),                                                              PN(limits.maxMemoryAllocationCount),                                                                                                                    LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxSamplerAllocationCount),                                                                                                                   LIM_MIN_UINT32(4000) },
+               { PN(checkAlways),                                                              PN(limits.bufferImageGranularity),                                                                                                                              LIM_MIN_DEVSIZE(1) },
+               { PN(checkAlways),                                                              PN(limits.bufferImageGranularity),                                                                                                                              LIM_MAX_DEVSIZE(131072) },
+               { PN(features.sparseBinding),                                   PN(limits.sparseAddressSpaceSize),                                                                                                                              LIM_MIN_DEVSIZE((1ull<<31)) },
+               { PN(checkAlways),                                                              PN(limits.maxBoundDescriptorSets),                                                                                                                              LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorSamplers),                                                                                                               LIM_MIN_UINT32(16) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorUniformBuffers),                                                                                                 LIM_MIN_UINT32(12) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorStorageBuffers),                                                                                                 LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorSampledImages),                                                                                                  LIM_MIN_UINT32(16) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorStorageImages),                                                                                                  LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageDescriptorInputAttachments),                                                                                               LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxPerStageResources),                                                                                                                                LIM_MIN_UINT32(maxPerStageResourcesMin) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetSamplers),                                                                                                                    LIM_MIN_UINT32(shaderStages * 16) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetUniformBuffers),                                                                                                              LIM_MIN_UINT32(shaderStages * 12) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetUniformBuffersDynamic),                                                                                               LIM_MIN_UINT32(8) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetStorageBuffers),                                                                                                              LIM_MIN_UINT32(shaderStages * 4) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetStorageBuffersDynamic),                                                                                               LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetSampledImages),                                                                                                               LIM_MIN_UINT32(shaderStages * 16) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetStorageImages),                                                                                                               LIM_MIN_UINT32(shaderStages * 4) },
+               { PN(checkAlways),                                                              PN(limits.maxDescriptorSetInputAttachments),                                                                                                    LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxVertexInputAttributes),                                                                                                                    LIM_MIN_UINT32(16) },
+               { PN(checkAlways),                                                              PN(limits.maxVertexInputBindings),                                                                                                                              LIM_MIN_UINT32(16) },
+               { PN(checkAlways),                                                              PN(limits.maxVertexInputAttributeOffset),                                                                                                               LIM_MIN_UINT32(2047) },
+               { PN(checkAlways),                                                              PN(limits.maxVertexInputBindingStride),                                                                                                                 LIM_MIN_UINT32(2048) },
+               { PN(checkAlways),                                                              PN(limits.maxVertexOutputComponents),                                                                                                                   LIM_MIN_UINT32(64) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationGenerationLevel),                                                                                                              LIM_MIN_UINT32(64) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationPatchSize),                                                                                                                    LIM_MIN_UINT32(32) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationControlPerVertexInputComponents),                                                                              LIM_MIN_UINT32(64) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationControlPerVertexOutputComponents),                                                                             LIM_MIN_UINT32(64) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationControlPerPatchOutputComponents),                                                                              LIM_MIN_UINT32(120) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationControlTotalOutputComponents),                                                                                 LIM_MIN_UINT32(2048) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationEvaluationInputComponents),                                                                                    LIM_MIN_UINT32(64) },
+               { PN(features.tessellationShader),                              PN(limits.maxTessellationEvaluationOutputComponents),                                                                                   LIM_MIN_UINT32(64) },
+               { PN(features.geometryShader),                                  PN(limits.maxGeometryShaderInvocations),                                                                                                                LIM_MIN_UINT32(32) },
+               { PN(features.geometryShader),                                  PN(limits.maxGeometryInputComponents),                                                                                                                  LIM_MIN_UINT32(64) },
+               { PN(features.geometryShader),                                  PN(limits.maxGeometryOutputComponents),                                                                                                                 LIM_MIN_UINT32(64) },
+               { PN(features.geometryShader),                                  PN(limits.maxGeometryOutputVertices),                                                                                                                   LIM_MIN_UINT32(256) },
+               { PN(features.geometryShader),                                  PN(limits.maxGeometryTotalOutputComponents),                                                                                                    LIM_MIN_UINT32(1024) },
+               { PN(checkAlways),                                                              PN(limits.maxFragmentInputComponents),                                                                                                                  LIM_MIN_UINT32(64) },
+               { PN(checkAlways),                                                              PN(limits.maxFragmentOutputAttachments),                                                                                                                LIM_MIN_UINT32(4) },
+               { PN(features.dualSrcBlend),                                    PN(limits.maxFragmentDualSrcAttachments),                                                                                                               LIM_MIN_UINT32(1) },
+               { PN(checkAlways),                                                              PN(limits.maxFragmentCombinedOutputResources),                                                                                                  LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeSharedMemorySize),                                                                                                                  LIM_MIN_UINT32(16384) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupCount[0]),                                                                                                                 LIM_MIN_UINT32(65535) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupCount[1]),                                                                                                                 LIM_MIN_UINT32(65535) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupCount[2]),                                                                                                                 LIM_MIN_UINT32(65535) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupInvocations),                                                                                                              LIM_MIN_UINT32(128) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupSize[0]),                                                                                                                  LIM_MIN_UINT32(128) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupSize[1]),                                                                                                                  LIM_MIN_UINT32(128) },
+               { PN(checkAlways),                                                              PN(limits.maxComputeWorkGroupSize[2]),                                                                                                                  LIM_MIN_UINT32(64) },
+               { PN(checkAlways),                                                              PN(limits.subPixelPrecisionBits),                                                                                                                               LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.subTexelPrecisionBits),                                                                                                                               LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.mipmapPrecisionBits),                                                                                                                                 LIM_MIN_UINT32(4) },
+               { PN(features.fullDrawIndexUint32),                             PN(limits.maxDrawIndexedIndexValue),                                                                                                                    LIM_MIN_UINT32((deUint32)~0) },
+               { PN(features.multiDrawIndirect),                               PN(limits.maxDrawIndirectCount),                                                                                                                                LIM_MIN_UINT32(65535) },
+               { PN(checkAlways),                                                              PN(limits.maxSamplerLodBias),                                                                                                                                   LIM_MIN_FLOAT(2.0f) },
+               { PN(features.samplerAnisotropy),                               PN(limits.maxSamplerAnisotropy),                                                                                                                                LIM_MIN_FLOAT(16.0f) },
+               { PN(features.multiViewport),                                   PN(limits.maxViewports),                                                                                                                                                LIM_MIN_UINT32(16) },
+               { PN(checkAlways),                                                              PN(limits.maxViewportDimensions[0]),                                                                                                                    LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxViewportDimensions[1]),                                                                                                                    LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.viewportBoundsRange[0]),                                                                                                                              LIM_MAX_FLOAT(-8192.0f) },
+               { PN(checkAlways),                                                              PN(limits.viewportBoundsRange[1]),                                                                                                                              LIM_MIN_FLOAT(8191.0f) },
+               { PN(checkAlways),                                                              PN(limits.viewportSubPixelBits),                                                                                                                                LIM_MIN_UINT32(0) },
+               { PN(checkAlways),                                                              PN(limits.minMemoryMapAlignment),                                                                                                                               LIM_MIN_UINT32(64) },
+               { PN(checkAlways),                                                              PN(limits.minTexelBufferOffsetAlignment),                                                                                                               LIM_MIN_DEVSIZE(1) },
+               { PN(checkAlways),                                                              PN(limits.minTexelBufferOffsetAlignment),                                                                                                               LIM_MAX_DEVSIZE(256) },
+               { PN(checkAlways),                                                              PN(limits.minUniformBufferOffsetAlignment),                                                                                                             LIM_MIN_DEVSIZE(1) },
+               { PN(checkAlways),                                                              PN(limits.minUniformBufferOffsetAlignment),                                                                                                             LIM_MAX_DEVSIZE(256) },
+               { PN(checkAlways),                                                              PN(limits.minStorageBufferOffsetAlignment),                                                                                                             LIM_MIN_DEVSIZE(1) },
+               { PN(checkAlways),                                                              PN(limits.minStorageBufferOffsetAlignment),                                                                                                             LIM_MAX_DEVSIZE(256) },
+               { PN(checkAlways),                                                              PN(limits.minTexelOffset),                                                                                                                                              LIM_MAX_INT32(-8) },
+               { PN(checkAlways),                                                              PN(limits.maxTexelOffset),                                                                                                                                              LIM_MIN_INT32(7) },
+               { PN(features.shaderImageGatherExtended),               PN(limits.minTexelGatherOffset),                                                                                                                                LIM_MAX_INT32(-8) },
+               { PN(features.shaderImageGatherExtended),               PN(limits.maxTexelGatherOffset),                                                                                                                                LIM_MIN_INT32(7) },
+               { PN(features.sampleRateShading),                               PN(limits.minInterpolationOffset),                                                                                                                              LIM_MAX_FLOAT(-0.5f) },
+               { PN(features.sampleRateShading),                               PN(limits.maxInterpolationOffset),                                                                                                                              LIM_MIN_FLOAT(0.5f - (1.0f/deFloatPow(2.0f, (float)limits.subPixelInterpolationOffsetBits))) },
+               { PN(features.sampleRateShading),                               PN(limits.subPixelInterpolationOffsetBits),                                                                                                             LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.maxFramebufferWidth),                                                                                                                                 LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxFramebufferHeight),                                                                                                                                LIM_MIN_UINT32(4096) },
+               { PN(checkAlways),                                                              PN(limits.maxFramebufferLayers),                                                                                                                                LIM_MIN_UINT32(256) },
+               { PN(checkAlways),                                                              PN(limits.framebufferColorSampleCounts),                                                                                                                LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.framebufferIntegerColorSampleCounts),                                                                             LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
+               { PN(checkAlways),                                                              PN(limits.framebufferDepthSampleCounts),                                                                                                                LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.framebufferStencilSampleCounts),                                                                                                              LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.framebufferNoAttachmentsSampleCounts),                                                                                                LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.maxColorAttachments),                                                                                                                                 LIM_MIN_UINT32(4) },
+               { PN(checkAlways),                                                              PN(limits.sampledImageColorSampleCounts),                                                                                                               LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.sampledImageIntegerSampleCounts),                                                                                                             LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT) },
+               { PN(checkAlways),                                                              PN(limits.sampledImageDepthSampleCounts),                                                                                                               LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.sampledImageStencilSampleCounts),                                                                                                             LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(features.shaderStorageImageMultisample),   PN(limits.storageImageSampleCounts),                                                                                                                    LIM_MIN_BITI32(VK_SAMPLE_COUNT_1_BIT|VK_SAMPLE_COUNT_4_BIT) },
+               { PN(checkAlways),                                                              PN(limits.maxSampleMaskWords),                                                                                                                                  LIM_MIN_UINT32(1) },
+               { PN(checkAlways),                                                              PN(limits.timestampComputeAndGraphics),                                                                                                                 LIM_NONE_UINT32 },
+               { PN(checkAlways),                                                              PN(limits.timestampPeriod),                                                                                                                                             LIM_NONE_UINT32 },
+               { PN(features.shaderClipDistance),                              PN(limits.maxClipDistances),                                                                                                                                    LIM_MIN_UINT32(8) },
+               { PN(features.shaderClipDistance),                              PN(limits.maxCullDistances),                                                                                                                                    LIM_MIN_UINT32(8) },
+               { PN(features.shaderClipDistance),                              PN(limits.maxCombinedClipAndCullDistances),                                                                                                             LIM_MIN_UINT32(8) },
+               { PN(checkAlways),                                                              PN(limits.discreteQueuePriorities),                                                                                                                             LIM_MIN_UINT32(2) },
+               { PN(features.largePoints),                                             PN(limits.pointSizeRange[0]),                                                                                                                                   LIM_MIN_FLOAT(0.0f) },
+               { PN(features.largePoints),                                             PN(limits.pointSizeRange[0]),                                                                                                                                   LIM_MAX_FLOAT(1.0f) },
+               { PN(features.largePoints),                                             PN(limits.pointSizeRange[1]),                                                                                                                                   LIM_MIN_FLOAT(64.0f - limits.pointSizeGranularity) },
+               { PN(features.wideLines),                                               PN(limits.lineWidthRange[0]),                                                                                                                                   LIM_MIN_FLOAT(0.0f) },
+               { PN(features.wideLines),                                               PN(limits.lineWidthRange[0]),                                                                                                                                   LIM_MAX_FLOAT(1.0f) },
+               { PN(features.wideLines),                                               PN(limits.lineWidthRange[1]),                                                                                                                                   LIM_MIN_FLOAT(8.0f - limits.lineWidthGranularity) },
+               { PN(features.largePoints),                                             PN(limits.pointSizeGranularity),                                                                                                                                LIM_MIN_FLOAT(0.0f) },
+               { PN(features.largePoints),                                             PN(limits.pointSizeGranularity),                                                                                                                                LIM_MAX_FLOAT(1.0f) },
+               { PN(features.wideLines),                                               PN(limits.lineWidthGranularity),                                                                                                                                LIM_MIN_FLOAT(0.0f) },
+               { PN(features.wideLines),                                               PN(limits.lineWidthGranularity),                                                                                                                                LIM_MAX_FLOAT(1.0f) },
+               { PN(checkAlways),                                                              PN(limits.strictLines),                                                                                                                                                 LIM_NONE_UINT32 },
+               { PN(checkAlways),                                                              PN(limits.standardSampleLocations),                                                                                                                             LIM_NONE_UINT32 },
+               { PN(checkAlways),                                                              PN(limits.optimalBufferCopyOffsetAlignment),                                                                                                    LIM_NONE_DEVSIZE },
+               { PN(checkAlways),                                                              PN(limits.optimalBufferCopyRowPitchAlignment),                                                                                                  LIM_NONE_DEVSIZE },
+               { PN(checkAlways),                                                              PN(limits.nonCoherentAtomSize),                                                                                                                                 LIM_MIN_DEVSIZE(1) },
+               { PN(checkAlways),                                                              PN(limits.nonCoherentAtomSize),                                                                                                                                 LIM_MAX_DEVSIZE(256) },
+
+               // VK_KHR_push_descriptor
+               { PN(pushDescriptorKHR),                                                PN(pushDescriptorPropertiesKHR.maxPushDescriptors),                                                                                             LIM_MIN_UINT32(32) },
+
+               // VK_KHR_multiview
+               { PN(multiviewKHR),                                                             PN(multiviewProperties.maxMultiviewViewCount),                                                                                                  LIM_MIN_UINT32(6) },
+               { PN(multiviewKHR),                                                             PN(multiviewProperties.maxMultiviewInstanceIndex),                                                                                              LIM_MIN_UINT32((1<<27) - 1) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan11Properties.maxMultiviewViewCount),                                                                                                   LIM_MIN_UINT32(6) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan11Properties.maxMultiviewInstanceIndex),                                                                                               LIM_MIN_UINT32((1<<27) - 1) },
+
+               // VK_EXT_discard_rectangles
+               { PN(discardRectangleEXT),                                              PN(discardRectanglePropertiesEXT.maxDiscardRectangles),                                                                                 LIM_MIN_UINT32(4) },
+
+               // VK_EXT_sample_locations
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.sampleLocationSampleCounts),                                                                    LIM_MIN_BITI32(VK_SAMPLE_COUNT_4_BIT) },
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.width),                                                               LIM_MIN_FLOAT(0.0f) },
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.maxSampleLocationGridSize.height),                                                              LIM_MIN_FLOAT(0.0f) },
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[0]),                                                              LIM_MAX_FLOAT(0.0f) },
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.sampleLocationCoordinateRange[1]),                                                              LIM_MIN_FLOAT(0.9375f) },
+               { PN(sampleLocationsEXT),                                               PN(sampleLocationsPropertiesEXT.sampleLocationSubPixelBits),                                                                    LIM_MIN_UINT32(4) },
+
+               // VK_EXT_external_memory_host
+               { PN(externalMemoryHostEXT),                                    PN(externalMemoryHostPropertiesEXT.minImportedHostPointerAlignment),                                                    LIM_MAX_DEVSIZE(65536) },
+
+               // VK_EXT_blend_operation_advanced
+               { PN(blendOperationAdvancedEXT),                                PN(blendOperationAdvancedPropertiesEXT.advancedBlendMaxColorAttachments),                                               LIM_MIN_UINT32(4) },
+
+               // VK_KHR_maintenance3
+               { PN(maintenance3KHR),                                                  PN(maintenance3Properties.maxPerSetDescriptors),                                                                                                LIM_MIN_UINT32(1024) },
+               { PN(maintenance3KHR),                                                  PN(maintenance3Properties.maxMemoryAllocationSize),                                                                                             LIM_MIN_DEVSIZE(1<<30) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan11Properties.maxPerSetDescriptors),                                                                                                    LIM_MIN_UINT32(1024) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan11Properties.maxMemoryAllocationSize),                                                                                                 LIM_MIN_DEVSIZE(1<<30) },
+
+               // VK_EXT_conservative_rasterization
+               { PN(conservativeRasterizationEXT),                             PN(conservativeRasterizationPropertiesEXT.primitiveOverestimationSize),                                                 LIM_MIN_FLOAT(0.0f) },
+               { PN(conservativeRasterizationEXT),                             PN(conservativeRasterizationPropertiesEXT.maxExtraPrimitiveOverestimationSize),                                 LIM_MIN_FLOAT(0.0f) },
+               { PN(conservativeRasterizationEXT),                             PN(conservativeRasterizationPropertiesEXT.extraPrimitiveOverestimationSizeGranularity),                 LIM_MIN_FLOAT(0.0f) },
+
+               // VK_EXT_descriptor_indexing
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxUpdateAfterBindDescriptorsInAllPools),                                    LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers),                               LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers),                 LIM_MIN_UINT32(12) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers),                 LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages),                  LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages),                  LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments),               LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources),                                                LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers),                                    LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers),                              LIM_MIN_UINT32(shaderStages * 12) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),               LIM_MIN_UINT32(8) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers),                              LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),               LIM_MIN_UINT32(4) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages),                               LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages),                               LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments),                    LIM_MIN_UINT32(500000) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSamplers),                               LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindUniformBuffers),                 LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageBuffers),                 LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindSampledImages),                  LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindStorageImages),                  LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInputAttachments),               LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxPerStageUpdateAfterBindResources),                                                LIM_MIN_UINT32(limits.maxPerStageResources) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSamplers),                                    LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffers),                              LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),               LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffers),                              LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),               LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindSampledImages),                               LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindStorageImages),                               LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
+               { PN(descriptorIndexingEXT),                                    PN(descriptorIndexingPropertiesEXT.maxDescriptorSetUpdateAfterBindInputAttachments),                    LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
+
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxUpdateAfterBindDescriptorsInAllPools),                                                                 LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers),                                                    LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers),                                              LIM_MIN_UINT32(12) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers),                                              LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages),                                               LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages),                                               LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments),                                    LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageUpdateAfterBindResources),                                                                             LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers),                                                                 LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers),                                                   LIM_MIN_UINT32(shaderStages * 12) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),                                    LIM_MIN_UINT32(8) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers),                                                   LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),                                    LIM_MIN_UINT32(4) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages),                                                    LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages),                                                    LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments),                                                 LIM_MIN_UINT32(500000) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSamplers),                                                    LIM_MIN_UINT32(limits.maxPerStageDescriptorSamplers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindUniformBuffers),                                              LIM_MIN_UINT32(limits.maxPerStageDescriptorUniformBuffers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageBuffers),                                              LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageBuffers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindSampledImages),                                               LIM_MIN_UINT32(limits.maxPerStageDescriptorSampledImages) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindStorageImages),                                               LIM_MIN_UINT32(limits.maxPerStageDescriptorStorageImages) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageDescriptorUpdateAfterBindInputAttachments),                                    LIM_MIN_UINT32(limits.maxPerStageDescriptorInputAttachments) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxPerStageUpdateAfterBindResources),                                                                             LIM_MIN_UINT32(limits.maxPerStageResources) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSamplers),                                                                 LIM_MIN_UINT32(limits.maxDescriptorSetSamplers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffers),                                                   LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindUniformBuffersDynamic),                                    LIM_MIN_UINT32(limits.maxDescriptorSetUniformBuffersDynamic) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffers),                                                   LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffers) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageBuffersDynamic),                                    LIM_MIN_UINT32(limits.maxDescriptorSetStorageBuffersDynamic) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindSampledImages),                                                    LIM_MIN_UINT32(limits.maxDescriptorSetSampledImages) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindStorageImages),                                                    LIM_MIN_UINT32(limits.maxDescriptorSetStorageImages) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxDescriptorSetUpdateAfterBindInputAttachments),                                                 LIM_MIN_UINT32(limits.maxDescriptorSetInputAttachments) },
+
+               // VK_EXT_inline_uniform_block
+               { PN(inlineUniformBlockEXT),                                    PN(inlineUniformBlockPropertiesEXT.maxInlineUniformBlockSize),                                                                  LIM_MIN_UINT32(256) },
+               { PN(inlineUniformBlockEXT),                                    PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorInlineUniformBlocks),                                   LIM_MIN_UINT32(4) },
+               { PN(inlineUniformBlockEXT),                                    PN(inlineUniformBlockPropertiesEXT.maxPerStageDescriptorUpdateAfterBindInlineUniformBlocks),    LIM_MIN_UINT32(4) },
+               { PN(inlineUniformBlockEXT),                                    PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetInlineUniformBlocks),                                                LIM_MIN_UINT32(4) },
+               { PN(inlineUniformBlockEXT),                                    PN(inlineUniformBlockPropertiesEXT.maxDescriptorSetUpdateAfterBindInlineUniformBlocks),                 LIM_MIN_UINT32(4) },
+
+               // VK_EXT_vertex_attribute_divisor
+               { PN(vertexAttributeDivisorEXT),                                PN(vertexAttributeDivisorPropertiesEXT.maxVertexAttribDivisor),                                                                 LIM_MIN_UINT32((1<<16) - 1) },
+
+               // VK_NV_mesh_shader
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxDrawMeshTasksCount),                                                                                               LIM_MIN_UINT32(deUint32((1ull<<16) - 1)) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskWorkGroupInvocations),                                                                                 LIM_MIN_UINT32(32) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[0]),                                                                                             LIM_MIN_UINT32(32) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[1]),                                                                                             LIM_MIN_UINT32(1) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskWorkGroupSize[2]),                                                                                             LIM_MIN_UINT32(1) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskTotalMemorySize),                                                                                              LIM_MIN_UINT32(16384) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxTaskOutputCount),                                                                                                  LIM_MIN_UINT32((1<<16) - 1) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshWorkGroupInvocations),                                                                                 LIM_MIN_UINT32(32) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[0]),                                                                                             LIM_MIN_UINT32(32) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[1]),                                                                                             LIM_MIN_UINT32(1) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshWorkGroupSize[2]),                                                                                             LIM_MIN_UINT32(1) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshTotalMemorySize),                                                                                              LIM_MIN_UINT32(16384) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshOutputVertices),                                                                                               LIM_MIN_UINT32(256) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshOutputPrimitives),                                                                                             LIM_MIN_UINT32(256) },
+               { PN(meshShaderNV),                                                             PN(meshShaderPropertiesNV.maxMeshMultiviewViewCount),                                                                                   LIM_MIN_UINT32(1) },
+
+               // VK_EXT_transform_feedback
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreams),                                                                 LIM_MIN_UINT32(1) },
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBuffers),                                                                 LIM_MIN_UINT32(1) },
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferSize),                                                              LIM_MIN_DEVSIZE(1ull<<27) },
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackStreamDataSize),                                                  LIM_MIN_UINT32(512) },
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataSize),                                                  LIM_MIN_UINT32(512) },
+               { PN(transformFeedbackEXT),                                             PN(transformFeedbackPropertiesEXT.maxTransformFeedbackBufferDataStride),                                                LIM_MIN_UINT32(512) },
+
+               // fragmentDensityMap
+               { PN(fragmentDensityMapEXT),                                    PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.width),                                                  LIM_MIN_UINT32(1) },
+               { PN(fragmentDensityMapEXT),                                    PN(fragmentDensityMapPropertiesEXT.minFragmentDensityTexelSize.height),                                                 LIM_MIN_UINT32(1) },
+               { PN(fragmentDensityMapEXT),                                    PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.width),                                                  LIM_MIN_UINT32(1) },
+               { PN(fragmentDensityMapEXT),                                    PN(fragmentDensityMapPropertiesEXT.maxFragmentDensityTexelSize.height),                                                 LIM_MIN_UINT32(1) },
+
+               // VK_NV_ray_tracing
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.shaderGroupHandleSize),                                                                                               LIM_MIN_UINT32(16) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.maxRecursionDepth),                                                                                                   LIM_MIN_UINT32(31) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.shaderGroupBaseAlignment),                                                                                    LIM_MIN_UINT32(64) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.maxGeometryCount),                                                                                                    LIM_MIN_UINT32((1<<24)-1) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.maxInstanceCount),                                                                                                    LIM_MIN_UINT32((1<<24)-1) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.maxTriangleCount),                                                                                                    LIM_MIN_UINT32((1<<29)-1) },
+               { PN(rayTracingNV),                                                             PN(rayTracingPropertiesNV.maxDescriptorSetAccelerationStructures),                                                              LIM_MIN_UINT32(16) },
+
+               // timelineSemaphore
+               { PN(timelineSemaphoreKHR),                                             PN(timelineSemaphorePropertiesKHR.maxTimelineSemaphoreValueDifference),                                                 LIM_MIN_DEVSIZE((1ull<<31) - 1) },
+               { PN(checkVulkan12Limit),                                               PN(vulkan12Properties.maxTimelineSemaphoreValueDifference),                                                                             LIM_MIN_DEVSIZE((1ull<<31) - 1) },
+
+               // VK_EXT_line_rasterization
+               { PN(lineRasterizationEXT),                                             PN(lineRasterizationPropertiesEXT.lineSubPixelPrecisionBits),                                                                   LIM_MIN_UINT32(4) },
+       };
+
+       log << TestLog::Message << limits << TestLog::EndMessage;
+
+       for (deUint32 ndx = 0; ndx < DE_LENGTH_OF_ARRAY(featureLimitTable); ndx++)
+       {
+               bool    limitOk         = true;
+
+               if (*((VkBool32*)featureLimitTable[ndx].cond) == DE_FALSE)
+               {
+                       log << TestLog::Message
+                               << "Limit validation skipped '" << featureLimitTable[ndx].name << "' due to "
+                               << featureLimitTable[ndx].condName << " == false'"
+                               << TestLog::EndMessage;
+
+                       continue;
+               }
+
+               switch (featureLimitTable[ndx].format)
+               {
+                       case LIMIT_FORMAT_UNSIGNED_INT:
+                       {
+                               const deUint32  limitToCheck    = featureLimitTable[ndx].uintVal;
+                               const deUint32  reportedValue   = *(deUint32*)featureLimitTable[ndx].ptr;
+
+                               limitOk = validateNumericLimit(limitToCheck, reportedValue, featureLimitTable[ndx].type, featureLimitTable[ndx].name, log);
+
+                               break;
+                       }
+
+                       case LIMIT_FORMAT_FLOAT:
+                       {
+                               const float             limitToCheck    = featureLimitTable[ndx].floatVal;
+                               const float             reportedValue   = *(float*)featureLimitTable[ndx].ptr;
+
+                               limitOk = validateNumericLimit(limitToCheck, reportedValue, featureLimitTable[ndx].type, featureLimitTable[ndx].name, log);
+
+                               break;
+                       }
+
+                       case LIMIT_FORMAT_SIGNED_INT:
+                       {
+                               const deInt32   limitToCheck    = featureLimitTable[ndx].intVal;
+                               const deInt32   reportedValue   = *(deInt32*)featureLimitTable[ndx].ptr;
+
+                               limitOk = validateNumericLimit(limitToCheck, reportedValue, featureLimitTable[ndx].type, featureLimitTable[ndx].name, log);
+
+                               break;
+                       }
+
+                       case LIMIT_FORMAT_DEVICE_SIZE:
+                       {
+                               const deUint64  limitToCheck    = featureLimitTable[ndx].deviceSizeVal;
+                               const deUint64  reportedValue   = *(deUint64*)featureLimitTable[ndx].ptr;
+
+                               limitOk = validateNumericLimit(limitToCheck, reportedValue, featureLimitTable[ndx].type, featureLimitTable[ndx].name, log);
+
+                               break;
+                       }
+
+                       case LIMIT_FORMAT_BITMASK:
+                       {
+                               const deUint32  limitToCheck    = featureLimitTable[ndx].uintVal;
+                               const deUint32  reportedValue   = *(deUint32*)featureLimitTable[ndx].ptr;
+
+                               limitOk = validateBitmaskLimit(limitToCheck, reportedValue, featureLimitTable[ndx].type, featureLimitTable[ndx].name, log);
+
+                               break;
+                       }
+
+                       default:
+                               TCU_THROW(InternalError, "Unknown LimitFormat specified");
+               }
+
+               limitsOk = limitsOk && limitOk;
+       }
+
+       if (limits.maxFramebufferWidth > limits.maxViewportDimensions[0] ||
+               limits.maxFramebufferHeight > limits.maxViewportDimensions[1])
+       {
+               log << TestLog::Message << "limit validation failed, maxFramebufferDimension of "
+                       << "[" << limits.maxFramebufferWidth << ", " << limits.maxFramebufferHeight << "] "
+                       << "is larger than maxViewportDimension of "
+                       << "[" << limits.maxViewportDimensions[0] << ", " << limits.maxViewportDimensions[1] << "]" << TestLog::EndMessage;
+               limitsOk = false;
+       }
+
+       if (limits.viewportBoundsRange[0] > float(-2 * limits.maxViewportDimensions[0]))
+       {
+               log << TestLog::Message << "limit validation failed, viewPortBoundsRange[0] of " << limits.viewportBoundsRange[0]
+                       << "is larger than -2*maxViewportDimension[0] of " << -2*limits.maxViewportDimensions[0] << TestLog::EndMessage;
+               limitsOk = false;
+       }
+
+       if (limits.viewportBoundsRange[1] < float(2 * limits.maxViewportDimensions[1] - 1))
+       {
+               log << TestLog::Message << "limit validation failed, viewportBoundsRange[1] of " << limits.viewportBoundsRange[1]
+                       << "is less than 2*maxViewportDimension[1] of " << 2*limits.maxViewportDimensions[1] << TestLog::EndMessage;
+               limitsOk = false;
+       }
+
+       if (limitsOk)
+               return tcu::TestStatus::pass("pass");
+       else
+               return tcu::TestStatus::fail("fail");
+#      undef PN
+}
+
 template<typename T>
 class CheckIncompleteResult
 {
@@ -4582,6 +5136,7 @@ tcu::TestCaseGroup* createFeatureInfoTests (tcu::TestContext& testCtx)
                addFunctionCase(extendedPropertiesTests.get(), "properties",                                            "Extended Vulkan 1.2 Device Properties",                                        devicePropertiesVulkan12);
                addFunctionCase(extendedPropertiesTests.get(), "feature_extensions_consistency",        "Vulkan 1.2 consistency between Features and Extensions",       deviceFeatureExtensionsConsistencyVulkan12);
                addFunctionCase(extendedPropertiesTests.get(), "property_extensions_consistency",       "Vulkan 1.2 consistency between Properties and Extensions", devicePropertyExtensionsConsistencyVulkan12);
+               addFunctionCase(extendedPropertiesTests.get(), "limits_validation",                                     "Vulkan 1.2 Limit validation",                                                          validateLimitsCheckSupport, validateLimits12);
 
                infoTests->addChild(extendedPropertiesTests.release());
        }
index 2dea37c..0c847c7 100644 (file)
@@ -1431,6 +1431,7 @@ dEQP-VK.api.info.vulkan1p2.features
 dEQP-VK.api.info.vulkan1p2.properties
 dEQP-VK.api.info.vulkan1p2.feature_extensions_consistency
 dEQP-VK.api.info.vulkan1p2.property_extensions_consistency
+dEQP-VK.api.info.vulkan1p2.limits_validation
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4_unorm_pack8
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4b4a4_unorm_pack16
 dEQP-VK.api.info.image_format_properties2.1d.optimal.b4g4r4a4_unorm_pack16
index 8d865f3..900e2fe 100644 (file)
@@ -1431,6 +1431,7 @@ dEQP-VK.api.info.vulkan1p2.features
 dEQP-VK.api.info.vulkan1p2.properties
 dEQP-VK.api.info.vulkan1p2.feature_extensions_consistency
 dEQP-VK.api.info.vulkan1p2.property_extensions_consistency
+dEQP-VK.api.info.vulkan1p2.limits_validation
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4_unorm_pack8
 dEQP-VK.api.info.image_format_properties2.1d.optimal.r4g4b4a4_unorm_pack16
 dEQP-VK.api.info.image_format_properties2.1d.optimal.b4g4r4a4_unorm_pack16