[Mesa-dev] [PATCH 147/133] nir: Make intrinsic flags into an enum
Connor Abbott
cwabbott0 at gmail.com
Thu Jan 8 17:01:33 PST 2015
On Tue, Jan 6, 2015 at 6:27 PM, Jason Ekstrand <jason at jlekstrand.net> wrote:
>
>
> On Mon, Jan 5, 2015 at 11:26 PM, Connor Abbott <cwabbott0 at gmail.com> wrote:
>>
>> Can you make the fields lowercase to match the algebraic properties
>> enum? Or did you make that uppercase? Lowercase feels better to me
>> since it's an enum, but I don't really care too much.
>
>
> I prefer upper-case for bitfields which is really what it is. I also did
> that for the algebraic properties.
>
> FWIW, I considered moving the other enums to upper-case but it was too much
> typing and they're probably fine as-is.
Ok... personally I would prefer lower-case, since it's an enum value
and not a #define, but I don't care enough to bikeshed so... meh.
Reviewed-by: Connor Abbott <cwabbott0 at gmail.com>
>
>>
>>
>> On Fri, Dec 19, 2014 at 8:02 PM, Jason Ekstrand <jason at jlekstrand.net>
>> wrote:
>> > This should be much better for debugging as GDB will pick up on the fact
>> > that it's an enum and actually tell you what you're looking at instead
>> > of
>> > giving you some arbitrary hex value you have to go look up.
>> > ---
>> > src/glsl/nir/nir.h | 28 ++++++++++++++--------------
>> > 1 file changed, 14 insertions(+), 14 deletions(-)
>> >
>> > diff --git a/src/glsl/nir/nir.h b/src/glsl/nir/nir.h
>> > index 8b3c2c2..ab9383e 100644
>> > --- a/src/glsl/nir/nir.h
>> > +++ b/src/glsl/nir/nir.h
>> > @@ -754,20 +754,20 @@ typedef struct {
>> > *
>> > * \sa nir_intrinsic_info::flags
>> > */
>> > -/*@{*/
>> > -/**
>> > - * whether the intrinsic can be safely eliminated if none of its
>> > register
>> > - * outputs are being used.
>> > - */
>> > -#define NIR_INTRINSIC_CAN_ELIMINATE (1 << 0)
>> > +typedef enum {
>> > + /**
>> > + * whether the intrinsic can be safely eliminated if none of its
>> > output
>> > + * value is not being used.
>> > + */
>> > + NIR_INTRINSIC_CAN_ELIMINATE = (1 << 0),
>> >
>> > -/**
>> > - * Whether the intrinsic can be reordered with respect to any other
>> > intrinsic,
>> > - * i.e. whether the only reodering dependencies of the intrinsic are
>> > due to the
>> > - * register reads/writes.
>> > - */
>> > -#define NIR_INTRINSIC_CAN_REORDER (1 << 1)
>> > -/*@}*/
>> > + /**
>> > + * Whether the intrinsic can be reordered with respect to any other
>> > + * intrinsic, i.e. whether the only reordering dependencies of the
>> > + * intrinsic are due to the register reads/writes.
>> > + */
>> > + NIR_INTRINSIC_CAN_REORDER = (1 << 1),
>> > +} nir_intrinsic_semantic_flag;
>> >
>> > #define NIR_INTRINSIC_MAX_INPUTS 4
>> >
>> > @@ -799,7 +799,7 @@ typedef struct {
>> > unsigned num_indices;
>> >
>> > /** semantic flags for calls to this intrinsic */
>> > - unsigned flags;
>> > + nir_intrinsic_semantic_flag flags;
>> > } nir_intrinsic_info;
>> >
>> > extern const nir_intrinsic_info
>> > nir_intrinsic_infos[nir_num_intrinsics];
>> > --
>> > 2.2.0
>> >
>> > _______________________________________________
>> > mesa-dev mailing list
>> > mesa-dev at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
>
>
More information about the mesa-dev
mailing list