- gl.VertexAttribPointer(attr.location,
- GLVertexFormat(attr.format).size,
- GLVertexFormat(attr.format).format,
- GL_FALSE,
- bufferBinding.stride,
- reinterpret_cast<void*>(attr.offset));
+ if(attr.format == VertexInputFormat::FLOAT ||
+ attr.format == VertexInputFormat::FVECTOR2 ||
+ attr.format == VertexInputFormat::FVECTOR3 ||
+ attr.format == VertexInputFormat::FVECTOR4)
+ {
+ gl->VertexAttribPointer(attr.location, // Not cached...
+ GLVertexFormat(attr.format).size,
+ GLVertexFormat(attr.format).format,
+ GL_FALSE,
+ bufferBinding.stride,
+ reinterpret_cast<void*>(attr.offset));
+ }
+ else
+ {
+ gl->VertexAttribIPointer(attr.location,
+ GLVertexFormat(attr.format).size,
+ GLVertexFormat(attr.format).format,
+ bufferBinding.stride,
+ reinterpret_cast<void*>(attr.offset));
+ }
+
+ if(hasGLES3)
+ {
+ switch(bufferBinding.inputRate)
+ {
+ case Graphics::VertexInputRate::PER_VERTEX:
+ {
+ gl->VertexAttribDivisor(attr.location, 0);
+ break;
+ }
+ case Graphics::VertexInputRate::PER_INSTANCE:
+ {
+ //@todo Get actual instance rate...
+ gl->VertexAttribDivisor(attr.location, 1);
+ break;
+ }
+ }
+ }
+ }