11 #ifndef hifi_gpu_Format_h
12 #define hifi_gpu_Format_h
49 NORMALIZED_START = NINT32,
52 static const int TYPE_SIZE[NUM_TYPES] = {
76 static const bool TYPE_IS_INTEGER[NUM_TYPES] = {
100 enum Dimension : uint8_t {
113 static const int DIMENSION_LOCATION_COUNT[NUM_DIMENSIONS] = {
125 static const int DIMENSION_SCALAR_COUNT_PER_LOCATION[NUM_DIMENSIONS] = {
137 static const int DIMENSION_SCALAR_COUNT[NUM_DIMENSIONS] = {
149 static const glm::ivec2 DIMENSION_TILE_DIM[NUM_DIMENSIONS] = {
162 enum Semantic : uint8_t {
193 COMPRESSED_BC1_SRGBA,
194 COMPRESSED_BC3_SRGBA,
198 COMPRESSED_BC7_SRGBA,
201 COMPRESSED_ETC2_SRGB,
202 COMPRESSED_ETC2_RGB_PUNCHTHROUGH_ALPHA,
203 COMPRESSED_ETC2_SRGB_PUNCHTHROUGH_ALPHA,
204 COMPRESSED_ETC2_RGBA,
205 COMPRESSED_ETC2_SRGBA,
207 COMPRESSED_EAC_RED_SIGNED,
209 COMPRESSED_EAC_XY_SIGNED,
228 static const int SEMANTIC_SIZE_FACTOR[NUM_SEMANTICS] = {
297 Element(Dimension dim, Type type, Semantic sem) :
344 uint8
getScalarCount()
const {
return DIMENSION_SCALAR_COUNT[(Dimension)_dimension]; }
349 uint32
getSize()
const {
return (DIMENSION_SCALAR_COUNT[_dimension] * TYPE_SIZE[_type] * SEMANTIC_SIZE_FACTOR[_semantic]); }
356 const glm::ivec2&
getTile()
const {
return (DIMENSION_TILE_DIM[_dimension]); }
371 uint32
getLocationSize()
const {
return DIMENSION_SCALAR_COUNT_PER_LOCATION[_dimension] * TYPE_SIZE[_type]; }
373 uint16 getRaw()
const {
return *((
const uint16*) (
this)); }
376 bool operator ==(
const Element& right)
const {
377 return getRaw() == right.getRaw();
379 bool operator !=(
const Element& right)
const {
380 return getRaw() != right.getRaw();
383 static const Element COLOR_R_8;
384 static const Element COLOR_SR_8;
385 static const Element COLOR_RGBA_32;
386 static const Element COLOR_SRGBA_32;
387 static const Element COLOR_BGRA_32;
388 static const Element COLOR_SBGRA_32;
389 static const Element COLOR_RGBA_2;
390 static const Element COLOR_R11G11B10;
391 static const Element COLOR_RGB9E5;
392 static const Element COLOR_COMPRESSED_BCX_RED;
393 static const Element COLOR_COMPRESSED_BCX_SRGB;
394 static const Element COLOR_COMPRESSED_BCX_SRGBA_MASK;
395 static const Element COLOR_COMPRESSED_BCX_SRGBA;
396 static const Element COLOR_COMPRESSED_BCX_XY;
397 static const Element COLOR_COMPRESSED_BCX_SRGBA_HIGH;
398 static const Element COLOR_COMPRESSED_BCX_HDR_RGB;
399 static const Element COLOR_COMPRESSED_ETC2_RGB;
400 static const Element COLOR_COMPRESSED_ETC2_SRGB;
401 static const Element COLOR_COMPRESSED_ETC2_RGB_PUNCHTHROUGH_ALPHA;
402 static const Element COLOR_COMPRESSED_ETC2_SRGB_PUNCHTHROUGH_ALPHA;
403 static const Element COLOR_COMPRESSED_ETC2_RGBA;
404 static const Element COLOR_COMPRESSED_ETC2_SRGBA;
405 static const Element COLOR_COMPRESSED_EAC_RED;
406 static const Element COLOR_COMPRESSED_EAC_RED_SIGNED;
407 static const Element COLOR_COMPRESSED_EAC_XY;
408 static const Element COLOR_COMPRESSED_EAC_XY_SIGNED;
409 static const Element DEPTH24_STENCIL8;
410 static const Element VEC2NU8_XY;
411 static const Element VEC4F_COLOR_RGBA;
412 static const Element VEC2F_UV;
413 static const Element VEC2F_XY;
414 static const Element VEC3F_XYZ;
415 static const Element VEC4F_XYZW;
416 static const Element VEC4F_NORMALIZED_XYZ10W2;
417 static const Element INDEX_UINT16;
418 static const Element INDEX_INT32;
419 static const Element PART_DRAWCALL;
422 uint16 _semantic : 7;
423 uint16 _dimension : 4;
const glm::ivec2 & getTile() const
Definition: Format.h:356
uint8 getLocationCount() const
Definition: Format.h:361
bool isInteger() const
Definition: Format.h:339
uint32 getSize() const
Definition: Format.h:349
bool isCompressed() const
Definition: Format.h:321
bool isNormalized() const
Definition: Format.h:334
uint8 getLocationScalarCount() const
Definition: Format.h:366
Dimension getDimension() const
Definition: Format.h:316
Type getType() const
Definition: Format.h:326
uint32 getLocationSize() const
Definition: Format.h:371
Semantic getSemantic() const
Definition: Format.h:311
uint8 getScalarCount() const
Definition: Format.h:344