Fix random bool generation in GL subgroup tests
authorGraeme Leese <gleese@broadcom.com>
Wed, 18 Sep 2019 10:48:16 +0000 (11:48 +0100)
committerAlexander Galazin <Alexander.Galazin@arm.com>
Tue, 8 Oct 2019 07:57:17 +0000 (03:57 -0400)
This is a port of https://gerrit.khronos.org/c/4594/ to the GL version
of the subgroups tests.

Components: OpenGL
VK-GL-CTS issue: 1998
Affects: KHR-Single-*.subgroups.*_bool*
         KHR-Single-*.subgroups.*_bvec*

Change-Id: I89e9e6bca667043f32ee2698064b16b7dbd2e4a0

external/openglcts/modules/common/subgroups/glcSubgroupsTestsUtils.cpp

index f579dd7..01f29b9 100755 (executable)
@@ -978,6 +978,16 @@ void initializeMemory(deqp::Context& context, glw::GLvoid *hostPtr, subgroups::S
                        case FORMAT_R32G32_BOOL:
                        case FORMAT_R32G32B32_BOOL:
                        case FORMAT_R32G32B32A32_BOOL:
+                       {
+                               deUint32* ptr = reinterpret_cast<deUint32*>(hostPtr);
+
+                               for (deUint64 k = 0; k < (size / sizeof(deUint32)); k++)
+                               {
+                                       deUint32 r = rnd.getUint32();
+                                       ptr[k] = (r & 1) ? r : 0;
+                               }
+                       }
+                       break;
                        case FORMAT_R32_SINT:
                        case FORMAT_R32G32_SINT:
                        case FORMAT_R32G32B32_SINT: