Results 1 to 4 of 4

Thread: OUT_OF_MEMORY error on glDrawArrays

  1. #1
    Senior Member Regular Contributor
    Join Date
    Sep 2013
    Posts
    186

    OUT_OF_MEMORY error on glDrawArrays

    Hi there.

    I know, this is not supposed to happen, but for some reason I get an OUT_OF_MEMORY error when calling glDrawArrays. Yes I know, it doesnt say anything about that in the reference pages...

    I am checking for gl errors each frame (for debugging purposes) just in case I missed to check after any openGL command. There are no errors at all, unless I insert this line in my program:
    Code :
    glDrawArrays(GL_QUADS, 0, 4);
    If I comment that line out nothing happens, everything works fine. But when its uncommented I get the error.

    Can anybody explain to me why this could happen? Its not even a heavy application or anything, its just a small little test program doing almost nothing.

    Thanks in advance.

  2. #2
    Member Contributor
    Join Date
    Nov 2011
    Posts
    51
    Does this problem occurs even at FIRST function call or only after few/many of these calls? I'm asking this because if you pass ARRAY(s) by value (and not by reference, to a sub function which will execute glDrawArrays) in some languages it could generates out_of_memory error.

    However please check OpenGL reference: http://www.opengl.org/sdk/docs/man4/...DrawArrays.xml GL_QUADS is not more a supported value. Triangles are always preferred for the most of VGA/GPU architectures....

  3. #3
    Senior Member Regular Contributor
    Join Date
    Sep 2013
    Posts
    186
    Thank you for the reply. The error is generated the very first time I called glDrawArrays.
    It has been fixed by now, but I did change quite a bit about the program, so I can not tell for sure what change fixed this behavior.
    But I know for sure, that the error was only generated after the call to glDrawArrays since I was checking for errors after each and every gl method call.

    When I use GL_QUADS the driver automatically splits the quad into 2 triangles. I know it would be better to use triangles directly, but this was just a short test program so I didnt care much about the performance.

  4. #4
    Member Contributor
    Join Date
    Nov 2011
    Posts
    51
    I think it would be useful to read more lines of code, especially those concerning VBO/Array creation.

    Are you using VBOs? If yes: are you using interleaved vertices attributes (PositionNormalTexcoordColor|PositionNormalTextureColor|....etc...) in one single Array or one array for each attrib (Position, Normals, etc)?

    Using VBO it's easy to get errors during glDraw*() functions if attrib arrays have different lengths/counts or if glVertexAttribPointer points to a null/invalid buffer position...

Similar Threads

  1. Strange segfault error when calling glDrawArrays
    By jonathanbyrn in forum OpenGL: Basic Coding
    Replies: 24
    Last Post: 01-18-2017, 06:23 AM
  2. Opengl Out_of_memory
    By macsam in forum OpenGL: Basic Coding
    Replies: 3
    Last Post: 04-30-2016, 12:32 PM
  3. Out_of_memory
    By mcmike in forum OpenGL: Windows
    Replies: 5
    Last Post: 04-14-2014, 08:57 AM
  4. FBO usage : glRenderBufferStorageExt OUT_OF_MEMORY
    By Tyrahell in forum OpenGL: Basic Coding
    Replies: 5
    Last Post: 01-12-2012, 07:47 AM
  5. NV: ARBvbo & OUT_OF_MEMORY
    By Hampel in forum OpenGL: Advanced Coding
    Replies: 6
    Last Post: 04-26-2003, 11:53 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Proudly hosted by Digital Ocean