nir: Add system values from ARB_shader_ballot
authorMatt Turner <mattst88@gmail.com>
Thu, 22 Jun 2017 23:37:51 +0000 (16:37 -0700)
committerMatt Turner <mattst88@gmail.com>
Thu, 20 Jul 2017 23:56:49 +0000 (16:56 -0700)
commit43ef75b394f1cd779a54a22fe16fbb5ef23f0458
tree60122c01065572e95fa49b427d7a0cfbc6066542
parent636fe4d1c6b21e9efecd4bce1cedd67afa33343a
nir: Add system values from ARB_shader_ballot

We already had a channel_num system value, which I'm renaming to
subgroup_invocation to match the rest of the new system values.

Note that while ballotARB(true) will return zeros in the high 32-bits on
systems where gl_SubGroupSizeARB <= 32, the gl_SubGroup??MaskARB
variables do not consider whether channels are enabled. See issue (1) of
ARB_shader_ballot.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
src/compiler/nir/nir.c
src/compiler/nir/nir.h
src/compiler/nir/nir_intrinsics.h
src/compiler/nir/nir_lower_system_values.c
src/compiler/nir/nir_opt_intrinsics.c
src/intel/compiler/brw_fs_nir.cpp
src/intel/compiler/brw_nir_intrinsics.c