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 3 of 3

Thread: When is data sent into the pipeline?

  1. #1
    Intern Newbie
    Join Date
    Apr 2007
    Location
    Ohio
    Posts
    45

    When is data sent into the pipeline?

    I've been coding OpenGL purely by example, and I'm at the point where I want (and need) to understand what I'm doing rather than just mimic code. Especially considering the project I'm working on. . .

    A simple question then:

    What function actually sends data into the pipeline? gEnd()? In the simplest program I can create, it looks like it's either that or SwapBuffers(). The latter seems like an unlikely function for sending all the data, but I don't want to assume anything.

  2. #2
    Advanced Member Frequent Contributor arekkusu's Avatar
    Join Date
    Nov 2003
    Posts
    783
    GL implementations typically maintain a buffer of commands as you call API. When the buffer is full, it will be flushed, starting the pipeline.

    If you think about that, it means any command can potentially start the pipeline, and you can't tell which, because the size of the command buffer is unknown to you (it may even resize dynamically.)

    Certain API does force commands to execute, i.e. glFlush() or SwapBuffers(). Or any command that needs rendering results visible back on the CPU, like (non-PBO) glReadPixels or (non-async) glMapBuffer. You should not depend on glEnd() to force execution.

  3. #3
    Intern Newbie
    Join Date
    Apr 2007
    Location
    Ohio
    Posts
    45
    Interesting, and good to know! Thanks!

Posting Permissions

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