MCPcopy Create free account
hub / github.com/defold/defold / DataTypeToByteWidth

Function DataTypeToByteWidth

engine/graphics/src/graphics.h:671–685  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

669 }
670
671 static inline uint32_t DataTypeToByteWidth(VertexAttribute::DataType data_type)
672 {
673 switch(data_type)
674 {
675 case dmGraphics::VertexAttribute::TYPE_BYTE: return 1;
676 case dmGraphics::VertexAttribute::TYPE_UNSIGNED_BYTE: return 1;
677 case dmGraphics::VertexAttribute::TYPE_SHORT: return 2;
678 case dmGraphics::VertexAttribute::TYPE_UNSIGNED_SHORT: return 2;
679 case dmGraphics::VertexAttribute::TYPE_INT: return 4;
680 case dmGraphics::VertexAttribute::TYPE_UNSIGNED_INT: return 4;
681 case dmGraphics::VertexAttribute::TYPE_FLOAT: return 4;
682 default: break;
683 }
684 return 0;
685 }
686
687 // Test functions:
688 void* MapVertexBuffer(HContext context, HVertexBuffer buffer, BufferAccess access);

Callers 8

HashRenderItemFunction · 0.85
GetAttributeValuesFunction · 0.85
WriteMatrixToMatrixFunction · 0.85
WriteVectorFunction · 0.85
WriteScalarFunction · 0.85
WriteAttributesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected