mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-18 13:03:05 +01:00
Maybe it makes more sense for fields to be uint16_t since the result, m_attributes, is uint16_t.
This commit is contained in:
@@ -111,10 +111,10 @@ namespace bgfx
|
||||
|
||||
VertexDecl& VertexDecl::add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized, bool _asInt)
|
||||
{
|
||||
const uint32_t encodedNorm = (_normalized&1)<<7;
|
||||
const uint32_t encodedType = (_type&7)<<3;
|
||||
const uint32_t encodedNum = (_num-1)&3;
|
||||
const uint32_t encodeAsInt = (_asInt&(!!"\x1\x1\x1\x0\x0"[_type]) )<<8;
|
||||
const uint16_t encodedNorm = (_normalized&1)<<7;
|
||||
const uint16_t encodedType = (_type&7)<<3;
|
||||
const uint16_t encodedNum = (_num-1)&3;
|
||||
const uint16_t encodeAsInt = (_asInt&(!!"\x1\x1\x1\x0\x0"[_type]) )<<8;
|
||||
m_attributes[_attrib] = encodedNorm|encodedType|encodedNum|encodeAsInt;
|
||||
|
||||
m_offset[_attrib] = m_stride;
|
||||
|
||||
Reference in New Issue
Block a user