[Mesa-dev] [PATCH 0/3] nir: Convert nir_variable_mode to a bitfield
Iago Toral
itoral at igalia.com
Wed Apr 13 10:43:57 UTC 2016
On Mon, 2016-04-11 at 13:50 -0700, Jason Ekstrand wrote:
> This tiny series converts nir_var_mode to be a bitfield instead of a
> regular enum and then converts two of the passes that currently take a mode
> to handle the new bitfield. The reason for this is that a number of
> different passes want to be able to act on some subset of the modes and can
> run more efficiently if they are called once with that set rather than once
> per mode.
I guess you intend to send patches for those other passes after you land
this?
> I'm not 100% sold on making it a bitfield and asserting only one bit is set
> in nir_validate. This isn't the standard pattern in the mesa compiler
> stack today so it may throw people off. It still looks kind of strage to
> me. On the other hand, it does have the potential to make things look
> nicer and gdb will pretty-print it for you. For what it's worth, the
> Khronos group settled on using this pattern for bitfield-capable enums in
> Vulkan. Rob seems to prefer this over a regular enum and using (1 << mode)
> everywhere so, unless there are major objections, we'll probably go with
> it.
I don't have a particular preference myself, so if nobody else has
objections, the series is:
Reviewed-by: Iago Toral Quiroga <itoral at igalia.com>
> Cc: Kenneth Graunke <kenneth at whitecape.org>
> Cc: Eric Anholt <eric at anholt.net>
> Cc: Connor Abbott <cwabbott0 at gmail.com>
> Cc: Rob Clark <robclark at gmail.com>
>
> Jason Ekstrand (3):
> nir: Convert nir_variable_mode to a bitfield
> nir/lower_indirect: nir_variable_mode is now a bitfield
> nir/lower_io: Allow for a full bitmask of modes
>
> src/compiler/nir/nir.h | 37 ++++++++++++++--------------
> src/compiler/nir/nir_lower_indirect_derefs.c | 12 ++++-----
> src/compiler/nir/nir_lower_io.c | 12 ++++-----
> src/compiler/nir/nir_validate.c | 3 +++
> 4 files changed, 33 insertions(+), 31 deletions(-)
>
More information about the mesa-dev
mailing list