Commit 7322195e by Nicolas Capens

Use safer typed enums.

Bug 19331817 Change-Id: I75787c6a9df3bca539dcaf3a1d3f0e49994c73b4 Reviewed-on: https://swiftshader-review.googlesource.com/2390Tested-by: 's avatarNicolas Capens <capn@google.com> Reviewed-by: 's avatarAlexis Hétu <sugoi@google.com> Reviewed-by: 's avatarNicolas Capens <capn@google.com>
parent e9233fb7
......@@ -10,7 +10,7 @@
//
// Precision qualifiers
//
enum TPrecision
enum TPrecision : unsigned char
{
// These need to be kept sorted
EbpUndefined,
......@@ -33,7 +33,7 @@ inline const char* getPrecisionString(TPrecision p)
//
// Basic type. Arrays, vectors, etc., are orthogonal to this.
//
enum TBasicType
enum TBasicType : unsigned char
{
EbtVoid,
EbtFloat,
......@@ -97,7 +97,7 @@ inline bool IsSampler(TBasicType type)
// to allocate variables in. Since built-ins tend to go to different registers
// than varying or uniform, it makes sense they are peers, not sub-classes.
//
enum TQualifier
enum TQualifier : unsigned char
{
EvqTemporary, // For temporaries (within a function), read/write
EvqGlobal, // For globals read/write
......
......@@ -241,17 +241,17 @@ protected:
int getStructSize() const;
void computeDeepestStructNesting();
TBasicType type : 6;
TBasicType type;
TPrecision precision;
TQualifier qualifier : 7;
int size : 8; // size of vector or matrix, not size of array
unsigned int matrix : 1;
unsigned int array : 1;
TQualifier qualifier;
unsigned char size; // size of vector or matrix, not size of array
bool matrix;
bool array;
int arraySize;
int maxArraySize;
TType* arrayInformationType;
TType *arrayInformationType;
TTypeList* structure; // 0 unless this is a struct
TTypeList *structure; // 0 unless this is a struct
mutable int structureSize;
int deepestStructNesting;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment