diff options
Diffstat (limited to 'make/config')
-rw-r--r-- | make/config/jogl/gl-common.cfg | 2 | ||||
-rwxr-xr-x | make/config/jogl/gl-es1.cfg | 12 | ||||
-rwxr-xr-x | make/config/jogl/gl-es2.cfg | 12 | ||||
-rw-r--r-- | make/config/jogl/gl-gl2.cfg | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-gl2es12.cfg | 9 | ||||
-rw-r--r-- | make/config/jogl/gl-gl3.cfg | 8 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-desktop.java | 32 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-embedded.java | 20 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2.java | 7 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java | 7 | ||||
-rw-r--r-- | make/config/jogl/gl-impl-CustomJavaCode-gl3.java | 7 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles1.java | 7 | ||||
-rwxr-xr-x | make/config/jogl/gl-impl-CustomJavaCode-gles2.java | 7 |
13 files changed, 105 insertions, 33 deletions
diff --git a/make/config/jogl/gl-common.cfg b/make/config/jogl/gl-common.cfg index 4d3a05d63..a1414f0ad 100644 --- a/make/config/jogl/gl-common.cfg +++ b/make/config/jogl/gl-common.cfg @@ -408,7 +408,9 @@ JavaEpilogue glEnd inBeginEndPair = false; JavaEpilogue glBindBuffer bufferStateTracker.setBoundBufferObject({0}, {1}); JavaEpilogue glBindBufferARB bufferStateTracker.setBoundBufferObject({0}, {1}); JavaEpilogue glPushClientAttrib bufferStateTracker.clearBufferObjectState(); +JavaEpilogue glPushClientAttrib glStateTracker.pushAttrib(mask); JavaEpilogue glPopClientAttrib bufferStateTracker.clearBufferObjectState(); +JavaEpilogue glPopClientAttrib glStateTracker.popAttrib(); JavaEpilogue glBufferData bufferSizeTracker.setBufferSize(bufferStateTracker, {0}, this, {1}); BufferObjectKind Array glColorPointer diff --git a/make/config/jogl/gl-es1.cfg b/make/config/jogl/gl-es1.cfg index 35ea7f0ce..867ef8a83 100755 --- a/make/config/jogl/gl-es1.cfg +++ b/make/config/jogl/gl-es1.cfg @@ -54,6 +54,18 @@ TagNativeBinding true IgnoreExtension GL_OES_fixed_point IgnoreExtension GL_OES_single_precision +# Add PixelStorei StateTracker +# +# Add input validation to glPixelStorei, just to be sure. +CustomJavaCode GLES1Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. + +JavaPrologue glPixelStorei if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) { +JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(pname)); +JavaPrologue glPixelStorei } +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } + CustomJavaCode GLES1Impl public void glOrtho(double left, double right, double bottom, double top, double near_val, double far_val) { CustomJavaCode GLES1Impl glOrtho((float) left, (float) right, (float) bottom, (float) top, (float) near_val, (float) far_val); } diff --git a/make/config/jogl/gl-es2.cfg b/make/config/jogl/gl-es2.cfg index 6a81c9376..f78001dee 100755 --- a/make/config/jogl/gl-es2.cfg +++ b/make/config/jogl/gl-es2.cfg @@ -44,6 +44,18 @@ LocalProcAddressCallingConvention __ALL__ GL_APIENTRY # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true +# Add PixelStorei StateTracker +# +# Add input validation to glPixelStorei, just to be sure. +CustomJavaCode GLES2Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. + +JavaPrologue glPixelStorei if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) { +JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(pname)); +JavaPrologue glPixelStorei } +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } + IncludeAs CustomJavaCode GLES2 gl-if-CustomJavaCode-gles2.java CustomCCode /* Define GL_GLEXT_PROTOTYPES so that the OpenGL extension prototypes in diff --git a/make/config/jogl/gl-gl2.cfg b/make/config/jogl/gl-gl2.cfg index 50574598a..820243ff5 100644 --- a/make/config/jogl/gl-gl2.cfg +++ b/make/config/jogl/gl-gl2.cfg @@ -40,6 +40,14 @@ TagNativeBinding true # Ignore extensions that are already picked up via the GL2ES1 interface IgnoreExtension GL_EXT_point_parameters +# Add PixelStorei StateTracker +# +CustomJavaCode GL2Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. + +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } + CustomJavaCode GL2 public boolean glIsPBOPackEnabled(); CustomJavaCode GL2 public boolean glIsPBOUnpackEnabled(); diff --git a/make/config/jogl/gl-gl2es12.cfg b/make/config/jogl/gl-gl2es12.cfg index 9e36da2ea..232116a61 100644 --- a/make/config/jogl/gl-gl2es12.cfg +++ b/make/config/jogl/gl-gl2es12.cfg @@ -49,12 +49,19 @@ TagNativeBinding true Ignore glGetTexImage Ignore glPixelStoref +# Add PixelStorei StateTracker +# # Add input validation to glPixelStorei to make sure that, even if we # are running on top of desktop OpenGL, parameters not exposed in # OpenGL ES can not be changed +CustomJavaCode GL2ES12Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. + JavaPrologue glPixelStorei if (pname != GL_PACK_ALIGNMENT && pname != GL_UNPACK_ALIGNMENT) { -JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(param)); +JavaPrologue glPixelStorei throw new GLException("Unsupported pixel store parameter name 0x" + Integer.toHexString(pname)); JavaPrologue glPixelStorei } +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } CustomJavaCode GL2ES12Impl public void glFrustumf(float left, float right, float bottom, float top, float zNear, float zFar) { CustomJavaCode GL2ES12Impl glFrustum((double)left, (double)right, (double)bottom, (double)top, (double)zNear, (double)zFar); } diff --git a/make/config/jogl/gl-gl3.cfg b/make/config/jogl/gl-gl3.cfg index 576cd7cad..9f0ea05a8 100644 --- a/make/config/jogl/gl-gl3.cfg +++ b/make/config/jogl/gl-gl3.cfg @@ -43,6 +43,14 @@ LocalProcAddressCallingConvention __ALL__ APIENTRY # Pick up on-line OpenGL javadoc thanks to user cylab on javagaming.org forums TagNativeBinding true +# Add PixelStorei StateTracker +# +CustomJavaCode GL3Impl private static final int params_offset = 0; // just a helper for JavaPrologue .. + +JavaPrologue glPixelStorei glStateTracker.setInt(pname, param); + +JavaPrologue glGetIntegerv if ( glStateTracker.getInt(pname, params, params_offset) ) { return; } + CustomJavaCode GL3Impl public void glClearDepthf(float depth) { CustomJavaCode GL3Impl glClearDepth((double)depth); } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java index 0d01aaec4..bd4659b88 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-desktop.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-desktop.java @@ -3,7 +3,7 @@ private int[] imageSizeTemp = new int[1]; /** Helper for more precise computation of number of bytes that will be touched by a pixel pack or unpack operation. */ private int imageSizeInBytes(int bytesPerElement, - int w, int h, int d, + int width, int height, int depth, int dimensions, boolean pack) { int rowLength = 0; @@ -45,14 +45,16 @@ private int imageSizeInBytes(int bytesPerElement, } } // Try to deal somewhat correctly with potentially invalid values - rowLength = Math.max(0, rowLength); + height = Math.max(0, height); skipRows = Math.max(0, skipRows); skipPixels = Math.max(0, skipPixels); alignment = Math.max(1, alignment); imageHeight = Math.max(0, imageHeight); skipImages = Math.max(0, skipImages); - rowLength = Math.max(rowLength, w + skipPixels); + + rowLength = Math.max(Math.max(0, rowLength), width); // > 0 && >= width int rowLengthInBytes = rowLength * bytesPerElement; + if (alignment > 1) { int modulus = rowLengthInBytes % alignment; if (modulus > 0) { @@ -60,15 +62,19 @@ private int imageSizeInBytes(int bytesPerElement, } } - int size = 0; - if (dimensions == 1) { - return (w + skipPixels) * bytesPerElement; - } else { - int size2D = ((skipRows + h - 1) * rowLengthInBytes) + (w + skipPixels) * bytesPerElement; - if (dimensions == 2) { - return size2D; - } - int imageSizeInBytes = imageHeight * rowLength; - return ((skipImages + d - 1) * imageSizeInBytes) + size2D; + /** + * skipPixels and skipRows is a static one time offset + * + * rowlenght is the actual repeating offset + * from line-start to the next line-start. + */ + int size = height * rowLengthInBytes; // height == 1 for 1D + if(dimensions==3) { + size *= (skipImages + depth); } + + int skipOffset = skipPixels * bytesPerElement + + skipRows * rowLengthInBytes; + + return size + skipOffset; } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-embedded.java b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java index 2d4cd1372..c803a06a4 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-embedded.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-embedded.java @@ -3,10 +3,10 @@ private int[] imageSizeTemp = new int[1]; /** Helper for more precise computation of number of bytes that will be touched by a pixel pack or unpack operation. */ private int imageSizeInBytes(int bytesPerElement, - int w, int h, int d, + int width, int height, int depth, int dimensions, boolean pack) { - int rowLength = w; + int rowLength; int alignment = 1; if (pack) { @@ -17,10 +17,12 @@ private int imageSizeInBytes(int bytesPerElement, alignment = imageSizeTemp[0]; } // Try to deal somewhat correctly with potentially invalid values - rowLength = Math.max(0, rowLength); + height = Math.max(0, height); alignment = Math.max(1, alignment); - h = Math.max(0, h); + + rowLength = Math.max(0, width); // > 0 && >= width int rowLengthInBytes = rowLength * bytesPerElement; + if (alignment > 1) { int modulus = rowLengthInBytes % alignment; if (modulus > 0) { @@ -28,10 +30,10 @@ private int imageSizeInBytes(int bytesPerElement, } } - int size = 0; - if (dimensions == 1) { - return rowLengthInBytes; - } else { - return h * rowLengthInBytes; + int size = height * rowLengthInBytes; // height == 1 for 1D + if(dimensions==3) { + size *= depth; } + + return size; } diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java index 5928b3a0b..587bb6738 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2.java @@ -18,7 +18,9 @@ public void setObjectTracker(GLObjectTracker tracker) { public GL2Impl(GLProfile glp, GLContextImpl context) { this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); this.glProfile = glp; } @@ -231,8 +233,9 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); } -private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); private GLBufferSizeTracker bufferSizeTracker; +private GLBufferStateTracker bufferStateTracker; +private GLStateTracker glStateTracker; private boolean bufferObjectExtensionsInitialized = false; private boolean haveARBPixelBufferObject; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java index 3dfcf5908..8e9c8bf01 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl2es12.java @@ -17,7 +17,9 @@ public void setObjectTracker(GLObjectTracker tracker) { public GL2ES12Impl(GLProfile glp, GLContextImpl context) { this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); this.isGL2ES2 = glp.isGL2ES2(); this.glProfile = glp; } @@ -203,8 +205,9 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); } -private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); private GLBufferSizeTracker bufferSizeTracker; +private GLBufferStateTracker bufferStateTracker; +private GLStateTracker glStateTracker; private boolean bufferObjectExtensionsInitialized = false; private boolean haveGL15; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java index 9123f35c8..b69188c73 100644 --- a/make/config/jogl/gl-impl-CustomJavaCode-gl3.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gl3.java @@ -17,7 +17,9 @@ public void setObjectTracker(GLObjectTracker tracker) { public GL3Impl(GLProfile glp, GLContextImpl context) { this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); this.glProfile = glp; } @@ -222,8 +224,9 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); } -private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); private GLBufferSizeTracker bufferSizeTracker; +private GLBufferStateTracker bufferStateTracker; +private GLStateTracker glStateTracker; private boolean bufferObjectExtensionsInitialized = false; private boolean haveARBPixelBufferObject; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java index c5831f426..4e46f076b 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles1.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles1.java @@ -1,6 +1,8 @@ public GLES1Impl(GLProfile glp, GLContextImpl context) { this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); this.glProfile = glp; } @@ -167,8 +169,9 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); } -private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); private GLBufferSizeTracker bufferSizeTracker; +private GLBufferStateTracker bufferStateTracker; +private GLStateTracker glStateTracker; private boolean bufferObjectExtensionsInitialized = false; private boolean haveOESFramebufferObject; diff --git a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java index 7e9b786b0..97a0dbd27 100755 --- a/make/config/jogl/gl-impl-CustomJavaCode-gles2.java +++ b/make/config/jogl/gl-impl-CustomJavaCode-gles2.java @@ -4,7 +4,9 @@ private boolean inBeginEndPair; public GLES2Impl(GLProfile glp, GLContextImpl context) { this._context = context; - this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferSizeTracker = context.getBufferSizeTracker(); + this.bufferStateTracker = context.getBufferStateTracker(); + this.glStateTracker = context.getGLStateTracker(); this.glProfile = glp; } @@ -177,8 +179,9 @@ private int imageSizeInBytes(int format, int type, int w, int h, int d, return imageSizeInBytes(elements * esize, w, h, d, dimensions, pack); } -private GLBufferStateTracker bufferStateTracker = new GLBufferStateTracker(); private GLBufferSizeTracker bufferSizeTracker; +private GLBufferStateTracker bufferStateTracker; +private GLStateTracker glStateTracker; private boolean bufferObjectExtensionsInitialized = false; private boolean haveOESFramebufferObject; |