Fix for dEQP-VK.subgroups.*_requiredsubgroupsize
authorCharles Johnston <Charles.Johnston@amd.com>
Wed, 22 Jul 2020 16:54:13 +0000 (12:54 -0400)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Fri, 31 Jul 2020 13:06:05 +0000 (09:06 -0400)
The tests in the group dEQP-VK.subgroups.*_requiredsubgroupsize do
not check if requiredSubgroupSizeStages from the structure
VkPhysicalDeviceSubgroupSizeControlPropertiesEXT contain the
shader stage the tests are using.

Affected tests:
dEQP-VK.subgroups.*_requiredsubgroupsize

Components: Vulkan
VK-GL-CTS issue: 2494

Change-Id: I2a932248698658a75364b9adc907f5454ff1d969

14 files changed:
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsArithmeticTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotMasksTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotOtherTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBasicTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinMaskVarTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBuiltinVarTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsClusteredTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsPartitionedTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsQuadTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShapeTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsShuffleTests.cpp
external/vulkancts/modules/vulkan/subgroups/vktSubgroupsVoteTests.cpp

index f6cd13a..d9182f3 100755 (executable)
@@ -273,6 +273,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index dbc7b25..26bddd6 100755 (executable)
@@ -284,6 +284,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 1274730..c622f7a 100755 (executable)
@@ -425,6 +425,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 4fa0e3c..eb039a7 100755 (executable)
@@ -491,6 +491,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index d983650..b8260e7 100755 (executable)
@@ -939,6 +939,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index fe0bbd7..9d0b8c9 100755 (executable)
@@ -1879,6 +1879,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 9661ec1..047ddea 100755 (executable)
@@ -1378,6 +1378,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 48a2102..afb033b 100755 (executable)
@@ -1608,6 +1608,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 294e126..1e9ff24 100755 (executable)
@@ -192,6 +192,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 89b038a..3f0e552 100755 (executable)
@@ -595,6 +595,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 0f1d443..004104b 100755 (executable)
@@ -237,6 +237,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index d2a5ad0..82a828c 100755 (executable)
@@ -489,6 +489,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index 53176ed..457167a 100755 (executable)
@@ -485,6 +485,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);
index fd3bd55..0416791 100755 (executable)
@@ -645,6 +645,19 @@ void supportedCheck (Context& context, CaseDefinition caseDef)
 
                if (subgroupSizeControlFeatures.computeFullSubgroups == DE_FALSE)
                        TCU_THROW(NotSupportedError, "Device does not support full subgroups in compute shaders");
+
+               VkPhysicalDeviceSubgroupSizeControlPropertiesEXT subgroupSizeControlProperties;
+               subgroupSizeControlProperties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_SUBGROUP_SIZE_CONTROL_PROPERTIES_EXT;
+               subgroupSizeControlProperties.pNext = DE_NULL;
+
+               VkPhysicalDeviceProperties2 properties;
+               properties.sType = VK_STRUCTURE_TYPE_PHYSICAL_DEVICE_PROPERTIES_2;
+               properties.pNext = &subgroupSizeControlProperties;
+
+               context.getInstanceInterface().getPhysicalDeviceProperties2(context.getPhysicalDevice(), &properties);
+
+               if ((subgroupSizeControlProperties.requiredSubgroupSizeStages & caseDef.shaderStage) != caseDef.shaderStage)
+                       TCU_THROW(NotSupportedError, "Required subgroup size is not supported for shader stage");
        }
 
        *caseDef.geometryPointSizeSupported = subgroups::isTessellationAndGeometryPointSizeSupported(context);