Project Home
Project Home
Documents
Documents
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - VBO and VA limits: (3 Items)
   
VBO and VA limits  
if VBO is activated in the current context, it doesn't check if offset passed via glVertexPointer() is exceeds amount of
 data passed to vertex buffer object.

glBindBufferOES(GL_ARRAY_BUFFER_ES, nVBOVertices);
glVertexPointer(3, GL_FLOAT, 0, 0x60000000);
glDrawArrays(GL_TRIANGLES, 0, nVertexCount);

It is silly example but in my case I specified 32768 vertices offset instead of 31255, and it was enough to hang all QNX
 box.

What is vertex maximum count (or memory size in bytes) limit when vertices  are passed to VBO ?

What about limits for VAs ? On devg-extreme2 glGetIntegerv() returns 65536 for GL_MAX_ELEMENTS_VERTICES and 
GL_MAX_ELEMENTS_INDICES. But by mistake I've passed near 98K of vertices and all primitives have been drawn, like there 
are no any limits.
Re: VBO and VA limits  
glVertexPointer can return one of the following errors:

GL_INVALID_VALUE is generated if size is not 2, 3, or 4.
GL_INVALID_ENUM is generated if type is is not an accepted value.
GL_INVALID_VALUE is generated if stride is negative.

The only VBO related work that glVertexPointer is required to do is to copy the buffer object name in the 
ARRAY_BUFFER_BINDING internal state to the VERTEX_ARRAY_BUFFER_BINDING internal state. This allows the following code to
 work:

glBindBuffer(GL_ARRAY_BUFFER, vbo);
[...]
glVertexPointer(3, GL_FLOAT, 0, 0);
[...]
glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
[...]
glDrawArrays(GL_TRIANGLES, 0, count);

GL_MAX_ELEMENTS_VERTICES and GL_MAX_ELEMENTS_INDICES are marked as exposed, but not queriable in the OpenGL ES 1.0 spec.
 Neither are exposed in the OpenGL ES 1.1 spec. For these reasons, I would just refrain from writing code that uses 
these constants.
Re: VBO and VA limits  
> glBindBuffer(GL_ARRAY_BUFFER, vbo);
> [...]
> glVertexPointer(3, GL_FLOAT, 0, 0);
> [...]
> glBufferData(GL_ARRAY_BUFFER, size, data, GL_STATIC_DRAW);
> [...]
> glDrawArrays(GL_TRIANGLES, 0, count);

I'm talking about bad offset value could hang the machine. I know how to use VBOs.

Etienne, could you answer on question "What is maximum vertex count could be passed as VBOs and VAs data ?"