Fixing the size evaluation for compressed texture and gpu::Element Type enum

This commit is contained in:
samcake 2018-05-08 15:57:27 -07:00
parent 6ac43c34c2
commit 44e7541888

View file

@ -50,47 +50,50 @@ enum Type : uint8_t {
}; };
// Array providing the size in bytes for a given scalar type // Array providing the size in bytes for a given scalar type
static const int TYPE_SIZE[NUM_TYPES] = { static const int TYPE_SIZE[NUM_TYPES] = {
4, 4, // FLOAT
4, 4, // INT32
4, 4, // UINT32
2, 2, // HALF
2, 2, // INT16
2, 2, // UINT16
1, 1, // INT8
1, 1, // UINT8
// normalized values // normalized values
4, 4, // NINT32
4, 4, // NUINT32
2, 2, // NINT16
2, 2, // NUINT16
1, 1, // NINT8
1, 1, // NUINT8
4, 1, // NUINT2
1, // NINT2_10_10_10
1 1, // COMPRESSED
}; };
// Array answering the question Does this type is integer or not // Array answering the question Does this type is integer or not
static const bool TYPE_IS_INTEGER[NUM_TYPES] = { static const bool TYPE_IS_INTEGER[NUM_TYPES] = {
false, false, // FLOAT
true, true, // INT32
true, true, // UINT32
false, false, // HALF
true, true, // INT16
true, true, // UINT16
true, true, // INT8
true, true, // UINT8
// Normalized values // Normalized values
false, false, // NINT32
false, false, // NUINT32
false, false, // NINT16
false, false, // NUINT16
false, false, // NINT8
false, false, // NUINT8
false, false, // NUINT2
false, // NINT2_10_10_10
false, false, // COMPRESSED
}; };
// Dimension of an Element // Dimension of an Element
@ -367,9 +370,9 @@ public:
static const Element PART_DRAWCALL; static const Element PART_DRAWCALL;
protected: protected:
uint8 _semantic; uint16 _semantic : 7;
uint8 _dimension : 4; uint16 _dimension : 4;
uint8 _type : 4; uint16 _type : 5;
}; };