for(VertexAttribute a: fmt)
{
unsigned sem = get_attribute_semantic(a);
- bool integer = is_integer_attribute(a);
- GLenum type = get_gl_type(get_attribute_source_type(a));
- unsigned cc = get_attribute_component_count(a);
- if(direct)
- {
- if(integer)
- glVertexArrayAttribIFormat(id, sem, cc, type, offset);
- else
- glVertexArrayAttribFormat(id, sem, cc, type, true, offset);
- glVertexArrayAttribBinding(id, sem, binding);
- glEnableVertexArrayAttrib(id, sem);
- }
- else
+ if(!is_padding(a))
{
- if(integer)
- glVertexAttribIPointer(sem, cc, type, stride, reinterpret_cast<void *>(offset));
+ bool integer = is_integer_attribute(a);
+ GLenum type = get_gl_type(get_attribute_source_type(a));
+ unsigned cc = get_attribute_component_count(a);
+ if(direct)
+ {
+ if(integer)
+ glVertexArrayAttribIFormat(id, sem, cc, type, offset);
+ else
+ glVertexArrayAttribFormat(id, sem, cc, type, true, offset);
+ glVertexArrayAttribBinding(id, sem, binding);
+ glEnableVertexArrayAttrib(id, sem);
+ }
else
- glVertexAttribPointer(sem, cc, type, true, stride, reinterpret_cast<void *>(offset));
- if(ARB_instanced_arrays)
- glVertexAttribDivisor(sem, divisor);
- glEnableVertexAttribArray(sem);
+ {
+ if(integer)
+ glVertexAttribIPointer(sem, cc, type, stride, reinterpret_cast<void *>(offset));
+ else
+ glVertexAttribPointer(sem, cc, type, true, stride, reinterpret_cast<void *>(offset));
+ if(ARB_instanced_arrays)
+ glVertexAttribDivisor(sem, divisor);
+ glEnableVertexAttribArray(sem);
+ }
}
offset += get_attribute_size(a);
}
glBindBuffer(GL_ARRAY_BUFFER, 0);
for(VertexAttribute a: static_cast<const VertexSetup *>(this)->vertex_format)
- {
- unsigned sem = get_attribute_semantic(a);
- glDisableVertexAttribArray(sem);
- glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0);
- }
+ if(!is_padding(a))
+ {
+ unsigned sem = get_attribute_semantic(a);
+ glDisableVertexAttribArray(sem);
+ glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0);
+ }
for(VertexAttribute a: static_cast<const VertexSetup *>(this)->inst_format)
- {
- unsigned sem = get_attribute_semantic(a);
- glDisableVertexAttribArray(sem);
- glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0);
- }
+ if(!is_padding(a))
+ {
+ unsigned sem = get_attribute_semantic(a);
+ glDisableVertexAttribArray(sem);
+ glVertexAttribPointer(sem, 1, GL_FLOAT, false, 0, 0);
+ }
glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, 0);
}
convert_attribute(str, "GROUP", 1, 4, a, GROUP1) ||
convert_attribute(str, "WEIGHT", 1, 4, a, WEIGHT1) ||
convert_attribute(str, "TEXCOORD", 1, 4, a, TEXCOORD1) ||
- convert_attribute(str, "GENERIC", 1, 4, a, GENERIC1))
+ convert_attribute(str, "GENERIC", 1, 4, a, GENERIC1) ||
+ convert_attribute(str, "PADDING", 1, 4, a, PADDING1))
return;
}
catch(...)