On Mon, Apr 11, 2016 at 6:48 PM, Eric Anholt <[email protected]> wrote: > Jason Ekstrand <[email protected]> writes: > >> 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'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 find it odd compared to the usual (1 << mode), but no real objection. > > Acked-by: Eric Anholt <[email protected]>
I do like the type-safety aspect and that gdb can grok this better than (1 << mode) ;-) for the series, Reviewed-by: Rob Clark <[email protected]> > _______________________________________________ > mesa-dev mailing list > [email protected] > https://lists.freedesktop.org/mailman/listinfo/mesa-dev > _______________________________________________ mesa-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/mesa-dev
