Results 1 to 8 of 8

Thread: Vertex limits?

  1. #1
    Junior Member
    Join Date
    Sep 2008
    Posts
    11

    Vertex limits?

    What are the limits on the amount of vertices for one glVertexPointer() pointer
    and the number of subsequent times you can call glDrawArrays() using the same previous glVertexPonter() call?

    I break down at about 300 subsequent glDrawArrays calls of anywhere from 5 to 1000 verticies each time.

    The total memory needed is about 1.4 MB (151673 * (3 xyz) * (4 float) /1024/1024)
    I don't think thats too much. I think I have 24 MB available

    It will take about 6000 calls to exhaust the array of vertices

    (BTW the vertices represent coastal waterlines)

    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), cVerts);
    for (i=0; i<cNum; i++)
    {
    glDrawArrays(GL_LINE_STRIP, index, cLengths[i]);
    index+=cLengths[i];
    }

    this also breaks down...

    for (i=0; i<cNum; i++)
    {
    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), &cVerts[index]);
    glDrawArrays(GL_LINE_STRIP, 0, cLengths[i]);
    index+=cLengths[i];
    }

  2. #2

    Re: Vertex limits?

    Probably you are suffering with memory leak problem.

    I have tested my application (PocketPC and Symbian OS) with more than 100.000 vertices, calling glDraw a lot of times.

    Check every place you alloc a memory and dont disalloc

    or, it also can be the ammount of memory your device can handle. Some devices have a small heap memory

  3. #3
    Junior Member
    Join Date
    Sep 2008
    Posts
    11

    Re: Vertex limits?

    Quote Originally Posted by cobrahc
    Probably you are suffering with memory leak problem.

    I have tested my application (PocketPC and Symbian OS) with more than 100.000 vertices, calling glDraw a lot of times.

    Check every place you alloc a memory and dont disalloc

    or, it also can be the ammount of memory your device can handle. Some devices have a small heap memory

    Thank you for the suggestions. I was hoping you were right about the heap or memory segments.
    My memory is not dynamically allocated.
    I loaded the vertices into code, then compiled them into the application
    so it will start faster.
    I was able to exercise all the vertex memory locations.
    using a simple sqrt() on xyz to get the sphere radius.
    every vertex passed.
    That tells me my vertex array is not too big for my platform.

    I was able to run the code on my PC and another embedded device.
    the ipod is the only one I cant get to work.

    Any other suggestions?
    Is there a way to flush or render the vertices without swapping buffers?

  4. #4
    Junior Member
    Join Date
    Sep 2008
    Posts
    11

    Re: Vertex limits?

    I read something about stalling the pipeline.
    When I run my application only calling glDrawArrays() when there are more than 133 vertices it works.
    The problem is all the good data comes in less than 133 vertecies!

    This seems to point back to a vertex limit.

  5. #5
    Senior Member
    Join Date
    May 2006
    Posts
    353

    Re: Vertex limits?

    The easiest way to find out if there is a vertex limit should be to ask your platform provider.
    Georg Kolling, Imagination Technologies
    Please ask questions specific to PowerVR hardware or SDKs on the PowerVR Insider Forum
    DevTech@imgtec.com | http://www.powervrinsider.com

  6. #6
    Junior Member
    Join Date
    Sep 2008
    Posts
    11

    Re: Vertex limits?

    Thank you. I agree. It is probably the platfoem and not OpenGL ES.
    I am able to run the same code on another embedded platform; and on my PC.
    I also get the same behaviour using glBindBuffer and glBufferData.

    Is there a way to query GPU memory utilization?
    Are there any guides to optimize GPU memory management?


    Thanks again.

  7. #7

    Re: Vertex limits?

    I am just curious, Does adding a glGetError() immediately after glVertexPointer & glDrawArray return an error code?

  8. #8
    Junior Member
    Join Date
    Sep 2008
    Posts
    11

    Re: Vertex limits?

    glGetError yields GL_NO_ERROR
    and once the limit is reached each subsequent (and "successful') call to glDrawArrays takes over one whole second.

    I have been able to excercise the entire vertex buffer using a VBO and I still get the same performance.

    I believe I proved the code and memory to be correct since I can draw a different subset of the the data each frame accounting for all the vertices in about 10 frames. just cant do them all in one frame. This is with the vertex data already loaded (It think - assuming on the ipod, a VBO is actually on the graphics chip memory already)

    Thank you for the thought. and I forgot that the program still runs. just in an obviously unacceptable manner. one second per glDrawArray call.

    Is this what is meant by stalling the pipeline?
    Is it possible even though I am using VBO's the data isn't really on the other side of the platform/graphics bus?

    as you can already tell I am a noob, so feel free to state the obvious.

Similar Threads

  1. Limits of GLSL Arrays
    By backspaces in forum Developers Coding:Beginner
    Replies: 1
    Last Post: 05-07-2011, 08:28 AM
  2. Replies: 2
    Last Post: 07-21-2009, 01:14 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
  •