1

Hi I am porting an OpenGL app to OpenGL ES 3.0 and I wonder if exists any equivalent function to glVertexAttribI2i

void glVertexAttribI2i(GLuint index​, GLint v0​, GLint v1​);

The closest I could find GLES is glVertexAttrib family which doc says:

These commands can be used to specify one, two, three, or all four components of the generic vertex attribute specified by index. ... Similarly, a 2 in the name of the command indicates that values are provided for the first two components, the third component will be set to 0, and the fourth component will be set to 1...

Anybody see any way I can use some of these functions to replace glVertexAttribI2i?

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
gabocalero
  • 473
  • 6
  • 15

1 Answers1

0

You can always use glVertexAttribI4i, and pass zeros for the last two components.

But it's not like you can use glBegin/End-style immediate mode rendering in ES 2.0+. So whatever it is you think you're doing with these functions is probably not going to be particularly fast. You shouldn't treat them as a clever way to provide uniforms to shaders. Indeed, it's best to pretend that they don't exist at all.

Nicol Bolas
  • 449,505
  • 63
  • 781
  • 982
  • If I use glVertexAttribI4i it will write zeros in a contiguous memory position, exceeding the attribute memory space, won't it? – gabocalero Oct 05 '16 at 17:15
  • @grabox: [No (see fourth paragraph)](https://www.opengl.org/wiki/Vertex_Specification#Vertex_format). – Nicol Bolas Oct 05 '16 at 20:54