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

Thread: Resize Buffer Object from Transform Feedback Result. GL3 < GL 3.3

  1. #1
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    4

    Resize Buffer Object from Transform Feedback Result. GL3 < GL 3.3

    Hello GL Fellows.

    I need to glBufferData a buffer based on the result of a Transform Feedback.
    I do Iso-Surface extraction and the last step in the algo is the resize and copy of the result of the extraction into a more reasonable sized buffer object. Everything works just fine. I have everything on the GPU thanks to DrawTransformFeedback, except the last "copy to smaller sized buffer object" step.

    The problem is, that last resize/copy step kills the performance! I could do the copy step with another DrawTransformFeedback and a copy vertex shader, but the resize command still remains that forces me to round-trip to the CPU... I.e. I wait for the query object that delivers the number of vertices written.

    Do you have any advice or is it even possible to do a glBufferData(resize buffer) based on TF result on GL 3.3 and prior?

    Please do not consider >= GL 4.0, I need to do it in pre-4.0 GL.

    Thanks.

  2. #2
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    Quote Originally Posted by master_of_the_gl View Post
    I need to glBufferData a buffer based on the result of a Transform Feedback. ... the resize command still remains that forces me to round-trip to the CPU... I.e. I wait for the query object that delivers the number of vertices written.
    You should be able to do what you want by using atomics or ARB_query_buffer_object to keep the number of verts written on the GPU. For information on the former, see this thread.

  3. #3
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    4
    Wait a minute! I looked ARB_draw_indirect up in the reg and it is written against GL 3.2. Doesnt this mean, it is only available in GL 4.0, or is it even available in GL 3.3? I cant get that version stuff right...

  4. #4
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    If your card/driver supports the extension, you can use it. Doesn't so much matter what context version you've requested.

  5. #5
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    4
    I am more concerned about the availability of the "indirect technique" pertaining older gfx cards, i.e. pre GL 4.0 gpus. Since I am coding a game, I want to have it run on older hardware that has GL 3.x driver/hardware support, and along with it, all the required GL features...
    So it is not a question of, can my GL 4.0 Gpu perform these steps, but can older hardware perform it. This is what I mean with GL 3.x.

    I think I dont understand the term "This extension is written against the OpenGL 3.2 specification" which can be found in ARB_draw_indirect.
    Does this mean, it is available on GL 3.2>= hardware/driver?

  6. #6
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    Quote Originally Posted by master_of_the_gl View Post
    I am more concerned about the availability of the "indirect technique" pertaining older gfx cards, i.e. pre GL 4.0 gpus.
    Gotcha.

    Consulting the:

    * OpenGL Capabilities DB (at wildfiregames.com)

    we see that ARB_draw_indirect is (by NVidia at least) only supported by GeForce 4xx+ GPUs (Fermi+), which correspond to OpenGL 4.0+ capability. GeForce 2xx GPUs (OpenGL 3.x) don't support it.

    This blog post may give you some ideas:

    * GPU based dynamic geometry LOD (rastergrid)

    As it mentions, you can use other GPU work to help hide the latency associated with those queries.

    However, failing that, it kinda looks like all of the methods you'd want to use to keep the primitives generated count on the GPU are GL4.0+.

    I think I dont understand the term "This extension is written against the OpenGL 3.2 specification" which can be found in ARB_draw_indirect.
    Does this mean, it is available on GL 3.2>= hardware/driver?
    Apparently not. I'd guess that just means that is the version of they spec to which the spec modifications in the extension "mark up".
    Last edited by Dark Photon; 12-07-2013 at 08:00 PM.

  7. #7
    Junior Member Newbie
    Join Date
    Dec 2013
    Posts
    4
    Dark Photon, thanks for boiling it down!

    At least, I already assumed that the indirect technique in not available on GL 3.x hardware.

    To me, transform feedback seems a bit unfinished and there is more potential in it. DrawTransformFeedback really helped me to realize a multi-stage pipeline, for fast iso-surface extraction, completely on the gpu. And thats at least something. Without it, I couldnt realize my ideas.

    Is there any reason why for example, a CopyTransformFeedback or ResizeTransformFeedback is not available?

    Apparently not. I'd guess that just means that is the version of they spec to which the spec modifications in the extension "mark up".
    So an extension stays a extension. It is still up to the vendor implementing a particular extension for the GL version suggested by the spec, as your example stated.
    Last edited by master_of_the_gl; 12-08-2013 at 12:05 PM.

  8. #8
    Senior Member OpenGL Guru Dark Photon's Avatar
    Join Date
    Oct 2004
    Location
    Druidia
    Posts
    3,126
    Quote Originally Posted by master_of_the_gl View Post
    To me, transform feedback seems a bit unfinished and there is more potential in it. DrawTransformFeedback really helped me to realize a multi-stage pipeline, for fast iso-surface extraction, completely on the gpu. And thats at least something. Without it, I couldnt realize my ideas.

    Is there any reason why for example, a CopyTransformFeedback or ResizeTransformFeedback is not available?
    That's a question for the driver writers. Here's one post that may shed some light on it for you: link.

Posting Permissions

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