From 63ed38dc52b27c5b39b11717d0c7736e1756db42 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 29 Mar 2013 11:02:07 -0700 Subject: [PATCH 01/14] Generate GLES30 class, just a clone of GLES20 for now Bug: 8566953 Change-Id: I6fad880344b9c247de4018711ea7cb6eb1a609d6 --- opengl/tools/glgen/gen | 5 +- opengl/tools/glgen/specs/gles11/GLES30.spec | 144 ++++++++ opengl/tools/glgen/src/GenerateGLES.java | 2 +- .../glgen/stubs/gles11/GLES30Header.java-if | 331 ++++++++++++++++++ .../glgen/stubs/gles11/GLES30cHeader.cpp | 22 ++ 5 files changed, 501 insertions(+), 3 deletions(-) create mode 100644 opengl/tools/glgen/specs/gles11/GLES30.spec create mode 100644 opengl/tools/glgen/stubs/gles11/GLES30Header.java-if create mode 100644 opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp diff --git a/opengl/tools/glgen/gen b/opengl/tools/glgen/gen index cae0c424c..29212c0ec 100755 --- a/opengl/tools/glgen/gen +++ b/opengl/tools/glgen/gen @@ -106,7 +106,8 @@ javac -d classes android/opengl/EGL14.java \ android/opengl/GLES10Ext.java \ android/opengl/GLES11.java \ android/opengl/GLES11Ext.java \ - android/opengl/GLES20.java + android/opengl/GLES20.java \ + android/opengl/GLES30.java popd > /dev/null JAVA_RESULT=$? if [ $JAVA_RESULT -ne 0 ]; then @@ -153,7 +154,7 @@ do compareGenerated ../../../../base/opengl/java/javax/microedition/khronos/opengles generated/javax/microedition/khronos/opengles $x done -for x in EGL14 GLES10 GLES10Ext GLES11 GLES11Ext GLES20 +for x in EGL14 GLES10 GLES10Ext GLES11 GLES11Ext GLES20 GLES30 do compareGenerated ../../../../base/opengl/java/android/opengl generated/android/opengl ${x}.java compareGenerated ../../../../base/core/jni generated/C android_opengl_${x}.cpp diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec new file mode 100644 index 000000000..68d146e48 --- /dev/null +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -0,0 +1,144 @@ +void glActiveTexture ( GLenum texture ) +void glAttachShader ( GLuint program, GLuint shader ) +void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) +void glBindBuffer ( GLenum target, GLuint buffer ) +void glBindFramebuffer ( GLenum target, GLuint framebuffer ) +void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) +void glBindTexture ( GLenum target, GLuint texture ) +void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) +void glBlendEquation ( GLenum mode ) +void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) +void glBlendFunc ( GLenum sfactor, GLenum dfactor ) +void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) +void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) +void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) +GLenum glCheckFramebufferStatus ( GLenum target ) +void glClear ( GLbitfield mask ) +void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) +void glClearDepthf ( GLclampf depth ) +void glClearStencil ( GLint s ) +void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) +void glCompileShader ( GLuint shader ) +void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) +void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) +void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) +GLuint glCreateProgram ( void ) +GLuint glCreateShader ( GLenum type ) +void glCullFace ( GLenum mode ) +void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) +void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) +void glDeleteProgram ( GLuint program ) +void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) +void glDeleteShader ( GLuint shader ) +void glDeleteTextures ( GLsizei n, const GLuint *textures ) +void glDepthFunc ( GLenum func ) +void glDepthMask ( GLboolean flag ) +void glDepthRangef ( GLclampf zNear, GLclampf zFar ) +void glDetachShader ( GLuint program, GLuint shader ) +void glDisable ( GLenum cap ) +void glDisableVertexAttribArray ( GLuint index ) +void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) +void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) +void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) +void glEnable ( GLenum cap ) +void glEnableVertexAttribArray ( GLuint index ) +void glFinish ( void ) +void glFlush ( void ) +void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) +void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) +void glFrontFace ( GLenum mode ) +void glGenBuffers ( GLsizei n, GLuint *buffers ) +void glGenerateMipmap ( GLenum target ) +void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) +void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) +void glGenTextures ( GLsizei n, GLuint *textures ) +void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) +void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) +void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) +GLint glGetAttribLocation ( GLuint program, const char *name ) +void glGetBooleanv ( GLenum pname, GLboolean *params ) +void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) +GLenum glGetError ( void ) +void glGetFloatv ( GLenum pname, GLfloat *params ) +void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) +void glGetIntegerv ( GLenum pname, GLint *params ) +void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) +void glGetProgramInfoLog ( GLuint program, GLsizei bufsize, GLsizei *length, char *infolog ) +void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) +void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) +void glGetShaderInfoLog ( GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog ) +void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) +void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) +const GLubyte * glGetString ( GLenum name ) +void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) +void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) +void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) +void glGetUniformiv ( GLuint program, GLint location, GLint *params ) +GLint glGetUniformLocation ( GLuint program, const char *name ) +void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) +void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) +// void glGetVertexAttribPointerv ( GLuint index, GLenum pname, void **pointer ) +void glHint ( GLenum target, GLenum mode ) +GLboolean glIsBuffer ( GLuint buffer ) +GLboolean glIsEnabled ( GLenum cap ) +GLboolean glIsFramebuffer ( GLuint framebuffer ) +GLboolean glIsProgram ( GLuint program ) +GLboolean glIsRenderbuffer ( GLuint renderbuffer ) +GLboolean glIsShader ( GLuint shader ) +GLboolean glIsTexture ( GLuint texture ) +void glLineWidth ( GLfloat width ) +void glLinkProgram ( GLuint program ) +void glPixelStorei ( GLenum pname, GLint param ) +void glPolygonOffset ( GLfloat factor, GLfloat units ) +void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) +void glReleaseShaderCompiler ( void ) +void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) +void glSampleCoverage ( GLclampf value, GLboolean invert ) +void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) +void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) +void glShaderSource ( GLuint shader ) +void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) +void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) +void glStencilMask ( GLuint mask ) +void glStencilMaskSeparate ( GLenum face, GLuint mask ) +void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) +void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) +void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) +void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) +void glTexParameteri ( GLenum target, GLenum pname, GLint param ) +void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) +void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) +void glUniform1f ( GLint location, GLfloat x ) +void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) +void glUniform1i ( GLint location, GLint x ) +void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) +void glUniform2f ( GLint location, GLfloat x, GLfloat y ) +void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) +void glUniform2i ( GLint location, GLint x, GLint y ) +void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) +void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) +void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) +void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) +void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) +void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) +void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) +void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) +void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUseProgram ( GLuint program ) +void glValidateProgram ( GLuint program ) +void glVertexAttrib1f ( GLuint indx, GLfloat x ) +void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) +void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) +void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) +void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) +void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) +void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) +void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) +void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) +void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) +void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) diff --git a/opengl/tools/glgen/src/GenerateGLES.java b/opengl/tools/glgen/src/GenerateGLES.java index 6f9da5d8d..c99c45dd9 100644 --- a/opengl/tools/glgen/src/GenerateGLES.java +++ b/opengl/tools/glgen/src/GenerateGLES.java @@ -84,7 +84,7 @@ public class GenerateGLES { // Generate files for(String suffix: new String[] {"GLES10", "GLES10Ext", - "GLES11", "GLES11Ext", "GLES20"}) + "GLES11", "GLES11Ext", "GLES20", "GLES30"}) { BufferedReader spec11Reader = new BufferedReader(new FileReader("specs/gles11/" diff --git a/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if new file mode 100644 index 000000000..4498968aa --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if @@ -0,0 +1,331 @@ +/* +** +** Copyright 2013, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +// This source file is automatically generated + +package android.opengl; + +/** OpenGL ES 3.0 + */ +public class GLES30 { + public static final int GL_ACTIVE_TEXTURE = 0x84E0; + public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; + public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; + public static final int GL_COLOR_BUFFER_BIT = 0x00004000; + public static final int GL_FALSE = 0; + public static final int GL_TRUE = 1; + public static final int GL_POINTS = 0x0000; + public static final int GL_LINES = 0x0001; + public static final int GL_LINE_LOOP = 0x0002; + public static final int GL_LINE_STRIP = 0x0003; + public static final int GL_TRIANGLES = 0x0004; + public static final int GL_TRIANGLE_STRIP = 0x0005; + public static final int GL_TRIANGLE_FAN = 0x0006; + public static final int GL_ZERO = 0; + public static final int GL_ONE = 1; + public static final int GL_SRC_COLOR = 0x0300; + public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301; + public static final int GL_SRC_ALPHA = 0x0302; + public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303; + public static final int GL_DST_ALPHA = 0x0304; + public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305; + public static final int GL_DST_COLOR = 0x0306; + public static final int GL_ONE_MINUS_DST_COLOR = 0x0307; + public static final int GL_SRC_ALPHA_SATURATE = 0x0308; + public static final int GL_FUNC_ADD = 0x8006; + public static final int GL_BLEND_EQUATION = 0x8009; + public static final int GL_BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ + public static final int GL_BLEND_EQUATION_ALPHA = 0x883D; + public static final int GL_FUNC_SUBTRACT = 0x800A; + public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B; + public static final int GL_BLEND_DST_RGB = 0x80C8; + public static final int GL_BLEND_SRC_RGB = 0x80C9; + public static final int GL_BLEND_DST_ALPHA = 0x80CA; + public static final int GL_BLEND_SRC_ALPHA = 0x80CB; + public static final int GL_CONSTANT_COLOR = 0x8001; + public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002; + public static final int GL_CONSTANT_ALPHA = 0x8003; + public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; + public static final int GL_BLEND_COLOR = 0x8005; + public static final int GL_ARRAY_BUFFER = 0x8892; + public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893; + public static final int GL_ARRAY_BUFFER_BINDING = 0x8894; + public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; + public static final int GL_STREAM_DRAW = 0x88E0; + public static final int GL_STATIC_DRAW = 0x88E4; + public static final int GL_DYNAMIC_DRAW = 0x88E8; + public static final int GL_BUFFER_SIZE = 0x8764; + public static final int GL_BUFFER_USAGE = 0x8765; + public static final int GL_CURRENT_VERTEX_ATTRIB = 0x8626; + public static final int GL_FRONT = 0x0404; + public static final int GL_BACK = 0x0405; + public static final int GL_FRONT_AND_BACK = 0x0408; + public static final int GL_TEXTURE_2D = 0x0DE1; + public static final int GL_CULL_FACE = 0x0B44; + public static final int GL_BLEND = 0x0BE2; + public static final int GL_DITHER = 0x0BD0; + public static final int GL_STENCIL_TEST = 0x0B90; + public static final int GL_DEPTH_TEST = 0x0B71; + public static final int GL_SCISSOR_TEST = 0x0C11; + public static final int GL_POLYGON_OFFSET_FILL = 0x8037; + public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E; + public static final int GL_SAMPLE_COVERAGE = 0x80A0; + public static final int GL_NO_ERROR = 0; + public static final int GL_INVALID_ENUM = 0x0500; + public static final int GL_INVALID_VALUE = 0x0501; + public static final int GL_INVALID_OPERATION = 0x0502; + public static final int GL_OUT_OF_MEMORY = 0x0505; + public static final int GL_CW = 0x0900; + public static final int GL_CCW = 0x0901; + public static final int GL_LINE_WIDTH = 0x0B21; + public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D; + public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E; + public static final int GL_CULL_FACE_MODE = 0x0B45; + public static final int GL_FRONT_FACE = 0x0B46; + public static final int GL_DEPTH_RANGE = 0x0B70; + public static final int GL_DEPTH_WRITEMASK = 0x0B72; + public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73; + public static final int GL_DEPTH_FUNC = 0x0B74; + public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91; + public static final int GL_STENCIL_FUNC = 0x0B92; + public static final int GL_STENCIL_FAIL = 0x0B94; + public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; + public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; + public static final int GL_STENCIL_REF = 0x0B97; + public static final int GL_STENCIL_VALUE_MASK = 0x0B93; + public static final int GL_STENCIL_WRITEMASK = 0x0B98; + public static final int GL_STENCIL_BACK_FUNC = 0x8800; + public static final int GL_STENCIL_BACK_FAIL = 0x8801; + public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; + public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; + public static final int GL_STENCIL_BACK_REF = 0x8CA3; + public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; + public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5; + public static final int GL_VIEWPORT = 0x0BA2; + public static final int GL_SCISSOR_BOX = 0x0C10; + public static final int GL_COLOR_CLEAR_VALUE = 0x0C22; + public static final int GL_COLOR_WRITEMASK = 0x0C23; + public static final int GL_UNPACK_ALIGNMENT = 0x0CF5; + public static final int GL_PACK_ALIGNMENT = 0x0D05; + public static final int GL_MAX_TEXTURE_SIZE = 0x0D33; + public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A; + public static final int GL_SUBPIXEL_BITS = 0x0D50; + public static final int GL_RED_BITS = 0x0D52; + public static final int GL_GREEN_BITS = 0x0D53; + public static final int GL_BLUE_BITS = 0x0D54; + public static final int GL_ALPHA_BITS = 0x0D55; + public static final int GL_DEPTH_BITS = 0x0D56; + public static final int GL_STENCIL_BITS = 0x0D57; + public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00; + public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038; + public static final int GL_TEXTURE_BINDING_2D = 0x8069; + public static final int GL_SAMPLE_BUFFERS = 0x80A8; + public static final int GL_SAMPLES = 0x80A9; + public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA; + public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB; + public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; + public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; + public static final int GL_DONT_CARE = 0x1100; + public static final int GL_FASTEST = 0x1101; + public static final int GL_NICEST = 0x1102; + public static final int GL_GENERATE_MIPMAP_HINT = 0x8192; + public static final int GL_BYTE = 0x1400; + public static final int GL_UNSIGNED_BYTE = 0x1401; + public static final int GL_SHORT = 0x1402; + public static final int GL_UNSIGNED_SHORT = 0x1403; + public static final int GL_INT = 0x1404; + public static final int GL_UNSIGNED_INT = 0x1405; + public static final int GL_FLOAT = 0x1406; + public static final int GL_FIXED = 0x140C; + public static final int GL_DEPTH_COMPONENT = 0x1902; + public static final int GL_ALPHA = 0x1906; + public static final int GL_RGB = 0x1907; + public static final int GL_RGBA = 0x1908; + public static final int GL_LUMINANCE = 0x1909; + public static final int GL_LUMINANCE_ALPHA = 0x190A; + public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; + public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; + public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; + public static final int GL_FRAGMENT_SHADER = 0x8B30; + public static final int GL_VERTEX_SHADER = 0x8B31; + public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869; + public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + public static final int GL_MAX_VARYING_VECTORS = 0x8DFC; + public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; + public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + public static final int GL_SHADER_TYPE = 0x8B4F; + public static final int GL_DELETE_STATUS = 0x8B80; + public static final int GL_LINK_STATUS = 0x8B82; + public static final int GL_VALIDATE_STATUS = 0x8B83; + public static final int GL_ATTACHED_SHADERS = 0x8B85; + public static final int GL_ACTIVE_UNIFORMS = 0x8B86; + public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; + public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89; + public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; + public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; + public static final int GL_CURRENT_PROGRAM = 0x8B8D; + public static final int GL_NEVER = 0x0200; + public static final int GL_LESS = 0x0201; + public static final int GL_EQUAL = 0x0202; + public static final int GL_LEQUAL = 0x0203; + public static final int GL_GREATER = 0x0204; + public static final int GL_NOTEQUAL = 0x0205; + public static final int GL_GEQUAL = 0x0206; + public static final int GL_ALWAYS = 0x0207; + public static final int GL_KEEP = 0x1E00; + public static final int GL_REPLACE = 0x1E01; + public static final int GL_INCR = 0x1E02; + public static final int GL_DECR = 0x1E03; + public static final int GL_INVERT = 0x150A; + public static final int GL_INCR_WRAP = 0x8507; + public static final int GL_DECR_WRAP = 0x8508; + public static final int GL_VENDOR = 0x1F00; + public static final int GL_RENDERER = 0x1F01; + public static final int GL_VERSION = 0x1F02; + public static final int GL_EXTENSIONS = 0x1F03; + public static final int GL_NEAREST = 0x2600; + public static final int GL_LINEAR = 0x2601; + public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700; + public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701; + public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702; + public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703; + public static final int GL_TEXTURE_MAG_FILTER = 0x2800; + public static final int GL_TEXTURE_MIN_FILTER = 0x2801; + public static final int GL_TEXTURE_WRAP_S = 0x2802; + public static final int GL_TEXTURE_WRAP_T = 0x2803; + public static final int GL_TEXTURE = 0x1702; + public static final int GL_TEXTURE_CUBE_MAP = 0x8513; + public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; + public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; + public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; + public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; + public static final int GL_TEXTURE0 = 0x84C0; + public static final int GL_TEXTURE1 = 0x84C1; + public static final int GL_TEXTURE2 = 0x84C2; + public static final int GL_TEXTURE3 = 0x84C3; + public static final int GL_TEXTURE4 = 0x84C4; + public static final int GL_TEXTURE5 = 0x84C5; + public static final int GL_TEXTURE6 = 0x84C6; + public static final int GL_TEXTURE7 = 0x84C7; + public static final int GL_TEXTURE8 = 0x84C8; + public static final int GL_TEXTURE9 = 0x84C9; + public static final int GL_TEXTURE10 = 0x84CA; + public static final int GL_TEXTURE11 = 0x84CB; + public static final int GL_TEXTURE12 = 0x84CC; + public static final int GL_TEXTURE13 = 0x84CD; + public static final int GL_TEXTURE14 = 0x84CE; + public static final int GL_TEXTURE15 = 0x84CF; + public static final int GL_TEXTURE16 = 0x84D0; + public static final int GL_TEXTURE17 = 0x84D1; + public static final int GL_TEXTURE18 = 0x84D2; + public static final int GL_TEXTURE19 = 0x84D3; + public static final int GL_TEXTURE20 = 0x84D4; + public static final int GL_TEXTURE21 = 0x84D5; + public static final int GL_TEXTURE22 = 0x84D6; + public static final int GL_TEXTURE23 = 0x84D7; + public static final int GL_TEXTURE24 = 0x84D8; + public static final int GL_TEXTURE25 = 0x84D9; + public static final int GL_TEXTURE26 = 0x84DA; + public static final int GL_TEXTURE27 = 0x84DB; + public static final int GL_TEXTURE28 = 0x84DC; + public static final int GL_TEXTURE29 = 0x84DD; + public static final int GL_TEXTURE30 = 0x84DE; + public static final int GL_TEXTURE31 = 0x84DF; + public static final int GL_REPEAT = 0x2901; + public static final int GL_CLAMP_TO_EDGE = 0x812F; + public static final int GL_MIRRORED_REPEAT = 0x8370; + public static final int GL_FLOAT_VEC2 = 0x8B50; + public static final int GL_FLOAT_VEC3 = 0x8B51; + public static final int GL_FLOAT_VEC4 = 0x8B52; + public static final int GL_INT_VEC2 = 0x8B53; + public static final int GL_INT_VEC3 = 0x8B54; + public static final int GL_INT_VEC4 = 0x8B55; + public static final int GL_BOOL = 0x8B56; + public static final int GL_BOOL_VEC2 = 0x8B57; + public static final int GL_BOOL_VEC3 = 0x8B58; + public static final int GL_BOOL_VEC4 = 0x8B59; + public static final int GL_FLOAT_MAT2 = 0x8B5A; + public static final int GL_FLOAT_MAT3 = 0x8B5B; + public static final int GL_FLOAT_MAT4 = 0x8B5C; + public static final int GL_SAMPLER_2D = 0x8B5E; + public static final int GL_SAMPLER_CUBE = 0x8B60; + public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + public static final int GL_COMPILE_STATUS = 0x8B81; + public static final int GL_INFO_LOG_LENGTH = 0x8B84; + public static final int GL_SHADER_SOURCE_LENGTH = 0x8B88; + public static final int GL_SHADER_COMPILER = 0x8DFA; + public static final int GL_SHADER_BINARY_FORMATS = 0x8DF8; + public static final int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9; + public static final int GL_LOW_FLOAT = 0x8DF0; + public static final int GL_MEDIUM_FLOAT = 0x8DF1; + public static final int GL_HIGH_FLOAT = 0x8DF2; + public static final int GL_LOW_INT = 0x8DF3; + public static final int GL_MEDIUM_INT = 0x8DF4; + public static final int GL_HIGH_INT = 0x8DF5; + public static final int GL_FRAMEBUFFER = 0x8D40; + public static final int GL_RENDERBUFFER = 0x8D41; + public static final int GL_RGBA4 = 0x8056; + public static final int GL_RGB5_A1 = 0x8057; + public static final int GL_RGB565 = 0x8D62; + public static final int GL_DEPTH_COMPONENT16 = 0x81A5; + public static final int GL_STENCIL_INDEX = 0x1901; + public static final int GL_STENCIL_INDEX8 = 0x8D48; + public static final int GL_RENDERBUFFER_WIDTH = 0x8D42; + public static final int GL_RENDERBUFFER_HEIGHT = 0x8D43; + public static final int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; + public static final int GL_RENDERBUFFER_RED_SIZE = 0x8D50; + public static final int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51; + public static final int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52; + public static final int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53; + public static final int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54; + public static final int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55; + public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; + public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; + public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; + public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; + public static final int GL_COLOR_ATTACHMENT0 = 0x8CE0; + public static final int GL_DEPTH_ATTACHMENT = 0x8D00; + public static final int GL_STENCIL_ATTACHMENT = 0x8D20; + public static final int GL_NONE = 0; + public static final int GL_FRAMEBUFFER_COMPLETE = 0x8CD5; + public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; + public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; + public static final int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD; + public static final int GL_FRAMEBUFFER_BINDING = 0x8CA6; + public static final int GL_RENDERBUFFER_BINDING = 0x8CA7; + public static final int GL_MAX_RENDERBUFFER_SIZE = 0x84E8; + public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506; + + native private static void _nativeClassInit(); + static { + _nativeClassInit(); + } diff --git a/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp new file mode 100644 index 000000000..f5ec455a9 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/GLES30cHeader.cpp @@ -0,0 +1,22 @@ +/* +** +** Copyright 2013, The Android Open Source Project +** +** Licensed under the Apache License, Version 2.0 (the "License"); +** you may not use this file except in compliance with the License. +** You may obtain a copy of the License at +** +** http://www.apache.org/licenses/LICENSE-2.0 +** +** Unless required by applicable law or agreed to in writing, software +** distributed under the License is distributed on an "AS IS" BASIS, +** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +** See the License for the specific language governing permissions and +** limitations under the License. +*/ + +// This source file is automatically generated + +#include +#include + From 439bc1614dba5694cd10476c0238ddd1f77fc94e Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 29 Mar 2013 15:21:09 -0700 Subject: [PATCH 02/14] Minor changes to ES3 functions inherited from ES2 With the addition of float framebuffer support in ES3, some parameters to ES2 functions are now GLfloat instead of GLclampf. Both are typedefs for 'float', so this is a source and binary compatible change. Bug: 8566953 Change-Id: I0b5acc78da7799a04053fdb568205f793792cad9 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index 68d146e48..a02e6f761 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -5,7 +5,7 @@ void glBindBuffer ( GLenum target, GLuint buffer ) void glBindFramebuffer ( GLenum target, GLuint framebuffer ) void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) void glBindTexture ( GLenum target, GLuint texture ) -void glBlendColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) +void glBlendColor ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) void glBlendEquation ( GLenum mode ) void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) void glBlendFunc ( GLenum sfactor, GLenum dfactor ) @@ -14,8 +14,8 @@ void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum u void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) GLenum glCheckFramebufferStatus ( GLenum target ) void glClear ( GLbitfield mask ) -void glClearColor ( GLclampf red, GLclampf green, GLclampf blue, GLclampf alpha ) -void glClearDepthf ( GLclampf depth ) +void glClearColor ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) +void glClearDepthf ( GLfloat depth ) void glClearStencil ( GLint s ) void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) void glCompileShader ( GLuint shader ) @@ -34,7 +34,7 @@ void glDeleteShader ( GLuint shader ) void glDeleteTextures ( GLsizei n, const GLuint *textures ) void glDepthFunc ( GLenum func ) void glDepthMask ( GLboolean flag ) -void glDepthRangef ( GLclampf zNear, GLclampf zFar ) +void glDepthRangef ( GLfloat n, GLfloat f ) void glDetachShader ( GLuint program, GLuint shader ) void glDisable ( GLenum cap ) void glDisableVertexAttribArray ( GLuint index ) @@ -94,7 +94,7 @@ void glPolygonOffset ( GLfloat factor, GLfloat units ) void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) void glReleaseShaderCompiler ( void ) void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) -void glSampleCoverage ( GLclampf value, GLboolean invert ) +void glSampleCoverage ( GLfloat value, GLboolean invert ) void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) void glShaderSource ( GLuint shader ) From 0eb6ad563825b97aec760a893db0eead10fe0ae6 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 29 Mar 2013 15:20:45 -0700 Subject: [PATCH 03/14] Support "const GLChar*" and "const GLenum*" types Bug: 8566953 Change-Id: I349575e592e8b0d93d14237230b69bec4e04cf3e --- opengl/tools/glgen/src/CType.java | 3 ++- opengl/tools/glgen/src/JType.java | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/opengl/tools/glgen/src/CType.java b/opengl/tools/glgen/src/CType.java index 92950ea07..aba98afb9 100644 --- a/opengl/tools/glgen/src/CType.java +++ b/opengl/tools/glgen/src/CType.java @@ -70,7 +70,8 @@ public class CType { } public boolean isConstCharPointer() { - return isConst && isPointer && baseType.equals("char"); + return isConst && isPointer && + (baseType.equals("char") || baseType.equals("GLchar")); } public boolean isTypedPointer() { diff --git a/opengl/tools/glgen/src/JType.java b/opengl/tools/glgen/src/JType.java index 994e60905..795d833e1 100644 --- a/opengl/tools/glgen/src/JType.java +++ b/opengl/tools/glgen/src/JType.java @@ -46,6 +46,7 @@ public class JType { typeMapping.put(new CType("GLubyte", true, true), new JType("String", false, false)); typeMapping.put(new CType("char", false, true), new JType("byte")); typeMapping.put(new CType("char", true, true), new JType("String", false, false)); + typeMapping.put(new CType("GLchar", true, true), new JType("String", false, false)); typeMapping.put(new CType("int"), new JType("int")); // EGL primitive types @@ -80,6 +81,8 @@ public class JType { new JType("java.nio.IntBuffer", true, false)); typeMapping.put(new CType("GLenum", false, true), new JType("java.nio.IntBuffer", true, false)); + typeMapping.put(new CType("GLenum", true, true), + new JType("java.nio.IntBuffer", true, false)); typeMapping.put(new CType("GLfixed", false, true), new JType("java.nio.IntBuffer", true, false)); typeMapping.put(new CType("GLfixed", true, true), @@ -107,6 +110,7 @@ public class JType { arrayTypeMapping.put(new CType("GLboolean", false, true), new JType("boolean", false, true)); arrayTypeMapping.put(new CType("GLenum", false, true), new JType("int", false, true)); + arrayTypeMapping.put(new CType("GLenum", true, true), new JType("int", false, true)); arrayTypeMapping.put(new CType("GLfixed", true, true), new JType("int", false, true)); arrayTypeMapping.put(new CType("GLfixed", false, true), new JType("int", false, true)); arrayTypeMapping.put(new CType("GLfloat", false, true), new JType("float", false, true)); From 2d9faafa2318c05f8991beff9cc683d72cbabd07 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Fri, 29 Mar 2013 13:06:32 -0700 Subject: [PATCH 04/14] Add ES3 functions and constants, difficult ones commented out This change adds ES3 functions to GLES30.spec, disabling any that require non-trivial changes for the generator to handle. Steps taken to add these: - Copy ES3 function declarations from gl3.h - Remove GL_APICALL, GL_APIENTRY, and semicolon from each declaration - Add whitespace around parens and *s as required by the parser - Comment out functions that the generator doesn't understand or that it generates bad Java interfaces for (by inspection). Bug: 8566953 Change-Id: Iaaef7d53e24f9a576759dbba72cd206bae1c1276 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 110 ++++++ .../glgen/stubs/gles11/GLES20Header.java-if | 3 + .../glgen/stubs/gles11/GLES30Header.java-if | 371 ++++++++++++++++-- 3 files changed, 453 insertions(+), 31 deletions(-) diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index a02e6f761..f181976eb 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -1,3 +1,6 @@ +// +// Inherited OpenGL ES 2.0 functions +// void glActiveTexture ( GLenum texture ) void glAttachShader ( GLuint program, GLuint shader ) void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) @@ -142,3 +145,110 @@ void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) +// +// New OpenGL ES 3.0 functions +// +void glReadBuffer ( GLenum mode ) +void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) +void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) +void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) +void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) +void glGenQueries ( GLsizei n, GLuint *ids ) +void glDeleteQueries ( GLsizei n, const GLuint *ids ) +GLboolean glIsQuery ( GLuint id ) +void glBeginQuery ( GLenum target, GLuint id ) +void glEndQuery ( GLenum target ) +void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) +void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) +GLboolean glUnmapBuffer ( GLenum target ) +// void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid **params ) +void glDrawBuffers ( GLsizei n, const GLenum *bufs ) +void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix2x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix4x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix3x4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) +void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) +void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) +void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) +// GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) +void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) +void glBindVertexArray ( GLuint array ) +void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) +void glGenVertexArrays ( GLsizei n, GLuint *arrays ) +GLboolean glIsVertexArray ( GLuint array ) +void glGetIntegeri_v ( GLenum target, GLuint index, GLint *data ) +void glBeginTransformFeedback ( GLenum primitiveMode ) +void glEndTransformFeedback ( void ) +void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) +void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) +// void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *const *varyings, GLenum bufferMode ) +// void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name ) +// void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) +void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) +void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) +void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) +void glVertexAttribI4ui ( GLuint index, GLuint x, GLuint y, GLuint z, GLuint w ) +void glVertexAttribI4iv ( GLuint index, const GLint *v ) +void glVertexAttribI4uiv ( GLuint index, const GLuint *v ) +void glGetUniformuiv ( GLuint program, GLint location, GLuint *params ) +GLint glGetFragDataLocation ( GLuint program, const GLchar *name ) +void glUniform1ui ( GLint location, GLuint v0 ) +void glUniform2ui ( GLint location, GLuint v0, GLuint v1 ) +void glUniform3ui ( GLint location, GLuint v0, GLuint v1, GLuint v2 ) +void glUniform4ui ( GLint location, GLuint v0, GLuint v1, GLuint v2, GLuint v3 ) +void glUniform1uiv ( GLint location, GLsizei count, const GLuint *value ) +void glUniform2uiv ( GLint location, GLsizei count, const GLuint *value ) +void glUniform3uiv ( GLint location, GLsizei count, const GLuint *value ) +void glUniform4uiv ( GLint location, GLsizei count, const GLuint *value ) +void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) +void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) +void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) +void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) +// const GLubyte * glGetStringi ( GLenum name, GLuint index ) +void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) +// void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) +void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) +GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) +void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) +// void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) +void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) +void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) +void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) +// GLsync glFenceSync ( GLenum condition, GLbitfield flags ) +// GLboolean glIsSync ( GLsync sync ) +// void glDeleteSync ( GLsync sync ) +// GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) +// void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) +// void glGetInteger64v ( GLenum pname, GLint64 *params ) +// void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) +// void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) +// void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) +void glGenSamplers ( GLsizei count, GLuint *samplers ) +void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) +GLboolean glIsSampler ( GLuint sampler ) +void glBindSampler ( GLuint unit, GLuint sampler ) +void glSamplerParameteri ( GLuint sampler, GLenum pname, GLint param ) +void glSamplerParameteriv ( GLuint sampler, GLenum pname, const GLint *param ) +void glSamplerParameterf ( GLuint sampler, GLenum pname, GLfloat param ) +void glSamplerParameterfv ( GLuint sampler, GLenum pname, const GLfloat *param ) +void glGetSamplerParameteriv ( GLuint sampler, GLenum pname, GLint *params ) +void glGetSamplerParameterfv ( GLuint sampler, GLenum pname, GLfloat *params ) +void glVertexAttribDivisor ( GLuint index, GLuint divisor ) +void glBindTransformFeedback ( GLenum target, GLuint id ) +void glDeleteTransformFeedbacks ( GLsizei n, const GLuint *ids ) +void glGenTransformFeedbacks ( GLsizei n, GLuint *ids ) +GLboolean glIsTransformFeedback ( GLuint id ) +void glPauseTransformFeedback ( void ) +void glResumeTransformFeedback ( void ) +void glGetProgramBinary ( GLuint program, GLsizei bufSize, GLsizei *length, GLenum *binaryFormat, GLvoid *binary ) +void glProgramBinary ( GLuint program, GLenum binaryFormat, const GLvoid *binary, GLsizei length ) +void glProgramParameteri ( GLuint program, GLenum pname, GLint value ) +void glInvalidateFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments ) +void glInvalidateSubFramebuffer ( GLenum target, GLsizei numAttachments, const GLenum *attachments, GLint x, GLint y, GLsizei width, GLsizei height ) +void glTexStorage2D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height ) +void glTexStorage3D ( GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth ) +void glGetInternalformativ ( GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params ) diff --git a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if index 7a7dccdb5..6ec126f04 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if +++ b/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if @@ -296,6 +296,9 @@ public class GLES20 { public static final int GL_RGB5_A1 = 0x8057; public static final int GL_RGB565 = 0x8D62; public static final int GL_DEPTH_COMPONENT16 = 0x81A5; + // GL_STENCIL_INDEX does not appear in gl2.h or gl2ext.h, and there is no + // token with value 0x1901. It shouldn't be here, but we can't remove it + // now in case someone is using it. public static final int GL_STENCIL_INDEX = 0x1901; public static final int GL_STENCIL_INDEX8 = 0x8D48; public static final int GL_RENDERBUFFER_WIDTH = 0x8D42; diff --git a/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if index 4498968aa..efe3c5fe6 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if +++ b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if @@ -22,6 +22,7 @@ package android.opengl; /** OpenGL ES 3.0 */ public class GLES30 { + /* Inherited from OpenGL ES 2.0 */ public static final int GL_ACTIVE_TEXTURE = 0x84E0; public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; @@ -160,26 +161,26 @@ public class GLES30 { public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; - public static final int GL_FRAGMENT_SHADER = 0x8B30; - public static final int GL_VERTEX_SHADER = 0x8B31; - public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869; - public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public static final int GL_MAX_VARYING_VECTORS = 0x8DFC; - public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; - public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public static final int GL_SHADER_TYPE = 0x8B4F; - public static final int GL_DELETE_STATUS = 0x8B80; - public static final int GL_LINK_STATUS = 0x8B82; - public static final int GL_VALIDATE_STATUS = 0x8B83; - public static final int GL_ATTACHED_SHADERS = 0x8B85; - public static final int GL_ACTIVE_UNIFORMS = 0x8B86; - public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89; - public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; - public static final int GL_CURRENT_PROGRAM = 0x8B8D; + public static final int GL_FRAGMENT_SHADER = 0x8B30; + public static final int GL_VERTEX_SHADER = 0x8B31; + public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869; + public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; + public static final int GL_MAX_VARYING_VECTORS = 0x8DFC; + public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; + public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; + public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; + public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; + public static final int GL_SHADER_TYPE = 0x8B4F; + public static final int GL_DELETE_STATUS = 0x8B80; + public static final int GL_LINK_STATUS = 0x8B82; + public static final int GL_VALIDATE_STATUS = 0x8B83; + public static final int GL_ATTACHED_SHADERS = 0x8B85; + public static final int GL_ACTIVE_UNIFORMS = 0x8B86; + public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; + public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89; + public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; + public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; + public static final int GL_CURRENT_PROGRAM = 0x8B8D; public static final int GL_NEVER = 0x0200; public static final int GL_LESS = 0x0201; public static final int GL_EQUAL = 0x0202; @@ -269,15 +270,15 @@ public class GLES30 { public static final int GL_FLOAT_MAT4 = 0x8B5C; public static final int GL_SAMPLER_2D = 0x8B5E; public static final int GL_SAMPLER_CUBE = 0x8B60; - public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; - public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; + public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; + public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; + public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; + public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; + public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; + public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; + public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; + public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; + public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; public static final int GL_COMPILE_STATUS = 0x8B81; public static final int GL_INFO_LOG_LENGTH = 0x8B84; public static final int GL_SHADER_SOURCE_LENGTH = 0x8B88; @@ -296,7 +297,6 @@ public class GLES30 { public static final int GL_RGB5_A1 = 0x8057; public static final int GL_RGB565 = 0x8D62; public static final int GL_DEPTH_COMPONENT16 = 0x81A5; - public static final int GL_STENCIL_INDEX = 0x1901; public static final int GL_STENCIL_INDEX8 = 0x8D48; public static final int GL_RENDERBUFFER_WIDTH = 0x8D42; public static final int GL_RENDERBUFFER_HEIGHT = 0x8D43; @@ -317,7 +317,7 @@ public class GLES30 { public static final int GL_NONE = 0; public static final int GL_FRAMEBUFFER_COMPLETE = 0x8CD5; public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; + public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; public static final int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD; public static final int GL_FRAMEBUFFER_BINDING = 0x8CA6; @@ -325,6 +325,315 @@ public class GLES30 { public static final int GL_MAX_RENDERBUFFER_SIZE = 0x84E8; public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506; + /* New in OpenGL ES 3.0 */ + public static final int GL_READ_BUFFER = 0x0C02; + public static final int GL_UNPACK_ROW_LENGTH = 0x0CF2; + public static final int GL_UNPACK_SKIP_ROWS = 0x0CF3; + public static final int GL_UNPACK_SKIP_PIXELS = 0x0CF4; + public static final int GL_PACK_ROW_LENGTH = 0x0D02; + public static final int GL_PACK_SKIP_ROWS = 0x0D03; + public static final int GL_PACK_SKIP_PIXELS = 0x0D04; + public static final int GL_COLOR = 0x1800; + public static final int GL_DEPTH = 0x1801; + public static final int GL_STENCIL = 0x1802; + public static final int GL_RED = 0x1903; + public static final int GL_RGB8 = 0x8051; + public static final int GL_RGBA8 = 0x8058; + public static final int GL_RGB10_A2 = 0x8059; + public static final int GL_TEXTURE_BINDING_3D = 0x806A; + public static final int GL_UNPACK_SKIP_IMAGES = 0x806D; + public static final int GL_UNPACK_IMAGE_HEIGHT = 0x806E; + public static final int GL_TEXTURE_3D = 0x806F; + public static final int GL_TEXTURE_WRAP_R = 0x8072; + public static final int GL_MAX_3D_TEXTURE_SIZE = 0x8073; + public static final int GL_UNSIGNED_INT_2_10_10_10_REV = 0x8368; + public static final int GL_MAX_ELEMENTS_VERTICES = 0x80E8; + public static final int GL_MAX_ELEMENTS_INDICES = 0x80E9; + public static final int GL_TEXTURE_MIN_LOD = 0x813A; + public static final int GL_TEXTURE_MAX_LOD = 0x813B; + public static final int GL_TEXTURE_BASE_LEVEL = 0x813C; + public static final int GL_TEXTURE_MAX_LEVEL = 0x813D; + public static final int GL_MIN = 0x8007; + public static final int GL_MAX = 0x8008; + public static final int GL_DEPTH_COMPONENT24 = 0x81A6; + public static final int GL_MAX_TEXTURE_LOD_BIAS = 0x84FD; + public static final int GL_TEXTURE_COMPARE_MODE = 0x884C; + public static final int GL_TEXTURE_COMPARE_FUNC = 0x884D; + public static final int GL_CURRENT_QUERY = 0x8865; + public static final int GL_QUERY_RESULT = 0x8866; + public static final int GL_QUERY_RESULT_AVAILABLE = 0x8867; + public static final int GL_BUFFER_MAPPED = 0x88BC; + public static final int GL_BUFFER_MAP_POINTER = 0x88BD; + public static final int GL_STREAM_READ = 0x88E1; + public static final int GL_STREAM_COPY = 0x88E2; + public static final int GL_STATIC_READ = 0x88E5; + public static final int GL_STATIC_COPY = 0x88E6; + public static final int GL_DYNAMIC_READ = 0x88E9; + public static final int GL_DYNAMIC_COPY = 0x88EA; + public static final int GL_MAX_DRAW_BUFFERS = 0x8824; + public static final int GL_DRAW_BUFFER0 = 0x8825; + public static final int GL_DRAW_BUFFER1 = 0x8826; + public static final int GL_DRAW_BUFFER2 = 0x8827; + public static final int GL_DRAW_BUFFER3 = 0x8828; + public static final int GL_DRAW_BUFFER4 = 0x8829; + public static final int GL_DRAW_BUFFER5 = 0x882A; + public static final int GL_DRAW_BUFFER6 = 0x882B; + public static final int GL_DRAW_BUFFER7 = 0x882C; + public static final int GL_DRAW_BUFFER8 = 0x882D; + public static final int GL_DRAW_BUFFER9 = 0x882E; + public static final int GL_DRAW_BUFFER10 = 0x882F; + public static final int GL_DRAW_BUFFER11 = 0x8830; + public static final int GL_DRAW_BUFFER12 = 0x8831; + public static final int GL_DRAW_BUFFER13 = 0x8832; + public static final int GL_DRAW_BUFFER14 = 0x8833; + public static final int GL_DRAW_BUFFER15 = 0x8834; + public static final int GL_MAX_FRAGMENT_UNIFORM_COMPONENTS = 0x8B49; + public static final int GL_MAX_VERTEX_UNIFORM_COMPONENTS = 0x8B4A; + public static final int GL_SAMPLER_3D = 0x8B5F; + public static final int GL_SAMPLER_2D_SHADOW = 0x8B62; + public static final int GL_FRAGMENT_SHADER_DERIVATIVE_HINT = 0x8B8B; + public static final int GL_PIXEL_PACK_BUFFER = 0x88EB; + public static final int GL_PIXEL_UNPACK_BUFFER = 0x88EC; + public static final int GL_PIXEL_PACK_BUFFER_BINDING = 0x88ED; + public static final int GL_PIXEL_UNPACK_BUFFER_BINDING = 0x88EF; + public static final int GL_FLOAT_MAT2x3 = 0x8B65; + public static final int GL_FLOAT_MAT2x4 = 0x8B66; + public static final int GL_FLOAT_MAT3x2 = 0x8B67; + public static final int GL_FLOAT_MAT3x4 = 0x8B68; + public static final int GL_FLOAT_MAT4x2 = 0x8B69; + public static final int GL_FLOAT_MAT4x3 = 0x8B6A; + public static final int GL_SRGB = 0x8C40; + public static final int GL_SRGB8 = 0x8C41; + public static final int GL_SRGB8_ALPHA8 = 0x8C43; + public static final int GL_COMPARE_REF_TO_TEXTURE = 0x884E; + public static final int GL_MAJOR_VERSION = 0x821B; + public static final int GL_MINOR_VERSION = 0x821C; + public static final int GL_NUM_EXTENSIONS = 0x821D; + public static final int GL_RGBA32F = 0x8814; + public static final int GL_RGB32F = 0x8815; + public static final int GL_RGBA16F = 0x881A; + public static final int GL_RGB16F = 0x881B; + public static final int GL_VERTEX_ATTRIB_ARRAY_INTEGER = 0x88FD; + public static final int GL_MAX_ARRAY_TEXTURE_LAYERS = 0x88FF; + public static final int GL_MIN_PROGRAM_TEXEL_OFFSET = 0x8904; + public static final int GL_MAX_PROGRAM_TEXEL_OFFSET = 0x8905; + public static final int GL_MAX_VARYING_COMPONENTS = 0x8B4B; + public static final int GL_TEXTURE_2D_ARRAY = 0x8C1A; + public static final int GL_TEXTURE_BINDING_2D_ARRAY = 0x8C1D; + public static final int GL_R11F_G11F_B10F = 0x8C3A; + public static final int GL_UNSIGNED_INT_10F_11F_11F_REV = 0x8C3B; + public static final int GL_RGB9_E5 = 0x8C3D; + public static final int GL_UNSIGNED_INT_5_9_9_9_REV = 0x8C3E; + public static final int GL_TRANSFORM_FEEDBACK_VARYING_MAX_LENGTH = 0x8C76; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_MODE = 0x8C7F; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_COMPONENTS = 0x8C80; + public static final int GL_TRANSFORM_FEEDBACK_VARYINGS = 0x8C83; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_START = 0x8C84; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_SIZE = 0x8C85; + public static final int GL_TRANSFORM_FEEDBACK_PRIMITIVES_WRITTEN = 0x8C88; + public static final int GL_RASTERIZER_DISCARD = 0x8C89; + public static final int GL_MAX_TRANSFORM_FEEDBACK_INTERLEAVED_COMPONENTS = 0x8C8A; + public static final int GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS = 0x8C8B; + public static final int GL_INTERLEAVED_ATTRIBS = 0x8C8C; + public static final int GL_SEPARATE_ATTRIBS = 0x8C8D; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER = 0x8C8E; + public static final int GL_TRANSFORM_FEEDBACK_BUFFER_BINDING = 0x8C8F; + public static final int GL_RGBA32UI = 0x8D70; + public static final int GL_RGB32UI = 0x8D71; + public static final int GL_RGBA16UI = 0x8D76; + public static final int GL_RGB16UI = 0x8D77; + public static final int GL_RGBA8UI = 0x8D7C; + public static final int GL_RGB8UI = 0x8D7D; + public static final int GL_RGBA32I = 0x8D82; + public static final int GL_RGB32I = 0x8D83; + public static final int GL_RGBA16I = 0x8D88; + public static final int GL_RGB16I = 0x8D89; + public static final int GL_RGBA8I = 0x8D8E; + public static final int GL_RGB8I = 0x8D8F; + public static final int GL_RED_INTEGER = 0x8D94; + public static final int GL_RGB_INTEGER = 0x8D98; + public static final int GL_RGBA_INTEGER = 0x8D99; + public static final int GL_SAMPLER_2D_ARRAY = 0x8DC1; + public static final int GL_SAMPLER_2D_ARRAY_SHADOW = 0x8DC4; + public static final int GL_SAMPLER_CUBE_SHADOW = 0x8DC5; + public static final int GL_UNSIGNED_INT_VEC2 = 0x8DC6; + public static final int GL_UNSIGNED_INT_VEC3 = 0x8DC7; + public static final int GL_UNSIGNED_INT_VEC4 = 0x8DC8; + public static final int GL_INT_SAMPLER_2D = 0x8DCA; + public static final int GL_INT_SAMPLER_3D = 0x8DCB; + public static final int GL_INT_SAMPLER_CUBE = 0x8DCC; + public static final int GL_INT_SAMPLER_2D_ARRAY = 0x8DCF; + public static final int GL_UNSIGNED_INT_SAMPLER_2D = 0x8DD2; + public static final int GL_UNSIGNED_INT_SAMPLER_3D = 0x8DD3; + public static final int GL_UNSIGNED_INT_SAMPLER_CUBE = 0x8DD4; + public static final int GL_UNSIGNED_INT_SAMPLER_2D_ARRAY = 0x8DD7; + public static final int GL_BUFFER_ACCESS_FLAGS = 0x911F; + public static final int GL_BUFFER_MAP_LENGTH = 0x9120; + public static final int GL_BUFFER_MAP_OFFSET = 0x9121; + public static final int GL_DEPTH_COMPONENT32F = 0x8CAC; + public static final int GL_DEPTH32F_STENCIL8 = 0x8CAD; + public static final int GL_FLOAT_32_UNSIGNED_INT_24_8_REV = 0x8DAD; + public static final int GL_FRAMEBUFFER_ATTACHMENT_COLOR_ENCODING = 0x8210; + public static final int GL_FRAMEBUFFER_ATTACHMENT_COMPONENT_TYPE = 0x8211; + public static final int GL_FRAMEBUFFER_ATTACHMENT_RED_SIZE = 0x8212; + public static final int GL_FRAMEBUFFER_ATTACHMENT_GREEN_SIZE = 0x8213; + public static final int GL_FRAMEBUFFER_ATTACHMENT_BLUE_SIZE = 0x8214; + public static final int GL_FRAMEBUFFER_ATTACHMENT_ALPHA_SIZE = 0x8215; + public static final int GL_FRAMEBUFFER_ATTACHMENT_DEPTH_SIZE = 0x8216; + public static final int GL_FRAMEBUFFER_ATTACHMENT_STENCIL_SIZE = 0x8217; + public static final int GL_FRAMEBUFFER_DEFAULT = 0x8218; + public static final int GL_FRAMEBUFFER_UNDEFINED = 0x8219; + public static final int GL_DEPTH_STENCIL_ATTACHMENT = 0x821A; + public static final int GL_DEPTH_STENCIL = 0x84F9; + public static final int GL_UNSIGNED_INT_24_8 = 0x84FA; + public static final int GL_DEPTH24_STENCIL8 = 0x88F0; + public static final int GL_UNSIGNED_NORMALIZED = 0x8C17; + public static final int GL_DRAW_FRAMEBUFFER_BINDING = GL_FRAMEBUFFER_BINDING; + public static final int GL_READ_FRAMEBUFFER = 0x8CA8; + public static final int GL_DRAW_FRAMEBUFFER = 0x8CA9; + public static final int GL_READ_FRAMEBUFFER_BINDING = 0x8CAA; + public static final int GL_RENDERBUFFER_SAMPLES = 0x8CAB; + public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LAYER = 0x8CD4; + public static final int GL_MAX_COLOR_ATTACHMENTS = 0x8CDF; + public static final int GL_COLOR_ATTACHMENT1 = 0x8CE1; + public static final int GL_COLOR_ATTACHMENT2 = 0x8CE2; + public static final int GL_COLOR_ATTACHMENT3 = 0x8CE3; + public static final int GL_COLOR_ATTACHMENT4 = 0x8CE4; + public static final int GL_COLOR_ATTACHMENT5 = 0x8CE5; + public static final int GL_COLOR_ATTACHMENT6 = 0x8CE6; + public static final int GL_COLOR_ATTACHMENT7 = 0x8CE7; + public static final int GL_COLOR_ATTACHMENT8 = 0x8CE8; + public static final int GL_COLOR_ATTACHMENT9 = 0x8CE9; + public static final int GL_COLOR_ATTACHMENT10 = 0x8CEA; + public static final int GL_COLOR_ATTACHMENT11 = 0x8CEB; + public static final int GL_COLOR_ATTACHMENT12 = 0x8CEC; + public static final int GL_COLOR_ATTACHMENT13 = 0x8CED; + public static final int GL_COLOR_ATTACHMENT14 = 0x8CEE; + public static final int GL_COLOR_ATTACHMENT15 = 0x8CEF; + public static final int GL_FRAMEBUFFER_INCOMPLETE_MULTISAMPLE = 0x8D56; + public static final int GL_MAX_SAMPLES = 0x8D57; + public static final int GL_HALF_FLOAT = 0x140B; + public static final int GL_MAP_READ_BIT = 0x0001; + public static final int GL_MAP_WRITE_BIT = 0x0002; + public static final int GL_MAP_INVALIDATE_RANGE_BIT = 0x0004; + public static final int GL_MAP_INVALIDATE_BUFFER_BIT = 0x0008; + public static final int GL_MAP_FLUSH_EXPLICIT_BIT = 0x0010; + public static final int GL_MAP_UNSYNCHRONIZED_BIT = 0x0020; + public static final int GL_RG = 0x8227; + public static final int GL_RG_INTEGER = 0x8228; + public static final int GL_R8 = 0x8229; + public static final int GL_RG8 = 0x822B; + public static final int GL_R16F = 0x822D; + public static final int GL_R32F = 0x822E; + public static final int GL_RG16F = 0x822F; + public static final int GL_RG32F = 0x8230; + public static final int GL_R8I = 0x8231; + public static final int GL_R8UI = 0x8232; + public static final int GL_R16I = 0x8233; + public static final int GL_R16UI = 0x8234; + public static final int GL_R32I = 0x8235; + public static final int GL_R32UI = 0x8236; + public static final int GL_RG8I = 0x8237; + public static final int GL_RG8UI = 0x8238; + public static final int GL_RG16I = 0x8239; + public static final int GL_RG16UI = 0x823A; + public static final int GL_RG32I = 0x823B; + public static final int GL_RG32UI = 0x823C; + public static final int GL_VERTEX_ARRAY_BINDING = 0x85B5; + public static final int GL_R8_SNORM = 0x8F94; + public static final int GL_RG8_SNORM = 0x8F95; + public static final int GL_RGB8_SNORM = 0x8F96; + public static final int GL_RGBA8_SNORM = 0x8F97; + public static final int GL_SIGNED_NORMALIZED = 0x8F9C; + public static final int GL_PRIMITIVE_RESTART_FIXED_INDEX = 0x8D69; + public static final int GL_COPY_READ_BUFFER = 0x8F36; + public static final int GL_COPY_WRITE_BUFFER = 0x8F37; + public static final int GL_COPY_READ_BUFFER_BINDING = GL_COPY_READ_BUFFER; + public static final int GL_COPY_WRITE_BUFFER_BINDING = GL_COPY_WRITE_BUFFER; + public static final int GL_UNIFORM_BUFFER = 0x8A11; + public static final int GL_UNIFORM_BUFFER_BINDING = 0x8A28; + public static final int GL_UNIFORM_BUFFER_START = 0x8A29; + public static final int GL_UNIFORM_BUFFER_SIZE = 0x8A2A; + public static final int GL_MAX_VERTEX_UNIFORM_BLOCKS = 0x8A2B; + public static final int GL_MAX_FRAGMENT_UNIFORM_BLOCKS = 0x8A2D; + public static final int GL_MAX_COMBINED_UNIFORM_BLOCKS = 0x8A2E; + public static final int GL_MAX_UNIFORM_BUFFER_BINDINGS = 0x8A2F; + public static final int GL_MAX_UNIFORM_BLOCK_SIZE = 0x8A30; + public static final int GL_MAX_COMBINED_VERTEX_UNIFORM_COMPONENTS = 0x8A31; + public static final int GL_MAX_COMBINED_FRAGMENT_UNIFORM_COMPONENTS = 0x8A33; + public static final int GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT = 0x8A34; + public static final int GL_ACTIVE_UNIFORM_BLOCK_MAX_NAME_LENGTH = 0x8A35; + public static final int GL_ACTIVE_UNIFORM_BLOCKS = 0x8A36; + public static final int GL_UNIFORM_TYPE = 0x8A37; + public static final int GL_UNIFORM_SIZE = 0x8A38; + public static final int GL_UNIFORM_NAME_LENGTH = 0x8A39; + public static final int GL_UNIFORM_BLOCK_INDEX = 0x8A3A; + public static final int GL_UNIFORM_OFFSET = 0x8A3B; + public static final int GL_UNIFORM_ARRAY_STRIDE = 0x8A3C; + public static final int GL_UNIFORM_MATRIX_STRIDE = 0x8A3D; + public static final int GL_UNIFORM_IS_ROW_MAJOR = 0x8A3E; + public static final int GL_UNIFORM_BLOCK_BINDING = 0x8A3F; + public static final int GL_UNIFORM_BLOCK_DATA_SIZE = 0x8A40; + public static final int GL_UNIFORM_BLOCK_NAME_LENGTH = 0x8A41; + public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORMS = 0x8A42; + public static final int GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES = 0x8A43; + public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_VERTEX_SHADER = 0x8A44; + public static final int GL_UNIFORM_BLOCK_REFERENCED_BY_FRAGMENT_SHADER = 0x8A46; + // GL_INVALID_INDEX is defined as 0xFFFFFFFFu in C. + public static final int GL_INVALID_INDEX = -1; + public static final int GL_MAX_VERTEX_OUTPUT_COMPONENTS = 0x9122; + public static final int GL_MAX_FRAGMENT_INPUT_COMPONENTS = 0x9125; + public static final int GL_MAX_SERVER_WAIT_TIMEOUT = 0x9111; + public static final int GL_OBJECT_TYPE = 0x9112; + public static final int GL_SYNC_CONDITION = 0x9113; + public static final int GL_SYNC_STATUS = 0x9114; + public static final int GL_SYNC_FLAGS = 0x9115; + public static final int GL_SYNC_FENCE = 0x9116; + public static final int GL_SYNC_GPU_COMMANDS_COMPLETE = 0x9117; + public static final int GL_UNSIGNALED = 0x9118; + public static final int GL_SIGNALED = 0x9119; + public static final int GL_ALREADY_SIGNALED = 0x911A; + public static final int GL_TIMEOUT_EXPIRED = 0x911B; + public static final int GL_CONDITION_SATISFIED = 0x911C; + public static final int GL_WAIT_FAILED = 0x911D; + public static final int GL_SYNC_FLUSH_COMMANDS_BIT = 0x00000001; + // GL_TIMEOUT_IGNORED is defined as 0xFFFFFFFFFFFFFFFFull in C. + public static final long GL_TIMEOUT_IGNORED = -1; + public static final int GL_VERTEX_ATTRIB_ARRAY_DIVISOR = 0x88FE; + public static final int GL_ANY_SAMPLES_PASSED = 0x8C2F; + public static final int GL_ANY_SAMPLES_PASSED_CONSERVATIVE = 0x8D6A; + public static final int GL_SAMPLER_BINDING = 0x8919; + public static final int GL_RGB10_A2UI = 0x906F; + public static final int GL_TEXTURE_SWIZZLE_R = 0x8E42; + public static final int GL_TEXTURE_SWIZZLE_G = 0x8E43; + public static final int GL_TEXTURE_SWIZZLE_B = 0x8E44; + public static final int GL_TEXTURE_SWIZZLE_A = 0x8E45; + public static final int GL_GREEN = 0x1904; + public static final int GL_BLUE = 0x1905; + public static final int GL_INT_2_10_10_10_REV = 0x8D9F; + public static final int GL_TRANSFORM_FEEDBACK = 0x8E22; + public static final int GL_TRANSFORM_FEEDBACK_PAUSED = 0x8E23; + public static final int GL_TRANSFORM_FEEDBACK_ACTIVE = 0x8E24; + public static final int GL_TRANSFORM_FEEDBACK_BINDING = 0x8E25; + public static final int GL_PROGRAM_BINARY_RETRIEVABLE_HINT = 0x8257; + public static final int GL_PROGRAM_BINARY_LENGTH = 0x8741; + public static final int GL_NUM_PROGRAM_BINARY_FORMATS = 0x87FE; + public static final int GL_PROGRAM_BINARY_FORMATS = 0x87FF; + public static final int GL_COMPRESSED_R11_EAC = 0x9270; + public static final int GL_COMPRESSED_SIGNED_R11_EAC = 0x9271; + public static final int GL_COMPRESSED_RG11_EAC = 0x9272; + public static final int GL_COMPRESSED_SIGNED_RG11_EAC = 0x9273; + public static final int GL_COMPRESSED_RGB8_ETC2 = 0x9274; + public static final int GL_COMPRESSED_SRGB8_ETC2 = 0x9275; + public static final int GL_COMPRESSED_RGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9276; + public static final int GL_COMPRESSED_SRGB8_PUNCHTHROUGH_ALPHA1_ETC2 = 0x9277; + public static final int GL_COMPRESSED_RGBA8_ETC2_EAC = 0x9278; + public static final int GL_COMPRESSED_SRGB8_ALPHA8_ETC2_EAC = 0x9279; + public static final int GL_TEXTURE_IMMUTABLE_FORMAT = 0x912F; + public static final int GL_MAX_ELEMENT_INDEX = 0x8D6B; + public static final int GL_NUM_SAMPLE_COUNTS = 0x9380; + public static final int GL_TEXTURE_IMMUTABLE_LEVELS = 0x82DF; + native private static void _nativeClassInit(); static { _nativeClassInit(); From 68fc8bbced285a8a2b716e5fe1900968ad8ba7d3 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 01:01:00 -0700 Subject: [PATCH 05/14] Add *int64 and GLsync types and related functions Return values are declared with the C return type, but the JNI function returns the JNI return type. In the case of GLsync/jlong as in glFenceSync(), this causes a compile error. So the generator now explicitly casts the return value to the JNI return type. Bug: 8566953 Change-Id: I814befe2e4cce745434cbc4e1c8639fc3ce8aeae --- opengl/tools/glgen/specs/gles11/GLES30.spec | 18 +++++++++--------- opengl/tools/glgen/src/JType.java | 5 +++++ opengl/tools/glgen/src/JniCodeEmitter.java | 3 ++- 3 files changed, 16 insertions(+), 10 deletions(-) diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index f181976eb..cf5a75870 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -218,15 +218,15 @@ void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenu void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) -// GLsync glFenceSync ( GLenum condition, GLbitfield flags ) -// GLboolean glIsSync ( GLsync sync ) -// void glDeleteSync ( GLsync sync ) -// GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) -// void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) -// void glGetInteger64v ( GLenum pname, GLint64 *params ) -// void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) -// void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) -// void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) +GLsync glFenceSync ( GLenum condition, GLbitfield flags ) +GLboolean glIsSync ( GLsync sync ) +void glDeleteSync ( GLsync sync ) +GLenum glClientWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) +void glWaitSync ( GLsync sync, GLbitfield flags, GLuint64 timeout ) +void glGetInteger64v ( GLenum pname, GLint64 *params ) +void glGetSynciv ( GLsync sync, GLenum pname, GLsizei bufSize, GLsizei *length, GLint *values ) +void glGetInteger64i_v ( GLenum target, GLuint index, GLint64 *data ) +void glGetBufferParameteri64v ( GLenum target, GLenum pname, GLint64 *params ) void glGenSamplers ( GLsizei count, GLuint *samplers ) void glDeleteSamplers ( GLsizei count, const GLuint *samplers ) GLboolean glIsSampler ( GLuint sampler ) diff --git a/opengl/tools/glgen/src/JType.java b/opengl/tools/glgen/src/JType.java index 795d833e1..b10e7e255 100644 --- a/opengl/tools/glgen/src/JType.java +++ b/opengl/tools/glgen/src/JType.java @@ -48,6 +48,8 @@ public class JType { typeMapping.put(new CType("char", true, true), new JType("String", false, false)); typeMapping.put(new CType("GLchar", true, true), new JType("String", false, false)); typeMapping.put(new CType("int"), new JType("int")); + typeMapping.put(new CType("GLuint64"), new JType("long")); + typeMapping.put(new CType("GLsync"), new JType("long")); // EGL primitive types typeMapping.put(new CType("EGLint"), new JType("int")); @@ -103,6 +105,8 @@ public class JType { new JType("java.nio.IntBuffer", true, false)); typeMapping.put(new CType("GLshort", true, true), new JType("java.nio.ShortBuffer", true, false)); + typeMapping.put(new CType("GLint64", false, true), + new JType("java.nio.LongBuffer", true, false)); // Typed pointers map to arrays + offsets arrayTypeMapping.put(new CType("char", false, true), @@ -124,6 +128,7 @@ public class JType { arrayTypeMapping.put(new CType("GLuint", true, true), new JType("int", false, true)); arrayTypeMapping.put(new CType("GLintptr"), new JType("int", false, true)); arrayTypeMapping.put(new CType("GLsizeiptr"), new JType("int", false, true)); + arrayTypeMapping.put(new CType("GLint64", false, true), new JType("long", false, true)); //EGL typed pointers map to arrays + offsets arrayTypeMapping.put(new CType("EGLint", false, true), new JType("int", false, true)); diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java index ffe376717..ba1152a7a 100644 --- a/opengl/tools/glgen/src/JniCodeEmitter.java +++ b/opengl/tools/glgen/src/JniCodeEmitter.java @@ -1421,7 +1421,8 @@ public class JniCodeEmitter { "return toEGLHandle(_env, " + baseType + "Class, " + baseType + "Constructor, _returnValue);"); } else { - out.println(indent + "return _returnValue;"); + out.println(indent + "return (" + + getJniType(jfunc.getType()) + ")_returnValue;"); } } From 071fc660597efdfa5ebc58b427252393e628a497 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 01:17:34 -0700 Subject: [PATCH 06/14] Add buffer object versions of several functions Some of these are new ES3 functions, some are existing ES2 functions that can now use the new pixel pack/unpack buffer bindings. glDrawElementsInstanced needs a special case since the pointer/offset arg isn't the last one like the generator assumes. Bug: 8566953 Change-Id: I638a36b0a31aefcb5bfee6f4d049348223045103 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 13 ++++++- opengl/tools/glgen/src/JniCodeEmitter.java | 22 ++++++++--- opengl/tools/glgen/stubs/gles11/common.cpp | 6 +++ .../stubs/gles11/glDrawElementsInstanced.cpp | 39 +++++++++++++++++++ .../stubs/gles11/glDrawElementsInstanced.java | 20 ++++++++++ .../gles11/glDrawElementsInstanced.nativeReg | 2 + 6 files changed, 95 insertions(+), 7 deletions(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.java create mode 100644 opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index cf5a75870..dad4499e5 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -23,7 +23,9 @@ void glClearStencil ( GLint s ) void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) void glCompileShader ( GLuint shader ) void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLsizei offset ) void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLsizei offset ) void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) GLuint glCreateProgram ( void ) @@ -95,6 +97,7 @@ void glLinkProgram ( GLuint program ) void glPixelStorei ( GLenum pname, GLint param ) void glPolygonOffset ( GLfloat factor, GLfloat units ) void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) +void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei offset ) void glReleaseShaderCompiler ( void ) void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) void glSampleCoverage ( GLfloat value, GLboolean invert ) @@ -108,11 +111,13 @@ void glStencilMaskSeparate ( GLenum face, GLuint mask ) void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei offset ) void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) void glTexParameteri ( GLenum target, GLenum pname, GLint param ) void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei offset ) void glUniform1f ( GLint location, GLfloat x ) void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) void glUniform1i ( GLint location, GLint x ) @@ -150,11 +155,16 @@ void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) // void glReadBuffer ( GLenum mode ) void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) +void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexImage3D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLsizei offset ) void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid *pixels ) +void glTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLsizei offset ) void glCopyTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height ) void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexImage3D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLsizei offset ) void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data ) +void glCompressedTexSubImage3D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLsizei offset ) void glGenQueries ( GLsizei n, GLuint *ids ) void glDeleteQueries ( GLsizei n, const GLuint *ids ) GLboolean glIsQuery ( GLuint id ) @@ -187,7 +197,8 @@ void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr of void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) // void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *const *varyings, GLenum bufferMode ) // void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name ) -// void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) +void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) +void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) void glGetVertexAttribIuiv ( GLuint index, GLenum pname, GLuint *params ) void glVertexAttribI4i ( GLuint index, GLint x, GLint y, GLint z, GLint w ) diff --git a/opengl/tools/glgen/src/JniCodeEmitter.java b/opengl/tools/glgen/src/JniCodeEmitter.java index ba1152a7a..d5e2d3424 100644 --- a/opengl/tools/glgen/src/JniCodeEmitter.java +++ b/opengl/tools/glgen/src/JniCodeEmitter.java @@ -749,10 +749,20 @@ public class JniCodeEmitter { String outName = "android_" + jfunc.getName(); boolean isPointerFunc = isPointerFunc(jfunc); - boolean isVBOPointerFunc = (outName.endsWith("Pointer") || - outName.endsWith("PointerOES") || - outName.endsWith("DrawElements") || outName.endsWith("VertexAttribPointer")) && - !jfunc.getCFunc().hasPointerArg(); + boolean isPointerOffsetFunc = + (outName.endsWith("Pointer") || outName.endsWith("PointerOES") || + outName.endsWith("glDrawElements") || + outName.endsWith("glDrawRangeElements") || + outName.endsWith("glTexImage2D") || + outName.endsWith("glTexSubImage2D") || + outName.endsWith("glCompressedTexImage2D") || + outName.endsWith("glCompressedTexSubImage2D") || + outName.endsWith("glTexImage3D") || + outName.endsWith("glTexSubImage3D") || + outName.endsWith("glCompressedTexImage3D") || + outName.endsWith("glCompressedTexSubImage3D") || + outName.endsWith("glReadPixels")) + && !jfunc.getCFunc().hasPointerArg(); if (isPointerFunc) { outName += "Bounds"; } @@ -1271,8 +1281,8 @@ public class JniCodeEmitter { } for (int i = 0; i < numArgs; i++) { String typecast; - if (i == numArgs - 1 && isVBOPointerFunc) { - typecast = "(const GLvoid *)"; + if (i == numArgs - 1 && isPointerOffsetFunc) { + typecast = "(GLvoid *)"; } else { typecast = "(" + cfunc.getArgType(i).getDeclaration() + ")"; } diff --git a/opengl/tools/glgen/stubs/gles11/common.cpp b/opengl/tools/glgen/stubs/gles11/common.cpp index 106dbdcc5..579d573ef 100644 --- a/opengl/tools/glgen/stubs/gles11/common.cpp +++ b/opengl/tools/glgen/stubs/gles11/common.cpp @@ -41,6 +41,12 @@ static void glVertexAttribPointerBounds(GLuint indx, GLint size, GLenum type, glVertexAttribPointer(indx, size, type, normalized, stride, pointer); } #endif +#ifdef GL_ES_VERSION_3_0 +static void glVertexAttribIPointerBounds(GLuint indx, GLint size, GLenum type, + GLsizei stride, const GLvoid *pointer, GLsizei count) { + glVertexAttribIPointer(indx, size, type, stride, pointer); +} +#endif } /* Cache method IDs each time the class is loaded. */ diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp new file mode 100644 index 000000000..41df486f1 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.cpp @@ -0,0 +1,39 @@ +/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */ +static void +android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I + (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jobject indices_buf, jint instanceCount) { + jarray _array = (jarray) 0; + jint _bufferOffset = (jint) 0; + jint _remaining; + GLvoid *indices = (GLvoid *) 0; + + indices = (GLvoid *)getPointer(_env, indices_buf, &_array, &_remaining, &_bufferOffset); + if (indices == NULL) { + char * _indicesBase = (char *)_env->GetPrimitiveArrayCritical(_array, (jboolean *) 0); + indices = (GLvoid *) (_indicesBase + _bufferOffset); + } + glDrawElementsInstanced( + (GLenum)mode, + (GLsizei)count, + (GLenum)type, + (GLvoid *)indices, + (GLsizei)instanceCount + ); + if (_array) { + releasePointer(_env, _array, indices, JNI_FALSE); + } +} + +/* void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) */ +static void +android_glDrawElementsInstanced__IIIII + (JNIEnv *_env, jobject _this, jint mode, jint count, jint type, jint indicesOffset, jint instanceCount) { + glDrawElementsInstanced( + (GLenum)mode, + (GLsizei)count, + (GLenum)type, + (GLvoid *)indicesOffset, + (GLsizei)instanceCount + ); +} + diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.java b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.java new file mode 100644 index 000000000..53651ce35 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.java @@ -0,0 +1,20 @@ + // C function void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) + + public static native void glDrawElementsInstanced( + int mode, + int count, + int type, + java.nio.Buffer indices, + int instanceCount + ); + + // C function void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) + + public static native void glDrawElementsInstanced( + int mode, + int count, + int type, + int indicesOffset, + int instanceCount + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.nativeReg b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.nativeReg new file mode 100644 index 000000000..3b7424c49 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glDrawElementsInstanced.nativeReg @@ -0,0 +1,2 @@ +{"glDrawElementsInstanced", "(IIILjava/nio/Buffer;I)V", (void *) android_glDrawElementsInstanced__IIILjava_nio_Buffer_2I }, +{"glDrawElementsInstanced", "(IIIII)V", (void *) android_glDrawElementsInstanced__IIIII }, From 552a6204828b5f25db0c3e644cead321664706fa Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 00:34:07 -0700 Subject: [PATCH 07/14] Special-case glTransformFeedbackVaryings Bug: 8566953 Change-Id: I02a1548aebc12bd3599903029bfd2e4ccea53211 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../gles11/glTransformFeedbackVaryings.cpp | 49 +++++++++++++++++++ .../gles11/glTransformFeedbackVaryings.java | 8 +++ .../glTransformFeedbackVaryings.nativeReg | 1 + 4 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java create mode 100644 opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index dad4499e5..6315c5691 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -195,7 +195,7 @@ void glBeginTransformFeedback ( GLenum primitiveMode ) void glEndTransformFeedback ( void ) void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) -// void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *const *varyings, GLenum bufferMode ) +void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) // void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name ) void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp new file mode 100644 index 000000000..0dedd0fda --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.cpp @@ -0,0 +1,49 @@ +/* void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) */ +static +void +android_glTransformFeedbackVaryings + (JNIEnv *_env, jobject _this, jint program, jobjectArray varyings_ref, jint bufferMode) { + jint _exception = 0; + const char* _exceptionType = NULL; + const char* _exceptionMessage = NULL; + jint _count = 0, _i; + const char** _varyings = NULL; + const char* _varying = NULL; + + if (!varyings_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "varyings == null"; + goto exit; + } + + _count = _env->GetArrayLength(varyings_ref); + _varyings = (const char**)calloc(_count, sizeof(const char*)); + for (_i = 0; _i < _count; _i++) { + jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i); + if (!_varying) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "null varyings element"; + goto exit; + } + _varyings[_i] = _env->GetStringUTFChars(_varying, 0); + } + + glTransformFeedbackVaryings(program, _count, _varyings, bufferMode); + +exit: + for (_i = _count - 1; _i >= 0; _i--) { + if (_varyings[_i]) { + jstring _varying = (jstring)_env->GetObjectArrayElement(varyings_ref, _i); + if (_varying) { + _env->ReleaseStringUTFChars(_varying, _varyings[_i]); + } + } + } + free(_varyings); + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } +} + diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java new file mode 100644 index 000000000..c8243447a --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.java @@ -0,0 +1,8 @@ + // C function void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) + + public static native void glTransformFeedbackVaryings( + int program, + String[] varyings, + int bufferMode + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg new file mode 100644 index 000000000..24f2b77ab --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glTransformFeedbackVaryings.nativeReg @@ -0,0 +1 @@ +{"glTransformFeedbackVaryings", "(I[Ljava/lang/String;I)V", (void *) android_glTransformFeedbackVaryings }, From 31f6edc21bbc2802f4c755b4982945d5237e92ce Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 00:50:32 -0700 Subject: [PATCH 08/14] Special-case glGetTransformFeedbackVarying Just a search-and-replace on the glGetActiveAttrib special-case, since they have the same signature and parameter handling. Bug: 8566953 Change-Id: I40834d6f32bf9ecb39718df29036aa2d1bbfa07a --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../gles11/glGetTransformFeedbackVarying.cpp | 328 ++++++++++++++++++ .../gles11/glGetTransformFeedbackVarying.java | 48 +++ .../glGetTransformFeedbackVarying.nativeReg | 4 + 4 files changed, 381 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.java create mode 100644 opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index 6315c5691..1e2acf9e0 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -196,7 +196,7 @@ void glEndTransformFeedback ( void ) void glBindBufferRange ( GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size ) void glBindBufferBase ( GLenum target, GLuint index, GLuint buffer ) void glTransformFeedbackVaryings ( GLuint program, GLsizei count, const GLchar *varyings, GLenum bufferMode ) -// void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name ) +void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLsizei *size, GLenum *type, GLchar *name ) void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid *pointer ) void glVertexAttribIPointer ( GLuint index, GLint size, GLenum type, GLsizei stride, GLsizei offset ) void glGetVertexAttribIiv ( GLuint index, GLenum pname, GLint *params ) diff --git a/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp new file mode 100644 index 000000000..0514fe980 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.cpp @@ -0,0 +1,328 @@ +/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ +static void +android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI + (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jintArray length_ref, jint lengthOffset, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset, jbyteArray name_ref, jint nameOffset) { + jint _exception = 0; + const char * _exceptionType; + const char * _exceptionMessage; + GLsizei *length_base = (GLsizei *) 0; + jint _lengthRemaining; + GLsizei *length = (GLsizei *) 0; + GLint *size_base = (GLint *) 0; + jint _sizeRemaining; + GLint *size = (GLint *) 0; + GLenum *type_base = (GLenum *) 0; + jint _typeRemaining; + GLenum *type = (GLenum *) 0; + char *name_base = (char *) 0; + jint _nameRemaining; + char *name = (char *) 0; + + if (!length_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "length == null"; + goto exit; + } + if (lengthOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "lengthOffset < 0"; + goto exit; + } + _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; + length_base = (GLsizei *) + _env->GetPrimitiveArrayCritical(length_ref, (jboolean *)0); + length = length_base + lengthOffset; + + if (!size_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "size == null"; + goto exit; + } + if (sizeOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "sizeOffset < 0"; + goto exit; + } + _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; + size_base = (GLint *) + _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); + size = size_base + sizeOffset; + + if (!type_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "type == null"; + goto exit; + } + if (typeOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "typeOffset < 0"; + goto exit; + } + _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; + type_base = (GLenum *) + _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); + type = type_base + typeOffset; + + if (!name_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "name == null"; + goto exit; + } + if (nameOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "nameOffset < 0"; + goto exit; + } + _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; + name_base = (char *) + _env->GetPrimitiveArrayCritical(name_ref, (jboolean *)0); + name = name_base + nameOffset; + + glGetTransformFeedbackVarying( + (GLuint)program, + (GLuint)index, + (GLsizei)bufsize, + (GLsizei *)length, + (GLint *)size, + (GLenum *)type, + (char *)name + ); + +exit: + if (name_base) { + _env->ReleasePrimitiveArrayCritical(name_ref, name_base, + _exception ? JNI_ABORT: 0); + } + if (type_base) { + _env->ReleasePrimitiveArrayCritical(type_ref, type_base, + _exception ? JNI_ABORT: 0); + } + if (size_base) { + _env->ReleasePrimitiveArrayCritical(size_ref, size_base, + _exception ? JNI_ABORT: 0); + } + if (length_base) { + _env->ReleasePrimitiveArrayCritical(length_ref, length_base, + _exception ? JNI_ABORT: 0); + } + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } +} + +/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ +static void +android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B + (JNIEnv *_env, jobject _this, jint program, jint index, jint bufsize, jobject length_buf, jobject size_buf, jobject type_buf, jbyte name) { + jarray _lengthArray = (jarray) 0; + jint _lengthBufferOffset = (jint) 0; + jarray _sizeArray = (jarray) 0; + jint _sizeBufferOffset = (jint) 0; + jarray _typeArray = (jarray) 0; + jint _typeBufferOffset = (jint) 0; + jint _lengthRemaining; + GLsizei *length = (GLsizei *) 0; + jint _sizeRemaining; + GLint *size = (GLint *) 0; + jint _typeRemaining; + GLenum *type = (GLenum *) 0; + + length = (GLsizei *)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); + size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset); + type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset); + if (length == NULL) { + char * _lengthBase = (char *)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean *) 0); + length = (GLsizei *) (_lengthBase + _lengthBufferOffset); + } + if (size == NULL) { + char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0); + size = (GLint *) (_sizeBase + _sizeBufferOffset); + } + if (type == NULL) { + char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0); + type = (GLenum *) (_typeBase + _typeBufferOffset); + } + glGetTransformFeedbackVarying( + (GLuint)program, + (GLuint)index, + (GLsizei)bufsize, + (GLsizei *)length, + (GLint *)size, + (GLenum *)type, + (char *)name + ); + if (_typeArray) { + releasePointer(_env, _typeArray, type, JNI_TRUE); + } + if (_sizeArray) { + releasePointer(_env, _sizeArray, size, JNI_TRUE); + } + if (_lengthArray) { + releasePointer(_env, _lengthArray, length, JNI_TRUE); + } +} + +/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ +static jstring +android_glGetTransformFeedbackVarying1 + (JNIEnv *_env, jobject _this, jint program, jint index, jintArray size_ref, jint sizeOffset, jintArray type_ref, jint typeOffset) { + jint _exception = 0; + const char * _exceptionType; + const char * _exceptionMessage; + GLint *size_base = (GLint *) 0; + jint _sizeRemaining; + GLint *size = (GLint *) 0; + GLenum *type_base = (GLenum *) 0; + jint _typeRemaining; + GLenum *type = (GLenum *) 0; + + jstring result = 0; + + GLint len = 0; + glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); + if (!len) { + return _env->NewStringUTF(""); + } + char* buf = (char*) malloc(len); + + if (buf == NULL) { + jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); + return NULL; + } + if (!size_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "size == null"; + goto exit; + } + if (sizeOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "sizeOffset < 0"; + goto exit; + } + _sizeRemaining = _env->GetArrayLength(size_ref) - sizeOffset; + size_base = (GLint *) + _env->GetPrimitiveArrayCritical(size_ref, (jboolean *)0); + size = size_base + sizeOffset; + + if (!type_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "type == null"; + goto exit; + } + if (typeOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "typeOffset < 0"; + goto exit; + } + _typeRemaining = _env->GetArrayLength(type_ref) - typeOffset; + type_base = (GLenum *) + _env->GetPrimitiveArrayCritical(type_ref, (jboolean *)0); + type = type_base + typeOffset; + + glGetTransformFeedbackVarying( + (GLuint)program, + (GLuint)index, + (GLsizei)len, + NULL, + (GLint *)size, + (GLenum *)type, + (char *)buf + ); +exit: + if (type_base) { + _env->ReleasePrimitiveArrayCritical(type_ref, type_base, + _exception ? JNI_ABORT: 0); + } + if (size_base) { + _env->ReleasePrimitiveArrayCritical(size_ref, size_base, + _exception ? JNI_ABORT: 0); + } + if (_exception != 1) { + result = _env->NewStringUTF(buf); + } + if (buf) { + free(buf); + } + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } + if (result == 0) { + result = _env->NewStringUTF(""); + } + + return result; +} + +/* void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) */ +static jstring +android_glGetTransformFeedbackVarying2 + (JNIEnv *_env, jobject _this, jint program, jint index, jobject size_buf, jobject type_buf) { + jarray _sizeArray = (jarray) 0; + jint _sizeBufferOffset = (jint) 0; + jarray _typeArray = (jarray) 0; + jint _typeBufferOffset = (jint) 0; + jint _lengthRemaining; + GLsizei *length = (GLsizei *) 0; + jint _sizeRemaining; + GLint *size = (GLint *) 0; + jint _typeRemaining; + GLenum *type = (GLenum *) 0; + + jstring result = 0; + + GLint len = 0; + glGetProgramiv((GLuint)program, GL_ACTIVE_ATTRIBUTE_MAX_LENGTH, &len); + if (!len) { + return _env->NewStringUTF(""); + } + char* buf = (char*) malloc(len); + + if (buf == NULL) { + jniThrowException(_env, "java/lang/IllegalArgumentException", "out of memory"); + return NULL; + } + + size = (GLint *)getPointer(_env, size_buf, &_sizeArray, &_sizeRemaining, &_sizeBufferOffset); + type = (GLenum *)getPointer(_env, type_buf, &_typeArray, &_typeRemaining, &_typeBufferOffset); + if (size == NULL) { + char * _sizeBase = (char *)_env->GetPrimitiveArrayCritical(_sizeArray, (jboolean *) 0); + size = (GLint *) (_sizeBase + _sizeBufferOffset); + } + if (type == NULL) { + char * _typeBase = (char *)_env->GetPrimitiveArrayCritical(_typeArray, (jboolean *) 0); + type = (GLenum *) (_typeBase + _typeBufferOffset); + } + glGetTransformFeedbackVarying( + (GLuint)program, + (GLuint)index, + (GLsizei)len, + NULL, + (GLint *)size, + (GLenum *)type, + (char *)buf + ); + + if (_typeArray) { + releasePointer(_env, _typeArray, type, JNI_TRUE); + } + if (_sizeArray) { + releasePointer(_env, _sizeArray, size, JNI_TRUE); + } + result = _env->NewStringUTF(buf); + if (buf) { + free(buf); + } + return result; +} diff --git a/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.java b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.java new file mode 100644 index 000000000..f73bbfe30 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.java @@ -0,0 +1,48 @@ + // C function void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) + + public static native void glGetTransformFeedbackVarying( + int program, + int index, + int bufsize, + int[] length, + int lengthOffset, + int[] size, + int sizeOffset, + int[] type, + int typeOffset, + byte[] name, + int nameOffset + ); + + // C function void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) + + public static native void glGetTransformFeedbackVarying( + int program, + int index, + int bufsize, + java.nio.IntBuffer length, + java.nio.IntBuffer size, + java.nio.IntBuffer type, + byte name + ); + + // C function void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) + + public static native String glGetTransformFeedbackVarying( + int program, + int index, + int[] size, + int sizeOffset, + int[] type, + int typeOffset + ); + + // C function void glGetTransformFeedbackVarying ( GLuint program, GLuint index, GLsizei bufSize, GLsizei *length, GLint *size, GLenum *type, GLchar *name ) + + public static native String glGetTransformFeedbackVarying( + int program, + int index, + java.nio.IntBuffer size, + java.nio.IntBuffer type + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.nativeReg new file mode 100644 index 000000000..412d04ccc --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetTransformFeedbackVarying.nativeReg @@ -0,0 +1,4 @@ +{"glGetTransformFeedbackVarying", "(III[II[II[II[BI)V", (void *) android_glGetTransformFeedbackVarying__III_3II_3II_3II_3BI }, +{"glGetTransformFeedbackVarying", "(IIILjava/nio/IntBuffer;Ljava/nio/IntBuffer;Ljava/nio/IntBuffer;B)V", (void *) android_glGetTransformFeedbackVarying__IIILjava_nio_IntBuffer_2Ljava_nio_IntBuffer_2Ljava_nio_IntBuffer_2B }, +{"glGetTransformFeedbackVarying", "(II[II[II)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying1 }, +{"glGetTransformFeedbackVarying", "(IILjava/nio/IntBuffer;Ljava/nio/IntBuffer;)Ljava/lang/String;", (void *) android_glGetTransformFeedbackVarying2 }, From 27c86b962373f40a01f094689d623d51c51d4f83 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 09:26:48 -0700 Subject: [PATCH 09/14] Special-case glGetUniformIndices Bug: 8566953 Change-Id: Ic8bcd03e8d41a81f48d603f67ce2046a4afa1561 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../stubs/gles11/glGetUniformIndices.cpp | 154 ++++++++++++++++++ .../stubs/gles11/glGetUniformIndices.java | 17 ++ .../gles11/glGetUniformIndices.nativeReg | 2 + 4 files changed, 174 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glGetUniformIndices.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glGetUniformIndices.java create mode 100644 opengl/tools/glgen/stubs/gles11/glGetUniformIndices.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index 1e2acf9e0..4fc541bb5 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -221,7 +221,7 @@ void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) // const GLubyte * glGetStringi ( GLenum name, GLuint index ) void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) -// void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) +void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) diff --git a/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.cpp b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.cpp new file mode 100644 index 000000000..fb137ab4f --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.cpp @@ -0,0 +1,154 @@ +/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */ +static +void +android_glGetUniformIndices_array + (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jintArray uniformIndices_ref, jint uniformIndicesOffset) { + jint _exception = 0; + const char* _exceptionType = NULL; + const char* _exceptionMessage = NULL; + jint _count = 0; + jint _i; + const char** _names = NULL; + GLuint* _indices_base = NULL; + GLuint* _indices = NULL; + + if (!uniformNames_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformNames == null"; + goto exit; + } + _count = _env->GetArrayLength(uniformNames_ref); + _names = (const char**)calloc(_count, sizeof(const char*)); + for (_i = 0; _i < _count; _i++) { + jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); + if (!_name) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "null uniformNames element"; + goto exit; + } + _names[_i] = _env->GetStringUTFChars(_name, 0); + } + + if (!uniformIndices_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformIndices == null"; + goto exit; + } + if (uniformIndicesOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformIndicesOffset < 0"; + goto exit; + } + if (_env->GetArrayLength(uniformIndices_ref) - uniformIndicesOffset < _count) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "not enough space in uniformIndices"; + goto exit; + } + _indices_base = (GLuint*)_env->GetPrimitiveArrayCritical( + uniformIndices_ref, 0); + _indices = _indices_base + uniformIndicesOffset; + + glGetUniformIndices(program, _count, _names, _indices); + +exit: + if (_indices_base) { + _env->ReleasePrimitiveArrayCritical(uniformIndices_ref, _indices_base, + _exception ? JNI_ABORT : 0); + } + for (_i = _count - 1; _i >= 0; _i--) { + if (_names[_i]) { + jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); + if (_name) { + _env->ReleaseStringUTFChars(_name, _names[_i]); + } + } + } + free(_names); + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } +} + +/* void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) */ +static +void +android_glGetUniformIndices_buffer + (JNIEnv *_env, jobject _this, jint program, jobjectArray uniformNames_ref, jobject uniformIndices_buf) { + jint _exception = 0; + const char* _exceptionType = NULL; + const char* _exceptionMessage = NULL; + jint _count = 0; + jint _i; + const char** _names = NULL; + jarray _uniformIndicesArray = (jarray)0; + jint _uniformIndicesRemaining; + jint _uniformIndicesOffset = 0; + GLuint* _indices = NULL; + char* _indicesBase = NULL; + + if (!uniformNames_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformNames == null"; + goto exit; + } + if (!uniformIndices_buf) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformIndices == null"; + goto exit; + } + + _count = _env->GetArrayLength(uniformNames_ref); + _names = (const char**)calloc(_count, sizeof(const char*)); + for (_i = 0; _i < _count; _i++) { + jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); + if (!_name) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "null uniformNames element"; + goto exit; + } + _names[_i] = _env->GetStringUTFChars(_name, 0); + } + + _indices = (GLuint*)getPointer(_env, uniformIndices_buf, + &_uniformIndicesArray, &_uniformIndicesRemaining, + &_uniformIndicesOffset); + if (!_indices) { + _indicesBase = (char*)_env->GetPrimitiveArrayCritical( + _uniformIndicesArray, 0); + _indices = (GLuint*)(_indicesBase + _uniformIndicesOffset); + } + if (_uniformIndicesRemaining < _count) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "not enough space in uniformIndices"; + goto exit; + } + + glGetUniformIndices(program, _count, _names, _indices); + +exit: + if (_uniformIndicesArray) { + releasePointer(_env, _uniformIndicesArray, _indicesBase, JNI_TRUE); + } + for (_i = _count - 1; _i >= 0; _i--) { + if (_names[_i]) { + jstring _name = (jstring)_env->GetObjectArrayElement(uniformNames_ref, _i); + if (_name) { + _env->ReleaseStringUTFChars(_name, _names[_i]); + } + } + } + free(_names); + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } +} + diff --git a/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.java b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.java new file mode 100644 index 000000000..719429b94 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.java @@ -0,0 +1,17 @@ + // C function void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) + + public static native void glGetUniformIndices( + int program, + String[] uniformNames, + int[] uniformIndices, + int uniformIndicesOffset + ); + + // C function void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) + + public static native void glGetUniformIndices( + int program, + String[] uniformNames, + java.nio.IntBuffer uniformIndices + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.nativeReg new file mode 100644 index 000000000..c71130790 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetUniformIndices.nativeReg @@ -0,0 +1,2 @@ +{"glGetUniformIndices", "(I[Ljava/lang/String;[II)V", (void *) android_glGetUniformIndices_array }, +{"glGetUniformIndices", "(I[Ljava/lang/String;[Ljava/nio/IntBuffer)V", (void *) android_glGetUniformIndices_buffer }, From 610bbf2b6fd80af98849d7e23526c6ce8a4112da Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 15:48:58 -0700 Subject: [PATCH 10/14] Special-case glGetBufferPointerv Bug: 8566953 Change-Id: I11a7394eb46f229fd3ae716e77487a45bac6ed53 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../tools/glgen/stubs/gles11/glGetBufferPointerv.cpp | 11 +++++++++++ .../tools/glgen/stubs/gles11/glGetBufferPointerv.java | 7 +++++++ .../glgen/stubs/gles11/glGetBufferPointerv.nativeReg | 1 + 4 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.java create mode 100644 opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index 4fc541bb5..d95937d87 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -173,7 +173,7 @@ void glEndQuery ( GLenum target ) void glGetQueryiv ( GLenum target, GLenum pname, GLint *params ) void glGetQueryObjectuiv ( GLuint id, GLenum pname, GLuint *params ) GLboolean glUnmapBuffer ( GLenum target ) -// void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid **params ) +void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid **params ) void glDrawBuffers ( GLsizei n, const GLenum *bufs ) void glUniformMatrix2x3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) void glUniformMatrix3x2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) diff --git a/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.cpp b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.cpp new file mode 100644 index 000000000..7016c4b16 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.cpp @@ -0,0 +1,11 @@ +/* void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) */ +static jobject +android_glGetBufferPointerv__II + (JNIEnv *_env, jobject _this, jint target, jint pname) { + GLint64 _mapLength; + GLvoid* _p; + glGetBufferParameteri64v((GLenum)target, GL_BUFFER_MAP_LENGTH, &_mapLength); + glGetBufferPointerv((GLenum)target, (GLenum)pname, &_p); + return _env->NewDirectByteBuffer(_p, _mapLength); +} + diff --git a/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.java b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.java new file mode 100644 index 000000000..c966e11fa --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.java @@ -0,0 +1,7 @@ + // C function void glGetBufferPointerv ( GLenum target, GLenum pname, GLvoid** params ) + + public static native java.nio.Buffer glGetBufferPointerv( + int target, + int pname + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.nativeReg new file mode 100644 index 000000000..7886451c9 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetBufferPointerv.nativeReg @@ -0,0 +1 @@ +{"glGetBufferPointerv", "(II)Ljava/nio/Buffer;", (void *) android_glGetBufferPointerv__II }, \ No newline at end of file From 1c8b8e8b8ee6290875fe59288ffa7ccaf4d86247 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 16:13:35 -0700 Subject: [PATCH 11/14] Special-case glMapBufferRange Updating the generator to handle GLvoid*/java.nio.Buffer return values probably wouldn't be too hard, but this is the only function that needs it currently. Bug: 8566953 Change-Id: I359a951136ab479ab576ce2e5a2881b937b7e8c9 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../tools/glgen/stubs/gles11/glMapBufferRange.cpp | 13 +++++++++++++ .../tools/glgen/stubs/gles11/glMapBufferRange.java | 9 +++++++++ .../glgen/stubs/gles11/glMapBufferRange.nativeReg | 1 + 4 files changed, 24 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glMapBufferRange.java create mode 100644 opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index d95937d87..b7fe460e7 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -184,7 +184,7 @@ void glUniformMatrix4x3fv ( GLint location, GLsizei count, GLboolean transpose, void glBlitFramebuffer ( GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter ) void glRenderbufferStorageMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height ) void glFramebufferTextureLayer ( GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer ) -// GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) +GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) void glFlushMappedBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length ) void glBindVertexArray ( GLuint array ) void glDeleteVertexArrays ( GLsizei n, const GLuint *arrays ) diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp new file mode 100644 index 000000000..248564232 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.cpp @@ -0,0 +1,13 @@ +/* GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) */ +static jobject +android_glMapBufferRange__IIII + (JNIEnv *_env, jobject _this, jint target, jint offset, jint length, jint access) { + GLvoid* _p = glMapBufferRange((GLenum)target, + (GLintptr)offset, (GLsizeiptr)length, (GLbitfield)access); + jobject _buf = (jobject)0; + if (_p) { + _buf = _env->NewDirectByteBuffer(_p, length); + } + return _buf; +} + diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java new file mode 100644 index 000000000..482ea9981 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.java @@ -0,0 +1,9 @@ + // C function GLvoid * glMapBufferRange ( GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access ) + + public static native java.nio.Buffer glMapBufferRange( + int target, + int offset, + int length, + int access + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg new file mode 100644 index 000000000..ad5c07776 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glMapBufferRange.nativeReg @@ -0,0 +1 @@ +{"glMapBufferRange", "(IIII)Ljava/nio/Buffer;", (void *) android_glMapBufferRange__IIII }, \ No newline at end of file From fa4c1170ac1c18fb919efcc965f55a045a42c06e Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 16:27:00 -0700 Subject: [PATCH 12/14] Special-case glGetStringi Modeled on the existing glGetString special-case. Bug: 8566953 Change-Id: Icc6b23ab53b00510368900ad99c92028253dc797 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- opengl/tools/glgen/stubs/gles11/glGetStringi.cpp | 8 ++++++++ opengl/tools/glgen/stubs/gles11/glGetStringi.java | 7 +++++++ opengl/tools/glgen/stubs/gles11/glGetStringi.nativeReg | 1 + 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glGetStringi.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glGetStringi.java create mode 100644 opengl/tools/glgen/stubs/gles11/glGetStringi.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index b7fe460e7..d09885c1c 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -219,7 +219,7 @@ void glClearBufferiv ( GLenum buffer, GLint drawbuffer, const GLint *value ) void glClearBufferuiv ( GLenum buffer, GLint drawbuffer, const GLuint *value ) void glClearBufferfv ( GLenum buffer, GLint drawbuffer, const GLfloat *value ) void glClearBufferfi ( GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil ) -// const GLubyte * glGetStringi ( GLenum name, GLuint index ) +const GLubyte * glGetStringi ( GLenum name, GLuint index ) void glCopyBufferSubData ( GLenum readTarget, GLenum writeTarget, GLintptr readOffset, GLintptr writeOffset, GLsizeiptr size ) void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *const *uniformNames, GLuint *uniformIndices ) void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) diff --git a/opengl/tools/glgen/stubs/gles11/glGetStringi.cpp b/opengl/tools/glgen/stubs/gles11/glGetStringi.cpp new file mode 100644 index 000000000..1611539fe --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetStringi.cpp @@ -0,0 +1,8 @@ +/* const GLubyte * glGetStringi ( GLenum name, GLuint index ) */ +static jstring +android_glGetStringi__II + (JNIEnv *_env, jobject _this, jint name, jint index) { + const GLubyte* _chars = glGetStringi((GLenum)name, (GLuint)index); + return _env->NewStringUTF((const char*)_chars); +} + diff --git a/opengl/tools/glgen/stubs/gles11/glGetStringi.java b/opengl/tools/glgen/stubs/gles11/glGetStringi.java new file mode 100644 index 000000000..523d4c735 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetStringi.java @@ -0,0 +1,7 @@ + // C function const GLubyte * glGetStringi ( GLenum name, GLuint index ) + + public static native String glGetStringi( + int name, + int index + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glGetStringi.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetStringi.nativeReg new file mode 100644 index 000000000..e7ee353ab --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetStringi.nativeReg @@ -0,0 +1 @@ +{"glGetStringi", "(II)Ljava/lang/String;", (void *) android_glGetStringi__II }, \ No newline at end of file From 4f6693080c9a186f3fe37abe445abdb39662ae22 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Wed, 10 Apr 2013 21:49:55 -0700 Subject: [PATCH 13/14] Special-case glGetActiveUniformBlockName Bug: 8566953 Change-Id: Ic9b3be9fa0136495633ee3b1c38583cfa315942a --- opengl/tools/glgen/specs/gles11/GLES30.spec | 2 +- .../gles11/glGetActiveUniformBlockName.cpp | 127 ++++++++++++++++++ .../gles11/glGetActiveUniformBlockName.java | 28 ++++ .../glGetActiveUniformBlockName.nativeReg | 3 + 4 files changed, 159 insertions(+), 1 deletion(-) create mode 100644 opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.cpp create mode 100644 opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.java create mode 100644 opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.nativeReg diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index d09885c1c..cc4f7b1c0 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -225,7 +225,7 @@ void glGetUniformIndices ( GLuint program, GLsizei uniformCount, const GLchar *c void glGetActiveUniformsiv ( GLuint program, GLsizei uniformCount, const GLuint *uniformIndices, GLenum pname, GLint *params ) GLuint glGetUniformBlockIndex ( GLuint program, const GLchar *uniformBlockName ) void glGetActiveUniformBlockiv ( GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint *params ) -// void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) +void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) void glUniformBlockBinding ( GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding ) void glDrawArraysInstanced ( GLenum mode, GLint first, GLsizei count, GLsizei instanceCount ) void glDrawElementsInstanced ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices, GLsizei instanceCount ) diff --git a/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.cpp b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.cpp new file mode 100644 index 000000000..bb6ae7cea --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.cpp @@ -0,0 +1,127 @@ +/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ +static void +android_glGetActiveUniformBlockName_III_3II_3BI + (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, int bufSize, jintArray length_ref, jint lengthOffset, jbyteArray name_ref, jint nameOffset) { + jint _exception = 0; + const char* _exceptionType; + const char* _exceptionMessage; + GLsizei* _length_base = (GLsizei*)0; + jint _lengthRemaining; + GLsizei* _length = (GLsizei*)0; + GLchar* _name_base = (GLchar*)0; + jint _nameRemaining; + GLchar* _name = (GLchar*)0; + + if (!length_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "length == null"; + goto exit; + } + if (lengthOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "lengthOffset < 0"; + goto exit; + } + _lengthRemaining = _env->GetArrayLength(length_ref) - lengthOffset; + _length_base = (GLsizei*)_env->GetPrimitiveArrayCritical( + length_ref, (jboolean*)0); + _length = _length_base + lengthOffset; + + if (!name_ref) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformBlockName == null"; + goto exit; + } + if (nameOffset < 0) { + _exception = 1; + _exceptionType = "java/lang/IllegalArgumentException"; + _exceptionMessage = "uniformBlockNameOffset < 0"; + goto exit; + } + _nameRemaining = _env->GetArrayLength(name_ref) - nameOffset; + _name_base = (GLchar*)_env->GetPrimitiveArrayCritical( + name_ref, (jboolean*)0); + _name = _name_base + nameOffset; + + glGetActiveUniformBlockName( + (GLuint)program, + (GLuint)uniformBlockIndex, + (GLsizei)bufSize, + (GLsizei*)_length, + (GLchar*)_name + ); + +exit: + if (_name_base) { + _env->ReleasePrimitiveArrayCritical(name_ref, _name_base, + _exception ? JNI_ABORT: 0); + } + if (_length_base) { + _env->ReleasePrimitiveArrayCritical(length_ref, _length_base, + _exception ? JNI_ABORT: 0); + } + if (_exception) { + jniThrowException(_env, _exceptionType, _exceptionMessage); + } +} + +/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ +static void +android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 + (JNIEnv* _env, jobject _this, jint program, jint uniformBlockIndex, jobject length_buf, jobject uniformBlockName_buf) { + jint _exception = 0; + const char* _exceptionType; + const char* _exceptionMessage; + jarray _lengthArray = (jarray)0; + jint _lengthBufferOffset = (jint)0; + GLsizei* _length = (GLsizei*)0; + jint _lengthRemaining; + jarray _nameArray = (jarray)0; + jint _nameBufferOffset = (jint)0; + GLchar* _name = (GLchar*)0; + jint _nameRemaining; + + _length = (GLsizei*)getPointer(_env, length_buf, &_lengthArray, &_lengthRemaining, &_lengthBufferOffset); + if (_length == NULL) { + GLsizei* _lengthBase = (GLsizei*)_env->GetPrimitiveArrayCritical(_lengthArray, (jboolean*)0); + _length = (GLsizei*)(_lengthBase + _lengthBufferOffset); + } + + _name = (GLchar*)getPointer(_env, uniformBlockName_buf, &_nameArray, &_nameRemaining, &_nameBufferOffset); + if (_name == NULL) { + GLchar* _nameBase = (GLchar*)_env->GetPrimitiveArrayCritical(_nameArray, (jboolean*)0); + _name = (GLchar*)(_nameBase + _nameBufferOffset); + } + + glGetActiveUniformBlockName( + (GLuint)program, + (GLuint)uniformBlockIndex, + (GLsizei)_nameRemaining, + _length, _name + ); + if (_nameArray) { + releasePointer(_env, _nameArray, _name, JNI_TRUE); + } + if (_lengthArray) { + releasePointer(_env, _lengthArray, _length, JNI_TRUE); + } +} + +/* void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) */ +static jstring +android_glGetActiveUniformBlockName_II + (JNIEnv *_env, jobject _this, jint program, jint uniformBlockIndex) { + GLint len = 0; + glGetActiveUniformBlockiv((GLuint)program, (GLuint)uniformBlockIndex, + GL_UNIFORM_BLOCK_NAME_LENGTH, &len); + GLchar* name = (GLchar*)malloc(len); + glGetActiveUniformBlockName((GLuint)program, (GLuint)uniformBlockIndex, + len, NULL, name); + jstring result = _env->NewStringUTF(name); + free(name); + return result; +} + diff --git a/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.java b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.java new file mode 100644 index 000000000..3d9ed0fd3 --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.java @@ -0,0 +1,28 @@ + // C function void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) + + public static native void glGetActiveUniformBlockName( + int program, + int uniformBlockIndex, + int bufSize, + int[] length, + int lengthOffset, + byte[] uniformBlockName, + int uniformBlockNameOffset + ); + + // C function void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) + + public static native void glGetActiveUniformBlockName( + int program, + int uniformBlockIndex, + java.nio.Buffer length, + java.nio.Buffer uniformBlockName + ); + + // C function void glGetActiveUniformBlockName ( GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei *length, GLchar *uniformBlockName ) + + public static native String glGetActiveUniformBlockName( + int program, + int uniformBlockIndex + ); + diff --git a/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.nativeReg b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.nativeReg new file mode 100644 index 000000000..fb37689ae --- /dev/null +++ b/opengl/tools/glgen/stubs/gles11/glGetActiveUniformBlockName.nativeReg @@ -0,0 +1,3 @@ +{"glGetActiveUniformBlockName", "(III[II[BI)V", (void *) android_glGetActiveUniformBlockName_III_3II_3BI }, +{"glGetActiveUniformBlockName", "(IILjava/nio/Buffer;Ljava/nio/Buffer;)V", (void *) android_glGetActiveUniformBlockName_IILjava_nio_Buffer_2Ljava_nio_Buffer_2 }, +{"glGetActiveUniformBlockName", "(II)Ljava/lang/String;", (void *) android_glGetActiveUniformBlockName_II }, \ No newline at end of file From c0d184b8c1002098138f65e5cd2d9b1fb3da8bb1 Mon Sep 17 00:00:00 2001 From: Jesse Hall Date: Mon, 15 Apr 2013 16:35:08 -0700 Subject: [PATCH 14/14] Subclass GLES30 from GLES20, @Deprecate GL_STENCIL_INDEX Bug: 8566953 Change-Id: I66085c300a8658a4018796645257edb73be94719 --- opengl/tools/glgen/specs/gles11/GLES30.spec | 155 --------- .../glgen/stubs/gles11/GLES20Header.java-if | 7 +- .../glgen/stubs/gles11/GLES30Header.java-if | 309 +----------------- .../stubs/gles11/glGetProgramInfoLog.java | 2 +- .../stubs/gles11/glGetShaderInfoLog.java | 2 +- 5 files changed, 9 insertions(+), 466 deletions(-) diff --git a/opengl/tools/glgen/specs/gles11/GLES30.spec b/opengl/tools/glgen/specs/gles11/GLES30.spec index cc4f7b1c0..a426eb012 100644 --- a/opengl/tools/glgen/specs/gles11/GLES30.spec +++ b/opengl/tools/glgen/specs/gles11/GLES30.spec @@ -1,158 +1,3 @@ -// -// Inherited OpenGL ES 2.0 functions -// -void glActiveTexture ( GLenum texture ) -void glAttachShader ( GLuint program, GLuint shader ) -void glBindAttribLocation ( GLuint program, GLuint index, const char *name ) -void glBindBuffer ( GLenum target, GLuint buffer ) -void glBindFramebuffer ( GLenum target, GLuint framebuffer ) -void glBindRenderbuffer ( GLenum target, GLuint renderbuffer ) -void glBindTexture ( GLenum target, GLuint texture ) -void glBlendColor ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) -void glBlendEquation ( GLenum mode ) -void glBlendEquationSeparate ( GLenum modeRGB, GLenum modeAlpha ) -void glBlendFunc ( GLenum sfactor, GLenum dfactor ) -void glBlendFuncSeparate ( GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha ) -void glBufferData ( GLenum target, GLsizeiptr size, const GLvoid *data, GLenum usage ) -void glBufferSubData ( GLenum target, GLintptr offset, GLsizeiptr size, const GLvoid *data ) -GLenum glCheckFramebufferStatus ( GLenum target ) -void glClear ( GLbitfield mask ) -void glClearColor ( GLfloat red, GLfloat green, GLfloat blue, GLfloat alpha ) -void glClearDepthf ( GLfloat depth ) -void glClearStencil ( GLint s ) -void glColorMask ( GLboolean red, GLboolean green, GLboolean blue, GLboolean alpha ) -void glCompileShader ( GLuint shader ) -void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid *data ) -void glCompressedTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLsizei offset ) -void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid *data ) -void glCompressedTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLsizei offset ) -void glCopyTexImage2D ( GLenum target, GLint level, GLenum internalformat, GLint x, GLint y, GLsizei width, GLsizei height, GLint border ) -void glCopyTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint x, GLint y, GLsizei width, GLsizei height ) -GLuint glCreateProgram ( void ) -GLuint glCreateShader ( GLenum type ) -void glCullFace ( GLenum mode ) -void glDeleteBuffers ( GLsizei n, const GLuint *buffers ) -void glDeleteFramebuffers ( GLsizei n, const GLuint *framebuffers ) -void glDeleteProgram ( GLuint program ) -void glDeleteRenderbuffers ( GLsizei n, const GLuint *renderbuffers ) -void glDeleteShader ( GLuint shader ) -void glDeleteTextures ( GLsizei n, const GLuint *textures ) -void glDepthFunc ( GLenum func ) -void glDepthMask ( GLboolean flag ) -void glDepthRangef ( GLfloat n, GLfloat f ) -void glDetachShader ( GLuint program, GLuint shader ) -void glDisable ( GLenum cap ) -void glDisableVertexAttribArray ( GLuint index ) -void glDrawArrays ( GLenum mode, GLint first, GLsizei count ) -void glDrawElements ( GLenum mode, GLsizei count, GLenum type, GLint offset ) -void glDrawElements ( GLenum mode, GLsizei count, GLenum type, const GLvoid *indices ) -void glEnable ( GLenum cap ) -void glEnableVertexAttribArray ( GLuint index ) -void glFinish ( void ) -void glFlush ( void ) -void glFramebufferRenderbuffer ( GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer ) -void glFramebufferTexture2D ( GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level ) -void glFrontFace ( GLenum mode ) -void glGenBuffers ( GLsizei n, GLuint *buffers ) -void glGenerateMipmap ( GLenum target ) -void glGenFramebuffers ( GLsizei n, GLuint *framebuffers ) -void glGenRenderbuffers ( GLsizei n, GLuint *renderbuffers ) -void glGenTextures ( GLsizei n, GLuint *textures ) -void glGetActiveAttrib ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) -void glGetActiveUniform ( GLuint program, GLuint index, GLsizei bufsize, GLsizei *length, GLint *size, GLenum *type, char *name ) -void glGetAttachedShaders ( GLuint program, GLsizei maxcount, GLsizei *count, GLuint *shaders ) -GLint glGetAttribLocation ( GLuint program, const char *name ) -void glGetBooleanv ( GLenum pname, GLboolean *params ) -void glGetBufferParameteriv ( GLenum target, GLenum pname, GLint *params ) -GLenum glGetError ( void ) -void glGetFloatv ( GLenum pname, GLfloat *params ) -void glGetFramebufferAttachmentParameteriv ( GLenum target, GLenum attachment, GLenum pname, GLint *params ) -void glGetIntegerv ( GLenum pname, GLint *params ) -void glGetProgramiv ( GLuint program, GLenum pname, GLint *params ) -void glGetProgramInfoLog ( GLuint program, GLsizei bufsize, GLsizei *length, char *infolog ) -void glGetRenderbufferParameteriv ( GLenum target, GLenum pname, GLint *params ) -void glGetShaderiv ( GLuint shader, GLenum pname, GLint *params ) -void glGetShaderInfoLog ( GLuint shader, GLsizei bufsize, GLsizei *length, char *infolog ) -void glGetShaderPrecisionFormat ( GLenum shadertype, GLenum precisiontype, GLint *range, GLint *precision ) -void glGetShaderSource ( GLuint shader, GLsizei bufsize, GLsizei *length, char *source ) -const GLubyte * glGetString ( GLenum name ) -void glGetTexParameterfv ( GLenum target, GLenum pname, GLfloat *params ) -void glGetTexParameteriv ( GLenum target, GLenum pname, GLint *params ) -void glGetUniformfv ( GLuint program, GLint location, GLfloat *params ) -void glGetUniformiv ( GLuint program, GLint location, GLint *params ) -GLint glGetUniformLocation ( GLuint program, const char *name ) -void glGetVertexAttribfv ( GLuint index, GLenum pname, GLfloat *params ) -void glGetVertexAttribiv ( GLuint index, GLenum pname, GLint *params ) -// void glGetVertexAttribPointerv ( GLuint index, GLenum pname, void **pointer ) -void glHint ( GLenum target, GLenum mode ) -GLboolean glIsBuffer ( GLuint buffer ) -GLboolean glIsEnabled ( GLenum cap ) -GLboolean glIsFramebuffer ( GLuint framebuffer ) -GLboolean glIsProgram ( GLuint program ) -GLboolean glIsRenderbuffer ( GLuint renderbuffer ) -GLboolean glIsShader ( GLuint shader ) -GLboolean glIsTexture ( GLuint texture ) -void glLineWidth ( GLfloat width ) -void glLinkProgram ( GLuint program ) -void glPixelStorei ( GLenum pname, GLint param ) -void glPolygonOffset ( GLfloat factor, GLfloat units ) -void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLvoid *pixels ) -void glReadPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei offset ) -void glReleaseShaderCompiler ( void ) -void glRenderbufferStorage ( GLenum target, GLenum internalformat, GLsizei width, GLsizei height ) -void glSampleCoverage ( GLfloat value, GLboolean invert ) -void glScissor ( GLint x, GLint y, GLsizei width, GLsizei height ) -void glShaderBinary ( GLsizei n, const GLuint *shaders, GLenum binaryformat, const GLvoid *binary, GLsizei length ) -void glShaderSource ( GLuint shader ) -void glStencilFunc ( GLenum func, GLint ref, GLuint mask ) -void glStencilFuncSeparate ( GLenum face, GLenum func, GLint ref, GLuint mask ) -void glStencilMask ( GLuint mask ) -void glStencilMaskSeparate ( GLenum face, GLuint mask ) -void glStencilOp ( GLenum fail, GLenum zfail, GLenum zpass ) -void glStencilOpSeparate ( GLenum face, GLenum fail, GLenum zfail, GLenum zpass ) -void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels ) -void glTexImage2D ( GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLsizei offset ) -void glTexParameterf ( GLenum target, GLenum pname, GLfloat param ) -void glTexParameterfv ( GLenum target, GLenum pname, const GLfloat *params ) -void glTexParameteri ( GLenum target, GLenum pname, GLint param ) -void glTexParameteriv ( GLenum target, GLenum pname, const GLint *params ) -void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels ) -void glTexSubImage2D ( GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei offset ) -void glUniform1f ( GLint location, GLfloat x ) -void glUniform1fv ( GLint location, GLsizei count, const GLfloat *v ) -void glUniform1i ( GLint location, GLint x ) -void glUniform1iv ( GLint location, GLsizei count, const GLint *v ) -void glUniform2f ( GLint location, GLfloat x, GLfloat y ) -void glUniform2fv ( GLint location, GLsizei count, const GLfloat *v ) -void glUniform2i ( GLint location, GLint x, GLint y ) -void glUniform2iv ( GLint location, GLsizei count, const GLint *v ) -void glUniform3f ( GLint location, GLfloat x, GLfloat y, GLfloat z ) -void glUniform3fv ( GLint location, GLsizei count, const GLfloat *v ) -void glUniform3i ( GLint location, GLint x, GLint y, GLint z ) -void glUniform3iv ( GLint location, GLsizei count, const GLint *v ) -void glUniform4f ( GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -void glUniform4fv ( GLint location, GLsizei count, const GLfloat *v ) -void glUniform4i ( GLint location, GLint x, GLint y, GLint z, GLint w ) -void glUniform4iv ( GLint location, GLsizei count, const GLint *v ) -void glUniformMatrix2fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) -void glUniformMatrix3fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) -void glUniformMatrix4fv ( GLint location, GLsizei count, GLboolean transpose, const GLfloat *value ) -void glUseProgram ( GLuint program ) -void glValidateProgram ( GLuint program ) -void glVertexAttrib1f ( GLuint indx, GLfloat x ) -void glVertexAttrib1fv ( GLuint indx, const GLfloat *values ) -void glVertexAttrib2f ( GLuint indx, GLfloat x, GLfloat y ) -void glVertexAttrib2fv ( GLuint indx, const GLfloat *values ) -void glVertexAttrib3f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z ) -void glVertexAttrib3fv ( GLuint indx, const GLfloat *values ) -void glVertexAttrib4f ( GLuint indx, GLfloat x, GLfloat y, GLfloat z, GLfloat w ) -void glVertexAttrib4fv ( GLuint indx, const GLfloat *values ) -void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, GLint offset ) -void glVertexAttribPointer ( GLuint indx, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const GLvoid *ptr ) -void glViewport ( GLint x, GLint y, GLsizei width, GLsizei height ) -// -// New OpenGL ES 3.0 functions -// void glReadBuffer ( GLenum mode ) void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid *indices ) void glDrawRangeElements ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLsizei offset ) diff --git a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if index 6ec126f04..9ce6728e0 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if +++ b/opengl/tools/glgen/stubs/gles11/GLES20Header.java-if @@ -297,8 +297,9 @@ public class GLES20 { public static final int GL_RGB565 = 0x8D62; public static final int GL_DEPTH_COMPONENT16 = 0x81A5; // GL_STENCIL_INDEX does not appear in gl2.h or gl2ext.h, and there is no - // token with value 0x1901. It shouldn't be here, but we can't remove it - // now in case someone is using it. + // token with value 0x1901. + // + @Deprecated public static final int GL_STENCIL_INDEX = 0x1901; public static final int GL_STENCIL_INDEX8 = 0x8D48; public static final int GL_RENDERBUFFER_WIDTH = 0x8D42; @@ -330,5 +331,5 @@ public class GLES20 { native private static void _nativeClassInit(); static { - _nativeClassInit(); + _nativeClassInit(); } diff --git a/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if index efe3c5fe6..747dbd328 100644 --- a/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if +++ b/opengl/tools/glgen/stubs/gles11/GLES30Header.java-if @@ -21,311 +21,7 @@ package android.opengl; /** OpenGL ES 3.0 */ -public class GLES30 { - /* Inherited from OpenGL ES 2.0 */ - public static final int GL_ACTIVE_TEXTURE = 0x84E0; - public static final int GL_DEPTH_BUFFER_BIT = 0x00000100; - public static final int GL_STENCIL_BUFFER_BIT = 0x00000400; - public static final int GL_COLOR_BUFFER_BIT = 0x00004000; - public static final int GL_FALSE = 0; - public static final int GL_TRUE = 1; - public static final int GL_POINTS = 0x0000; - public static final int GL_LINES = 0x0001; - public static final int GL_LINE_LOOP = 0x0002; - public static final int GL_LINE_STRIP = 0x0003; - public static final int GL_TRIANGLES = 0x0004; - public static final int GL_TRIANGLE_STRIP = 0x0005; - public static final int GL_TRIANGLE_FAN = 0x0006; - public static final int GL_ZERO = 0; - public static final int GL_ONE = 1; - public static final int GL_SRC_COLOR = 0x0300; - public static final int GL_ONE_MINUS_SRC_COLOR = 0x0301; - public static final int GL_SRC_ALPHA = 0x0302; - public static final int GL_ONE_MINUS_SRC_ALPHA = 0x0303; - public static final int GL_DST_ALPHA = 0x0304; - public static final int GL_ONE_MINUS_DST_ALPHA = 0x0305; - public static final int GL_DST_COLOR = 0x0306; - public static final int GL_ONE_MINUS_DST_COLOR = 0x0307; - public static final int GL_SRC_ALPHA_SATURATE = 0x0308; - public static final int GL_FUNC_ADD = 0x8006; - public static final int GL_BLEND_EQUATION = 0x8009; - public static final int GL_BLEND_EQUATION_RGB = 0x8009; /* same as BLEND_EQUATION */ - public static final int GL_BLEND_EQUATION_ALPHA = 0x883D; - public static final int GL_FUNC_SUBTRACT = 0x800A; - public static final int GL_FUNC_REVERSE_SUBTRACT = 0x800B; - public static final int GL_BLEND_DST_RGB = 0x80C8; - public static final int GL_BLEND_SRC_RGB = 0x80C9; - public static final int GL_BLEND_DST_ALPHA = 0x80CA; - public static final int GL_BLEND_SRC_ALPHA = 0x80CB; - public static final int GL_CONSTANT_COLOR = 0x8001; - public static final int GL_ONE_MINUS_CONSTANT_COLOR = 0x8002; - public static final int GL_CONSTANT_ALPHA = 0x8003; - public static final int GL_ONE_MINUS_CONSTANT_ALPHA = 0x8004; - public static final int GL_BLEND_COLOR = 0x8005; - public static final int GL_ARRAY_BUFFER = 0x8892; - public static final int GL_ELEMENT_ARRAY_BUFFER = 0x8893; - public static final int GL_ARRAY_BUFFER_BINDING = 0x8894; - public static final int GL_ELEMENT_ARRAY_BUFFER_BINDING = 0x8895; - public static final int GL_STREAM_DRAW = 0x88E0; - public static final int GL_STATIC_DRAW = 0x88E4; - public static final int GL_DYNAMIC_DRAW = 0x88E8; - public static final int GL_BUFFER_SIZE = 0x8764; - public static final int GL_BUFFER_USAGE = 0x8765; - public static final int GL_CURRENT_VERTEX_ATTRIB = 0x8626; - public static final int GL_FRONT = 0x0404; - public static final int GL_BACK = 0x0405; - public static final int GL_FRONT_AND_BACK = 0x0408; - public static final int GL_TEXTURE_2D = 0x0DE1; - public static final int GL_CULL_FACE = 0x0B44; - public static final int GL_BLEND = 0x0BE2; - public static final int GL_DITHER = 0x0BD0; - public static final int GL_STENCIL_TEST = 0x0B90; - public static final int GL_DEPTH_TEST = 0x0B71; - public static final int GL_SCISSOR_TEST = 0x0C11; - public static final int GL_POLYGON_OFFSET_FILL = 0x8037; - public static final int GL_SAMPLE_ALPHA_TO_COVERAGE = 0x809E; - public static final int GL_SAMPLE_COVERAGE = 0x80A0; - public static final int GL_NO_ERROR = 0; - public static final int GL_INVALID_ENUM = 0x0500; - public static final int GL_INVALID_VALUE = 0x0501; - public static final int GL_INVALID_OPERATION = 0x0502; - public static final int GL_OUT_OF_MEMORY = 0x0505; - public static final int GL_CW = 0x0900; - public static final int GL_CCW = 0x0901; - public static final int GL_LINE_WIDTH = 0x0B21; - public static final int GL_ALIASED_POINT_SIZE_RANGE = 0x846D; - public static final int GL_ALIASED_LINE_WIDTH_RANGE = 0x846E; - public static final int GL_CULL_FACE_MODE = 0x0B45; - public static final int GL_FRONT_FACE = 0x0B46; - public static final int GL_DEPTH_RANGE = 0x0B70; - public static final int GL_DEPTH_WRITEMASK = 0x0B72; - public static final int GL_DEPTH_CLEAR_VALUE = 0x0B73; - public static final int GL_DEPTH_FUNC = 0x0B74; - public static final int GL_STENCIL_CLEAR_VALUE = 0x0B91; - public static final int GL_STENCIL_FUNC = 0x0B92; - public static final int GL_STENCIL_FAIL = 0x0B94; - public static final int GL_STENCIL_PASS_DEPTH_FAIL = 0x0B95; - public static final int GL_STENCIL_PASS_DEPTH_PASS = 0x0B96; - public static final int GL_STENCIL_REF = 0x0B97; - public static final int GL_STENCIL_VALUE_MASK = 0x0B93; - public static final int GL_STENCIL_WRITEMASK = 0x0B98; - public static final int GL_STENCIL_BACK_FUNC = 0x8800; - public static final int GL_STENCIL_BACK_FAIL = 0x8801; - public static final int GL_STENCIL_BACK_PASS_DEPTH_FAIL = 0x8802; - public static final int GL_STENCIL_BACK_PASS_DEPTH_PASS = 0x8803; - public static final int GL_STENCIL_BACK_REF = 0x8CA3; - public static final int GL_STENCIL_BACK_VALUE_MASK = 0x8CA4; - public static final int GL_STENCIL_BACK_WRITEMASK = 0x8CA5; - public static final int GL_VIEWPORT = 0x0BA2; - public static final int GL_SCISSOR_BOX = 0x0C10; - public static final int GL_COLOR_CLEAR_VALUE = 0x0C22; - public static final int GL_COLOR_WRITEMASK = 0x0C23; - public static final int GL_UNPACK_ALIGNMENT = 0x0CF5; - public static final int GL_PACK_ALIGNMENT = 0x0D05; - public static final int GL_MAX_TEXTURE_SIZE = 0x0D33; - public static final int GL_MAX_VIEWPORT_DIMS = 0x0D3A; - public static final int GL_SUBPIXEL_BITS = 0x0D50; - public static final int GL_RED_BITS = 0x0D52; - public static final int GL_GREEN_BITS = 0x0D53; - public static final int GL_BLUE_BITS = 0x0D54; - public static final int GL_ALPHA_BITS = 0x0D55; - public static final int GL_DEPTH_BITS = 0x0D56; - public static final int GL_STENCIL_BITS = 0x0D57; - public static final int GL_POLYGON_OFFSET_UNITS = 0x2A00; - public static final int GL_POLYGON_OFFSET_FACTOR = 0x8038; - public static final int GL_TEXTURE_BINDING_2D = 0x8069; - public static final int GL_SAMPLE_BUFFERS = 0x80A8; - public static final int GL_SAMPLES = 0x80A9; - public static final int GL_SAMPLE_COVERAGE_VALUE = 0x80AA; - public static final int GL_SAMPLE_COVERAGE_INVERT = 0x80AB; - public static final int GL_NUM_COMPRESSED_TEXTURE_FORMATS = 0x86A2; - public static final int GL_COMPRESSED_TEXTURE_FORMATS = 0x86A3; - public static final int GL_DONT_CARE = 0x1100; - public static final int GL_FASTEST = 0x1101; - public static final int GL_NICEST = 0x1102; - public static final int GL_GENERATE_MIPMAP_HINT = 0x8192; - public static final int GL_BYTE = 0x1400; - public static final int GL_UNSIGNED_BYTE = 0x1401; - public static final int GL_SHORT = 0x1402; - public static final int GL_UNSIGNED_SHORT = 0x1403; - public static final int GL_INT = 0x1404; - public static final int GL_UNSIGNED_INT = 0x1405; - public static final int GL_FLOAT = 0x1406; - public static final int GL_FIXED = 0x140C; - public static final int GL_DEPTH_COMPONENT = 0x1902; - public static final int GL_ALPHA = 0x1906; - public static final int GL_RGB = 0x1907; - public static final int GL_RGBA = 0x1908; - public static final int GL_LUMINANCE = 0x1909; - public static final int GL_LUMINANCE_ALPHA = 0x190A; - public static final int GL_UNSIGNED_SHORT_4_4_4_4 = 0x8033; - public static final int GL_UNSIGNED_SHORT_5_5_5_1 = 0x8034; - public static final int GL_UNSIGNED_SHORT_5_6_5 = 0x8363; - public static final int GL_FRAGMENT_SHADER = 0x8B30; - public static final int GL_VERTEX_SHADER = 0x8B31; - public static final int GL_MAX_VERTEX_ATTRIBS = 0x8869; - public static final int GL_MAX_VERTEX_UNIFORM_VECTORS = 0x8DFB; - public static final int GL_MAX_VARYING_VECTORS = 0x8DFC; - public static final int GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS = 0x8B4D; - public static final int GL_MAX_VERTEX_TEXTURE_IMAGE_UNITS = 0x8B4C; - public static final int GL_MAX_TEXTURE_IMAGE_UNITS = 0x8872; - public static final int GL_MAX_FRAGMENT_UNIFORM_VECTORS = 0x8DFD; - public static final int GL_SHADER_TYPE = 0x8B4F; - public static final int GL_DELETE_STATUS = 0x8B80; - public static final int GL_LINK_STATUS = 0x8B82; - public static final int GL_VALIDATE_STATUS = 0x8B83; - public static final int GL_ATTACHED_SHADERS = 0x8B85; - public static final int GL_ACTIVE_UNIFORMS = 0x8B86; - public static final int GL_ACTIVE_UNIFORM_MAX_LENGTH = 0x8B87; - public static final int GL_ACTIVE_ATTRIBUTES = 0x8B89; - public static final int GL_ACTIVE_ATTRIBUTE_MAX_LENGTH = 0x8B8A; - public static final int GL_SHADING_LANGUAGE_VERSION = 0x8B8C; - public static final int GL_CURRENT_PROGRAM = 0x8B8D; - public static final int GL_NEVER = 0x0200; - public static final int GL_LESS = 0x0201; - public static final int GL_EQUAL = 0x0202; - public static final int GL_LEQUAL = 0x0203; - public static final int GL_GREATER = 0x0204; - public static final int GL_NOTEQUAL = 0x0205; - public static final int GL_GEQUAL = 0x0206; - public static final int GL_ALWAYS = 0x0207; - public static final int GL_KEEP = 0x1E00; - public static final int GL_REPLACE = 0x1E01; - public static final int GL_INCR = 0x1E02; - public static final int GL_DECR = 0x1E03; - public static final int GL_INVERT = 0x150A; - public static final int GL_INCR_WRAP = 0x8507; - public static final int GL_DECR_WRAP = 0x8508; - public static final int GL_VENDOR = 0x1F00; - public static final int GL_RENDERER = 0x1F01; - public static final int GL_VERSION = 0x1F02; - public static final int GL_EXTENSIONS = 0x1F03; - public static final int GL_NEAREST = 0x2600; - public static final int GL_LINEAR = 0x2601; - public static final int GL_NEAREST_MIPMAP_NEAREST = 0x2700; - public static final int GL_LINEAR_MIPMAP_NEAREST = 0x2701; - public static final int GL_NEAREST_MIPMAP_LINEAR = 0x2702; - public static final int GL_LINEAR_MIPMAP_LINEAR = 0x2703; - public static final int GL_TEXTURE_MAG_FILTER = 0x2800; - public static final int GL_TEXTURE_MIN_FILTER = 0x2801; - public static final int GL_TEXTURE_WRAP_S = 0x2802; - public static final int GL_TEXTURE_WRAP_T = 0x2803; - public static final int GL_TEXTURE = 0x1702; - public static final int GL_TEXTURE_CUBE_MAP = 0x8513; - public static final int GL_TEXTURE_BINDING_CUBE_MAP = 0x8514; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_X = 0x8515; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_X = 0x8516; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Y = 0x8517; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Y = 0x8518; - public static final int GL_TEXTURE_CUBE_MAP_POSITIVE_Z = 0x8519; - public static final int GL_TEXTURE_CUBE_MAP_NEGATIVE_Z = 0x851A; - public static final int GL_MAX_CUBE_MAP_TEXTURE_SIZE = 0x851C; - public static final int GL_TEXTURE0 = 0x84C0; - public static final int GL_TEXTURE1 = 0x84C1; - public static final int GL_TEXTURE2 = 0x84C2; - public static final int GL_TEXTURE3 = 0x84C3; - public static final int GL_TEXTURE4 = 0x84C4; - public static final int GL_TEXTURE5 = 0x84C5; - public static final int GL_TEXTURE6 = 0x84C6; - public static final int GL_TEXTURE7 = 0x84C7; - public static final int GL_TEXTURE8 = 0x84C8; - public static final int GL_TEXTURE9 = 0x84C9; - public static final int GL_TEXTURE10 = 0x84CA; - public static final int GL_TEXTURE11 = 0x84CB; - public static final int GL_TEXTURE12 = 0x84CC; - public static final int GL_TEXTURE13 = 0x84CD; - public static final int GL_TEXTURE14 = 0x84CE; - public static final int GL_TEXTURE15 = 0x84CF; - public static final int GL_TEXTURE16 = 0x84D0; - public static final int GL_TEXTURE17 = 0x84D1; - public static final int GL_TEXTURE18 = 0x84D2; - public static final int GL_TEXTURE19 = 0x84D3; - public static final int GL_TEXTURE20 = 0x84D4; - public static final int GL_TEXTURE21 = 0x84D5; - public static final int GL_TEXTURE22 = 0x84D6; - public static final int GL_TEXTURE23 = 0x84D7; - public static final int GL_TEXTURE24 = 0x84D8; - public static final int GL_TEXTURE25 = 0x84D9; - public static final int GL_TEXTURE26 = 0x84DA; - public static final int GL_TEXTURE27 = 0x84DB; - public static final int GL_TEXTURE28 = 0x84DC; - public static final int GL_TEXTURE29 = 0x84DD; - public static final int GL_TEXTURE30 = 0x84DE; - public static final int GL_TEXTURE31 = 0x84DF; - public static final int GL_REPEAT = 0x2901; - public static final int GL_CLAMP_TO_EDGE = 0x812F; - public static final int GL_MIRRORED_REPEAT = 0x8370; - public static final int GL_FLOAT_VEC2 = 0x8B50; - public static final int GL_FLOAT_VEC3 = 0x8B51; - public static final int GL_FLOAT_VEC4 = 0x8B52; - public static final int GL_INT_VEC2 = 0x8B53; - public static final int GL_INT_VEC3 = 0x8B54; - public static final int GL_INT_VEC4 = 0x8B55; - public static final int GL_BOOL = 0x8B56; - public static final int GL_BOOL_VEC2 = 0x8B57; - public static final int GL_BOOL_VEC3 = 0x8B58; - public static final int GL_BOOL_VEC4 = 0x8B59; - public static final int GL_FLOAT_MAT2 = 0x8B5A; - public static final int GL_FLOAT_MAT3 = 0x8B5B; - public static final int GL_FLOAT_MAT4 = 0x8B5C; - public static final int GL_SAMPLER_2D = 0x8B5E; - public static final int GL_SAMPLER_CUBE = 0x8B60; - public static final int GL_VERTEX_ATTRIB_ARRAY_ENABLED = 0x8622; - public static final int GL_VERTEX_ATTRIB_ARRAY_SIZE = 0x8623; - public static final int GL_VERTEX_ATTRIB_ARRAY_STRIDE = 0x8624; - public static final int GL_VERTEX_ATTRIB_ARRAY_TYPE = 0x8625; - public static final int GL_VERTEX_ATTRIB_ARRAY_NORMALIZED = 0x886A; - public static final int GL_VERTEX_ATTRIB_ARRAY_POINTER = 0x8645; - public static final int GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING = 0x889F; - public static final int GL_IMPLEMENTATION_COLOR_READ_TYPE = 0x8B9A; - public static final int GL_IMPLEMENTATION_COLOR_READ_FORMAT = 0x8B9B; - public static final int GL_COMPILE_STATUS = 0x8B81; - public static final int GL_INFO_LOG_LENGTH = 0x8B84; - public static final int GL_SHADER_SOURCE_LENGTH = 0x8B88; - public static final int GL_SHADER_COMPILER = 0x8DFA; - public static final int GL_SHADER_BINARY_FORMATS = 0x8DF8; - public static final int GL_NUM_SHADER_BINARY_FORMATS = 0x8DF9; - public static final int GL_LOW_FLOAT = 0x8DF0; - public static final int GL_MEDIUM_FLOAT = 0x8DF1; - public static final int GL_HIGH_FLOAT = 0x8DF2; - public static final int GL_LOW_INT = 0x8DF3; - public static final int GL_MEDIUM_INT = 0x8DF4; - public static final int GL_HIGH_INT = 0x8DF5; - public static final int GL_FRAMEBUFFER = 0x8D40; - public static final int GL_RENDERBUFFER = 0x8D41; - public static final int GL_RGBA4 = 0x8056; - public static final int GL_RGB5_A1 = 0x8057; - public static final int GL_RGB565 = 0x8D62; - public static final int GL_DEPTH_COMPONENT16 = 0x81A5; - public static final int GL_STENCIL_INDEX8 = 0x8D48; - public static final int GL_RENDERBUFFER_WIDTH = 0x8D42; - public static final int GL_RENDERBUFFER_HEIGHT = 0x8D43; - public static final int GL_RENDERBUFFER_INTERNAL_FORMAT = 0x8D44; - public static final int GL_RENDERBUFFER_RED_SIZE = 0x8D50; - public static final int GL_RENDERBUFFER_GREEN_SIZE = 0x8D51; - public static final int GL_RENDERBUFFER_BLUE_SIZE = 0x8D52; - public static final int GL_RENDERBUFFER_ALPHA_SIZE = 0x8D53; - public static final int GL_RENDERBUFFER_DEPTH_SIZE = 0x8D54; - public static final int GL_RENDERBUFFER_STENCIL_SIZE = 0x8D55; - public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE = 0x8CD0; - public static final int GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME = 0x8CD1; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL = 0x8CD2; - public static final int GL_FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE = 0x8CD3; - public static final int GL_COLOR_ATTACHMENT0 = 0x8CE0; - public static final int GL_DEPTH_ATTACHMENT = 0x8D00; - public static final int GL_STENCIL_ATTACHMENT = 0x8D20; - public static final int GL_NONE = 0; - public static final int GL_FRAMEBUFFER_COMPLETE = 0x8CD5; - public static final int GL_FRAMEBUFFER_INCOMPLETE_ATTACHMENT = 0x8CD6; - public static final int GL_FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT = 0x8CD7; - public static final int GL_FRAMEBUFFER_INCOMPLETE_DIMENSIONS = 0x8CD9; - public static final int GL_FRAMEBUFFER_UNSUPPORTED = 0x8CDD; - public static final int GL_FRAMEBUFFER_BINDING = 0x8CA6; - public static final int GL_RENDERBUFFER_BINDING = 0x8CA7; - public static final int GL_MAX_RENDERBUFFER_SIZE = 0x84E8; - public static final int GL_INVALID_FRAMEBUFFER_OPERATION = 0x0506; - - /* New in OpenGL ES 3.0 */ +public class GLES30 extends GLES20 { public static final int GL_READ_BUFFER = 0x0C02; public static final int GL_UNPACK_ROW_LENGTH = 0x0CF2; public static final int GL_UNPACK_SKIP_ROWS = 0x0CF3; @@ -636,5 +332,6 @@ public class GLES30 { native private static void _nativeClassInit(); static { - _nativeClassInit(); + _nativeClassInit(); } + diff --git a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java index 19504f258..da0a1fd68 100644 --- a/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java +++ b/opengl/tools/glgen/stubs/gles11/glGetProgramInfoLog.java @@ -1,5 +1,5 @@ // C function void glGetProgramInfoLog( GLuint program, GLsizei maxLength, GLsizei * length, - // GLchar * infoLog); + // GLchar * infoLog); public static native String glGetProgramInfoLog( int program diff --git a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java index 1fac6beae..dc1db5b94 100644 --- a/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java +++ b/opengl/tools/glgen/stubs/gles11/glGetShaderInfoLog.java @@ -1,5 +1,5 @@ // C function void glGetShaderInfoLog( GLuint shader, GLsizei maxLength, GLsizei * length, - // GLchar * infoLog); + // GLchar * infoLog); public static native String glGetShaderInfoLog( int shader