From fa9244bce9608c01e4dfe49d1e1c108b9d3bdd65 Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Wed, 12 Jul 2017 18:44:11 -0700 Subject: [PATCH] Use 64-bit math in work group size assertion. If the maximum workgroup size in each dimension is large enough, this can overflow, causing the comparison to fail. For example, on Intel Haswell, we get: assert(2048 * 2048 * 2048 > 2048) -> assert(0 > 2048) -> fail Casting one value to deInt64 causes the multiplications to occur as 64-bit values, so we don't overflow. Affects: dEQP-GLES31.functional.debug.negative_coverage.*.compute.invalid_maximum_work_group_sizes Components: AOSP Change-Id: Ie03627a378f4fdc46ce241bbdd3693ae829c217d --- modules/gles31/functional/es31fNegativeComputeTests.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/gles31/functional/es31fNegativeComputeTests.cpp b/modules/gles31/functional/es31fNegativeComputeTests.cpp index 8fc9f10..8d492ab 100644 --- a/modules/gles31/functional/es31fNegativeComputeTests.cpp +++ b/modules/gles31/functional/es31fNegativeComputeTests.cpp @@ -646,7 +646,7 @@ void invalid_maximum_work_group_sizes (NegativeTestContext& ctx) ctx.glGetIntegerv(GL_MAX_COMPUTE_WORK_GROUP_INVOCATIONS, &maxWorkGroupInvocations); ctx.expectError(GL_NO_ERROR); - DE_ASSERT((maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations ); + DE_ASSERT(((deInt64) maxWorkGroupSizeX * maxWorkGroupSizeY * maxWorkGroupSizeZ) > maxWorkGroupInvocations ); const bool isES32 = glu::contextSupports(ctx.getRenderContext().getType(), glu::ApiType::es(3, 2)); const char* const shaderVersion = isES32 -- 2.7.4