diff options
author | Sven Gothel <[email protected]> | 2015-03-11 17:58:52 +0100 |
---|---|---|
committer | Sven Gothel <[email protected]> | 2015-03-11 17:58:52 +0100 |
commit | a622ffbced14e1e2fe797c82fc62c431ffb6949f (patch) | |
tree | 611873d7f6dd3fc53a449fb18631092be20e606e /make/config/jogl | |
parent | 68391b118e93170c568edc21edad7f6b0c1f97a3 (diff) |
Bug 1135: GLBufferObjectTracker for GL 4.5: Separate GL 4.5 DSA and GL_EXT_direct_state_access
We cannot subsume/rename even parts of GL_EXT_direct_state_access,
since it is explcit stated in the spec that no assumption
shall be made in regards compatibility and interaction.
Hence we add both, GL 4.5 DSA and GL_EXT_direct_state_access.
Diffstat (limited to 'make/config/jogl')
-rw-r--r-- | make/config/jogl/gl-common.cfg | 27 | ||||
-rw-r--r-- | make/config/jogl/gl-gl4bc.cfg | 51 | ||||
-rw-r--r-- | make/config/jogl/gl-if-CustomJavaCode-gl2.java | 10 | ||||
-rw-r--r-- | make/config/jogl/gl-if-CustomJavaCode-gl4.java | 46 | ||||
-rw-r--r-- | make/config/jogl/gl-if-gl4.cfg | 2 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-common.java | 16 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java | 90 |
7 files changed, 193 insertions, 49 deletions
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 2993b4bb2..f22730472 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -125,17 +125,6 @@ MethodJavadoc glMapBufferRange * </p> DelegateImplementation glUnmapBuffer glUnmapBufferDelegate -# -# Manually implement following GL 4 functions to be redirected -# to GLBufferObjectTracker. -# RenameJavaSymbol: GL_EXT_direct_state_access -> GL 4.5 ! -# -RenameJavaSymbol glNamedBufferDataEXT glNamedBufferData -RenameJavaSymbol glNamedBufferStorageEXT glNamedBufferStorage -RenameJavaSymbol glMapNamedBufferEXT glMapNamedBuffer -RenameJavaSymbol glMapNamedBufferRangeEXT glMapNamedBufferRange -RenameJavaSymbol glUnmapNamedBufferEXT glUnmapNamedBuffer - # Ignore the ATI_map_object_buffer extension for now unless someone # claims they need it, as it will undoubtedly require a similar # construct to glMapBuffer @@ -914,7 +903,7 @@ ClassJavadoc GL2ES2 */ ClassJavadoc GL2ES3 /** ClassJavadoc GL2ES3 * <p> -ClassJavadoc GL2ES3 * Interface containing the common subset of core GL2 and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL2ES3 * Interface containing the common subset of core GL2 and GLES3 (OpenGL ES 3.0+).<br/> ClassJavadoc GL2ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> ClassJavadoc GL2ES3 * This interface is not GLES3 complete and merely exist to avoid duplicated definitions.<br/> ClassJavadoc GL2ES3 * </p> @@ -922,7 +911,7 @@ ClassJavadoc GL2ES3 */ ClassJavadoc GL3ES3 /** ClassJavadoc GL3ES3 * <p> -ClassJavadoc GL3ES3 * Interface containing the common subset of core GL3 (OpenGL 3.1+) and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL3ES3 * Interface containing the common subset of core GL3 (OpenGL 3.1+) and GLES3 (OpenGL ES 3.0+).<br/> ClassJavadoc GL3ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> ClassJavadoc GL3ES3 * This interface is almost GLES3 complete, lacking <code>GL_ARB_ES3_compatibility</code> extension.<br/> ClassJavadoc GL3ES3 * </p> @@ -930,7 +919,7 @@ ClassJavadoc GL3ES3 */ ClassJavadoc GL4ES3 /** ClassJavadoc GL4ES3 * <p> -ClassJavadoc GL4ES3 * Interface containing the common subset of core GL4 (OpenGL 4.0+) and GLES3 (OpenGL ES 3.0).<br/> +ClassJavadoc GL4ES3 * Interface containing the common subset of core GL4 (OpenGL 4.0+) and GLES3 (OpenGL ES 3.0+).<br/> ClassJavadoc GL4ES3 * This interface reflects only the programmable shader functionality of desktop and embedded OpenGL<br/> ClassJavadoc GL4ES3 * This interface is GLES3 complete w/o vendor extensions.<br/> ClassJavadoc GL4ES3 * </p> @@ -968,15 +957,15 @@ ClassJavadoc GL3bc * <p>Note: OpenGL [ 3.1 .. 3.3 ] compatibility profile does ClassJavadoc GL3bc */ ClassJavadoc GL4 /** -ClassJavadoc GL4 * <p>This interface contains all OpenGL [ 4.0 .. 4.3 ] <i>core</i> methods, +ClassJavadoc GL4 * <p>This interface contains all OpenGL [ 4.0 .. 4.5 ] <i>core</i> methods, ClassJavadoc GL4 * as well as most of it's extensions defined at the time of this specification.</p> -ClassJavadoc GL4 * <p>Note: OpenGL [ 4.0 .. 4.3 ] core profile does not includes fixed point functionality.</p> +ClassJavadoc GL4 * <p>Note: OpenGL [ 4.0 .. 4.5 ] core profile does not includes fixed point functionality.</p> ClassJavadoc GL4 */ ClassJavadoc GL4bc /** -ClassJavadoc GL4bc * <p>This interface contains all OpenGL [ 4.0 .. 4.3 ] <i>compatibility</i> profile, +ClassJavadoc GL4bc * <p>This interface contains all OpenGL [ 4.0 .. 4.5 ] <i>compatibility</i> profile, ClassJavadoc GL4bc * as well as most of it's extensions defined at the time of this specification.</p> -ClassJavadoc GL4bc * <p>Note: OpenGL [ 4.0 .. 4.3 ] compatibility profile does includes fixed point functionality.</p> +ClassJavadoc GL4bc * <p>Note: OpenGL [ 4.0 .. 4.5 ] compatibility profile does includes fixed point functionality.</p> ClassJavadoc GL4bc */ ClassJavadoc GLES1 /** @@ -990,7 +979,7 @@ ClassJavadoc GLES2 * as well as most of it's extensions defined at the time of ClassJavadoc GLES2 */ ClassJavadoc GLES3 /** -ClassJavadoc GLES3 * <p>This interface contains all OpenGL ES 3.0 methods, +ClassJavadoc GLES3 * <p>This interface contains all OpenGL ES [ 3.0 .. 3.1 ] methods, ClassJavadoc GLES3 * as well as most of it's extensions defined at the time of this specification.</p> ClassJavadoc GLES3 */ diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg index 0b92d78b9..e3e706688 100644 --- a/make/config/jogl/gl-gl4bc.cfg +++ b/make/config/jogl/gl-gl4bc.cfg @@ -70,8 +70,10 @@ Include gl2_es2-CustomJavaCode.cfg # Manually implement following GL 4 functions to be redirected # to GLBufferObjectTracker. # -# RenameJavaSymbol: GL_EXT_direct_state_access -> GL 4.5 ! -# see gl-common.cfg +# We cannot subsume/rename even parts of GL_EXT_direct_state_access, +# since it is explcit stated in the spec that no assumption +# shall be made in regards compatibility and interaction. +# Hence we add both, GL 4.5 DSA and GL_EXT_direct_state_access. # DelegateImplementation glNamedBufferData glNamedBufferDataDelegate MethodJavadoc glNamedBufferData * <p> @@ -81,6 +83,14 @@ MethodJavadoc glNamedBufferData * <p> MethodJavadoc glNamedBufferData * @throws GLException if size is less-than zero MethodJavadoc glNamedBufferData * @throws GLException if a native GL-Error occurs MethodJavadoc glNamedBufferData * </p> +DelegateImplementation glNamedBufferDataEXT glNamedBufferDataEXTDelegate +MethodJavadoc glNamedBufferDataEXT * <p> +MethodJavadoc glNamedBufferDataEXT * Throws a {@link GLException} if GL-function constraints are not met or the native GL-function fails. +MethodJavadoc glNamedBufferDataEXT * </p> +MethodJavadoc glNamedBufferDataEXT * <p> +MethodJavadoc glNamedBufferDataEXT * @throws GLException if size is less-than zero +MethodJavadoc glNamedBufferDataEXT * @throws GLException if a native GL-Error occurs +MethodJavadoc glNamedBufferDataEXT * </p> DelegateImplementation glBufferStorage glBufferStorageDelegate MethodJavadoc glBufferStorage * <p> @@ -101,6 +111,15 @@ MethodJavadoc glNamedBufferStorage * @throws GLException if buffer is not bound MethodJavadoc glNamedBufferStorage * @throws GLException if size is less-or-equal zero MethodJavadoc glNamedBufferStorage * @throws GLException if a native GL-Error occurs MethodJavadoc glNamedBufferStorage * </p> +DelegateImplementation glNamedBufferStorageEXT glNamedBufferStorageEXTDelegate +MethodJavadoc glNamedBufferStorageEXT * <p> +MethodJavadoc glNamedBufferStorageEXT * Throws a {@link GLException} if GL-function constraints are not met or the native GL-function fails. +MethodJavadoc glNamedBufferStorageEXT * </p> +MethodJavadoc glNamedBufferStorageEXT * <p> +MethodJavadoc glNamedBufferStorageEXT * @throws GLException if buffer is not bound to target +MethodJavadoc glNamedBufferStorageEXT * @throws GLException if size is less-or-equal zero +MethodJavadoc glNamedBufferStorageEXT * @throws GLException if a native GL-Error occurs +MethodJavadoc glNamedBufferStorageEXT * </p> DelegateImplementation glMapNamedBuffer glMapNamedBufferDelegate ReturnsOpaque long glMapNamedBufferDelegate @@ -115,6 +134,19 @@ MethodJavadoc glMapNamedBuffer * @throws GLException if buffer is not tracked MethodJavadoc glMapNamedBuffer * @throws GLException if buffer is already mapped MethodJavadoc glMapNamedBuffer * @throws GLException if buffer has invalid store size, i.e. less-than zero MethodJavadoc glMapNamedBuffer * </p> +DelegateImplementation glMapNamedBufferEXT glMapNamedBufferEXTDelegate +ReturnsOpaque long glMapNamedBufferEXTDelegate +MethodJavadoc glMapNamedBufferEXT * <p> +MethodJavadoc glMapNamedBufferEXT * Throws a {@link GLException} if GL-function constraints are not met. +MethodJavadoc glMapNamedBufferEXT * </p> +MethodJavadoc glMapNamedBufferEXT * <p> +MethodJavadoc glMapNamedBufferEXT * Returns {@link GL2#mapNamedBuffer(int, int)}'s {@link GLBufferStorage#getMappedBuffer()}. +MethodJavadoc glMapNamedBufferEXT * </p> +MethodJavadoc glMapNamedBufferEXT * <p> +MethodJavadoc glMapNamedBufferEXT * @throws GLException if buffer is not tracked +MethodJavadoc glMapNamedBufferEXT * @throws GLException if buffer is already mapped +MethodJavadoc glMapNamedBufferEXT * @throws GLException if buffer has invalid store size, i.e. less-than zero +MethodJavadoc glMapNamedBufferEXT * </p> DelegateImplementation glMapNamedBufferRange glMapNamedBufferRangeDelegate ReturnsOpaque long glMapNamedBufferRangeDelegate @@ -130,8 +162,23 @@ MethodJavadoc glMapNamedBufferRange * @throws GLException if buffer is already m MethodJavadoc glMapNamedBufferRange * @throws GLException if buffer has invalid store size, i.e. less-than zero MethodJavadoc glMapNamedBufferRange * @throws GLException if buffer mapping range does not fit, incl. offset MethodJavadoc glMapNamedBufferRange * </p> +DelegateImplementation glMapNamedBufferRangeEXT glMapNamedBufferRangeEXTDelegate +ReturnsOpaque long glMapNamedBufferRangeEXTDelegate +MethodJavadoc glMapNamedBufferRangeEXT * <p> +MethodJavadoc glMapNamedBufferRangeEXT * Throws a {@link GLException} if GL-function constraints are not met. +MethodJavadoc glMapNamedBufferRangeEXT * </p> +MethodJavadoc glMapNamedBufferRangeEXT * <p> +MethodJavadoc glMapNamedBufferRangeEXT * Returns {@link GL2#mapNamedBufferRange(int, long, long, int)}'s {@link GLBufferStorage#getMappedBuffer()}. +MethodJavadoc glMapNamedBufferRangeEXT * </p> +MethodJavadoc glMapNamedBufferRangeEXT * <p> +MethodJavadoc glMapNamedBufferRangeEXT * @throws GLException if buffer is not tracked +MethodJavadoc glMapNamedBufferRangeEXT * @throws GLException if buffer is already mapped +MethodJavadoc glMapNamedBufferRangeEXT * @throws GLException if buffer has invalid store size, i.e. less-than zero +MethodJavadoc glMapNamedBufferRangeEXT * @throws GLException if buffer mapping range does not fit, incl. offset +MethodJavadoc glMapNamedBufferRangeEXT * </p> DelegateImplementation glUnmapNamedBuffer glUnmapNamedBufferDelegate +DelegateImplementation glUnmapNamedEXTBuffer glUnmapNamedEXTBufferDelegate # Manuall implement glDebugMessageCallback* using the proc address resolver ForceProcAddressGen glDebugMessageCallback diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl2.java b/make/config/jogl/gl-if-CustomJavaCode-gl2.java index 283f72da1..d7def0ef9 100644 --- a/make/config/jogl/gl-if-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-if-CustomJavaCode-gl2.java @@ -9,6 +9,9 @@ * Throws a {@link GLException} if GL-function constraints are not met. * </p> * <p> + * Depends on <code>GL_EXT_direct_state_access</code>. + * </p> + * <p> * {@link GL2#glMapNamedBufferEXT(int, int)} wrapper calls this method and returns {@link GLBufferStorage#getMappedBuffer()}. * </p> * @param bufferName denotes the buffer @@ -17,7 +20,7 @@ * @throws GLException if buffer is already mapped * @throws GLException if buffer has invalid store size, i.e. less-than zero */ - public GLBufferStorage mapNamedBuffer(int bufferName, int access) throws GLException; + public GLBufferStorage mapNamedBufferEXT(int bufferName, int access) throws GLException; /** * Returns the {@link GLBufferStorage} instance as mapped via OpenGL's native {@link GL2#glMapNamedBufferRangeEXT(int, long, long, int) glMapNamedBufferRangeEXT(..)} implementation. @@ -25,6 +28,9 @@ * Throws a {@link GLException} if GL-function constraints are not met. * </p> * <p> + * Depends on <code>GL_EXT_direct_state_access</code>. + * </p> + * <p> * {@link GL2#glMapNamedBufferRangeEXT(int, long, long, int)} wrapper calls this method and returns {@link GLBufferStorage#getMappedBuffer()}. * </p> * @param bufferName denotes the buffer @@ -36,5 +42,5 @@ * @throws GLException if buffer has invalid store size, i.e. less-than zero * @throws GLException if buffer mapping range does not fit, incl. offset */ - public GLBufferStorage mapNamedBufferRange(final int bufferName, final long offset, final long length, final int access) throws GLException; + public GLBufferStorage mapNamedBufferRangeEXT(final int bufferName, final long offset, final long length, final int access) throws GLException; diff --git a/make/config/jogl/gl-if-CustomJavaCode-gl4.java b/make/config/jogl/gl-if-CustomJavaCode-gl4.java new file mode 100644 index 000000000..8ed25e56b --- /dev/null +++ b/make/config/jogl/gl-if-CustomJavaCode-gl4.java @@ -0,0 +1,46 @@ + + // + // GLBufferObjectTracker Redirects + // + + /** + * Returns the {@link GLBufferStorage} instance as mapped via OpenGL's native {@link GL4#glMapNamedBuffer(int, int) glMapNamedBuffer(..)} implementation. + * <p> + * Throws a {@link GLException} if GL-function constraints are not met. + * </p> + * <p> + * Depends on <code>GL_VERSION_4_5</code>. + * </p> + * <p> + * {@link GL4#glMapNamedBuffer(int, int)} wrapper calls this method and returns {@link GLBufferStorage#getMappedBuffer()}. + * </p> + * @param bufferName denotes the buffer + * @param access the mapping access mode + * @throws GLException if buffer is not tracked + * @throws GLException if buffer is already mapped + * @throws GLException if buffer has invalid store size, i.e. less-than zero + */ + public GLBufferStorage mapNamedBuffer(int bufferName, int access) throws GLException; + + /** + * Returns the {@link GLBufferStorage} instance as mapped via OpenGL's native {@link GL4#glMapNamedBufferRange(int, long, long, int) glMapNamedBufferRange(..)} implementation. + * <p> + * Throws a {@link GLException} if GL-function constraints are not met. + * </p> + * <p> + * Depends on <code>GL_VERSION_4_5</code>. + * </p> + * <p> + * {@link GL4#glMapNamedBufferRange(int, long, long, int)} wrapper calls this method and returns {@link GLBufferStorage#getMappedBuffer()}. + * </p> + * @param bufferName denotes the buffer + * @param offset offset of the mapped buffer's storage + * @param length length of the mapped buffer's storage + * @param access the mapping access mode + * @throws GLException if buffer is not tracked + * @throws GLException if buffer is already mapped + * @throws GLException if buffer has invalid store size, i.e. less-than zero + * @throws GLException if buffer mapping range does not fit, incl. offset + */ + public GLBufferStorage mapNamedBufferRange(final int bufferName, final long offset, final long length, final int access) throws GLException; + diff --git a/make/config/jogl/gl-if-gl4.cfg b/make/config/jogl/gl-if-gl4.cfg index d4e231ce9..3ba10e24a 100644 --- a/make/config/jogl/gl-if-gl4.cfg +++ b/make/config/jogl/gl-if-gl4.cfg @@ -39,6 +39,8 @@ Include gl-embedded-ignores.cfg Include gl3-desktop.cfg Include gl3-common.cfg +IncludeAs CustomJavaCode GL4 gl-if-CustomJavaCode-gl4.java + # dummy procaddress config / force procaddress for comments EmitProcAddressTable false ProcAddressTableClassName DontGenerateProcAddressTableStuff diff --git a/make/config/jogl/gl-impl-CustomJavaCode-common.java b/make/config/jogl/gl-impl-CustomJavaCode-common.java index 6ecb886b7..b764191e2 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-common.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-common.java @@ -140,9 +140,9 @@ public final void glBufferData(int target, long size, Buffer data, int usage) { bufferObjectTracker.createBufferStorage(bufferStateTracker, this, target, size, data, usage, 0 /* immutableFlags */, - createBoundMutableStorageDispatch); + glBufferDataDispatch); } - private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createBoundMutableStorageDispatch = + private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glBufferDataDispatch = new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { public final void create(final int target, final long size, final Buffer data, final int mutableUsage) { glBufferDataDelegate(target, size, data, mutableUsage); @@ -151,9 +151,9 @@ @Override public boolean glUnmapBuffer(int target) { - return bufferObjectTracker.unmapBuffer(bufferStateTracker, this, target, unmapBoundBufferDispatch); + return bufferObjectTracker.unmapBuffer(bufferStateTracker, this, target, glUnmapBufferDispatch); } - private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch unmapBoundBufferDispatch = + private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch glUnmapBufferDispatch = new jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch() { public final boolean unmap(final int target) { return glUnmapBufferDelegate(target); @@ -166,9 +166,9 @@ } @Override public final GLBufferStorage mapBuffer(final int target, final int access) { - return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, access, mapBoundBufferAllDispatch); + return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, access, glMapBufferDispatch); } - private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch mapBoundBufferAllDispatch = + private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch glMapBufferDispatch = new jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch() { public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } public final long mapBuffer(final int target, final int access) { @@ -182,9 +182,9 @@ } @Override public final GLBufferStorage mapBufferRange(final int target, final long offset, final long length, final int access) { - return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, offset, length, access, mapBoundBufferRangeDispatch); + return bufferObjectTracker.mapBuffer(bufferStateTracker, this, target, offset, length, access, glMapBufferRangeDispatch); } - private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch mapBoundBufferRangeDispatch = + private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch glMapBufferRangeDispatch = new jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch() { public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } public final long mapBuffer(final int target, final long offset, final long length, final int access) { diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java index 72f4707a2..f46f08a94 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl4bc.java @@ -468,9 +468,9 @@ public final void glTexCoordPointer(GLArrayData array) { public final void glNamedBufferData(int buffer, long size, Buffer data, int usage) { bufferObjectTracker.createBufferStorage(this, buffer, size, data, usage, 0 /* immutableFlags */, - createNamedMutableStorageDispatch); + glNamedBufferDataDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createNamedMutableStorageDispatch = +private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glNamedBufferDataDispatch = new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { public final void create(final int buffer, final long size, final Buffer data, final int mutableUsage) { glNamedBufferDataDelegate(buffer, size, data, mutableUsage); @@ -478,12 +478,25 @@ private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createNa }; @Override +public final void glNamedBufferDataEXT(int buffer, long size, Buffer data, int usage) { + bufferObjectTracker.createBufferStorage(this, + buffer, size, data, usage, 0 /* immutableFlags */, + glNamedBufferDataEXTDispatch); +} +private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glNamedBufferDataEXTDispatch = + new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { + public final void create(final int buffer, final long size, final Buffer data, final int mutableUsage) { + glNamedBufferDataEXTDelegate(buffer, size, data, mutableUsage); + } + }; + +@Override public final void glBufferStorage(int target, long size, Buffer data, int flags) { bufferObjectTracker.createBufferStorage(bufferStateTracker, this, target, size, data, 0 /* mutableUsage */, flags, - createBoundImmutableStorageDispatch); + glBufferStorageDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createBoundImmutableStorageDispatch = +private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glBufferStorageDispatch = new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { public final void create(final int target, final long size, final Buffer data, final int immutableFlags) { glBufferStorageDelegate(target, size, data, immutableFlags); @@ -494,20 +507,32 @@ private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createBo public final void glNamedBufferStorage(int buffer, long size, Buffer data, int flags) { bufferObjectTracker.createBufferStorage(this, buffer, size, data, 0 /* mutableUsage */, flags, - createNamedImmutableStorageDispatch); + glNamedBufferStorageDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch createNamedImmutableStorageDispatch = +private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glNamedBufferStorageDispatch = new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { public final void create(final int buffer, final long size, final Buffer data, final int immutableFlags) { glNamedBufferStorageDelegate(buffer, size, data, immutableFlags); } }; +@Override +public final void glNamedBufferStorageEXT(int buffer, long size, Buffer data, int flags) { + bufferObjectTracker.createBufferStorage(this, + buffer, size, data, 0 /* mutableUsage */, flags, + glNamedBufferStorageEXTDispatch); +} +private final jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch glNamedBufferStorageEXTDispatch = + new jogamp.opengl.GLBufferObjectTracker.CreateStorageDispatch() { + public final void create(final int buffer, final long size, final Buffer data, final int immutableFlags) { + glNamedBufferStorageEXTDelegate(buffer, size, data, immutableFlags); + } + }; @Override public boolean glUnmapNamedBuffer(int buffer) { - return bufferObjectTracker.unmapBuffer(buffer, unmapNamedBufferDispatch); + return bufferObjectTracker.unmapBuffer(buffer, glUnmapNamedBufferDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch unmapNamedBufferDispatch = +private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch glUnmapNamedBufferDispatch = new jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch() { public final boolean unmap(final int buffer) { return glUnmapNamedBufferDelegate(buffer); @@ -515,10 +540,14 @@ private final jogamp.opengl.GLBufferObjectTracker.UnmapBufferDispatch unmapNamed }; @Override +public final java.nio.ByteBuffer glMapNamedBuffer(int bufferName, int access) { + return mapNamedBuffer(bufferName, access).getMappedBuffer(); +} +@Override public final GLBufferStorage mapNamedBuffer(final int bufferName, final int access) { - return bufferObjectTracker.mapBuffer(bufferName, access, mapNamedBufferAllDispatch); + return bufferObjectTracker.mapBuffer(bufferName, access, glMapNamedBufferDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch mapNamedBufferAllDispatch = +private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch glMapNamedBufferDispatch = new jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch() { public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } public final long mapBuffer(final int bufferName, final int access) { @@ -527,10 +556,30 @@ private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch mapNamedB }; @Override +public final java.nio.ByteBuffer glMapNamedBufferEXT(int bufferName, int access) { + return mapNamedBufferEXT(bufferName, access).getMappedBuffer(); +} +@Override +public final GLBufferStorage mapNamedBufferEXT(final int bufferName, final int access) { + return bufferObjectTracker.mapBuffer(bufferName, access, glMapNamedBufferEXTDispatch); +} +private final jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch glMapNamedBufferEXTDispatch = + new jogamp.opengl.GLBufferObjectTracker.MapBufferAllDispatch() { + public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } + public final long mapBuffer(final int bufferName, final int access) { + return glMapNamedBufferEXTDelegate(bufferName, access); + } + }; + +@Override +public final ByteBuffer glMapNamedBufferRange(int bufferName, long offset, long length, int access) { + return mapNamedBufferRange(bufferName, offset, length, access).getMappedBuffer(); +} +@Override public final GLBufferStorage mapNamedBufferRange(final int bufferName, final long offset, final long length, final int access) { - return bufferObjectTracker.mapBuffer(bufferName, offset, length, access, mapNamedBufferRangeDispatch); + return bufferObjectTracker.mapBuffer(bufferName, offset, length, access, glMapNamedBufferRangeDispatch); } -private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch mapNamedBufferRangeDispatch = +private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch glMapNamedBufferRangeDispatch = new jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch() { public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } public final long mapBuffer(final int bufferName, final long offset, final long length, final int access) { @@ -539,13 +588,18 @@ private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch mapName }; @Override -public final java.nio.ByteBuffer glMapNamedBuffer(int bufferName, int access) { - return mapNamedBuffer(bufferName, access).getMappedBuffer(); +public final ByteBuffer glMapNamedBufferRangeEXT(int bufferName, long offset, long length, int access) { + return mapNamedBufferRangeEXT(bufferName, offset, length, access).getMappedBuffer(); } - @Override -public final ByteBuffer glMapNamedBufferRange(int bufferName, long offset, long length, int access) { - return mapNamedBufferRange(bufferName, offset, length, access).getMappedBuffer(); +public final GLBufferStorage mapNamedBufferRangeEXT(final int bufferName, final long offset, final long length, final int access) { + return bufferObjectTracker.mapBuffer(bufferName, offset, length, access, glMapNamedBufferRangeEXTDispatch); } - +private final jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch glMapNamedBufferRangeEXTDispatch = + new jogamp.opengl.GLBufferObjectTracker.MapBufferRangeDispatch() { + public final ByteBuffer allocNioByteBuffer(final long addr, final long length) { return newDirectByteBuffer(addr, length); } + public final long mapBuffer(final int bufferName, final long offset, final long length, final int access) { + return glMapNamedBufferRangeEXTDelegate(bufferName, offset, length, access); + } + }; |