glVertexPointer glDrawArrays limitations?

Discussion in 'iOS Development' started by d1mbu1b, Sep 11, 2008.

  1. d1mbu1b

    d1mbu1b New Member

    Joined:
    Aug 27, 2008
    Messages:
    2
    Likes Received:
    0
    I am running into trouble using multiple (6297) subsequent calls to glDrawArrays() on
    151673 vertices of various lengths.

    The code ports to other OpenGL-ES platforms
    just can't get it to run on my ipod touch 1.1.5

    The only thing that will allow it to work is to throw away all line strips less than 133 vertices in length. unfortunately that s the bulk of my data.
    or only use the first couple hundred line strips out of 6297.
    Also missing the bulk of the data.

    I exercised the memory of the entire array and it is correct and accessible.
    The vertices are compiled in the executable as one array of vertex structure (3 floats) so there is no dynamic memory.

    Are the any pipeline stalling issues?
    glFlush?

    not sure why but when it works (only with some of the data) it works fine
    when it fails, the touch screen is locked up.
    I can ssh to it and respring just cant get the screen back.
    have to hard boot it every time.

    Thanks for any ideas.



    code...


    void MapsDraw(int dummy)
    {
    int i;
    int index=0;

    glEnableClientState(GL_VERTEX_ARRAY);
    glColor4f(1.0, 0.0, 0.0, 1.0);


    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), eq);
    glDrawArrays(GL_LINE_STRIP, 0, 361);

    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), arctic);
    glDrawArrays(GL_LINE_STRIP, 0, 361);

    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), antarctic);
    glDrawArrays(GL_LINE_STRIP, 0, 361);


    glColor4f(0.5, 0.5, 0.5, 1.0);
    #ifdef __pc__
    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), cVerts);
    for (i=0; i<C_NUM; i++)
    {
    if (cLengths > 1)
    glDrawArrays(GL_LINE_STRIP, index, cLengths);
    index+=cLengths;
    }
    #endif
    #ifdef __ipod__
    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), cVerts);
    for (i=0; i<C_NUM; i++)
    {
    if (cLengths > 133 )
    glDrawArrays(GL_LINE_STRIP, index, cLengths);
    index+=cLengths;
    }
    #endif
    #ifdef __psp__
    for (i=0; (i<C_NUM); i++)
    {
    if (cLengths > 1)
    {
    // PSP requires < 128K of cached array data
    // thats why this is inside the loop
    glVertexPointer(3, GL_FLOAT, sizeof(glV3f), &cVerts[index]);
    glDrawArrays(GL_LINE_STRIP, 0, cLengths);
    }
    index+=cLengths;
    }
    #endif


    glDisableClientState(GL_VERTEX_ARRAY);
    }
    ------------------double post merged------------------
    I get the same behavior using
    glBindBuffer() and glBufferData()
  2. gojohnnyboi

    gojohnnyboi Well-Known Member

    Joined:
    Jan 25, 2008
    Messages:
    3,339
    Likes Received:
    55
    i admire your skill, if what i think i see is correct. open GL. i'm sorry i cannot help you just wanted to give a shout out saying hot damn you're awesome

    Please Register or Log in to view images

    lol
  3. d1mbu1b

    d1mbu1b New Member

    Joined:
    Aug 27, 2008
    Messages:
    2
    Likes Received:
    0
    Why do I feel like I am being set up? thanks for the compliment.


    I have optimized the rendering using vertex buffer objects VBOs and I still get the same behavior. I can even draw different subsets of vertices each frame (covering all the vertices in the vertex buffer.) but I still cannot do all of them at once.
    This verifies its not a ipod memory, or graphics memory, or code issue.
    So I am back to the pipeline.

    Does anybody have any insight into the ipod/OpenGL-ES pipeline?

Share This Page