Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8a59ca73 authored by Pablo Ceballos's avatar Pablo Ceballos
Browse files

Add GLES32 class templates

- Added a script that takes the #defines in gl2/3.h and formats them
  for use in the Java template.

- Generated GLES32.spec using glgen2.

- Added full support for void* in glgen. It wasn't previously
  necessary since the apis were using GLvoid instead.

- Created the GLES32 header stubs. Added stubs for GLES32 functions
  that couldn't be handled by the code generator. Added checks in the
  checks.spec file where appropriate.

- Generated the GLES32 class and JNI.

Change-Id: Ifc8512ed56af75bbc3e7ec2ea1377895201d5325
parent 4690754e
Loading
Loading
Loading
Loading
+31 −0
Original line number Diff line number Diff line
#!/usr/bin/env python
#
# Copyright 2015 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 script is for converting the #defines in the gl2/3.h into the Java
# form used in the GLES2/3Header.java-if stub files that are then used by
# the code generator. Provide input with stdin and receive output on stdout.

import sys

allDefines = []
maxLen = 0

for line in sys.stdin:
    defineValuePair = line.strip().split()[1:]
    maxLen = max(maxLen, len(defineValuePair[0]))
    allDefines.append(defineValuePair)
for define in sorted(allDefines, key=lambda define: define[1]):
    print('    public static final int {0[0]:<{1}} = {0[1]};'.format(define, maxLen))
+3 −2
Original line number Diff line number Diff line
@@ -107,7 +107,8 @@ javac -d classes android/opengl/EGL14.java \
                    android/opengl/GLES20.java \
                    android/opengl/GLES30.java \
                    android/opengl/GLES31.java \
                    android/opengl/GLES31Ext.java
                    android/opengl/GLES31Ext.java \
                    android/opengl/GLES32.java
popd > /dev/null
JAVA_RESULT=$?
if [ $JAVA_RESULT -ne 0 ]; then
@@ -154,7 +155,7 @@ do
    compareGenerated ../../../../base/opengl/java/javax/microedition/khronos/opengles generated/javax/microedition/khronos/opengles $x
done

for x in EGL14 EGLExt GLES10 GLES10Ext GLES11 GLES11Ext GLES20 GLES30 GLES31 GLES31Ext
for x in EGL14 EGLExt GLES10 GLES10Ext GLES11 GLES11Ext GLES20 GLES30 GLES31 GLES31Ext GLES32
do
    compareGenerated ../../../../base/opengl/java/android/opengl generated/android/opengl ${x}.java
    compareGenerated ../../../../base/core/jni generated/C android_opengl_${x}.cpp
+44 −0
Original line number Diff line number Diff line
void glBlendBarrier ( void )
void glCopyImageSubData ( GLuint srcName, GLenum srcTarget, GLint srcLevel, GLint srcX, GLint srcY, GLint srcZ, GLuint dstName, GLenum dstTarget, GLint dstLevel, GLint dstX, GLint dstY, GLint dstZ, GLsizei srcWidth, GLsizei srcHeight, GLsizei srcDepth )
void glDebugMessageControl ( GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled )
void glDebugMessageInsert ( GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf )
void glDebugMessageCallback ( GLDEBUGPROC callback, const void *userParam )
GLuint glGetDebugMessageLog ( GLuint count, GLsizei bufSize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog )
void glPushDebugGroup ( GLenum source, GLuint id, GLsizei length, const GLchar *message )
void glPopDebugGroup ( void )
void glObjectLabel ( GLenum identifier, GLuint name, GLsizei length, const GLchar *label )
void glGetObjectLabel ( GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label )
void glObjectPtrLabel ( const void *ptr, GLsizei length, const GLchar *label )
void glGetObjectPtrLabel ( const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label )
void glGetPointerv ( GLenum pname, void **params )
void glEnablei ( GLenum target, GLuint index )
void glDisablei ( GLenum target, GLuint index )
void glBlendEquationi ( GLuint buf, GLenum mode )
void glBlendEquationSeparatei ( GLuint buf, GLenum modeRGB, GLenum modeAlpha )
void glBlendFunci ( GLuint buf, GLenum src, GLenum dst )
void glBlendFuncSeparatei ( GLuint buf, GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha )
void glColorMaski ( GLuint index, GLboolean r, GLboolean g, GLboolean b, GLboolean a )
GLboolean glIsEnabledi ( GLenum target, GLuint index )
void glDrawElementsBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLint basevertex )
void glDrawRangeElementsBaseVertex ( GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const void *indices, GLint basevertex )
void glDrawElementsInstancedBaseVertex ( GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei instancecount, GLint basevertex )
void glFramebufferTexture ( GLenum target, GLenum attachment, GLuint texture, GLint level )
void glPrimitiveBoundingBox ( GLfloat minX, GLfloat minY, GLfloat minZ, GLfloat minW, GLfloat maxX, GLfloat maxY, GLfloat maxZ, GLfloat maxW )
GLenum glGetGraphicsResetStatus ( void )
void glReadnPixels ( GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLsizei bufSize, void *data )
void glGetnUniformfv ( GLuint program, GLint location, GLsizei bufSize, GLfloat *params )
void glGetnUniformiv ( GLuint program, GLint location, GLsizei bufSize, GLint *params )
void glGetnUniformuiv ( GLuint program, GLint location, GLsizei bufSize, GLuint *params )
void glMinSampleShading ( GLfloat value )
void glPatchParameteri ( GLenum pname, GLint value )
void glTexParameterIiv ( GLenum target, GLenum pname, const GLint *params )
void glTexParameterIuiv ( GLenum target, GLenum pname, const GLuint *params )
void glGetTexParameterIiv ( GLenum target, GLenum pname, GLint *params )
void glGetTexParameterIuiv ( GLenum target, GLenum pname, GLuint *params )
void glSamplerParameterIiv ( GLuint sampler, GLenum pname, const GLint *param )
void glSamplerParameterIuiv ( GLuint sampler, GLenum pname, const GLuint *param )
void glGetSamplerParameterIiv ( GLuint sampler, GLenum pname, GLint *params )
void glGetSamplerParameterIuiv ( GLuint sampler, GLenum pname, GLuint *params )
void glTexBuffer ( GLenum target, GLenum internalformat, GLuint buffer )
void glTexBufferRange ( GLenum target, GLenum internalformat, GLuint buffer, GLintptr offset, GLsizeiptr size )
void glTexStorage3DMultisample ( GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations )
+10 −0
Original line number Diff line number Diff line
@@ -25,6 +25,8 @@ glBufferSubData check data size
# glCompressedTexSubImage2D
glClipPlanef check eqn 4
glClipPlanex check eqn 4
glDebugMessageControl check ids count
glDebugMessageInsert check message length
glDeleteBuffers check buffers n
glDeleteFramebuffers check framebuffers n
glDeleteFramebuffersOES check framebuffers n
@@ -32,6 +34,8 @@ glDeleteRenderbuffers check renderbuffers n
glDeleteRenderbuffersOES check renderbuffers n
glDeleteTextures check textures n
glDrawElements check_AIOOBE indices count
glDrawElementsBaseVertex check_AIOOBE indices count-basevertex
glDrawRangeElementsBaseVertex check_AIOOBE indices count-basevertex
glDrawTexfvOES check coords 5
glDrawTexivOES check coords 5
glDrawTexsvOES check coords 5
@@ -72,6 +76,9 @@ glGetSynciv nullAllowed length
glGetTexEnv ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
glGetTexGen ifcheck params 4 pname GL_OBJECT_PLANE,GL_EYE_PLANE
glGetTexParameter check params 1
glGetnUniformfv check params bufSize
glGetnUniformiv check params bufSize
glGetnUniformuiv check params bufSize
glGetUniform check params 1
glGetVertexAttrib ifcheck params 4 pname GL_CURRENT_VERTEX_ATTRIB
glLight ifcheck params 3 pname GL_SPOT_DIRECTION ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION
@@ -80,9 +87,12 @@ glLoadMatrix check m 16
glMaterial ifcheck params 4 pname GL_AMBIENT,GL_DIFFUSE,GL_SPECULAR,GL_EMISSION,GL_AMBIENT_AND_DIFFUSE
glMultMatrix check m 16
glObjectLabelKHR nullAllowed label
glObjectLabel nullAllowed label check label length
glPointParameter check params 1
glPushDebugGroup check message length
glQueryMatrixxOES check mantissa 16 check exponent 16 return -1
# glReadPixels
glReadnPixels check data bufSize
glShaderBinary check binary length
// glShaderSource
glTexEnv ifcheck params 4 pname GL_TEXTURE_ENV_COLOR
+4 −5
Original line number Diff line number Diff line
@@ -141,7 +141,10 @@ public class CFunc {
            String tok = tokens[i++];

            if (tok.equals("(")) {
                continue;
                tok = tokens[i++];
                if (tok.equals("void")) {
                    break;
                }
            }
            if (tok.equals(")")) {
                break;
@@ -158,10 +161,6 @@ public class CFunc {
            }
            argType.setBaseType(argTypeName);

            if (argTypeName.equals("void")) {
                break;
            }

            argName = tokens[i++];
            if (argName.startsWith("*")) {
                argType.setIsPointer(true);
Loading