Part of the Khronos Group
OpenGL.org

The Industry's Foundation for High Performance Graphics

from games to virtual reality, mobile phones to supercomputers

Results 1 to 4 of 4

Thread: GL_INVALID_OPERATION in glVertexAttribPointer

Hybrid View

  1. #1
    Junior Member Regular Contributor pjcozzi's Avatar
    Join Date
    Jun 2004
    Location
    Philadelphia, PA
    Posts
    196

    GL_INVALID_OPERATION in glVertexAttribPointer

    Hi,

    glGetError returns GL_INVALID_OPERATION after the following sequence:

    Code :
    glBindVertexArray(1);
    glDisableVertexAttribArray(1);
    glBindBuffer(GL_ARRAY_BUFFER,0);
    glVertexAttribPointer(1,0,GL_FLOAT,false,0,0x0000);
    I am not sure why it is happening considering the SDK for glVertexAttribPointer says:

    GL_INVALID_OPERATION is generated if zero is bound to the GL_ARRAY_BUFFER buffer object binding point and the pointer argument is not NULL.
    In this case, both GL_ARRAY_BUFFER and pointer are null. I suppose the call is not necessary, and I should just call glDisableVertexAttribArray.

    Also, I doubt this is the problem, but I am using GLIntercept, and read "OpenGL3.0 + pure core profiles do not work correctly (will be fixed)."

    I am using GL 3.3 core profile and tested on both NVIDIA and ATI so I think this is my fault, not a driver issue.

    Regards,
    Patrick

  2. #2
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    947

    Re: GL_INVALID_OPERATION in glVertexAttribPointer

    It is definitely true that the DisableVertexAttribArray would be enough.

    Also, the GL_ARB_vertex_array_object spec says the following:
    An INVALID_OPERATION error is generated if VertexAttribPointer or VertexAttribIPointer is called while a non-zero vertex array object is bound and zero is bound to the ARRAY_BUFFER buffer object binding point.
    So the error code seems to be valid here.
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

  3. #3
    Junior Member Regular Contributor pjcozzi's Avatar
    Join Date
    Jun 2004
    Location
    Philadelphia, PA
    Posts
    196

    Re: GL_INVALID_OPERATION in glVertexAttribPointer

    Good eye. I thought the VAO may have something to do with it, but I expected to see VAO restrictions in the SDK page for glVertexAttribPointer. Next time, I'll check both.

    Thanks!
    Patrick

  4. #4
    Advanced Member Frequent Contributor
    Join Date
    Dec 2007
    Location
    Hungary
    Posts
    947

    Re: GL_INVALID_OPERATION in glVertexAttribPointer

    With pleasure!

    Actually it wouldn't have been that easy to find if I would have not checked that extension specification just yesterday because I read the issues part
    Disclaimer: This is my personal profile. Whatever I write here is my personal opinion and none of my statements or speculations are anyhow related to my employer and as such should not be treated as accurate or valid and in no case should those be considered to represent the opinions of my employer.
    Technical Blog: http://www.rastergrid.com/blog/

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •