aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2013-10-10 02:15:56 +0200
committerSven Gothel <[email protected]>2013-10-10 02:15:56 +0200
commit4e83a5df7a851cc33d85f76381f058256906ad4c (patch)
tree9454329d601da72c7e4642491406dac8eed3d4c6
parente96b2d648e7d69b95325fb6b80c6eb508e1e8a14 (diff)
Bug 852: Remove CPU sourced data API entry where not allowed (ES3 and GL core >= 3.0) ; GL2 cfg: Ignore GL2ES3 symbols (super)
Remove CPU sourced data API entries via new config 'BufferObjectOnly <name>', listed in 'gl-common-gpubufferonly.cfg' and included in ES3 and all GL core >= 3 interfaces. If BufferObjectOnly is defined for a function, only the 'long offset' variant is being emitted. Due to limitations of GlueGen's 'ExtendedInterfaceSymbolsIgnore A.java', which only identifies the function name and not the signature - all CPU sourced variants are manually added to the compatibility and ES2 GL profiles via '*-common-cpubufferJavaCode.java' files. GLContext: Added 'isCPUSourcedAvail()' to determine whether context allows CPU sourced data, i.e. for GL2ES1 and GLES2 ctx. GLContext/GLProfile/GL: isGLES2() now returns false if having a ES3 context due to 'CPU sourced' incompatibility! +++ GL2 cfg: Added ignore GL2ES3 symbols of it's superclass, removing duplicated symbols.
-rw-r--r--make/build-jogl.xml19
-rw-r--r--make/config/jogl/gl-common-gpubufferonly.cfg50
-rw-r--r--make/config/jogl/gl-es3-impl.cfg (renamed from make/config/jogl/gl-es3.cfg)15
-rw-r--r--make/config/jogl/gl-gl4bc.cfg3
-rw-r--r--make/config/jogl/gl-if-es2.cfg3
-rw-r--r--make/config/jogl/gl-if-es3.cfg39
-rw-r--r--make/config/jogl/gl-if-gl.cfg1
-rw-r--r--make/config/jogl/gl-if-gl2.cfg3
-rw-r--r--make/config/jogl/gl-if-gl2_es1.cfg2
-rw-r--r--make/config/jogl/gl-if-gl2_es2.cfg1
-rw-r--r--make/config/jogl/gl-if-gl2_es3.cfg1
-rw-r--r--make/config/jogl/gl-if-gl2_gl3.cfg1
-rw-r--r--make/config/jogl/gl-if-gl3.cfg1
-rw-r--r--make/config/jogl/gl-if-gl3bc.cfg2
-rw-r--r--make/config/jogl/gl-if-gl4.cfg1
-rw-r--r--make/config/jogl/gl-if-gl4_es3.cfg1
-rw-r--r--make/config/jogl/gl-impl-CustomJavaCode-gles3.java2
-rw-r--r--make/config/jogl/gl2-common-cpubufferJavaCode.java13
-rw-r--r--make/config/jogl/gl2_es1-common-cpubufferJavaCode.java4
-rw-r--r--make/config/jogl/gl2_es2-common-cpubufferJavaCode.java4
-rw-r--r--make/config/jogl/gl3bc-common-cpubufferJavaCode.java13
-rw-r--r--make/config/jogl/gl4bc-common-cpubufferJavaCode.java21
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java8
-rw-r--r--src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java25
-rw-r--r--src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java6
-rw-r--r--src/jogl/classes/javax/media/opengl/GLContext.java14
-rw-r--r--src/jogl/classes/javax/media/opengl/GLProfile.java4
-rw-r--r--src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java15
28 files changed, 241 insertions, 31 deletions
diff --git a/make/build-jogl.xml b/make/build-jogl.xml
index e83f33603..8c30bb038 100644
--- a/make/build-jogl.xml
+++ b/make/build-jogl.xml
@@ -602,11 +602,24 @@
</target>
<target name="java.generate.gles3">
- <echo message="Generating GLES3 interface and implementation" />
+ <echo message="Generating GLES3 interface" />
<antcall target="java.generate.copy2temp" inheritRefs="true" />
<gluegen src="${stub.includes.opengl}/gles3.c"
outputRootDir="${build.jogl}"
- config="${config.jogl}/gl-es3.cfg"
+ config="${config.jogl}/gl-if-es3.cfg"
+ includeRefid="stub.includes.fileset.all.gldesktop"
+ literalInclude="${stub.includes.gluegen.gg}"
+ emitter="com.jogamp.gluegen.opengl.GLEmitter">
+ <classpath refid="gluegen-gl.classpath" />
+ </gluegen>
+ </target>
+
+ <target name="java.generate.gles3impl">
+ <echo message="Generating GLES3 implementation" />
+ <antcall target="java.generate.copy2temp" inheritRefs="true" />
+ <gluegen src="${stub.includes.opengl}/gles3.c"
+ outputRootDir="${build.jogl}"
+ config="${config.jogl}/gl-es3-impl.cfg"
includeRefid="stub.includes.fileset.all.gldesktop"
literalInclude="${stub.includes.gluegen.gg}"
emitter="com.jogamp.gluegen.opengl.GLEmitter">
@@ -641,7 +654,7 @@
</gluegen>
</target>
- <target name="java.generate.gl.all" depends="build.gluegen-gl.jar, java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gles1, java.generate.gl2_es2_if, java.generate.gles2, java.generate.gl2_es3_if, java.generate.gl3_es3_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl4_es3_if, java.generate.gles3, java.generate.gl4, java.generate.gl4bc"/>
+ <target name="java.generate.gl.all" depends="build.gluegen-gl.jar, java.generate.gl_if, java.generate.gl2_es1_if, java.generate.gles1, java.generate.gl2_es2_if, java.generate.gles2, java.generate.gl2_es3_if, java.generate.gl3_es3_if, java.generate.gl2_gl3_if, java.generate.gl2, java.generate.gl3, java.generate.gl3bc, java.generate.gl4_es3_if, java.generate.gles3, java.generate.gles3impl, java.generate.gl4, java.generate.gl4bc"/>
<!-- target name="java.generate.gl.nsig" if="gluegen.nsig">
<echo message="Generating GL interface and implementation" />
diff --git a/make/config/jogl/gl-common-gpubufferonly.cfg b/make/config/jogl/gl-common-gpubufferonly.cfg
new file mode 100644
index 000000000..14671f353
--- /dev/null
+++ b/make/config/jogl/gl-common-gpubufferonly.cfg
@@ -0,0 +1,50 @@
+
+#
+# For core GL spec >= 3.1 and ES >= 3.0
+# source can only be a buffer object!
+#
+# See Bug 852
+#
+# OpenGL 3.1 core spec 2.10 p41
+# Vertex Array Objects - *Pointer commands
+#
+# OpenGL 3.2 core spec 2.9.7 p45
+# Draw* commands -w/ "Array Indices in Buffer Objects"
+#
+# OpenGL 4.0 core spec 2.9.8 p51:
+# Draw* Indirect Commands ..
+#
+
+BufferObjectOnly glColorPointer
+BufferObjectOnly glEdgeFlagPointer
+BufferObjectOnly glElementPointerATI
+BufferObjectOnly glFogCoordPointer
+BufferObjectOnly glFogCoordPointerEXT
+BufferObjectOnly glInterleavedArrays
+BufferObjectOnly glMatrixIndexPointerARB
+BufferObjectOnly glNormalPointer
+BufferObjectOnly glSecondaryColorPointer
+BufferObjectOnly glSecondaryColorPointerEXT
+BufferObjectOnly glTexCoordPointer
+BufferObjectOnly glVariantPointerEXT
+BufferObjectOnly glVertexPointer
+BufferObjectOnly glVertexAttribPointer
+BufferObjectOnly glVertexAttribPointerARB
+BufferObjectOnly glVertexAttribPointerNV
+BufferObjectOnly glVertexAttribIPointer
+BufferObjectOnly glVertexAttribLPointer
+BufferObjectOnly glVertexWeightPointerEXT
+BufferObjectOnly glWeightPointerARB
+
+BufferObjectOnly glDrawElements
+BufferObjectOnly glDrawElementsBaseVertex
+BufferObjectOnly glDrawElementsInstanced
+BufferObjectOnly glDrawElementsInstancedBaseInstance
+BufferObjectOnly glDrawElementsInstancedBaseVertex
+BufferObjectOnly glDrawElementsInstancedBaseVertexBaseInstance
+BufferObjectOnly glDrawRangeElements
+BufferObjectOnly glDrawRangeElementsBaseVertex
+
+BufferObjectOnly glDrawArraysIndirect
+BufferObjectOnly glDrawElementsIndirect
+
diff --git a/make/config/jogl/gl-es3.cfg b/make/config/jogl/gl-es3-impl.cfg
index 997723d01..2e5e36e9c 100644
--- a/make/config/jogl/gl-es3.cfg
+++ b/make/config/jogl/gl-es3-impl.cfg
@@ -1,4 +1,4 @@
-# This .cfg file is used to generate the GL interface and implementing class.
+# This .cfg file is used to generate the GL implementing class.
JavaOutputDir gensrc/classes
NativeOutputDir gensrc/native/jogl/es3
@@ -8,18 +8,10 @@ ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/G
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4ES3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GLES3.java
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
-Package javax.media.opengl
-Style InterfaceAndImpl
-JavaClass GLES3
-#Extends GLES3 GLBase
-#Extends GLES3 GL
-#Extends GLES3 GL2ES2
-#Extends GLES3 GL2ES3
-#Extends GLES3 GL3ES3
-Extends GLES3 GLES2
-Extends GLES3 GL4ES3
+Style ImplOnly
ImplPackage jogamp.opengl.es3
ImplJavaClass GLES3Impl
Implements GLES3Impl GLBase
@@ -29,6 +21,7 @@ Implements GLES3Impl GLES2
Implements GLES3Impl GL2ES3
Implements GLES3Impl GL3ES3
Implements GLES3Impl GL4ES3
+Implements GLES3Impl GLES3
HierarchicalNativeOutput false
Include gl-common.cfg
Include gl-common-extensions.cfg
diff --git a/make/config/jogl/gl-gl4bc.cfg b/make/config/jogl/gl-gl4bc.cfg
index d1bd85641..c3a392c52 100644
--- a/make/config/jogl/gl-gl4bc.cfg
+++ b/make/config/jogl/gl-gl4bc.cfg
@@ -84,6 +84,8 @@ TagNativeBinding true
# Ignore extensions that are already picked up via the GL2ES1 interface
IgnoreExtension GL_EXT_point_parameters
+IncludeAs CustomJavaCode GL4bc gl4bc-common-cpubufferJavaCode.java
+
# Add PixelStorei StateTracker
CustomJavaCode GL4bcImpl private static final int params_offset = 0; // just a helper for JavaPrologue ..
@@ -117,6 +119,7 @@ Include gl3ext-headers.cfg
IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-common.java
IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl4bc.java
IncludeAs CustomJavaCode GL4bcImpl gl-impl-CustomJavaCode-gl2_es2.java
+
IncludeAs CustomCCode gl-impl-CustomCCode-gl4bc.c
Import javax.media.opengl.GLES1
diff --git a/make/config/jogl/gl-if-es2.cfg b/make/config/jogl/gl-if-es2.cfg
index aabd2d5a7..052722f40 100644
--- a/make/config/jogl/gl-if-es2.cfg
+++ b/make/config/jogl/gl-if-es2.cfg
@@ -17,6 +17,9 @@ Include gl-common-extensions.cfg
Include gl2_es2-common.cfg
Include gl2_es2-CustomJavaCode.cfg
+IncludeAs CustomJavaCode GLES2 gl2_es1-common-cpubufferJavaCode.java
+IncludeAs CustomJavaCode GLES2 gl2_es2-common-cpubufferJavaCode.java
+
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
diff --git a/make/config/jogl/gl-if-es3.cfg b/make/config/jogl/gl-if-es3.cfg
new file mode 100644
index 000000000..33e41762a
--- /dev/null
+++ b/make/config/jogl/gl-if-es3.cfg
@@ -0,0 +1,39 @@
+# This .cfg file is used to generate the GL interface.
+JavaOutputDir gensrc/classes
+
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GLES2.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL3ES3.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL4ES3.java
+ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
+
+Package javax.media.opengl
+Style InterfaceOnly
+JavaClass GLES3
+#Extends GLES3 GLBase
+#Extends GLES3 GL
+#Extends GLES3 GL2ES2
+#Extends GLES3 GL2ES3
+#Extends GLES3 GL3ES3
+Extends GLES3 GLES2
+Extends GLES3 GL4ES3
+HierarchicalNativeOutput false
+Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
+Include gl-common-extensions.cfg
+Include gl2_es3-common.cfg
+Include gl2_es2-CustomJavaCode.cfg
+
+ForceExtension GL_ARB_ES3_compatibility
+
+# dummy procaddress config / force procaddress for comments
+EmitProcAddressTable false
+ProcAddressTableClassName DontGenerateProcAddressTableStuff
+GetProcAddressTableExpr DontGenerateProcAddressTableStuff
+ForceProcAddressGen __ALL__
+
+# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
+TagNativeBinding true
+
diff --git a/make/config/jogl/gl-if-gl.cfg b/make/config/jogl/gl-if-gl.cfg
index 4137cae8e..5c9e4caa2 100644
--- a/make/config/jogl/gl-if-gl.cfg
+++ b/make/config/jogl/gl-if-gl.cfg
@@ -8,6 +8,7 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.jav
HierarchicalNativeOutput false
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl-if-gl-ignores.cfg
Include gl-if-gl2_es2-ignores.cfg
diff --git a/make/config/jogl/gl-if-gl2.cfg b/make/config/jogl/gl-if-gl2.cfg
index 60efd73af..37f7b6feb 100644
--- a/make/config/jogl/gl-if-gl2.cfg
+++ b/make/config/jogl/gl-if-gl2.cfg
@@ -5,6 +5,7 @@ NativeOutputDir gensrc/native/jogl/gl2
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL.java
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES1.java
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES2.java
+ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2ES3.java
ExtendedInterfaceSymbolsIgnore ../build-temp/gensrc/classes/javax/media/opengl/GL2GL3.java
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.java
ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/fixedfunc/GLMatrixFunc.java
@@ -26,6 +27,8 @@ Include gl-if-gl3-ignores.cfg
Include gl-if-gl4-ignores.cfg
IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl_compat.java
+IncludeAs CustomJavaCode GL2 gl2_es2-common-cpubufferJavaCode.java
+IncludeAs CustomJavaCode GL2 gl2-common-cpubufferJavaCode.java
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
diff --git a/make/config/jogl/gl-if-gl2_es1.cfg b/make/config/jogl/gl-if-gl2_es1.cfg
index 04d78f51e..b533e83c3 100644
--- a/make/config/jogl/gl-if-gl2_es1.cfg
+++ b/make/config/jogl/gl-if-gl2_es1.cfg
@@ -110,6 +110,8 @@ Ignore GL_MATRIX_INDEX_ARRAY_BUFFER_BINDING_OES
CustomJavaCode GL2ES1 public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val);
CustomJavaCode GL2ES1 public void glFrustum(double left, double right, double bottom, double top, double zNear, double zFar);
+IncludeAs CustomJavaCode GL2ES1 gl2_es1-common-cpubufferJavaCode.java
+
# dummy procaddress config / force procaddress for comments
EmitProcAddressTable false
ProcAddressTableClassName DontGenerateProcAddressTableStuff
diff --git a/make/config/jogl/gl-if-gl2_es2.cfg b/make/config/jogl/gl-if-gl2_es2.cfg
index 0ad140eb2..db5489d06 100644
--- a/make/config/jogl/gl-if-gl2_es2.cfg
+++ b/make/config/jogl/gl-if-gl2_es2.cfg
@@ -13,6 +13,7 @@ Extends GL2ES2 GL
HierarchicalNativeOutput false
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl2_es2-common.cfg
Include gl-if-gl2_es2-ignores.cfg
diff --git a/make/config/jogl/gl-if-gl2_es3.cfg b/make/config/jogl/gl-if-gl2_es3.cfg
index f44c9b393..112bc5434 100644
--- a/make/config/jogl/gl-if-gl2_es3.cfg
+++ b/make/config/jogl/gl-if-gl2_es3.cfg
@@ -17,6 +17,7 @@ ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL2ES3
HierarchicalNativeOutput false
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl2_es3-common.cfg
Include gl-if-gl2_es3-ignores.cfg
diff --git a/make/config/jogl/gl-if-gl2_gl3.cfg b/make/config/jogl/gl-if-gl2_gl3.cfg
index 467919328..532a670e6 100644
--- a/make/config/jogl/gl-if-gl2_gl3.cfg
+++ b/make/config/jogl/gl-if-gl2_gl3.cfg
@@ -16,6 +16,7 @@ ExtendedInterfaceSymbolsOnly ../build-temp/gluegen-set/javax/media/opengl/GL2GL3
HierarchicalNativeOutput false
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl-desktop.cfg
Include gl3-common.cfg
diff --git a/make/config/jogl/gl-if-gl3.cfg b/make/config/jogl/gl-if-gl3.cfg
index 09f51d6b0..d472fbc29 100644
--- a/make/config/jogl/gl-if-gl3.cfg
+++ b/make/config/jogl/gl-if-gl3.cfg
@@ -20,6 +20,7 @@ Extends GL3 GL3ES3
Extends GL3 GL2GL3
ImplPackage jogamp.opengl.gl3
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl3-desktop.cfg
Include gl3-common.cfg
diff --git a/make/config/jogl/gl-if-gl3bc.cfg b/make/config/jogl/gl-if-gl3bc.cfg
index bca3d61e6..5172c726c 100644
--- a/make/config/jogl/gl-if-gl3bc.cfg
+++ b/make/config/jogl/gl-if-gl3bc.cfg
@@ -34,7 +34,7 @@ Include gl-desktop.cfg
Include gl3-desktop.cfg
Include gl-if-gl4-ignores.cfg
-IncludeAs CustomJavaCode GL2 gl-if-CustomJavaCode-gl_compat.java
+IncludeAs CustomJavaCode GL3bc gl3bc-common-cpubufferJavaCode.java
# Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums
TagNativeBinding true
diff --git a/make/config/jogl/gl-if-gl4.cfg b/make/config/jogl/gl-if-gl4.cfg
index 4b19b448e..144c10ad2 100644
--- a/make/config/jogl/gl-if-gl4.cfg
+++ b/make/config/jogl/gl-if-gl4.cfg
@@ -23,6 +23,7 @@ JavaClass GL4
Extends GL4 GL4ES3
Extends GL4 GL3
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl3-desktop.cfg
Include gl3-common.cfg
diff --git a/make/config/jogl/gl-if-gl4_es3.cfg b/make/config/jogl/gl-if-gl4_es3.cfg
index cd9c17f27..6233d530a 100644
--- a/make/config/jogl/gl-if-gl4_es3.cfg
+++ b/make/config/jogl/gl-if-gl4_es3.cfg
@@ -20,6 +20,7 @@ ExtendedInterfaceSymbolsIgnore ../src/jogl/classes/javax/media/opengl/GLBase.jav
HierarchicalNativeOutput false
Include gl-common.cfg
+Include gl-common-gpubufferonly.cfg
Include gl-common-extensions.cfg
Include gl2_es3-common.cfg
Include gl-if-gl2_es3-ignores.cfg
diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
index 5c58f6cc4..38deb3399 100644
--- a/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
+++ b/make/config/jogl/gl-impl-CustomJavaCode-gles3.java
@@ -48,7 +48,7 @@ public final boolean isGLES1() {
@Override
public final boolean isGLES2() {
- return true;
+ return !_isES3;
}
@Override
diff --git a/make/config/jogl/gl2-common-cpubufferJavaCode.java b/make/config/jogl/gl2-common-cpubufferJavaCode.java
new file mode 100644
index 000000000..50a97b3df
--- /dev/null
+++ b/make/config/jogl/gl2-common-cpubufferJavaCode.java
@@ -0,0 +1,13 @@
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsInstanced}(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei instancecount); </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_1</code>; <code>GL_ARB_draw_instanced</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsInstanced(int mode, int count, int type, Buffer indices, int instancecount);
+
+ /** Entry point to C language function: <code> void {@native glDrawRangeElements}(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices); </code> <br>Part of <code>GL_VERSION_1_2</code>, <code>GL_ES_VERSION_3_0</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawRangeElements(int mode, int start, int end, int count, int type, Buffer indices);
+
+ /** Entry point to C language function: <code> void {@native glVertexAttribIPointer}(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); </code> <br>Part of <code>GL_ES_VERSION_3_0</code>, <code>GL_VERSION_3_0</code>
+ @param pointer a direct only {@link java.nio.Buffer} */
+ public void glVertexAttribIPointer(int index, int size, int type, int stride, Buffer pointer);
+
diff --git a/make/config/jogl/gl2_es1-common-cpubufferJavaCode.java b/make/config/jogl/gl2_es1-common-cpubufferJavaCode.java
new file mode 100644
index 000000000..39bc141b8
--- /dev/null
+++ b/make/config/jogl/gl2_es1-common-cpubufferJavaCode.java
@@ -0,0 +1,4 @@
+ /** Entry point to C language function: <code> void {@native glDrawElements}(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices); </code> <br>Part of <code>GL_VERSION_ES_CL_CM</code>, <code>GL_VERSION_1_1</code>, <code>GL_ES_VERSION_2_0</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElements(int mode, int count, int type, Buffer indices);
+
diff --git a/make/config/jogl/gl2_es2-common-cpubufferJavaCode.java b/make/config/jogl/gl2_es2-common-cpubufferJavaCode.java
new file mode 100644
index 000000000..fe6820e1f
--- /dev/null
+++ b/make/config/jogl/gl2_es2-common-cpubufferJavaCode.java
@@ -0,0 +1,4 @@
+ /** Entry point to C language function: <code> void {@native glVertexAttribPointer}(GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid * ptr); </code> <br>Part of <code>GL_ES_VERSION_2_0</code>, <code>GL_VERSION_2_0</code>
+ @param ptr a direct only {@link java.nio.Buffer} */
+ public void glVertexAttribPointer(int indx, int size, int type, boolean normalized, int stride, Buffer ptr);
+
diff --git a/make/config/jogl/gl3bc-common-cpubufferJavaCode.java b/make/config/jogl/gl3bc-common-cpubufferJavaCode.java
new file mode 100644
index 000000000..d5d2ec836
--- /dev/null
+++ b/make/config/jogl/gl3bc-common-cpubufferJavaCode.java
@@ -0,0 +1,13 @@
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsBaseVertex}(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); </code> <br>Part of <code>GL_ARB_draw_elements_base_vertex</code>, <code>GL_VERSION_3_2</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsBaseVertex(int mode, int count, int type, Buffer indices, int basevertex);
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsInstancedBaseVertex}(GLenum mode, GLsizei count, GLenum type, const GLvoid * indices, GLsizei instancecount, GLint basevertex); </code> <br>Part of <code>GL_ARB_draw_elements_base_vertex</code>, <code>GL_VERSION_3_2</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsInstancedBaseVertex(int mode, int count, int type, Buffer indices, int instancecount, int basevertex);
+
+ /** Entry point to C language function: <code> void {@native glDrawRangeElementsBaseVertex}(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid * indices, GLint basevertex); </code> <br>Part of <code>GL_ARB_draw_elements_base_vertex</code>, <code>GL_VERSION_3_2</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawRangeElementsBaseVertex(int mode, int start, int end, int count, int type, Buffer indices, int basevertex);
+
diff --git a/make/config/jogl/gl4bc-common-cpubufferJavaCode.java b/make/config/jogl/gl4bc-common-cpubufferJavaCode.java
new file mode 100644
index 000000000..a29f540fa
--- /dev/null
+++ b/make/config/jogl/gl4bc-common-cpubufferJavaCode.java
@@ -0,0 +1,21 @@
+
+ /** Entry point to C language function: <code> void {@native glDrawArraysIndirect}(GLenum mode, const GLvoid * indirect); </code> <br>Part of <code>GL_VERSION_4_0</code>, <code>GL_ARB_draw_indirect</code>
+ @param indirect a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawArraysIndirect(int mode, Buffer indirect);
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsIndirect}(GLenum mode, GLenum type, const GLvoid * indirect); </code> <br>Part of <code>GL_VERSION_4_0</code>, <code>GL_ARB_draw_indirect</code>
+ @param indirect a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsIndirect(int mode, int type, Buffer indirect);
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsInstancedBaseInstance}(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLuint baseinstance); </code> <br>Part of <code>GL_VERSION_4_2</code>, <code>GL_ARB_base_instance</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsInstancedBaseInstance(int mode, int count, int type, Buffer indices, int instancecount, int baseinstance);
+
+ /** Entry point to C language function: <code> void {@native glDrawElementsInstancedBaseVertexBaseInstance}(GLenum mode, GLsizei count, GLenum type, const void * indices, GLsizei instancecount, GLint basevertex, GLuint baseinstance); </code> <br>Part of <code>GL_VERSION_4_2</code>, <code>GL_ARB_base_instance</code>
+ @param indices a direct or array-backed {@link java.nio.Buffer} */
+ public void glDrawElementsInstancedBaseVertexBaseInstance(int mode, int count, int type, Buffer indices, int instancecount, int basevertex, int baseinstance);
+
+ /** Entry point to C language function: <code> void {@native glVertexAttribLPointer}(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid * pointer); </code> <br>Part of <code>GL_VERSION_4_1</code>, <code>GL_ARB_vertex_attrib_64bit</code>
+ @param pointer a direct only {@link java.nio.Buffer} */
+ public void glVertexAttribLPointer(int index, int size, int type, int stride, Buffer pointer);
+
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
index 861957c23..a00b19abc 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLConfiguration.java
@@ -67,6 +67,7 @@ public class GLConfiguration extends ProcAddressConfiguration {
// Maps function names to the kind of buffer object it deals with
private Map<String, GLEmitter.BufferObjectKind> bufferObjectKinds = new HashMap<String, GLEmitter.BufferObjectKind>();
+ private Set<String> bufferObjectOnly = new HashSet<String>();
private GLEmitter emitter;
private Set<String> dropUniqVendorExtensions = new HashSet<String>();
@@ -106,6 +107,9 @@ public class GLConfiguration extends ProcAddressConfiguration {
glHeaders.add(sym);
} else if (cmd.equalsIgnoreCase("BufferObjectKind")) {
readBufferObjectKind(tok, filename, lineNo);
+ } else if (cmd.equalsIgnoreCase("BufferObjectOnly")) {
+ String sym = readString("BufferObjectOnly", tok, filename, lineNo);
+ bufferObjectOnly.add(sym);
} else if (cmd.equalsIgnoreCase("DropUniqVendorExtensions")) {
String sym = readString("DropUniqVendorExtensions", tok, filename, lineNo);
dropUniqVendorExtensions.add(sym);
@@ -339,6 +343,10 @@ public class GLConfiguration extends ProcAddressConfiguration {
public boolean isBufferObjectFunction(String name) {
return (getBufferObjectKind(name) != null);
}
+
+ public boolean isBufferObjectOnly(String name) {
+ return bufferObjectOnly.contains(name);
+ }
/** Parses any GL headers specified in the configuration file for
the purpose of being able to ignore an extension at a time. */
diff --git a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
index fec90d047..fa95049cc 100644
--- a/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
+++ b/src/jogl/classes/com/jogamp/gluegen/opengl/GLEmitter.java
@@ -262,25 +262,31 @@ public class GLEmitter extends ProcAddressEmitter {
case (though we default to true currently). */
@Override
protected List<MethodBinding> expandMethodBinding(MethodBinding binding) {
- List<MethodBinding> bindings = super.expandMethodBinding(binding);
+ final GLConfiguration glConfig = getGLConfig();
+ final List<MethodBinding> bindings = super.expandMethodBinding(binding);
- if (!getGLConfig().isBufferObjectFunction(binding.getName())) {
+ if ( !glConfig.isBufferObjectFunction(binding.getName()) ) {
return bindings;
}
+ final boolean bufferObjectOnly = glConfig.isBufferObjectOnly(binding.getName());
- List<MethodBinding> newBindings = new ArrayList<MethodBinding>(bindings);
+ final List<MethodBinding> newBindings = new ArrayList<MethodBinding>();
// Need to expand each one of the generated bindings to take a
// Java long instead of a Buffer for each void* argument
- for (MethodBinding cur : bindings) {
-
+ // for (MethodBinding cur : bindings) {
+ int j=0;
+ while( j < bindings.size() ) {
+ final MethodBinding cur = bindings.get(j);
+
// Some of these routines (glBitmap) take strongly-typed
// primitive pointers as arguments which are expanded into
// non-void* arguments
// This test (rather than !signatureUsesNIO) is used to catch
// more unexpected situations
if (cur.signatureUsesJavaPrimitiveArrays()) {
+ j++;
continue;
}
@@ -300,9 +306,16 @@ public class GLEmitter extends ProcAddressEmitter {
// Now need to flag this MethodBinding so that we generate the
// correct flags in the emitters later
bufferObjectMethodBindings.put(result, result);
+
+ if( bufferObjectOnly ) {
+ bindings.remove(j);
+ } else {
+ j++;
+ }
}
+ bindings.addAll(newBindings);
- return newBindings;
+ return bindings;
}
@Override
diff --git a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
index dc96cb5f2..dbe916877 100644
--- a/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
+++ b/src/jogl/classes/com/jogamp/opengl/util/ImmModeSink.java
@@ -522,6 +522,10 @@ public class ImmModeSink {
gl.glDrawArrays(mode, 0, vElems);
}
} else {
+ // FIXME: Impl. VBO usage .. or unroll (see above)!
+ if( !gl.getContext().isCPUSourcedAvail() ) {
+ throw new GLException("CPU sourcing n/a w/ "+gl.getContext());
+ }
final int type;
if(indices instanceof ByteBuffer) {
type = GL.GL_UNSIGNED_BYTE;
@@ -553,7 +557,7 @@ public class ImmModeSink {
}
}
} else {
- gl.glDrawElements(mode, idxLen, type, indices);
+ ((GL2ES1)gl).glDrawElements(mode, idxLen, type, indices);
// GL2: gl.glDrawRangeElements(mode, 0, idxLen-1, idxLen, type, indices);
}
}
diff --git a/src/jogl/classes/javax/media/opengl/GLContext.java b/src/jogl/classes/javax/media/opengl/GLContext.java
index 2dca2a685..3a72319bb 100644
--- a/src/jogl/classes/javax/media/opengl/GLContext.java
+++ b/src/jogl/classes/javax/media/opengl/GLContext.java
@@ -1009,6 +1009,16 @@ public abstract class GLContext {
) ;
}
+ /**
+ * Indicates whether this GLContext allows CPU sourced data (indices, vertices ..) as opposed to a GPU buffer source (VBO),
+ * e.g. {@link GL2#glDrawElements(int, int, int, java.nio.Buffer)}.
+ * <p>Includes [GL2ES1, GLES2] == [ GL4bc, GL3bc, GL2, GLES1, GL2ES1, GLES2 ].</p>
+ * <p>See Bug 852 - https://jogamp.org/bugzilla/show_bug.cgi?id=852 </p>
+ */
+ public final boolean isCPUSourcedAvail() {
+ return isGL2ES1() || isGLES2();
+ }
+
/**
* Indicates whether this GLContext's native profile does not implement a default <i>vertex array object</i> (VAO),
* starting w/ OpenGL 3.1 core and GLES3.
@@ -1078,11 +1088,11 @@ public abstract class GLContext {
}
/**
- * Indicates whether this GLContext is capable of GLES2. <p>Includes [ GLES3, GLES2 ].</p>
+ * Indicates whether this GLContext is capable of GLES2. <p>Includes [ GLES2 ].</p>
* @see GLProfile#isGLES2()
*/
public final boolean isGLES2() {
- return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() >= 2 ;
+ return 0 != ( ctxOptions & CTX_PROFILE_ES ) && ctxVersion.getMajor() == 2 ;
}
/**
diff --git a/src/jogl/classes/javax/media/opengl/GLProfile.java b/src/jogl/classes/javax/media/opengl/GLProfile.java
index 1dde2cbb6..4a2edc56b 100644
--- a/src/jogl/classes/javax/media/opengl/GLProfile.java
+++ b/src/jogl/classes/javax/media/opengl/GLProfile.java
@@ -1098,9 +1098,9 @@ public class GLProfile {
return GLES1 == profile;
}
- /** Indicates whether this profile is capable of GLES2. <p>Includes [ GLES3, GLES2 ].</p> */
+ /** Indicates whether this profile is capable of GLES2. <p>Includes [ GLES2 ].</p> */
public final boolean isGLES2() {
- return GLES3 == profile || GLES2 == profile;
+ return GLES2 == profile;
}
/** Indicates whether this profile is capable of GLES3. <p>Includes [ GLES3 ].</p> */
diff --git a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
index 2e924cbfb..173f7b3c6 100644
--- a/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
+++ b/src/jogl/classes/jogamp/opengl/util/glsl/fixedfunc/FixedFuncPipeline.java
@@ -40,6 +40,7 @@ import javax.media.opengl.GL2ES1;
import javax.media.opengl.GL2ES2;
import javax.media.opengl.GL2GL3;
import javax.media.opengl.GLArrayData;
+import javax.media.opengl.GLES2;
import javax.media.opengl.GLException;
import javax.media.opengl.GLRunnable2;
import javax.media.opengl.GLUniformData;
@@ -741,11 +742,17 @@ public class FixedFuncPipeline {
gl.glDrawArrays(GL.GL_TRIANGLE_FAN, (int)(0xffffffff & b.get(idx0+j)), 4);
}
}
- } else if( GL2ES1.GL_POINTS != mode ) {
- gl.glDrawElements(mode, count, type, indices);
} else {
- // FIXME GL_POINTS !
- gl.glDrawElements(mode, count, type, indices);
+ // FIXME: Impl. VBO usage .. or unroll (see above)!
+ if( !gl.getContext().isCPUSourcedAvail() ) {
+ throw new GLException("CPU sourcing n/a w/ "+gl.getContext());
+ }
+ if( GL2ES1.GL_POINTS != mode ) {
+ ((GLES2)gl).glDrawElements(mode, count, type, indices);
+ } else {
+ // FIXME GL_POINTS !
+ ((GLES2)gl).glDrawElements(mode, count, type, indices);
+ }
}
}
public void glDrawElements(GL2ES2 gl, int mode, int count, int type, long indices_buffer_offset) {