Fix gfx::setup for instanced attributes
This commit is contained in:
parent
6dd5fd5ee7
commit
359f9492b3
1 changed files with 3 additions and 2 deletions
|
|
@ -436,10 +436,11 @@ namespace psemek::gfx
|
|||
{
|
||||
gl::EnableVertexAttribArray(a.index);
|
||||
gl::VertexAttribDivisor(a.index, a.divisor);
|
||||
GLuint stride = (a.divisor == 0) ? attribs.vertex_size : attribs.instance_size;
|
||||
if (a.integer)
|
||||
gl::VertexAttribIPointer(a.index, a.size, a.type, attribs.vertex_size, a.pointer);
|
||||
gl::VertexAttribIPointer(a.index, a.size, a.type, stride, a.pointer);
|
||||
else
|
||||
gl::VertexAttribPointer(a.index, a.size, a.type, a.normalized, attribs.vertex_size, a.pointer);
|
||||
gl::VertexAttribPointer(a.index, a.size, a.type, a.normalized, stride, a.pointer);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue