Merge vk-gl-cts/vulkan-cts-1.2.6 into vk-gl-cts/vulkan-cts-1.2.7
authorMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 31 Mar 2022 19:30:35 +0000 (12:30 -0700)
committerMatthew Netsch <quic_mnetsch@quicinc.com>
Thu, 31 Mar 2022 19:30:35 +0000 (12:30 -0700)
Change-Id: I5e73a149353915a09697633abab737ee8a38fdca

1  2 
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsSizeControlTests.cpp

index f17633f72fac483cf3e1a53ad4594c1148756275,db56b709dedf34be233a757cf69dea3658d31ad8..6ce176d4caf4e1537e641d038e9f9f2b717cbe95
@@@ -688,45 -820,54 +688,49 @@@ TestStatus testRequireFullSubgroups (Co
                subgroupSize,
        };
  
 -      return subgroups::makeComputeTestRequiredSubgroupSize(context, VK_FORMAT_R32G32B32A32_UINT, DE_NULL, 0, &internalData, checkComputeRequireFull,
 -                                                                                                                caseDef.pipelineShaderStageCreateFlags, numWorkgroups, DE_FALSE, subgroupSize,
 -                                                                                                                localSizesToTest, localSizesToTestCount);
 +      return subgroups::makeComputeTestRequiredSubgroupSize(context,
 +                                                                                                                VK_FORMAT_R32G32B32A32_UINT,
 +                                                                                                                DE_NULL,
 +                                                                                                                0,
 +                                                                                                                &internalData,
 +                                                                                                                checkComputeRequireFull,
 +                                                                                                                caseDef.pipelineShaderStageCreateFlags,
 +                                                                                                                numWorkgroups,
 +                                                                                                                DE_FALSE,
 +                                                                                                                subgroupSize,
 +                                                                                                                localSizesToTest,
 +                                                                                                                localSizesToTestCount);
  }
  
 -tcu::TestStatus testRequireSubgroupSize (Context& context, const CaseDefinition caseDef)
 +TestStatus testRequireSubgroupSize (Context& context, const CaseDefinition caseDef)
  {
 -      if (VK_SHADER_STAGE_COMPUTE_BIT == caseDef.shaderStage)
 -      {
 -              const deUint32 numWorkgroups[3] = {1, 1, 1};
 -
 -              VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
 -              subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
 -              subgroupSizeControlProperties.pNext = DE_NULL;
 -
 -              VkPhysicalDeviceProperties2 properties2;
 -              properties2.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
 -              properties2.pNext = &subgroupSizeControlProperties;
 -              context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties2);
 -
 -              VkPhysicalDeviceProperties physicalDeviceProperties;
 -              context.getInstanceInterface().getPhysicalDeviceProperties(context.getPhysicalDevice(), &physicalDeviceProperties);
 -
 -              deUint32 requiredSubgroupSize = getRequiredSubgroupSizeFromMode(context, caseDef, subgroupSizeControlProperties);
 -
 -              const deUint64 maxSubgroupLimitSize = (deUint64)requiredSubgroupSize * subgroupSizeControlProperties.maxComputeWorkgroupSubgroups;
 -              const deUint32 maxTotalLocalSize = (deUint32)std::min<deUint64>(maxSubgroupLimitSize, physicalDeviceProperties.limits.maxComputeWorkGroupInvocations);
 -              deUint32 localSizeX, localSizeY, localSizeZ;
 -              getLocalSizes(physicalDeviceProperties, maxTotalLocalSize, localSizeX, localSizeY, localSizeZ);
 -
 -              deUint32 localSizesToTest[5][3] =
 +      if (isAllComputeStages(caseDef.shaderStage))
 +      {
 +              const deUint32                                                                                  numWorkgroups[3]                                                        = {1, 1, 1};
 +              const VkPhysicalDeviceSubgroupSizeControlPropertiesEXT& subgroupSizeControlProperties                           = context.getSubgroupSizeControlPropertiesEXT();
 +              const VkPhysicalDeviceProperties&                                               physicalDeviceProperties                                        = context.getDeviceProperties();
 +              const deUint32                                                                                  requiredSubgroupSize                                            = getRequiredSubgroupSizeFromMode(context, caseDef, subgroupSizeControlProperties);
 +              const deUint64                                                                                  maxSubgroupLimitSize                                            = (deUint64)requiredSubgroupSize * subgroupSizeControlProperties.maxComputeWorkgroupSubgroups;
 +              const deUint32                                                                                  maxTotalLocalSize                                                       = (deUint32)min<deUint64>(maxSubgroupLimitSize, physicalDeviceProperties.limits.maxComputeWorkGroupInvocations);
 +              const UVec3                                                                                             localSize                                                                       = getLocalSizes(physicalDeviceProperties, maxTotalLocalSize);
-               const deUint32                                                                                  localSizesToTestCount                                           = 5;
-               const deUint32                                                                                  localSizesToTest[localSizesToTestCount][3]      =
++              const deUint32                                                                                  localSizesToTest[5][3]  =
                {
 -                      {localSizeX, localSizeY, localSizeZ},
++                      {localSize.x(), localSize.y(), localSize.z()},
                        {requiredSubgroupSize, 1, 1},
                        {1, requiredSubgroupSize, 1},
                        {1, 1, requiredSubgroupSize},
-                       {localSize.x(), localSize.y(), localSize.z()},
                        {1, 1, 1} // Isn't used, just here to make double buffering checks easier
                };
-               struct internalDataStruct                                                               internalData                                                            =
+               deUint32 localSizesToTestCount = 5;
+               if (caseDef.pipelineShaderStageCreateFlags & VK_PIPELINE_SHADER_STAGE_CREATE_REQUIRE_FULL_SUBGROUPS_BIT_EXT)
+                       localSizesToTestCount = 3;
+               struct internalDataStruct internalData =
                {
 -                      &context,
 -                      caseDef,
 -                      requiredSubgroupSize,
 +                      &context,                               //  const Context*                      context;
 +                      caseDef,                                //  struct CaseDefinition       caseDef;
 +                      requiredSubgroupSize,   //  deUint32                            requiredSubgroupSize;
                };
  
                // Depending on the flag we need to run one verification function or another.