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.