glMultiDraw*Indirect

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

glMultiDraw*Indirect

Dolda2000
Hello!

I was just doing some early experiments with glMultiDrawElementsIndirect, and was surprised to find that it only supports a client-side java.nio.Buffer as the argument for the "command list" (the "indirect" argument in the spec), rather than also allowing a long in order to use a buffer object bound to GL_DRAW_INDIRECT_BUFFER. Conversely, I also found that glMultiDrawArraysIndirect only supports a long to use said bound buffer object, but does *not* support a client-side Buffer instead, even though the C function does support using client-side memory, just like glMultiDrawElementsIndirect does.

Is this some mere oversight, or is there some thought behind it?
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Dolda2000
Just to clarify, perhaps, what I'm finding is this:
$ javap -cp jogl-all.jar com.jogamp.opengl.GL3 | grep glMultiDraw.*Indirect
  public abstract void glMultiDrawArraysIndirect(int, long, int, int);
  public abstract void glMultiDrawElementsIndirect(int, int, java.nio.Buffer, int, int);
Whereas I would have expected this:
$ javap -cp jogl-all.jar com.jogamp.opengl.GL3 | grep glMultiDraw.*Indirect
  public abstract void glMultiDrawArraysIndirect(int, java.nio.Buffer, int, int);
  public abstract void glMultiDrawArraysIndirect(int, long, int, int);
  public abstract void glMultiDrawElementsIndirect(int, int, java.nio.Buffer, int, int);
  public abstract void glMultiDrawElementsIndirect(int, int, long, int, int);
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Sven Gothel
Administrator
Thank you 'Dolda2000'.

I have to check the binding / semantics of this 'indirect' call incl. unit tests.
Hope I can squeeze it in for 2.5.0.
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Dolda2000
Sounds like it was a mere oversight then, right? Does that mean I should go and file a Bugzilla report for it?

Thanks for looking at it!
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Sven Gothel
Administrator
finally checking on this in our code ..

/** Entry point to C language function: <code> void {@native glMultiDrawArraysIndirect}(GLenum mode, const void *  indirect, GLsizei drawcount, GLsizei stride); </code> <br>Part of <code>GL_VERSION_4_3</code>, <code>GL_ARB_multi_draw_indirect</code>
        @param indirect a direct or array-backed {@link java.nio.Buffer}   */
public void glMultiDrawArraysIndirect(int mode, Buffer indirect, int drawcount, int stride);
was added (by myself) in GL4bc and its implementation, instead of moving it 'up' to GL3 like the other one with the buffer pointer address. I should move it up ..

Same for the other manually implemented functions..
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Sven Gothel
Administrator
This post was updated on .
Correction:
- 'glMultiDrawElementsIndirect()'
  - should take a 'long' only for the indirect VBO bound buffer offset
  - Is GL4.3 but may exist in GL4.1 via ARB_multi_draw_indirect extension
    - TODO: Have it in GL4 with 'indirect' arg type as long only!
  - TODO: Needs 'indirect' arg type changed from NIO Buffer -> long for VBO offset only!
  https://www.khronos.org/opengl/wiki/GLAPI/glMultiDrawElementsIndirect

- 'glMultiDrawArraysIndirect'
  - should tale a NIO Buffer only for the indirect buffer address of values
  - Is GL4.3 but may exist in GL4.1 via ARB_multi_draw_indirect extension
    - TODO: Have it in GL4 with 'indirect' arg type as Buffer only!
    - TODO: Remove 'long' indirect variant
  https://www.khronos.org/opengl/wiki/GLAPI/glMultiDrawArraysIndirect

Edit: Both belonging to ARB_multi_draw_indirect extension,
which is written against OpenGL 4.1. Hence should only be in GL4 (IMHO).
- https://registry.khronos.org/OpenGL/extensions/ARB/ARB_multi_draw_indirect.txt

...
Reply | Threaded
Open this post in threaded view
|

Re: glMultiDraw*Indirect

Sven Gothel
Administrator
Sven Gothel wrote
Correction:
- 'glMultiDrawElementsIndirect()'
  - should take a 'long' only for the indirect VBO bound buffer offset
  - Is GL4.3 but may exist in GL4.1 via ARB_multi_draw_indirect extension
    - TODO: Have it in GL4 with 'indirect' arg type as long only!
  - TODO: Needs 'indirect' arg type changed from NIO Buffer -> long for VBO offset only!
  https://www.khronos.org/opengl/wiki/GLAPI/glMultiDrawElementsIndirect

- 'glMultiDrawArraysIndirect'
  - should tale a NIO Buffer only for the indirect buffer address of values
  - Is GL4.3 but may exist in GL4.1 via ARB_multi_draw_indirect extension
    - TODO: Have it in GL4 with 'indirect' arg type as Buffer only!
    - TODO: Remove 'long' indirect variant
  https://www.khronos.org/opengl/wiki/GLAPI/glMultiDrawArraysIndirect

Edit: Both belonging to ARB_multi_draw_indirect extension,
which is written against OpenGL 4.1. Hence should only be in GL4 (IMHO).
- https://registry.khronos.org/OpenGL/extensions/ARB/ARB_multi_draw_indirect.txt

...
Resolved, see https://jogamp.org/bugzilla/show_bug.cgi?id=1441
also see discussion in https://jogamp.org/bugzilla/show_bug.cgi?id=852

(Memories ..  I triaged w/ git blame, then checked our bugzilla crossref
to ensure I didn't miss anything .. and voila .. )

Notable, `glMultiDrawArraysIndirect` is dual sourced (cpu + gpu) per GL4 spec.
Also related, ARB_draw_indirect allows to be cpu sourced as well in ES 3.1.