mirror of
https://github.com/scratchfoundation/bgfx.git
synced 2024-11-25 00:58:30 -05:00
Fixing encodeAsInt field. Had two problems: 1# Bit field didn't got updated for Uint10. 2# Shifting by 8 on uint8_t. Problem was introduced on: 8da579ff99
.
This commit is contained in:
parent
7acf2b2616
commit
fa7cd66f71
1 changed files with 4 additions and 4 deletions
|
@ -111,10 +111,10 @@ namespace bgfx
|
|||
|
||||
VertexDecl& VertexDecl::add(Attrib::Enum _attrib, uint8_t _num, AttribType::Enum _type, bool _normalized, bool _asInt)
|
||||
{
|
||||
const uint8_t encodedNorm = (_normalized&1)<<7;
|
||||
const uint8_t encodedType = (_type&7)<<3;
|
||||
const uint8_t encodedNum = (_num-1)&3;
|
||||
const uint8_t encodeAsInt = (_asInt&(!!"\x1\x1\x0\x0"[_type]) )<<8;
|
||||
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;
|
||||
m_attributes[_attrib] = encodedNorm|encodedType|encodedNum|encodeAsInt;
|
||||
|
||||
m_offset[_attrib] = m_stride;
|
||||
|
|
Loading…
Reference in a new issue