mirror of
https://github.com/bkaradzic/bgfx.git
synced 2026-02-19 05:23:00 +01:00
GL: Fixed vertex layout binding.
This commit is contained in:
@@ -5164,7 +5164,7 @@ namespace bgfx { namespace gl
|
||||
|
||||
uint32_t baseVertex = _baseVertex*_layout.m_stride + _layout.m_offset[attr];
|
||||
if ( (BX_ENABLED(BGFX_CONFIG_RENDERER_OPENGL >= 30) || s_renderGL->m_gles3)
|
||||
&& (AttribType::Uint8 == type || AttribType::Int16 == type)
|
||||
&& !isFloat(type)
|
||||
&& !normalized)
|
||||
{
|
||||
GL_CHECK(glVertexAttribIPointer(loc
|
||||
|
||||
@@ -122,6 +122,21 @@ namespace bgfx
|
||||
_asInt = !!(val&(1<<8) );
|
||||
}
|
||||
|
||||
static const bool s_attribTypeIsFloat[] =
|
||||
{
|
||||
false, // Uint8
|
||||
false, // Uint10
|
||||
false, // Int16
|
||||
true, // Half
|
||||
true, // Float
|
||||
};
|
||||
BX_STATIC_ASSERT(BX_COUNTOF(s_attribTypeIsFloat) == AttribType::Count);
|
||||
|
||||
bool isFloat(AttribType::Enum _type)
|
||||
{
|
||||
return s_attribTypeIsFloat[_type];
|
||||
}
|
||||
|
||||
static const char* s_attrName[] =
|
||||
{
|
||||
"P", "Attrib::Position",
|
||||
|
||||
@@ -14,6 +14,9 @@ namespace bgfx
|
||||
///
|
||||
void initAttribTypeSizeTable(RendererType::Enum _type);
|
||||
|
||||
///
|
||||
bool isFloat(AttribType::Enum _type);
|
||||
|
||||
/// Returns attribute name.
|
||||
const char* getAttribName(Attrib::Enum _attr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user