Fix regression in subgroups tests after merging 393912cd
authorSlawomir Cygan <slawomir.cygan@intel.com>
Mon, 29 Apr 2019 11:45:02 +0000 (13:45 +0200)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Thu, 9 May 2019 07:57:30 +0000 (03:57 -0400)
This extends the additional verification to catch uninitialized memory from
commit 393912cd to tests added in 1.1.3, so after 393912cd.

This fixes regression that occured on master after 393912cd was merged.

Components: Vulkan

VK-GL-CTS Issue: 1757

Change-Id: Icb7fe91ee2839626d8ebc90ae2788f85b0e835b7
Affects: dEQP-VK.subgroups.basic.framebuffer.*tess*

external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBasicTests.cpp

index 6ae6c41..078c58e 100755 (executable)
@@ -187,24 +187,28 @@ static bool _checkVertexPipelineStagesSubgroupBarriersNoSSBO(std::vector<const v
 static bool checkVertexPipelineStagesSubgroupBarriersNoSSBO(std::vector<const void*> datas,
                deUint32 width, deUint32)
 {
-    return _checkVertexPipelineStagesSubgroupBarriersNoSSBO(datas, width, false);
+       return _checkVertexPipelineStagesSubgroupBarriersNoSSBO(datas, width, false);
 }
 
 static bool checkVertexPipelineStagesSubgroupBarriersWithImageNoSSBO(std::vector<const void*> datas,
                deUint32 width, deUint32)
 {
-    return _checkVertexPipelineStagesSubgroupBarriersNoSSBO(datas, width, true);
+       return _checkVertexPipelineStagesSubgroupBarriersNoSSBO(datas, width, true);
 }
 
-static bool checkTessellationEvaluationSubgroupBarriersNoSSBO(std::vector<const void*> datas,
-               deUint32 width, deUint32)
+static bool _checkTessellationEvaluationSubgroupBarriersNoSSBO(std::vector<const void*> datas,
+               deUint32 width, deUint32, bool withImage)
 {
        const float* const      resultData      = reinterpret_cast<const float*>(datas[0]);
 
        for (deUint32 x = 0u; x < width; ++x)
        {
                const deUint32 ndx = x*4u;
-               if (0.0f == resultData[ndx +2] && resultData[ndx] != resultData[ndx +3])
+               if (!withImage && 0.0f == resultData[ndx])
+               {
+                       return false;
+               }
+               else if (0.0f == resultData[ndx +2] && resultData[ndx] != resultData[ndx +3])
                {
                        return false;
                }
@@ -212,6 +216,18 @@ static bool checkTessellationEvaluationSubgroupBarriersNoSSBO(std::vector<const
        return true;
 }
 
+static bool checkTessellationEvaluationSubgroupBarriersWithImageNoSSBO(std::vector<const void*> datas,
+       deUint32 width, deUint32 height)
+{
+       return _checkTessellationEvaluationSubgroupBarriersNoSSBO(datas, width, height, true);
+}
+
+static bool checkTessellationEvaluationSubgroupBarriersNoSSBO(std::vector<const void*> datas,
+               deUint32 width, deUint32 height)
+{
+       return _checkTessellationEvaluationSubgroupBarriersNoSSBO(datas, width, height, false);
+}
+
 static bool checkComputeSubgroupElect(std::vector<const void*> datas,
                                                                          const deUint32 numWorkgroups[3], const deUint32 localSize[3],
                                                                          deUint32)
@@ -1921,7 +1937,13 @@ tcu::TestStatus noSSBOtest (Context& context, const CaseDefinition caseDef)
                return subgroups::makeTessellationEvaluationFrameBufferTest(context, VK_FORMAT_R32G32_SFLOAT, DE_NULL, 0u, checkVertexPipelineStagesSubgroupElectNoSSBO, caseDef.shaderStage);
 
        return subgroups::makeTessellationEvaluationFrameBufferTest(context, VK_FORMAT_R32G32B32A32_SFLOAT, &inputDatas[0], inputDatasCount,
-               (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT == caseDef.shaderStage)? checkVertexPipelineStagesSubgroupBarriersNoSSBO : checkTessellationEvaluationSubgroupBarriersNoSSBO,
+               (VK_SHADER_STAGE_TESSELLATION_CONTROL_BIT == caseDef.shaderStage) ?
+                       ((OPTYPE_SUBGROUP_MEMORY_BARRIER_IMAGE == caseDef.opType) ?
+                               checkVertexPipelineStagesSubgroupBarriersWithImageNoSSBO :
+                               checkVertexPipelineStagesSubgroupBarriersNoSSBO) :
+                       ((OPTYPE_SUBGROUP_MEMORY_BARRIER_IMAGE == caseDef.opType) ?
+                               checkTessellationEvaluationSubgroupBarriersWithImageNoSSBO :
+                               checkTessellationEvaluationSubgroupBarriersNoSSBO),
                caseDef.shaderStage);
 }