OSDN Git Service

nir/opt_intrinsics: Fix values for gl_SubGroupG{e,t}MaskARB
authorNeil Roberts <nroberts@igalia.com>
Tue, 31 Oct 2017 14:05:33 +0000 (15:05 +0100)
committerNeil Roberts <nroberts@igalia.com>
Tue, 31 Oct 2017 22:28:00 +0000 (23:28 +0100)
commitb697ece10aa041b8653eb184d73dcf5b846729a3
treea64f86796c6a5cd7906b014b3b0a71ddf542174b
parent9e849eb8bb97259136b40dc2b06f42a81cfd3dae
nir/opt_intrinsics: Fix values for gl_SubGroupG{e,t}MaskARB

Previously the values were calculated by just shifting ~0 by the
invocation ID. This would end up including bits that are higher than
gl_SubGroupSizeARB. The corresponding CTS test effectively requires that
these high bits be zero so it was failing. There is a Piglit test as
well but this appears to checking the wrong values so it passes.

For the two greater-than bitmasks, this patch adds an extra mask with
(~0>>(64-gl_SubGroupSizeARB)) to force these bits to zero.

Fixes: KHR-GL45.shader_ballot_tests.ShaderBallotBitmasks

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102680#c3
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Neil Roberts <nroberts@igalia.com>
src/compiler/nir/nir_opt_intrinsics.c