From: Graeme Leese Date: Fri, 6 Sep 2019 14:24:19 +0000 (+0100) Subject: Extend non-const broadcast tests X-Git-Tag: upstream/1.3.5~1527^2~48 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=bb55580699c09f4ac8959739a93795e79849cf9b;p=platform%2Fupstream%2FVK-GL-CTS.git Extend non-const broadcast tests Add an extra broadcast to the _nonconst tests that uses a lane index that is dynamically uniform but not subgroup uniform. Components: Vulkan Affects: dEQP-VK.subgroups.ballot_broadcast.*_nonconst_* Change-Id: I9cd077e0e1d3f8451e72d42d34ae1f44d26a5ec2 --- diff --git a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp index 76965ff..3ec42cb 100755 --- a/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp +++ b/external/vulkancts/modules/vulkan/subgroups/vktSubgroupsBallotBroadcastTests.cpp @@ -115,15 +115,16 @@ std::string getBodySource(CaseDefinition caseDef) << " uint sgInvocation = gl_SubgroupInvocationID;\n"; } - if (OPTYPE_BROADCAST == caseDef.opType) + const std::string fmt = subgroups::getFormatNameForGLSL(caseDef.format); + + if (caseDef.opType == OPTYPE_BROADCAST) { bdy << " uint tempResult = 0x3;\n"; for (int i = 0; i < max; i++) { bdy << " {\n" << " const uint id = "<< i << ";\n" - << " " << subgroups::getFormatNameForGLSL(caseDef.format) << " op = " - << broadcast << "(data1[sgInvocation], id);\n" + << " " << fmt << " op = " << broadcast << "(data1[sgInvocation], id);\n" << " if ((id < sgSize) && subgroupBallotBitExtract(mask, id))\n" << " {\n" << " if (op != data1[id])\n" @@ -134,20 +135,23 @@ std::string getBodySource(CaseDefinition caseDef) << " }\n"; } } - else if (OPTYPE_BROADCAST_NONCONST == caseDef.opType) + else if (caseDef.opType == OPTYPE_BROADCAST_NONCONST) { + const std::string validate = " if (subgroupBallotBitExtract(mask, id) && op != data1[id])\n" + " tempResult = 0;\n"; + bdy << " uint tempResult = 0x3;\n" << " for (uint id = 0; id < sgSize; id++)\n" << " {\n" - << " " << subgroups::getFormatNameForGLSL(caseDef.format) << " op = " - << broadcast << "(data1[sgInvocation], id);\n" - << " if (subgroupBallotBitExtract(mask, id))\n" - << " {\n" - << " if (op != data1[id])\n" - << " {\n" - << " tempResult = 0;\n" - << " }\n" - << " }\n" + << " " << fmt << " op = " << broadcast << "(data1[sgInvocation], id);\n" + << validate + << " }\n" + << " // Test lane id that is only uniform across active lanes\n" + << " if (sgInvocation >= sgSize / 2)\n" + << " {\n" + << " uint id = sgInvocation & ~((sgSize / 2) - 1);\n" + << " " << fmt << " op = " << broadcast << "(data1[sgInvocation], id);\n" + << validate << " }\n"; } else