[GLESv3] versions, es > 2, encoder

- Encoder with ES 3.x entry points
- Allow ES versions > 2 depending on host capability

Change-Id: I71e374f1685610bb0e4f9e04f4bba87b0cbaa02b
diff --git a/shared/OpenglCodecCommon/GLClientState.h b/shared/OpenglCodecCommon/GLClientState.h
index 8c876cb..9eee2f1 100644
--- a/shared/OpenglCodecCommon/GLClientState.h
+++ b/shared/OpenglCodecCommon/GLClientState.h
@@ -190,6 +190,8 @@
     void setCurrentProgram(GLint program) { m_currentProgram = program; }
     GLint currentProgram() const { return m_currentProgram; }
 
+    void setNumActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex, GLint numActiveUniforms);
+    size_t numActiveUniformsInUniformBlock(GLuint program, GLuint uniformBlockIndex) const;
     /* OES_EGL_image_external
      *
      * These functions manipulate GL state which interacts with the
diff --git a/shared/OpenglCodecCommon/codec_defs.h b/shared/OpenglCodecCommon/codec_defs.h
index f19f514..8fab90c 100644
--- a/shared/OpenglCodecCommon/codec_defs.h
+++ b/shared/OpenglCodecCommon/codec_defs.h
@@ -18,6 +18,10 @@
 
 #define CODEC_SERVER_PORT 22468
 
-#define CODEC_MAX_VERTEX_ATTRIBUTES 64
+enum {
+
+CODEC_MAX_VERTEX_ATTRIBUTES = 64,
+
+};
 
 #endif
diff --git a/shared/OpenglCodecCommon/gl_base_types.h b/shared/OpenglCodecCommon/gl_base_types.h
index d7bdef8..70cb325 100644
--- a/shared/OpenglCodecCommon/gl_base_types.h
+++ b/shared/OpenglCodecCommon/gl_base_types.h
@@ -18,12 +18,12 @@
 
 #include <KHR/khrplatform.h>
 
-#ifndef gl_APIENTRY
-#define gl_APIENTRY KHRONOS_APIENTRY
+#ifndef gles1_APIENTRY
+#define gles1_APIENTRY KHRONOS_APIENTRY
 #endif
 
-#ifndef gl2_APIENTRY
-#define gl2_APIENTRY KHRONOS_APIENTRY
+#ifndef gles2_APIENTRY
+#define gles2_APIENTRY KHRONOS_APIENTRY
 #endif
 
 typedef void             GLvoid;
@@ -47,6 +47,9 @@
 typedef char *GLstr;
 /* JR XXX Treating this as an in handle - is this correct? */
 typedef void * GLeglImageOES;
+typedef struct __GLsync *GLsync;
+typedef khronos_int64_t GLint64;
+typedef khronos_uint64_t GLuint64;
 
 /* ErrorCode */
 #ifndef GL_INVALID_ENUM
diff --git a/system/GLESv1/gl.cpp b/system/GLESv1/gl.cpp
index ad887f7..e20b45d 100644
--- a/system/GLESv1/gl.cpp
+++ b/system/GLESv1/gl.cpp
@@ -127,6 +127,11 @@
     glFinish();
 }
 
+void getIntegerv(unsigned int pname, int* param)
+{
+    glGetIntegerv((GLenum)pname, (GLint*)param);
+}
+
 const GLubyte *my_glGetString (void *self, GLenum name)
 {
     (void)self;
@@ -170,6 +175,7 @@
         s_gl->getProcAddress = getProcAddress;
         s_gl->finish = finish;
         s_gl->init = init;
+        s_gl->getIntegerv = getIntegerv;
     }
 
     return s_gl;
diff --git a/system/GLESv1_enc/gl_enc.h b/system/GLESv1_enc/gl_enc.h
index 37de4c4..030bd66 100644
--- a/system/GLESv1_enc/gl_enc.h
+++ b/system/GLESv1_enc/gl_enc.h
@@ -18,6 +18,7 @@
 	ChecksumCalculator *m_checksumCalculator;
 
 	gl_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void* data, uint32_t sz) { return 0; }
 };
 
-#endif  // GUARD_gl_encoder_context_t
\ No newline at end of file
+#endif  // GUARD_gl_encoder_context_t
diff --git a/system/GLESv2/gl2.cpp b/system/GLESv2/gl2.cpp
index ec82046..05d5db0 100644
--- a/system/GLESv2/gl2.cpp
+++ b/system/GLESv2/gl2.cpp
@@ -81,6 +81,7 @@
         GET_CONTEXT;
         ctx->override2DTextureTarget(target);
         GLeglImageOES hostImage = reinterpret_cast<GLeglImageOES>((intptr_t)image->host_egl_image);
+        ctx->associateEGLImage(target, hostImage);
         ctx->m_glEGLImageTargetTexture2DOES_enc(self, target, hostImage);
         ctx->restore2DTextureTarget(target);
     }
@@ -125,6 +126,11 @@
     glFinish();
 }
 
+void getIntegerv(unsigned int pname, int* param)
+{
+    glGetIntegerv((GLenum)pname, (GLint*)param);
+}
+
 const GLubyte *my_glGetString (void *self, GLenum name)
 {
     (void)self;
@@ -157,7 +163,6 @@
     ctx->glEGLImageTargetRenderbufferStorageOES = &glEGLImageTargetRenderbufferStorageOES;
     ctx->glGetString = &my_glGetString;
 }
-
 extern "C" {
 EGLClient_glesInterface * init_emul_gles(EGLClient_eglInterface *eglIface)
 {
@@ -168,10 +173,9 @@
         s_gl->getProcAddress = getProcAddress;
         s_gl->finish = finish;
         s_gl->init = init;
+        s_gl->getIntegerv = getIntegerv;
     }
 
     return s_gl;
 }
 } //extern
-
-
diff --git a/system/GLESv2_enc/Android.mk b/system/GLESv2_enc/Android.mk
index e76a175..98afcd2 100644
--- a/system/GLESv2_enc/Android.mk
+++ b/system/GLESv2_enc/Android.mk
@@ -8,7 +8,7 @@
     GL2Encoder.cpp \
     gl2_client_context.cpp \
     gl2_enc.cpp \
-    gl2_entry.cpp
+    gl2_entry.cpp \
 
 LOCAL_CFLAGS += -DLOG_TAG=\"emuglGLESv2_enc\"
 
diff --git a/system/GLESv2_enc/GL2Encoder.cpp b/system/GLESv2_enc/GL2Encoder.cpp
index 6d0b9a3..2631c36 100755
--- a/system/GLESv2_enc/GL2Encoder.cpp
+++ b/system/GLESv2_enc/GL2Encoder.cpp
@@ -50,6 +50,8 @@
 GL2Encoder::GL2Encoder(IOStream *stream, ChecksumCalculator *protocol)
         : gl2_encoder_context_t(stream, protocol)
 {
+    m_currMajorVersion = 2;
+    m_currMinorVersion = 0;
     m_initialized = false;
     m_state = NULL;
     m_error = GL_NO_ERROR;
@@ -65,6 +67,12 @@
 
     //overrides
 #define OVERRIDE(name)  m_##name##_enc = this-> name ; this-> name = &s_##name
+#define OVERRIDE_CUSTOM(name)  this-> name = &s_##name
+#define OVERRIDEWITH(name, target)  do { \
+    m_##target##_enc = this-> target; \
+    this-> target = &s_##name; \
+} while(0)
+#define OVERRIDEOES(name) OVERRIDEWITH(name, name##OES)
 
     OVERRIDE(glFlush);
     OVERRIDE(glPixelStorei);
diff --git a/system/GLESv2_enc/GL2Encoder.h b/system/GLESv2_enc/GL2Encoder.h
index 61a4806..11c9312 100644
--- a/system/GLESv2_enc/GL2Encoder.h
+++ b/system/GLESv2_enc/GL2Encoder.h
@@ -28,9 +28,12 @@
     void setClientState(GLClientState *state) {
         m_state = state;
     }
-    void setClientStateMakeCurrent(GLClientState *state) {
+    void setClientStateMakeCurrent(GLClientState *state, int majorVersion, int minorVersion) {
         m_state = state;
         m_state->fromMakeCurrent();
+        m_currMajorVersion = majorVersion;
+        m_currMinorVersion = minorVersion;
+    }
     }
     void setSharedGroup(GLSharedGroupPtr shared){ m_shared = shared; }
     const GLClientState *state() { return m_state; }
@@ -49,6 +52,9 @@
 
 private:
 
+    int m_currMajorVersion;
+    int m_currMinorVersion;
+
     bool    m_initialized;
     GLClientState *m_state;
     GLSharedGroupPtr m_shared;
@@ -64,7 +70,7 @@
     FixedBuffer m_fixedBuffer;
 
     int m_drawCallFlushCount;
-    // GLES 3 features. Disabled for now.
+
     bool m_primitiveRestartEnabled;
     GLuint m_primitiveRestartIndex;
 
diff --git a/system/GLESv2_enc/GL2EncoderUtils.cpp b/system/GLESv2_enc/GL2EncoderUtils.cpp
index fc2a723..d1f73cd 100644
--- a/system/GLESv2_enc/GL2EncoderUtils.cpp
+++ b/system/GLESv2_enc/GL2EncoderUtils.cpp
@@ -18,19 +18,22 @@
 #include "GL2Encoder.h"
 #include <assert.h>
 
+#include <GLES3/gl31.h>
+
 namespace glesv2_enc {
 
 size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack)
 {
     GL2Encoder *ctx = (GL2Encoder *)self;
     assert (ctx->state() != NULL);
-    return ctx->state()->pixelDataSize(width, height, format, type, pack);
+    return ctx->state()->pixelDataSize(width, height, 1, format, type, pack);
 }
 
 size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack)
 {
-    size_t layerSize = pixelDataSize(self, width, height, format, type, pack);
-    return layerSize * depth;
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->pixelDataSize(width, height, depth, format, type, pack);
 }
 
 GLenum uniformType(void * self, GLuint program, GLint location)
@@ -40,4 +43,27 @@
     return ctx->shared()->getProgramUniformType(program, location);
 }
 
+size_t clearBufferNumElts(void* self, GLenum buffer) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->clearBufferNumElts(buffer);
+}
+
+size_t numActiveUniformsInUniformBlock(void* self, GLuint program, GLuint blockIndex) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+    return ctx->state()->numActiveUniformsInUniformBlock(program, blockIndex);
+}
+
+size_t glActiveUniformBlockivParamSize(void* self, GLuint program, GLuint blockIndex, GLenum pname) {
+    GL2Encoder *ctx = (GL2Encoder *)self;
+    assert (ctx->state() != NULL);
+
+    if (pname == GL_UNIFORM_BLOCK_ACTIVE_UNIFORM_INDICES) {
+        return ctx->state()->numActiveUniformsInUniformBlock(program, blockIndex);
+    } else {
+        return glUtilsParamSize(pname);
+    }
+}
+
 }  // namespace glesv2_enc
diff --git a/system/GLESv2_enc/GL2EncoderUtils.h b/system/GLESv2_enc/GL2EncoderUtils.h
index 211e966..8d39ca3 100644
--- a/system/GLESv2_enc/GL2EncoderUtils.h
+++ b/system/GLESv2_enc/GL2EncoderUtils.h
@@ -21,6 +21,9 @@
 size_t pixelDataSize(void *self, GLsizei width, GLsizei height, GLenum format, GLenum type, int pack);
 size_t pixelDataSize3D(void *self, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, int pack);
 GLenum uniformType(void * self, GLuint program, GLint location);
+size_t clearBufferNumElts(void* self, GLenum buffer);
+size_t numActiveUniformsInUniformBlock(void* self, GLuint program, GLuint blockIndex);
+size_t glActiveUniformBlockivParamSize(void* self, GLuint program, GLuint blockIndex, GLenum pname);
 
 }  // namespace glesv2_enc
 
diff --git a/system/GLESv2_enc/gl2_client_context.cpp b/system/GLESv2_enc/gl2_client_context.cpp
index f903542..ff867df 100644
--- a/system/GLESv2_enc/gl2_client_context.cpp
+++ b/system/GLESv2_enc/gl2_client_context.cpp
@@ -218,6 +218,202 @@
 	glGetCompressedTextureFormats = (glGetCompressedTextureFormats_client_proc_t) getProc("glGetCompressedTextureFormats", userData);
 	glShaderString = (glShaderString_client_proc_t) getProc("glShaderString", userData);
 	glFinishRoundTrip = (glFinishRoundTrip_client_proc_t) getProc("glFinishRoundTrip", userData);
+	glGenVertexArrays = (glGenVertexArrays_client_proc_t) getProc("glGenVertexArrays", userData);
+	glBindVertexArray = (glBindVertexArray_client_proc_t) getProc("glBindVertexArray", userData);
+	glDeleteVertexArrays = (glDeleteVertexArrays_client_proc_t) getProc("glDeleteVertexArrays", userData);
+	glIsVertexArray = (glIsVertexArray_client_proc_t) getProc("glIsVertexArray", userData);
+	glMapBufferRange = (glMapBufferRange_client_proc_t) getProc("glMapBufferRange", userData);
+	glUnmapBuffer = (glUnmapBuffer_client_proc_t) getProc("glUnmapBuffer", userData);
+	glFlushMappedBufferRange = (glFlushMappedBufferRange_client_proc_t) getProc("glFlushMappedBufferRange", userData);
+	glMapBufferRangeAEMU = (glMapBufferRangeAEMU_client_proc_t) getProc("glMapBufferRangeAEMU", userData);
+	glUnmapBufferAEMU = (glUnmapBufferAEMU_client_proc_t) getProc("glUnmapBufferAEMU", userData);
+	glFlushMappedBufferRangeAEMU = (glFlushMappedBufferRangeAEMU_client_proc_t) getProc("glFlushMappedBufferRangeAEMU", userData);
+	glReadPixelsOffsetAEMU = (glReadPixelsOffsetAEMU_client_proc_t) getProc("glReadPixelsOffsetAEMU", userData);
+	glCompressedTexImage2DOffsetAEMU = (glCompressedTexImage2DOffsetAEMU_client_proc_t) getProc("glCompressedTexImage2DOffsetAEMU", userData);
+	glCompressedTexSubImage2DOffsetAEMU = (glCompressedTexSubImage2DOffsetAEMU_client_proc_t) getProc("glCompressedTexSubImage2DOffsetAEMU", userData);
+	glTexImage2DOffsetAEMU = (glTexImage2DOffsetAEMU_client_proc_t) getProc("glTexImage2DOffsetAEMU", userData);
+	glTexSubImage2DOffsetAEMU = (glTexSubImage2DOffsetAEMU_client_proc_t) getProc("glTexSubImage2DOffsetAEMU", userData);
+	glBindBufferRange = (glBindBufferRange_client_proc_t) getProc("glBindBufferRange", userData);
+	glBindBufferBase = (glBindBufferBase_client_proc_t) getProc("glBindBufferBase", userData);
+	glCopyBufferSubData = (glCopyBufferSubData_client_proc_t) getProc("glCopyBufferSubData", userData);
+	glClearBufferiv = (glClearBufferiv_client_proc_t) getProc("glClearBufferiv", userData);
+	glClearBufferuiv = (glClearBufferuiv_client_proc_t) getProc("glClearBufferuiv", userData);
+	glClearBufferfv = (glClearBufferfv_client_proc_t) getProc("glClearBufferfv", userData);
+	glClearBufferfi = (glClearBufferfi_client_proc_t) getProc("glClearBufferfi", userData);
+	glGetBufferParameteri64v = (glGetBufferParameteri64v_client_proc_t) getProc("glGetBufferParameteri64v", userData);
+	glGetBufferPointerv = (glGetBufferPointerv_client_proc_t) getProc("glGetBufferPointerv", userData);
+	glUniformBlockBinding = (glUniformBlockBinding_client_proc_t) getProc("glUniformBlockBinding", userData);
+	glGetUniformBlockIndex = (glGetUniformBlockIndex_client_proc_t) getProc("glGetUniformBlockIndex", userData);
+	glGetUniformIndices = (glGetUniformIndices_client_proc_t) getProc("glGetUniformIndices", userData);
+	glGetUniformIndicesAEMU = (glGetUniformIndicesAEMU_client_proc_t) getProc("glGetUniformIndicesAEMU", userData);
+	glGetActiveUniformBlockiv = (glGetActiveUniformBlockiv_client_proc_t) getProc("glGetActiveUniformBlockiv", userData);
+	glGetActiveUniformBlockName = (glGetActiveUniformBlockName_client_proc_t) getProc("glGetActiveUniformBlockName", userData);
+	glUniform1ui = (glUniform1ui_client_proc_t) getProc("glUniform1ui", userData);
+	glUniform2ui = (glUniform2ui_client_proc_t) getProc("glUniform2ui", userData);
+	glUniform3ui = (glUniform3ui_client_proc_t) getProc("glUniform3ui", userData);
+	glUniform4ui = (glUniform4ui_client_proc_t) getProc("glUniform4ui", userData);
+	glUniform1uiv = (glUniform1uiv_client_proc_t) getProc("glUniform1uiv", userData);
+	glUniform2uiv = (glUniform2uiv_client_proc_t) getProc("glUniform2uiv", userData);
+	glUniform3uiv = (glUniform3uiv_client_proc_t) getProc("glUniform3uiv", userData);
+	glUniform4uiv = (glUniform4uiv_client_proc_t) getProc("glUniform4uiv", userData);
+	glUniformMatrix2x3fv = (glUniformMatrix2x3fv_client_proc_t) getProc("glUniformMatrix2x3fv", userData);
+	glUniformMatrix3x2fv = (glUniformMatrix3x2fv_client_proc_t) getProc("glUniformMatrix3x2fv", userData);
+	glUniformMatrix2x4fv = (glUniformMatrix2x4fv_client_proc_t) getProc("glUniformMatrix2x4fv", userData);
+	glUniformMatrix4x2fv = (glUniformMatrix4x2fv_client_proc_t) getProc("glUniformMatrix4x2fv", userData);
+	glUniformMatrix3x4fv = (glUniformMatrix3x4fv_client_proc_t) getProc("glUniformMatrix3x4fv", userData);
+	glUniformMatrix4x3fv = (glUniformMatrix4x3fv_client_proc_t) getProc("glUniformMatrix4x3fv", userData);
+	glGetUniformuiv = (glGetUniformuiv_client_proc_t) getProc("glGetUniformuiv", userData);
+	glGetActiveUniformsiv = (glGetActiveUniformsiv_client_proc_t) getProc("glGetActiveUniformsiv", userData);
+	glVertexAttribI4i = (glVertexAttribI4i_client_proc_t) getProc("glVertexAttribI4i", userData);
+	glVertexAttribI4ui = (glVertexAttribI4ui_client_proc_t) getProc("glVertexAttribI4ui", userData);
+	glVertexAttribI4iv = (glVertexAttribI4iv_client_proc_t) getProc("glVertexAttribI4iv", userData);
+	glVertexAttribI4uiv = (glVertexAttribI4uiv_client_proc_t) getProc("glVertexAttribI4uiv", userData);
+	glVertexAttribIPointer = (glVertexAttribIPointer_client_proc_t) getProc("glVertexAttribIPointer", userData);
+	glVertexAttribIPointerOffsetAEMU = (glVertexAttribIPointerOffsetAEMU_client_proc_t) getProc("glVertexAttribIPointerOffsetAEMU", userData);
+	glVertexAttribIPointerDataAEMU = (glVertexAttribIPointerDataAEMU_client_proc_t) getProc("glVertexAttribIPointerDataAEMU", userData);
+	glGetVertexAttribIiv = (glGetVertexAttribIiv_client_proc_t) getProc("glGetVertexAttribIiv", userData);
+	glGetVertexAttribIuiv = (glGetVertexAttribIuiv_client_proc_t) getProc("glGetVertexAttribIuiv", userData);
+	glVertexAttribDivisor = (glVertexAttribDivisor_client_proc_t) getProc("glVertexAttribDivisor", userData);
+	glDrawArraysInstanced = (glDrawArraysInstanced_client_proc_t) getProc("glDrawArraysInstanced", userData);
+	glDrawElementsInstanced = (glDrawElementsInstanced_client_proc_t) getProc("glDrawElementsInstanced", userData);
+	glDrawElementsInstancedDataAEMU = (glDrawElementsInstancedDataAEMU_client_proc_t) getProc("glDrawElementsInstancedDataAEMU", userData);
+	glDrawElementsInstancedOffsetAEMU = (glDrawElementsInstancedOffsetAEMU_client_proc_t) getProc("glDrawElementsInstancedOffsetAEMU", userData);
+	glDrawRangeElements = (glDrawRangeElements_client_proc_t) getProc("glDrawRangeElements", userData);
+	glDrawRangeElementsDataAEMU = (glDrawRangeElementsDataAEMU_client_proc_t) getProc("glDrawRangeElementsDataAEMU", userData);
+	glDrawRangeElementsOffsetAEMU = (glDrawRangeElementsOffsetAEMU_client_proc_t) getProc("glDrawRangeElementsOffsetAEMU", userData);
+	glFenceSync = (glFenceSync_client_proc_t) getProc("glFenceSync", userData);
+	glClientWaitSync = (glClientWaitSync_client_proc_t) getProc("glClientWaitSync", userData);
+	glWaitSync = (glWaitSync_client_proc_t) getProc("glWaitSync", userData);
+	glDeleteSync = (glDeleteSync_client_proc_t) getProc("glDeleteSync", userData);
+	glIsSync = (glIsSync_client_proc_t) getProc("glIsSync", userData);
+	glGetSynciv = (glGetSynciv_client_proc_t) getProc("glGetSynciv", userData);
+	glDrawBuffers = (glDrawBuffers_client_proc_t) getProc("glDrawBuffers", userData);
+	glReadBuffer = (glReadBuffer_client_proc_t) getProc("glReadBuffer", userData);
+	glBlitFramebuffer = (glBlitFramebuffer_client_proc_t) getProc("glBlitFramebuffer", userData);
+	glInvalidateFramebuffer = (glInvalidateFramebuffer_client_proc_t) getProc("glInvalidateFramebuffer", userData);
+	glInvalidateSubFramebuffer = (glInvalidateSubFramebuffer_client_proc_t) getProc("glInvalidateSubFramebuffer", userData);
+	glFramebufferTextureLayer = (glFramebufferTextureLayer_client_proc_t) getProc("glFramebufferTextureLayer", userData);
+	glRenderbufferStorageMultisample = (glRenderbufferStorageMultisample_client_proc_t) getProc("glRenderbufferStorageMultisample", userData);
+	glTexStorage2D = (glTexStorage2D_client_proc_t) getProc("glTexStorage2D", userData);
+	glGetInternalformativ = (glGetInternalformativ_client_proc_t) getProc("glGetInternalformativ", userData);
+	glBeginTransformFeedback = (glBeginTransformFeedback_client_proc_t) getProc("glBeginTransformFeedback", userData);
+	glEndTransformFeedback = (glEndTransformFeedback_client_proc_t) getProc("glEndTransformFeedback", userData);
+	glGenTransformFeedbacks = (glGenTransformFeedbacks_client_proc_t) getProc("glGenTransformFeedbacks", userData);
+	glDeleteTransformFeedbacks = (glDeleteTransformFeedbacks_client_proc_t) getProc("glDeleteTransformFeedbacks", userData);
+	glBindTransformFeedback = (glBindTransformFeedback_client_proc_t) getProc("glBindTransformFeedback", userData);
+	glPauseTransformFeedback = (glPauseTransformFeedback_client_proc_t) getProc("glPauseTransformFeedback", userData);
+	glResumeTransformFeedback = (glResumeTransformFeedback_client_proc_t) getProc("glResumeTransformFeedback", userData);
+	glIsTransformFeedback = (glIsTransformFeedback_client_proc_t) getProc("glIsTransformFeedback", userData);
+	glTransformFeedbackVaryings = (glTransformFeedbackVaryings_client_proc_t) getProc("glTransformFeedbackVaryings", userData);
+	glTransformFeedbackVaryingsAEMU = (glTransformFeedbackVaryingsAEMU_client_proc_t) getProc("glTransformFeedbackVaryingsAEMU", userData);
+	glGetTransformFeedbackVarying = (glGetTransformFeedbackVarying_client_proc_t) getProc("glGetTransformFeedbackVarying", userData);
+	glGenSamplers = (glGenSamplers_client_proc_t) getProc("glGenSamplers", userData);
+	glDeleteSamplers = (glDeleteSamplers_client_proc_t) getProc("glDeleteSamplers", userData);
+	glBindSampler = (glBindSampler_client_proc_t) getProc("glBindSampler", userData);
+	glSamplerParameterf = (glSamplerParameterf_client_proc_t) getProc("glSamplerParameterf", userData);
+	glSamplerParameteri = (glSamplerParameteri_client_proc_t) getProc("glSamplerParameteri", userData);
+	glSamplerParameterfv = (glSamplerParameterfv_client_proc_t) getProc("glSamplerParameterfv", userData);
+	glSamplerParameteriv = (glSamplerParameteriv_client_proc_t) getProc("glSamplerParameteriv", userData);
+	glGetSamplerParameterfv = (glGetSamplerParameterfv_client_proc_t) getProc("glGetSamplerParameterfv", userData);
+	glGetSamplerParameteriv = (glGetSamplerParameteriv_client_proc_t) getProc("glGetSamplerParameteriv", userData);
+	glIsSampler = (glIsSampler_client_proc_t) getProc("glIsSampler", userData);
+	glGenQueries = (glGenQueries_client_proc_t) getProc("glGenQueries", userData);
+	glDeleteQueries = (glDeleteQueries_client_proc_t) getProc("glDeleteQueries", userData);
+	glBeginQuery = (glBeginQuery_client_proc_t) getProc("glBeginQuery", userData);
+	glEndQuery = (glEndQuery_client_proc_t) getProc("glEndQuery", userData);
+	glGetQueryiv = (glGetQueryiv_client_proc_t) getProc("glGetQueryiv", userData);
+	glGetQueryObjectuiv = (glGetQueryObjectuiv_client_proc_t) getProc("glGetQueryObjectuiv", userData);
+	glIsQuery = (glIsQuery_client_proc_t) getProc("glIsQuery", userData);
+	glProgramParameteri = (glProgramParameteri_client_proc_t) getProc("glProgramParameteri", userData);
+	glProgramBinary = (glProgramBinary_client_proc_t) getProc("glProgramBinary", userData);
+	glGetProgramBinary = (glGetProgramBinary_client_proc_t) getProc("glGetProgramBinary", userData);
+	glGetFragDataLocation = (glGetFragDataLocation_client_proc_t) getProc("glGetFragDataLocation", userData);
+	glGetInteger64v = (glGetInteger64v_client_proc_t) getProc("glGetInteger64v", userData);
+	glGetIntegeri_v = (glGetIntegeri_v_client_proc_t) getProc("glGetIntegeri_v", userData);
+	glGetInteger64i_v = (glGetInteger64i_v_client_proc_t) getProc("glGetInteger64i_v", userData);
+	glTexImage3D = (glTexImage3D_client_proc_t) getProc("glTexImage3D", userData);
+	glTexImage3DOffsetAEMU = (glTexImage3DOffsetAEMU_client_proc_t) getProc("glTexImage3DOffsetAEMU", userData);
+	glTexStorage3D = (glTexStorage3D_client_proc_t) getProc("glTexStorage3D", userData);
+	glTexSubImage3D = (glTexSubImage3D_client_proc_t) getProc("glTexSubImage3D", userData);
+	glTexSubImage3DOffsetAEMU = (glTexSubImage3DOffsetAEMU_client_proc_t) getProc("glTexSubImage3DOffsetAEMU", userData);
+	glCompressedTexImage3D = (glCompressedTexImage3D_client_proc_t) getProc("glCompressedTexImage3D", userData);
+	glCompressedTexImage3DOffsetAEMU = (glCompressedTexImage3DOffsetAEMU_client_proc_t) getProc("glCompressedTexImage3DOffsetAEMU", userData);
+	glCompressedTexSubImage3D = (glCompressedTexSubImage3D_client_proc_t) getProc("glCompressedTexSubImage3D", userData);
+	glCompressedTexSubImage3DOffsetAEMU = (glCompressedTexSubImage3DOffsetAEMU_client_proc_t) getProc("glCompressedTexSubImage3DOffsetAEMU", userData);
+	glCopyTexSubImage3D = (glCopyTexSubImage3D_client_proc_t) getProc("glCopyTexSubImage3D", userData);
+	glGetStringi = (glGetStringi_client_proc_t) getProc("glGetStringi", userData);
+	glGetBooleani_v = (glGetBooleani_v_client_proc_t) getProc("glGetBooleani_v", userData);
+	glMemoryBarrier = (glMemoryBarrier_client_proc_t) getProc("glMemoryBarrier", userData);
+	glMemoryBarrierByRegion = (glMemoryBarrierByRegion_client_proc_t) getProc("glMemoryBarrierByRegion", userData);
+	glGenProgramPipelines = (glGenProgramPipelines_client_proc_t) getProc("glGenProgramPipelines", userData);
+	glDeleteProgramPipelines = (glDeleteProgramPipelines_client_proc_t) getProc("glDeleteProgramPipelines", userData);
+	glBindProgramPipeline = (glBindProgramPipeline_client_proc_t) getProc("glBindProgramPipeline", userData);
+	glGetProgramPipelineiv = (glGetProgramPipelineiv_client_proc_t) getProc("glGetProgramPipelineiv", userData);
+	glGetProgramPipelineInfoLog = (glGetProgramPipelineInfoLog_client_proc_t) getProc("glGetProgramPipelineInfoLog", userData);
+	glValidateProgramPipeline = (glValidateProgramPipeline_client_proc_t) getProc("glValidateProgramPipeline", userData);
+	glIsProgramPipeline = (glIsProgramPipeline_client_proc_t) getProc("glIsProgramPipeline", userData);
+	glUseProgramStages = (glUseProgramStages_client_proc_t) getProc("glUseProgramStages", userData);
+	glCreateShaderProgramv = (glCreateShaderProgramv_client_proc_t) getProc("glCreateShaderProgramv", userData);
+	glCreateShaderProgramvAEMU = (glCreateShaderProgramvAEMU_client_proc_t) getProc("glCreateShaderProgramvAEMU", userData);
+	glProgramUniform1f = (glProgramUniform1f_client_proc_t) getProc("glProgramUniform1f", userData);
+	glProgramUniform2f = (glProgramUniform2f_client_proc_t) getProc("glProgramUniform2f", userData);
+	glProgramUniform3f = (glProgramUniform3f_client_proc_t) getProc("glProgramUniform3f", userData);
+	glProgramUniform4f = (glProgramUniform4f_client_proc_t) getProc("glProgramUniform4f", userData);
+	glProgramUniform1i = (glProgramUniform1i_client_proc_t) getProc("glProgramUniform1i", userData);
+	glProgramUniform2i = (glProgramUniform2i_client_proc_t) getProc("glProgramUniform2i", userData);
+	glProgramUniform3i = (glProgramUniform3i_client_proc_t) getProc("glProgramUniform3i", userData);
+	glProgramUniform4i = (glProgramUniform4i_client_proc_t) getProc("glProgramUniform4i", userData);
+	glProgramUniform1ui = (glProgramUniform1ui_client_proc_t) getProc("glProgramUniform1ui", userData);
+	glProgramUniform2ui = (glProgramUniform2ui_client_proc_t) getProc("glProgramUniform2ui", userData);
+	glProgramUniform3ui = (glProgramUniform3ui_client_proc_t) getProc("glProgramUniform3ui", userData);
+	glProgramUniform4ui = (glProgramUniform4ui_client_proc_t) getProc("glProgramUniform4ui", userData);
+	glProgramUniform1fv = (glProgramUniform1fv_client_proc_t) getProc("glProgramUniform1fv", userData);
+	glProgramUniform2fv = (glProgramUniform2fv_client_proc_t) getProc("glProgramUniform2fv", userData);
+	glProgramUniform3fv = (glProgramUniform3fv_client_proc_t) getProc("glProgramUniform3fv", userData);
+	glProgramUniform4fv = (glProgramUniform4fv_client_proc_t) getProc("glProgramUniform4fv", userData);
+	glProgramUniform1iv = (glProgramUniform1iv_client_proc_t) getProc("glProgramUniform1iv", userData);
+	glProgramUniform2iv = (glProgramUniform2iv_client_proc_t) getProc("glProgramUniform2iv", userData);
+	glProgramUniform3iv = (glProgramUniform3iv_client_proc_t) getProc("glProgramUniform3iv", userData);
+	glProgramUniform4iv = (glProgramUniform4iv_client_proc_t) getProc("glProgramUniform4iv", userData);
+	glProgramUniform1uiv = (glProgramUniform1uiv_client_proc_t) getProc("glProgramUniform1uiv", userData);
+	glProgramUniform2uiv = (glProgramUniform2uiv_client_proc_t) getProc("glProgramUniform2uiv", userData);
+	glProgramUniform3uiv = (glProgramUniform3uiv_client_proc_t) getProc("glProgramUniform3uiv", userData);
+	glProgramUniform4uiv = (glProgramUniform4uiv_client_proc_t) getProc("glProgramUniform4uiv", userData);
+	glProgramUniformMatrix2fv = (glProgramUniformMatrix2fv_client_proc_t) getProc("glProgramUniformMatrix2fv", userData);
+	glProgramUniformMatrix3fv = (glProgramUniformMatrix3fv_client_proc_t) getProc("glProgramUniformMatrix3fv", userData);
+	glProgramUniformMatrix4fv = (glProgramUniformMatrix4fv_client_proc_t) getProc("glProgramUniformMatrix4fv", userData);
+	glProgramUniformMatrix2x3fv = (glProgramUniformMatrix2x3fv_client_proc_t) getProc("glProgramUniformMatrix2x3fv", userData);
+	glProgramUniformMatrix3x2fv = (glProgramUniformMatrix3x2fv_client_proc_t) getProc("glProgramUniformMatrix3x2fv", userData);
+	glProgramUniformMatrix2x4fv = (glProgramUniformMatrix2x4fv_client_proc_t) getProc("glProgramUniformMatrix2x4fv", userData);
+	glProgramUniformMatrix4x2fv = (glProgramUniformMatrix4x2fv_client_proc_t) getProc("glProgramUniformMatrix4x2fv", userData);
+	glProgramUniformMatrix3x4fv = (glProgramUniformMatrix3x4fv_client_proc_t) getProc("glProgramUniformMatrix3x4fv", userData);
+	glProgramUniformMatrix4x3fv = (glProgramUniformMatrix4x3fv_client_proc_t) getProc("glProgramUniformMatrix4x3fv", userData);
+	glGetProgramInterfaceiv = (glGetProgramInterfaceiv_client_proc_t) getProc("glGetProgramInterfaceiv", userData);
+	glGetProgramResourceiv = (glGetProgramResourceiv_client_proc_t) getProc("glGetProgramResourceiv", userData);
+	glGetProgramResourceIndex = (glGetProgramResourceIndex_client_proc_t) getProc("glGetProgramResourceIndex", userData);
+	glGetProgramResourceLocation = (glGetProgramResourceLocation_client_proc_t) getProc("glGetProgramResourceLocation", userData);
+	glGetProgramResourceName = (glGetProgramResourceName_client_proc_t) getProc("glGetProgramResourceName", userData);
+	glBindImageTexture = (glBindImageTexture_client_proc_t) getProc("glBindImageTexture", userData);
+	glDispatchCompute = (glDispatchCompute_client_proc_t) getProc("glDispatchCompute", userData);
+	glDispatchComputeIndirect = (glDispatchComputeIndirect_client_proc_t) getProc("glDispatchComputeIndirect", userData);
+	glBindVertexBuffer = (glBindVertexBuffer_client_proc_t) getProc("glBindVertexBuffer", userData);
+	glVertexAttribBinding = (glVertexAttribBinding_client_proc_t) getProc("glVertexAttribBinding", userData);
+	glVertexAttribFormat = (glVertexAttribFormat_client_proc_t) getProc("glVertexAttribFormat", userData);
+	glVertexAttribIFormat = (glVertexAttribIFormat_client_proc_t) getProc("glVertexAttribIFormat", userData);
+	glVertexBindingDivisor = (glVertexBindingDivisor_client_proc_t) getProc("glVertexBindingDivisor", userData);
+	glDrawArraysIndirect = (glDrawArraysIndirect_client_proc_t) getProc("glDrawArraysIndirect", userData);
+	glDrawArraysIndirectDataAEMU = (glDrawArraysIndirectDataAEMU_client_proc_t) getProc("glDrawArraysIndirectDataAEMU", userData);
+	glDrawArraysIndirectOffsetAEMU = (glDrawArraysIndirectOffsetAEMU_client_proc_t) getProc("glDrawArraysIndirectOffsetAEMU", userData);
+	glDrawElementsIndirect = (glDrawElementsIndirect_client_proc_t) getProc("glDrawElementsIndirect", userData);
+	glDrawElementsIndirectDataAEMU = (glDrawElementsIndirectDataAEMU_client_proc_t) getProc("glDrawElementsIndirectDataAEMU", userData);
+	glDrawElementsIndirectOffsetAEMU = (glDrawElementsIndirectOffsetAEMU_client_proc_t) getProc("glDrawElementsIndirectOffsetAEMU", userData);
+	glTexStorage2DMultisample = (glTexStorage2DMultisample_client_proc_t) getProc("glTexStorage2DMultisample", userData);
+	glSampleMaski = (glSampleMaski_client_proc_t) getProc("glSampleMaski", userData);
+	glGetMultisamplefv = (glGetMultisamplefv_client_proc_t) getProc("glGetMultisamplefv", userData);
+	glFramebufferParameteri = (glFramebufferParameteri_client_proc_t) getProc("glFramebufferParameteri", userData);
+	glGetFramebufferParameteriv = (glGetFramebufferParameteriv_client_proc_t) getProc("glGetFramebufferParameteriv", userData);
+	glGetTexLevelParameterfv = (glGetTexLevelParameterfv_client_proc_t) getProc("glGetTexLevelParameterfv", userData);
+	glGetTexLevelParameteriv = (glGetTexLevelParameteriv_client_proc_t) getProc("glGetTexLevelParameteriv", userData);
 	return 0;
 }
 
diff --git a/system/GLESv2_enc/gl2_client_context.h b/system/GLESv2_enc/gl2_client_context.h
index 5d8b653..c82a662 100644
--- a/system/GLESv2_enc/gl2_client_context.h
+++ b/system/GLESv2_enc/gl2_client_context.h
@@ -218,6 +218,202 @@
 	glGetCompressedTextureFormats_client_proc_t glGetCompressedTextureFormats;
 	glShaderString_client_proc_t glShaderString;
 	glFinishRoundTrip_client_proc_t glFinishRoundTrip;
+	glGenVertexArrays_client_proc_t glGenVertexArrays;
+	glBindVertexArray_client_proc_t glBindVertexArray;
+	glDeleteVertexArrays_client_proc_t glDeleteVertexArrays;
+	glIsVertexArray_client_proc_t glIsVertexArray;
+	glMapBufferRange_client_proc_t glMapBufferRange;
+	glUnmapBuffer_client_proc_t glUnmapBuffer;
+	glFlushMappedBufferRange_client_proc_t glFlushMappedBufferRange;
+	glMapBufferRangeAEMU_client_proc_t glMapBufferRangeAEMU;
+	glUnmapBufferAEMU_client_proc_t glUnmapBufferAEMU;
+	glFlushMappedBufferRangeAEMU_client_proc_t glFlushMappedBufferRangeAEMU;
+	glReadPixelsOffsetAEMU_client_proc_t glReadPixelsOffsetAEMU;
+	glCompressedTexImage2DOffsetAEMU_client_proc_t glCompressedTexImage2DOffsetAEMU;
+	glCompressedTexSubImage2DOffsetAEMU_client_proc_t glCompressedTexSubImage2DOffsetAEMU;
+	glTexImage2DOffsetAEMU_client_proc_t glTexImage2DOffsetAEMU;
+	glTexSubImage2DOffsetAEMU_client_proc_t glTexSubImage2DOffsetAEMU;
+	glBindBufferRange_client_proc_t glBindBufferRange;
+	glBindBufferBase_client_proc_t glBindBufferBase;
+	glCopyBufferSubData_client_proc_t glCopyBufferSubData;
+	glClearBufferiv_client_proc_t glClearBufferiv;
+	glClearBufferuiv_client_proc_t glClearBufferuiv;
+	glClearBufferfv_client_proc_t glClearBufferfv;
+	glClearBufferfi_client_proc_t glClearBufferfi;
+	glGetBufferParameteri64v_client_proc_t glGetBufferParameteri64v;
+	glGetBufferPointerv_client_proc_t glGetBufferPointerv;
+	glUniformBlockBinding_client_proc_t glUniformBlockBinding;
+	glGetUniformBlockIndex_client_proc_t glGetUniformBlockIndex;
+	glGetUniformIndices_client_proc_t glGetUniformIndices;
+	glGetUniformIndicesAEMU_client_proc_t glGetUniformIndicesAEMU;
+	glGetActiveUniformBlockiv_client_proc_t glGetActiveUniformBlockiv;
+	glGetActiveUniformBlockName_client_proc_t glGetActiveUniformBlockName;
+	glUniform1ui_client_proc_t glUniform1ui;
+	glUniform2ui_client_proc_t glUniform2ui;
+	glUniform3ui_client_proc_t glUniform3ui;
+	glUniform4ui_client_proc_t glUniform4ui;
+	glUniform1uiv_client_proc_t glUniform1uiv;
+	glUniform2uiv_client_proc_t glUniform2uiv;
+	glUniform3uiv_client_proc_t glUniform3uiv;
+	glUniform4uiv_client_proc_t glUniform4uiv;
+	glUniformMatrix2x3fv_client_proc_t glUniformMatrix2x3fv;
+	glUniformMatrix3x2fv_client_proc_t glUniformMatrix3x2fv;
+	glUniformMatrix2x4fv_client_proc_t glUniformMatrix2x4fv;
+	glUniformMatrix4x2fv_client_proc_t glUniformMatrix4x2fv;
+	glUniformMatrix3x4fv_client_proc_t glUniformMatrix3x4fv;
+	glUniformMatrix4x3fv_client_proc_t glUniformMatrix4x3fv;
+	glGetUniformuiv_client_proc_t glGetUniformuiv;
+	glGetActiveUniformsiv_client_proc_t glGetActiveUniformsiv;
+	glVertexAttribI4i_client_proc_t glVertexAttribI4i;
+	glVertexAttribI4ui_client_proc_t glVertexAttribI4ui;
+	glVertexAttribI4iv_client_proc_t glVertexAttribI4iv;
+	glVertexAttribI4uiv_client_proc_t glVertexAttribI4uiv;
+	glVertexAttribIPointer_client_proc_t glVertexAttribIPointer;
+	glVertexAttribIPointerOffsetAEMU_client_proc_t glVertexAttribIPointerOffsetAEMU;
+	glVertexAttribIPointerDataAEMU_client_proc_t glVertexAttribIPointerDataAEMU;
+	glGetVertexAttribIiv_client_proc_t glGetVertexAttribIiv;
+	glGetVertexAttribIuiv_client_proc_t glGetVertexAttribIuiv;
+	glVertexAttribDivisor_client_proc_t glVertexAttribDivisor;
+	glDrawArraysInstanced_client_proc_t glDrawArraysInstanced;
+	glDrawElementsInstanced_client_proc_t glDrawElementsInstanced;
+	glDrawElementsInstancedDataAEMU_client_proc_t glDrawElementsInstancedDataAEMU;
+	glDrawElementsInstancedOffsetAEMU_client_proc_t glDrawElementsInstancedOffsetAEMU;
+	glDrawRangeElements_client_proc_t glDrawRangeElements;
+	glDrawRangeElementsDataAEMU_client_proc_t glDrawRangeElementsDataAEMU;
+	glDrawRangeElementsOffsetAEMU_client_proc_t glDrawRangeElementsOffsetAEMU;
+	glFenceSync_client_proc_t glFenceSync;
+	glClientWaitSync_client_proc_t glClientWaitSync;
+	glWaitSync_client_proc_t glWaitSync;
+	glDeleteSync_client_proc_t glDeleteSync;
+	glIsSync_client_proc_t glIsSync;
+	glGetSynciv_client_proc_t glGetSynciv;
+	glDrawBuffers_client_proc_t glDrawBuffers;
+	glReadBuffer_client_proc_t glReadBuffer;
+	glBlitFramebuffer_client_proc_t glBlitFramebuffer;
+	glInvalidateFramebuffer_client_proc_t glInvalidateFramebuffer;
+	glInvalidateSubFramebuffer_client_proc_t glInvalidateSubFramebuffer;
+	glFramebufferTextureLayer_client_proc_t glFramebufferTextureLayer;
+	glRenderbufferStorageMultisample_client_proc_t glRenderbufferStorageMultisample;
+	glTexStorage2D_client_proc_t glTexStorage2D;
+	glGetInternalformativ_client_proc_t glGetInternalformativ;
+	glBeginTransformFeedback_client_proc_t glBeginTransformFeedback;
+	glEndTransformFeedback_client_proc_t glEndTransformFeedback;
+	glGenTransformFeedbacks_client_proc_t glGenTransformFeedbacks;
+	glDeleteTransformFeedbacks_client_proc_t glDeleteTransformFeedbacks;
+	glBindTransformFeedback_client_proc_t glBindTransformFeedback;
+	glPauseTransformFeedback_client_proc_t glPauseTransformFeedback;
+	glResumeTransformFeedback_client_proc_t glResumeTransformFeedback;
+	glIsTransformFeedback_client_proc_t glIsTransformFeedback;
+	glTransformFeedbackVaryings_client_proc_t glTransformFeedbackVaryings;
+	glTransformFeedbackVaryingsAEMU_client_proc_t glTransformFeedbackVaryingsAEMU;
+	glGetTransformFeedbackVarying_client_proc_t glGetTransformFeedbackVarying;
+	glGenSamplers_client_proc_t glGenSamplers;
+	glDeleteSamplers_client_proc_t glDeleteSamplers;
+	glBindSampler_client_proc_t glBindSampler;
+	glSamplerParameterf_client_proc_t glSamplerParameterf;
+	glSamplerParameteri_client_proc_t glSamplerParameteri;
+	glSamplerParameterfv_client_proc_t glSamplerParameterfv;
+	glSamplerParameteriv_client_proc_t glSamplerParameteriv;
+	glGetSamplerParameterfv_client_proc_t glGetSamplerParameterfv;
+	glGetSamplerParameteriv_client_proc_t glGetSamplerParameteriv;
+	glIsSampler_client_proc_t glIsSampler;
+	glGenQueries_client_proc_t glGenQueries;
+	glDeleteQueries_client_proc_t glDeleteQueries;
+	glBeginQuery_client_proc_t glBeginQuery;
+	glEndQuery_client_proc_t glEndQuery;
+	glGetQueryiv_client_proc_t glGetQueryiv;
+	glGetQueryObjectuiv_client_proc_t glGetQueryObjectuiv;
+	glIsQuery_client_proc_t glIsQuery;
+	glProgramParameteri_client_proc_t glProgramParameteri;
+	glProgramBinary_client_proc_t glProgramBinary;
+	glGetProgramBinary_client_proc_t glGetProgramBinary;
+	glGetFragDataLocation_client_proc_t glGetFragDataLocation;
+	glGetInteger64v_client_proc_t glGetInteger64v;
+	glGetIntegeri_v_client_proc_t glGetIntegeri_v;
+	glGetInteger64i_v_client_proc_t glGetInteger64i_v;
+	glTexImage3D_client_proc_t glTexImage3D;
+	glTexImage3DOffsetAEMU_client_proc_t glTexImage3DOffsetAEMU;
+	glTexStorage3D_client_proc_t glTexStorage3D;
+	glTexSubImage3D_client_proc_t glTexSubImage3D;
+	glTexSubImage3DOffsetAEMU_client_proc_t glTexSubImage3DOffsetAEMU;
+	glCompressedTexImage3D_client_proc_t glCompressedTexImage3D;
+	glCompressedTexImage3DOffsetAEMU_client_proc_t glCompressedTexImage3DOffsetAEMU;
+	glCompressedTexSubImage3D_client_proc_t glCompressedTexSubImage3D;
+	glCompressedTexSubImage3DOffsetAEMU_client_proc_t glCompressedTexSubImage3DOffsetAEMU;
+	glCopyTexSubImage3D_client_proc_t glCopyTexSubImage3D;
+	glGetStringi_client_proc_t glGetStringi;
+	glGetBooleani_v_client_proc_t glGetBooleani_v;
+	glMemoryBarrier_client_proc_t glMemoryBarrier;
+	glMemoryBarrierByRegion_client_proc_t glMemoryBarrierByRegion;
+	glGenProgramPipelines_client_proc_t glGenProgramPipelines;
+	glDeleteProgramPipelines_client_proc_t glDeleteProgramPipelines;
+	glBindProgramPipeline_client_proc_t glBindProgramPipeline;
+	glGetProgramPipelineiv_client_proc_t glGetProgramPipelineiv;
+	glGetProgramPipelineInfoLog_client_proc_t glGetProgramPipelineInfoLog;
+	glValidateProgramPipeline_client_proc_t glValidateProgramPipeline;
+	glIsProgramPipeline_client_proc_t glIsProgramPipeline;
+	glUseProgramStages_client_proc_t glUseProgramStages;
+	glCreateShaderProgramv_client_proc_t glCreateShaderProgramv;
+	glCreateShaderProgramvAEMU_client_proc_t glCreateShaderProgramvAEMU;
+	glProgramUniform1f_client_proc_t glProgramUniform1f;
+	glProgramUniform2f_client_proc_t glProgramUniform2f;
+	glProgramUniform3f_client_proc_t glProgramUniform3f;
+	glProgramUniform4f_client_proc_t glProgramUniform4f;
+	glProgramUniform1i_client_proc_t glProgramUniform1i;
+	glProgramUniform2i_client_proc_t glProgramUniform2i;
+	glProgramUniform3i_client_proc_t glProgramUniform3i;
+	glProgramUniform4i_client_proc_t glProgramUniform4i;
+	glProgramUniform1ui_client_proc_t glProgramUniform1ui;
+	glProgramUniform2ui_client_proc_t glProgramUniform2ui;
+	glProgramUniform3ui_client_proc_t glProgramUniform3ui;
+	glProgramUniform4ui_client_proc_t glProgramUniform4ui;
+	glProgramUniform1fv_client_proc_t glProgramUniform1fv;
+	glProgramUniform2fv_client_proc_t glProgramUniform2fv;
+	glProgramUniform3fv_client_proc_t glProgramUniform3fv;
+	glProgramUniform4fv_client_proc_t glProgramUniform4fv;
+	glProgramUniform1iv_client_proc_t glProgramUniform1iv;
+	glProgramUniform2iv_client_proc_t glProgramUniform2iv;
+	glProgramUniform3iv_client_proc_t glProgramUniform3iv;
+	glProgramUniform4iv_client_proc_t glProgramUniform4iv;
+	glProgramUniform1uiv_client_proc_t glProgramUniform1uiv;
+	glProgramUniform2uiv_client_proc_t glProgramUniform2uiv;
+	glProgramUniform3uiv_client_proc_t glProgramUniform3uiv;
+	glProgramUniform4uiv_client_proc_t glProgramUniform4uiv;
+	glProgramUniformMatrix2fv_client_proc_t glProgramUniformMatrix2fv;
+	glProgramUniformMatrix3fv_client_proc_t glProgramUniformMatrix3fv;
+	glProgramUniformMatrix4fv_client_proc_t glProgramUniformMatrix4fv;
+	glProgramUniformMatrix2x3fv_client_proc_t glProgramUniformMatrix2x3fv;
+	glProgramUniformMatrix3x2fv_client_proc_t glProgramUniformMatrix3x2fv;
+	glProgramUniformMatrix2x4fv_client_proc_t glProgramUniformMatrix2x4fv;
+	glProgramUniformMatrix4x2fv_client_proc_t glProgramUniformMatrix4x2fv;
+	glProgramUniformMatrix3x4fv_client_proc_t glProgramUniformMatrix3x4fv;
+	glProgramUniformMatrix4x3fv_client_proc_t glProgramUniformMatrix4x3fv;
+	glGetProgramInterfaceiv_client_proc_t glGetProgramInterfaceiv;
+	glGetProgramResourceiv_client_proc_t glGetProgramResourceiv;
+	glGetProgramResourceIndex_client_proc_t glGetProgramResourceIndex;
+	glGetProgramResourceLocation_client_proc_t glGetProgramResourceLocation;
+	glGetProgramResourceName_client_proc_t glGetProgramResourceName;
+	glBindImageTexture_client_proc_t glBindImageTexture;
+	glDispatchCompute_client_proc_t glDispatchCompute;
+	glDispatchComputeIndirect_client_proc_t glDispatchComputeIndirect;
+	glBindVertexBuffer_client_proc_t glBindVertexBuffer;
+	glVertexAttribBinding_client_proc_t glVertexAttribBinding;
+	glVertexAttribFormat_client_proc_t glVertexAttribFormat;
+	glVertexAttribIFormat_client_proc_t glVertexAttribIFormat;
+	glVertexBindingDivisor_client_proc_t glVertexBindingDivisor;
+	glDrawArraysIndirect_client_proc_t glDrawArraysIndirect;
+	glDrawArraysIndirectDataAEMU_client_proc_t glDrawArraysIndirectDataAEMU;
+	glDrawArraysIndirectOffsetAEMU_client_proc_t glDrawArraysIndirectOffsetAEMU;
+	glDrawElementsIndirect_client_proc_t glDrawElementsIndirect;
+	glDrawElementsIndirectDataAEMU_client_proc_t glDrawElementsIndirectDataAEMU;
+	glDrawElementsIndirectOffsetAEMU_client_proc_t glDrawElementsIndirectOffsetAEMU;
+	glTexStorage2DMultisample_client_proc_t glTexStorage2DMultisample;
+	glSampleMaski_client_proc_t glSampleMaski;
+	glGetMultisamplefv_client_proc_t glGetMultisamplefv;
+	glFramebufferParameteri_client_proc_t glFramebufferParameteri;
+	glGetFramebufferParameteriv_client_proc_t glGetFramebufferParameteriv;
+	glGetTexLevelParameterfv_client_proc_t glGetTexLevelParameterfv;
+	glGetTexLevelParameteriv_client_proc_t glGetTexLevelParameteriv;
 	virtual ~gl2_client_context_t() {}
 
 	typedef gl2_client_context_t *CONTEXT_ACCESSOR_TYPE(void);
diff --git a/system/GLESv2_enc/gl2_client_proc.h b/system/GLESv2_enc/gl2_client_proc.h
index 445910d..b04efd5 100644
--- a/system/GLESv2_enc/gl2_client_proc.h
+++ b/system/GLESv2_enc/gl2_client_proc.h
@@ -217,6 +217,202 @@
 typedef void (gl2_APIENTRY *glGetCompressedTextureFormats_client_proc_t) (void * ctx, int, GLint*);
 typedef void (gl2_APIENTRY *glShaderString_client_proc_t) (void * ctx, GLuint, const GLchar*, GLsizei);
 typedef int (gl2_APIENTRY *glFinishRoundTrip_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glGenVertexArrays_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glBindVertexArray_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glDeleteVertexArrays_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsVertexArray_client_proc_t) (void * ctx, GLuint);
+typedef void* (gl2_APIENTRY *glMapBufferRange_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield);
+typedef GLboolean (gl2_APIENTRY *glUnmapBuffer_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRange_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glMapBufferRangeAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*);
+typedef void (gl2_APIENTRY *glUnmapBufferAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*, GLboolean*);
+typedef void (gl2_APIENTRY *glFlushMappedBufferRangeAEMU_client_proc_t) (void * ctx, GLenum, GLintptr, GLsizeiptr, GLbitfield, void*);
+typedef void (gl2_APIENTRY *glReadPixelsOffsetAEMU_client_proc_t) (void * ctx, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLint, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glTexImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLint, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexSubImage2DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glBindBufferRange_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glBindBufferBase_client_proc_t) (void * ctx, GLenum, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glCopyBufferSubData_client_proc_t) (void * ctx, GLenum, GLenum, GLintptr, GLintptr, GLsizeiptr);
+typedef void (gl2_APIENTRY *glClearBufferiv_client_proc_t) (void * ctx, GLenum, GLint, const GLint*);
+typedef void (gl2_APIENTRY *glClearBufferuiv_client_proc_t) (void * ctx, GLenum, GLint, const GLuint*);
+typedef void (gl2_APIENTRY *glClearBufferfv_client_proc_t) (void * ctx, GLenum, GLint, const GLfloat*);
+typedef void (gl2_APIENTRY *glClearBufferfi_client_proc_t) (void * ctx, GLenum, GLint, GLfloat, GLint);
+typedef void (gl2_APIENTRY *glGetBufferParameteri64v_client_proc_t) (void * ctx, GLenum, GLenum, GLint64*);
+typedef void (gl2_APIENTRY *glGetBufferPointerv_client_proc_t) (void * ctx, GLenum, GLenum, GLvoid**);
+typedef void (gl2_APIENTRY *glUniformBlockBinding_client_proc_t) (void * ctx, GLuint, GLuint, GLuint);
+typedef GLuint (gl2_APIENTRY *glGetUniformBlockIndex_client_proc_t) (void * ctx, GLuint, const GLchar*);
+typedef void (gl2_APIENTRY *glGetUniformIndices_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar**, GLuint*);
+typedef void (gl2_APIENTRY *glGetUniformIndicesAEMU_client_proc_t) (void * ctx, GLuint, GLsizei, const GLchar*, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformBlockiv_client_proc_t) (void * ctx, GLuint, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformBlockName_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glUniform1ui_client_proc_t) (void * ctx, GLint, GLuint);
+typedef void (gl2_APIENTRY *glUniform2ui_client_proc_t) (void * ctx, GLint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform3ui_client_proc_t) (void * ctx, GLint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform4ui_client_proc_t) (void * ctx, GLint, GLint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glUniform1uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform2uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform3uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniform4uiv_client_proc_t) (void * ctx, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glUniformMatrix2x3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix3x2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix2x4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix4x2fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix3x4fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glUniformMatrix4x3fv_client_proc_t) (void * ctx, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glGetUniformuiv_client_proc_t) (void * ctx, GLuint, GLint, GLuint*);
+typedef void (gl2_APIENTRY *glGetActiveUniformsiv_client_proc_t) (void * ctx, GLuint, GLsizei, const GLuint*, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glVertexAttribI4i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glVertexAttribI4ui_client_proc_t) (void * ctx, GLuint, GLuint, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribI4iv_client_proc_t) (void * ctx, GLuint, const GLint*);
+typedef void (gl2_APIENTRY *glVertexAttribI4uiv_client_proc_t) (void * ctx, GLuint, const GLuint*);
+typedef void (gl2_APIENTRY *glVertexAttribIPointer_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glVertexAttribIPointerOffsetAEMU_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribIPointerDataAEMU_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLsizei, void*, GLuint);
+typedef void (gl2_APIENTRY *glGetVertexAttribIiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetVertexAttribIuiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint*);
+typedef void (gl2_APIENTRY *glVertexAttribDivisor_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysInstanced_client_proc_t) (void * ctx, GLenum, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstanced_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const void*, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstancedDataAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, const void*, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glDrawElementsInstancedOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLuint, GLsizei);
+typedef void (gl2_APIENTRY *glDrawRangeElements_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glDrawRangeElementsDataAEMU_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, const GLvoid*, GLsizei);
+typedef void (gl2_APIENTRY *glDrawRangeElementsOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLuint, GLuint, GLsizei, GLenum, GLuint);
+typedef GLsync (gl2_APIENTRY *glFenceSync_client_proc_t) (void * ctx, GLenum, GLbitfield);
+typedef GLenum (gl2_APIENTRY *glClientWaitSync_client_proc_t) (void * ctx, GLsync, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glWaitSync_client_proc_t) (void * ctx, GLsync, GLbitfield, GLuint64);
+typedef void (gl2_APIENTRY *glDeleteSync_client_proc_t) (void * ctx, GLsync);
+typedef GLboolean (gl2_APIENTRY *glIsSync_client_proc_t) (void * ctx, GLsync);
+typedef void (gl2_APIENTRY *glGetSynciv_client_proc_t) (void * ctx, GLsync, GLenum, GLsizei, GLsizei*, GLint*);
+typedef void (gl2_APIENTRY *glDrawBuffers_client_proc_t) (void * ctx, GLsizei, const GLenum*);
+typedef void (gl2_APIENTRY *glReadBuffer_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glBlitFramebuffer_client_proc_t) (void * ctx, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLint, GLbitfield, GLenum);
+typedef void (gl2_APIENTRY *glInvalidateFramebuffer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*);
+typedef void (gl2_APIENTRY *glInvalidateSubFramebuffer_client_proc_t) (void * ctx, GLenum, GLsizei, const GLenum*, GLint, GLint, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glFramebufferTextureLayer_client_proc_t) (void * ctx, GLenum, GLenum, GLuint, GLint, GLint);
+typedef void (gl2_APIENTRY *glRenderbufferStorageMultisample_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glTexStorage2D_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glGetInternalformativ_client_proc_t) (void * ctx, GLenum, GLenum, GLenum, GLsizei, GLint*);
+typedef void (gl2_APIENTRY *glBeginTransformFeedback_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glEndTransformFeedback_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glGenTransformFeedbacks_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteTransformFeedbacks_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindTransformFeedback_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glPauseTransformFeedback_client_proc_t) (void * ctx);
+typedef void (gl2_APIENTRY *glResumeTransformFeedback_client_proc_t) (void * ctx);
+typedef GLboolean (gl2_APIENTRY *glIsTransformFeedback_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glTransformFeedbackVaryings_client_proc_t) (void * ctx, GLuint, GLsizei, const char**, GLenum);
+typedef void (gl2_APIENTRY *glTransformFeedbackVaryingsAEMU_client_proc_t) (void * ctx, GLuint, GLsizei, const char*, GLuint, GLenum);
+typedef void (gl2_APIENTRY *glGetTransformFeedbackVarying_client_proc_t) (void * ctx, GLuint, GLuint, GLsizei, GLsizei*, GLsizei*, GLenum*, char*);
+typedef void (gl2_APIENTRY *glGenSamplers_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteSamplers_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindSampler_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glSamplerParameterf_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat);
+typedef void (gl2_APIENTRY *glSamplerParameteri_client_proc_t) (void * ctx, GLuint, GLenum, GLint);
+typedef void (gl2_APIENTRY *glSamplerParameterfv_client_proc_t) (void * ctx, GLuint, GLenum, const GLfloat*);
+typedef void (gl2_APIENTRY *glSamplerParameteriv_client_proc_t) (void * ctx, GLuint, GLenum, const GLint*);
+typedef void (gl2_APIENTRY *glGetSamplerParameterfv_client_proc_t) (void * ctx, GLuint, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetSamplerParameteriv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef GLboolean (gl2_APIENTRY *glIsSampler_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGenQueries_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteQueries_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBeginQuery_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glEndQuery_client_proc_t) (void * ctx, GLenum);
+typedef void (gl2_APIENTRY *glGetQueryiv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetQueryObjectuiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint*);
+typedef GLboolean (gl2_APIENTRY *glIsQuery_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glProgramParameteri_client_proc_t) (void * ctx, GLuint, GLenum, GLint);
+typedef void (gl2_APIENTRY *glProgramBinary_client_proc_t) (void * ctx, GLuint, GLenum, const void*, GLsizei);
+typedef void (gl2_APIENTRY *glGetProgramBinary_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLenum*, void*);
+typedef GLint (gl2_APIENTRY *glGetFragDataLocation_client_proc_t) (void * ctx, GLuint, const char*);
+typedef void (gl2_APIENTRY *glGetInteger64v_client_proc_t) (void * ctx, GLenum, GLint64*);
+typedef void (gl2_APIENTRY *glGetIntegeri_v_client_proc_t) (void * ctx, GLenum, GLuint, GLint*);
+typedef void (gl2_APIENTRY *glGetInteger64i_v_client_proc_t) (void * ctx, GLenum, GLuint, GLint64*);
+typedef void (gl2_APIENTRY *glTexImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLsizei, GLsizei, GLsizei, GLint, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexStorage3D_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLsizei);
+typedef void (gl2_APIENTRY *glTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, const GLvoid*);
+typedef void (gl2_APIENTRY *glTexSubImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLsizei, GLsizei, GLsizei, GLint, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, const GLvoid*);
+typedef void (gl2_APIENTRY *glCompressedTexSubImage3DOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLsizei, GLsizei, GLsizei, GLenum, GLsizei, GLuint);
+typedef void (gl2_APIENTRY *glCopyTexSubImage3D_client_proc_t) (void * ctx, GLenum, GLint, GLint, GLint, GLint, GLint, GLint, GLsizei, GLsizei);
+typedef const GLubyte* (gl2_APIENTRY *glGetStringi_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glGetBooleani_v_client_proc_t) (void * ctx, GLenum, GLuint, GLboolean*);
+typedef void (gl2_APIENTRY *glMemoryBarrier_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glMemoryBarrierByRegion_client_proc_t) (void * ctx, GLbitfield);
+typedef void (gl2_APIENTRY *glGenProgramPipelines_client_proc_t) (void * ctx, GLsizei, GLuint*);
+typedef void (gl2_APIENTRY *glDeleteProgramPipelines_client_proc_t) (void * ctx, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glBindProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glGetProgramPipelineiv_client_proc_t) (void * ctx, GLuint, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramPipelineInfoLog_client_proc_t) (void * ctx, GLuint, GLsizei, GLsizei*, GLchar*);
+typedef void (gl2_APIENTRY *glValidateProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef GLboolean (gl2_APIENTRY *glIsProgramPipeline_client_proc_t) (void * ctx, GLuint);
+typedef void (gl2_APIENTRY *glUseProgramStages_client_proc_t) (void * ctx, GLuint, GLbitfield, GLuint);
+typedef GLuint (gl2_APIENTRY *glCreateShaderProgramv_client_proc_t) (void * ctx, GLenum, GLsizei, const char**);
+typedef GLuint (gl2_APIENTRY *glCreateShaderProgramvAEMU_client_proc_t) (void * ctx, GLenum, GLsizei, const char*, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform1f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform2f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform3f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform4f_client_proc_t) (void * ctx, GLuint, GLint, GLfloat, GLfloat, GLfloat, GLfloat);
+typedef void (gl2_APIENTRY *glProgramUniform1i_client_proc_t) (void * ctx, GLuint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform2i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform3i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform4i_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint, GLint);
+typedef void (gl2_APIENTRY *glProgramUniform1ui_client_proc_t) (void * ctx, GLuint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform2ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform3ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform4ui_client_proc_t) (void * ctx, GLuint, GLint, GLint, GLint, GLint, GLuint);
+typedef void (gl2_APIENTRY *glProgramUniform1fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniform1iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform2iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform3iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform4iv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLint*);
+typedef void (gl2_APIENTRY *glProgramUniform1uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform2uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform3uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniform4uiv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, const GLuint*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2x3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3x2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix2x4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4x2fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix3x4fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glProgramUniformMatrix4x3fv_client_proc_t) (void * ctx, GLuint, GLint, GLsizei, GLboolean, const GLfloat*);
+typedef void (gl2_APIENTRY *glGetProgramInterfaceiv_client_proc_t) (void * ctx, GLuint, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetProgramResourceiv_client_proc_t) (void * ctx, GLuint, GLenum, GLuint, GLsizei, const GLenum*, GLsizei, GLsizei*, GLint*);
+typedef GLuint (gl2_APIENTRY *glGetProgramResourceIndex_client_proc_t) (void * ctx, GLuint, GLenum, const char*);
+typedef GLint (gl2_APIENTRY *glGetProgramResourceLocation_client_proc_t) (void * ctx, GLuint, GLenum, const char*);
+typedef void (gl2_APIENTRY *glGetProgramResourceName_client_proc_t) (void * ctx, GLuint, GLenum, GLuint, GLsizei, GLsizei*, char*);
+typedef void (gl2_APIENTRY *glBindImageTexture_client_proc_t) (void * ctx, GLuint, GLuint, GLint, GLboolean, GLint, GLenum, GLenum);
+typedef void (gl2_APIENTRY *glDispatchCompute_client_proc_t) (void * ctx, GLuint, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDispatchComputeIndirect_client_proc_t) (void * ctx, GLintptr);
+typedef void (gl2_APIENTRY *glBindVertexBuffer_client_proc_t) (void * ctx, GLuint, GLuint, GLintptr, GLintptr);
+typedef void (gl2_APIENTRY *glVertexAttribBinding_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribFormat_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLboolean, GLuint);
+typedef void (gl2_APIENTRY *glVertexAttribIFormat_client_proc_t) (void * ctx, GLuint, GLint, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glVertexBindingDivisor_client_proc_t) (void * ctx, GLuint, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysIndirect_client_proc_t) (void * ctx, GLenum, const void*);
+typedef void (gl2_APIENTRY *glDrawArraysIndirectDataAEMU_client_proc_t) (void * ctx, GLenum, const void*, GLuint);
+typedef void (gl2_APIENTRY *glDrawArraysIndirectOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsIndirect_client_proc_t) (void * ctx, GLenum, GLenum, const void*);
+typedef void (gl2_APIENTRY *glDrawElementsIndirectDataAEMU_client_proc_t) (void * ctx, GLenum, GLenum, const void*, GLuint);
+typedef void (gl2_APIENTRY *glDrawElementsIndirectOffsetAEMU_client_proc_t) (void * ctx, GLenum, GLenum, GLuint);
+typedef void (gl2_APIENTRY *glTexStorage2DMultisample_client_proc_t) (void * ctx, GLenum, GLsizei, GLenum, GLsizei, GLsizei, GLboolean);
+typedef void (gl2_APIENTRY *glSampleMaski_client_proc_t) (void * ctx, GLuint, GLbitfield);
+typedef void (gl2_APIENTRY *glGetMultisamplefv_client_proc_t) (void * ctx, GLenum, GLuint, GLfloat*);
+typedef void (gl2_APIENTRY *glFramebufferParameteri_client_proc_t) (void * ctx, GLenum, GLenum, GLint);
+typedef void (gl2_APIENTRY *glGetFramebufferParameteriv_client_proc_t) (void * ctx, GLenum, GLenum, GLint*);
+typedef void (gl2_APIENTRY *glGetTexLevelParameterfv_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLfloat*);
+typedef void (gl2_APIENTRY *glGetTexLevelParameteriv_client_proc_t) (void * ctx, GLenum, GLint, GLenum, GLint*);
 
 
 #endif
diff --git a/system/GLESv2_enc/gl2_enc.cpp b/system/GLESv2_enc/gl2_enc.cpp
index 983dfa7..8c44d91 100644
--- a/system/GLESv2_enc/gl2_enc.cpp
+++ b/system/GLESv2_enc/gl2_enc.cpp
@@ -5059,6 +5059,5957 @@
 	return retval;
 }
 
+void glGenVertexArrays_enc(void *self , GLsizei n, GLuint* arrays)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenVertexArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(arrays, __size_arrays);
+	if (useChecksum) checksumCalculator->addBuffer(arrays, __size_arrays);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenVertexArrays: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBindVertexArray_enc(void *self , GLuint array)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteVertexArrays_enc(void *self , GLsizei n, const GLuint* arrays)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_arrays =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_arrays + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteVertexArrays;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_arrays; ptr += 4;
+	memcpy(ptr, arrays, __size_arrays);ptr += __size_arrays;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsVertexArray_enc(void *self , GLuint array)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsVertexArray;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &array, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsVertexArray: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glMapBufferRangeAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_mapped = ((mapped != NULL) ?  length : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMapBufferRangeAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_mapped; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (mapped != NULL) {
+		stream->readback(mapped, __size_mapped);
+		if (useChecksum) checksumCalculator->addBuffer(mapped, __size_mapped);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glMapBufferRangeAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glUnmapBufferAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	const unsigned int __size_out_res =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUnmapBufferAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_guest_buffer; ptr += 4;
+	if (guest_buffer != NULL) memcpy(ptr, guest_buffer, __size_guest_buffer);ptr += __size_guest_buffer;
+	*(unsigned int *)(ptr) = __size_out_res; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(out_res, __size_out_res);
+	if (useChecksum) checksumCalculator->addBuffer(out_res, __size_out_res);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glUnmapBufferAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFlushMappedBufferRangeAEMU_enc(void *self , GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_guest_buffer = ((guest_buffer != NULL) ?  length : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_guest_buffer + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFlushMappedBufferRangeAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &length, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_guest_buffer; ptr += 4;
+	if (guest_buffer != NULL) memcpy(ptr, guest_buffer, __size_guest_buffer);ptr += __size_guest_buffer;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadPixelsOffsetAEMU_enc(void *self , GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadPixelsOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexSubImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage2DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexSubImage2DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBufferRange_enc(void *self , GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBufferRange;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindBufferBase_enc(void *self , GLenum target, GLuint index, GLuint buffer)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindBufferBase;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyBufferSubData_enc(void *self , GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyBufferSubData;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &readtarget, 4); ptr += 4;
+		memcpy(ptr, &writetarget, 4); ptr += 4;
+		memcpy(ptr, &readoffset, 4); ptr += 4;
+		memcpy(ptr, &writeoffset, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->flush();
+}
+
+void glClearBufferiv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLint) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferuiv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLuint) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferfv_enc(void *self , GLenum buffer, GLint drawBuffer, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (sizeof(GLfloat) * glesv2_enc::clearBufferNumElts(self, buffer));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glClearBufferfi_enc(void *self , GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClearBufferfi;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &drawBuffer, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &stencil, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformBlockBinding_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformBlockBinding;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockBinding, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLuint glGetUniformBlockIndex_enc(void *self , GLuint program, const GLchar* uniformBlockName)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_uniformBlockName =  (strlen(uniformBlockName) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_uniformBlockName + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformBlockIndex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_uniformBlockName; ptr += 4;
+	memcpy(ptr, uniformBlockName, __size_uniformBlockName);ptr += __size_uniformBlockName;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformBlockIndex: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetUniformIndicesAEMU_enc(void *self , GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedUniformNames =  packedLen;
+	const unsigned int __size_uniformIndices =  (uniformCount * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedUniformNames + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformIndicesAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformCount, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_packedUniformNames; ptr += 4;
+	memcpy(ptr, packedUniformNames, __size_packedUniformNames);ptr += __size_packedUniformNames;
+		memcpy(ptr, &packedLen, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_uniformIndices; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(uniformIndices, __size_uniformIndices);
+	if (useChecksum) checksumCalculator->addBuffer(uniformIndices, __size_uniformIndices);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformIndicesAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformBlockiv_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glesv2_enc::glActiveUniformBlockivParamSize(self, program, uniformBlockIndex, pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformBlockiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformBlockiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformBlockName_enc(void *self , GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_uniformBlockName = ((uniformBlockName != NULL) ?  bufSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformBlockName;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformBlockIndex, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_uniformBlockName; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	if (uniformBlockName != NULL) {
+		stream->readback(uniformBlockName, __size_uniformBlockName);
+		if (useChecksum) checksumCalculator->addBuffer(uniformBlockName, __size_uniformBlockName);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformBlockName: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glUniform1ui_enc(void *self , GLint location, GLuint v0)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2ui_enc(void *self , GLint location, GLuint v0, GLuint v1)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3ui_enc(void *self , GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4ui_enc(void *self , GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform1uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform1uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform2uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 2 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform2uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform3uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 3 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform3uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniform4uiv_enc(void *self , GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniform4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix2x3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix2x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix3x2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix3x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix2x4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix2x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix4x2fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix4x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix3x4fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix3x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glUniformMatrix4x3fv_enc(void *self , GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUniformMatrix4x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetUniformuiv_enc(void *self , GLuint program, GLint location, GLuint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  glSizeof(glesv2_enc::uniformType(self, program, location));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetUniformuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetUniformuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetActiveUniformsiv_enc(void *self , GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_uniformIndices =  (uniformCount * sizeof(GLuint));
+	const unsigned int __size_params =  (uniformCount * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_uniformIndices + 4 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetActiveUniformsiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &uniformCount, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_uniformIndices; ptr += 4;
+	memcpy(ptr, uniformIndices, __size_uniformIndices);ptr += __size_uniformIndices;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetActiveUniformsiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glVertexAttribI4i_enc(void *self , GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4ui_enc(void *self , GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4iv_enc(void *self , GLuint index, const GLint* v)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_v; ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribI4uiv_enc(void *self , GLuint index, const GLuint* v)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_v =  (4 * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_v + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribI4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_v; ptr += 4;
+	memcpy(ptr, v, __size_v);ptr += __size_v;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIPointerOffsetAEMU_enc(void *self , GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIPointerOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIPointerDataAEMU_enc(void *self , GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_data + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIPointerDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_data; ptr += 4;
+	 glUtilsPackPointerData((unsigned char *)ptr, (unsigned char *)data, size, type, stride, datalen);ptr += __size_data;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetVertexAttribIiv_enc(void *self , GLuint index, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribIiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribIiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetVertexAttribIuiv_enc(void *self , GLuint index, GLenum pname, GLuint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetVertexAttribIuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetVertexAttribIuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glVertexAttribDivisor_enc(void *self , GLuint index, GLuint divisor)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribDivisor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &divisor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysInstanced_enc(void *self , GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysInstanced;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &first, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsInstancedDataAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indices =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_indices + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsInstancedDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_indices; ptr += 4;
+	memcpy(ptr, indices, __size_indices);ptr += __size_indices;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsInstancedOffsetAEMU_enc(void *self , GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsInstancedOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &primcount, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawRangeElementsDataAEMU_enc(void *self , GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indices =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + __size_indices + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawRangeElementsDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &start, 4); ptr += 4;
+		memcpy(ptr, &end, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_indices; ptr += 4;
+	memcpy(ptr, indices, __size_indices);ptr += __size_indices;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawRangeElementsOffsetAEMU_enc(void *self , GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawRangeElementsOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &start, 4); ptr += 4;
+		memcpy(ptr, &end, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLsync glFenceSync_enc(void *self , GLenum condition, GLbitfield flags)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFenceSync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &condition, 4); ptr += 4;
+		memcpy(ptr, &flags, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLsync retval;
+	stream->readback(&retval, 8);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 8);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glFenceSync: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLenum glClientWaitSync_enc(void *self , GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glClientWaitSync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &wait_on, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+		memcpy(ptr, &timeout, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLenum retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glClientWaitSync: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glWaitSync_enc(void *self , GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glWaitSync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &wait_on, 8); ptr += 8;
+		memcpy(ptr, &flags, 4); ptr += 4;
+		memcpy(ptr, &timeout, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDeleteSync_enc(void *self , GLsync to_delete)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteSync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &to_delete, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsSync_enc(void *self , GLsync sync)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsSync;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsSync: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetSynciv_enc(void *self , GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length =  (sizeof(GLsizei));
+	const unsigned int __size_values =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSynciv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sync, 8); ptr += 8;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_values; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(length, __size_length);
+	if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	stream->readback(values, __size_values);
+	if (useChecksum) checksumCalculator->addBuffer(values, __size_values);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSynciv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDrawBuffers_enc(void *self , GLsizei n, const GLenum* bufs)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_bufs =  (n * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_bufs + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawBuffers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_bufs; ptr += 4;
+	memcpy(ptr, bufs, __size_bufs);ptr += __size_bufs;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glReadBuffer_enc(void *self , GLenum src)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glReadBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &src, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBlitFramebuffer_enc(void *self , GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBlitFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &srcX0, 4); ptr += 4;
+		memcpy(ptr, &srcY0, 4); ptr += 4;
+		memcpy(ptr, &srcX1, 4); ptr += 4;
+		memcpy(ptr, &srcY1, 4); ptr += 4;
+		memcpy(ptr, &dstX0, 4); ptr += 4;
+		memcpy(ptr, &dstY0, 4); ptr += 4;
+		memcpy(ptr, &dstX1, 4); ptr += 4;
+		memcpy(ptr, &dstY1, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+		memcpy(ptr, &filter, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glInvalidateFramebuffer_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glInvalidateFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_attachments; ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glInvalidateSubFramebuffer_enc(void *self , GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_attachments =  (numAttachments * sizeof(GLenum));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_attachments + 4 + 4 + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glInvalidateSubFramebuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &numAttachments, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_attachments; ptr += 4;
+	memcpy(ptr, attachments, __size_attachments);ptr += __size_attachments;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glFramebufferTextureLayer_enc(void *self , GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferTextureLayer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &attachment, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &layer, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glRenderbufferStorageMultisample_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glRenderbufferStorageMultisample;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage2D_enc(void *self , GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage2D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &levels, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetInternalformativ_enc(void *self , GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (sizeof(GLint) * bufSize);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInternalformativ;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInternalformativ: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBeginTransformFeedback_enc(void *self , GLenum primitiveMode)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBeginTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &primitiveMode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEndTransformFeedback_enc(void *self )
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEndTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenTransformFeedbacks_enc(void *self , GLsizei n, GLuint* ids)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_ids =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenTransformFeedbacks;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_ids; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(ids, __size_ids);
+	if (useChecksum) checksumCalculator->addBuffer(ids, __size_ids);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenTransformFeedbacks: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteTransformFeedbacks_enc(void *self , GLsizei n, const GLuint* ids)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_ids =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_ids + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteTransformFeedbacks;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_ids; ptr += 4;
+	memcpy(ptr, ids, __size_ids);ptr += __size_ids;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindTransformFeedback_enc(void *self , GLenum target, GLuint id)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glPauseTransformFeedback_enc(void *self )
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glPauseTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glResumeTransformFeedback_enc(void *self )
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glResumeTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsTransformFeedback_enc(void *self , GLuint id)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsTransformFeedback;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &id, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsTransformFeedback: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glTransformFeedbackVaryingsAEMU_enc(void *self , GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedVaryings =  packedVaryingsLen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedVaryings + 4 + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTransformFeedbackVaryingsAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_packedVaryings; ptr += 4;
+	memcpy(ptr, packedVaryings, __size_packedVaryings);ptr += __size_packedVaryings;
+		memcpy(ptr, &packedVaryingsLen, 4); ptr += 4;
+		memcpy(ptr, &bufferMode, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetTransformFeedbackVarying_enc(void *self , GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_size =  (sizeof(GLsizei));
+	const unsigned int __size_type = ((type != NULL) ?  (sizeof(GLenum)) : 0);
+	const unsigned int __size_name = ((name != NULL) ?  bufSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 0 + 0 + 0 + 4*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTransformFeedbackVarying;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_size; ptr += 4;
+	*(unsigned int *)(ptr) = __size_type; ptr += 4;
+	*(unsigned int *)(ptr) = __size_name; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(size, __size_size);
+	if (useChecksum) checksumCalculator->addBuffer(size, __size_size);
+	if (type != NULL) {
+		stream->readback(type, __size_type);
+		if (useChecksum) checksumCalculator->addBuffer(type, __size_type);
+	}
+	if (name != NULL) {
+		stream->readback(name, __size_name);
+		if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	}
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTransformFeedbackVarying: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGenSamplers_enc(void *self , GLsizei n, GLuint* samplers)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_samplers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenSamplers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_samplers; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(samplers, __size_samplers);
+	if (useChecksum) checksumCalculator->addBuffer(samplers, __size_samplers);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenSamplers: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteSamplers_enc(void *self , GLsizei n, const GLuint* samplers)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_samplers =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_samplers + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteSamplers;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_samplers; ptr += 4;
+	memcpy(ptr, samplers, __size_samplers);ptr += __size_samplers;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindSampler_enc(void *self , GLuint unit, GLuint sampler)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindSampler;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &unit, 4); ptr += 4;
+		memcpy(ptr, &sampler, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameterf_enc(void *self , GLuint sampler, GLenum pname, GLfloat param)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameterf;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameteri_enc(void *self , GLuint sampler, GLenum pname, GLint param)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameterfv_enc(void *self , GLuint sampler, GLenum pname, const GLfloat* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSamplerParameteriv_enc(void *self , GLuint sampler, GLenum pname, const GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_params + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSamplerParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+	memcpy(ptr, params, __size_params);ptr += __size_params;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetSamplerParameterfv_enc(void *self , GLuint sampler, GLenum pname, GLfloat* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSamplerParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSamplerParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetSamplerParameteriv_enc(void *self , GLuint sampler, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetSamplerParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetSamplerParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsSampler_enc(void *self , GLuint sampler)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsSampler;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &sampler, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsSampler: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGenQueries_enc(void *self , GLsizei n, GLuint* queries)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_queries =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenQueries;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_queries; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(queries, __size_queries);
+	if (useChecksum) checksumCalculator->addBuffer(queries, __size_queries);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenQueries: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteQueries_enc(void *self , GLsizei n, const GLuint* queries)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_queries =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_queries + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteQueries;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_queries; ptr += 4;
+	memcpy(ptr, queries, __size_queries);ptr += __size_queries;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBeginQuery_enc(void *self , GLenum target, GLuint query)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBeginQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &query, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glEndQuery_enc(void *self , GLenum target)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glEndQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetQueryiv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetQueryiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetQueryiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetQueryObjectuiv_enc(void *self , GLuint query, GLenum pname, GLuint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetQueryObjectuiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &query, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetQueryObjectuiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLboolean glIsQuery_enc(void *self , GLuint query)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsQuery;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &query, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsQuery: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glProgramParameteri_enc(void *self , GLuint program, GLenum pname, GLint value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &value, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramBinary_enc(void *self , GLuint program, GLenum binaryFormat, const void* binary, GLsizei length)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_binary =  length;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_binary + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramBinary;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &binaryFormat, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_binary; ptr += 4;
+	memcpy(ptr, binary, __size_binary);ptr += __size_binary;
+		memcpy(ptr, &length, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramBinary_enc(void *self , GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length =  (sizeof(GLsizei));
+	const unsigned int __size_binaryFormat =  (sizeof(GLenum));
+	const unsigned int __size_binary =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramBinary;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_binaryFormat; ptr += 4;
+	*(unsigned int *)(ptr) = __size_binary; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(length, __size_length);
+	if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	stream->readback(binaryFormat, __size_binaryFormat);
+	if (useChecksum) checksumCalculator->addBuffer(binaryFormat, __size_binaryFormat);
+	stream->readback(binary, __size_binary);
+	if (useChecksum) checksumCalculator->addBuffer(binary, __size_binary);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramBinary: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLint glGetFragDataLocation_enc(void *self , GLuint program, const char* name)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFragDataLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_name; ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFragDataLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetInteger64v_enc(void *self , GLenum pname, GLint64* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (glUtilsParamSize(pname) * sizeof(GLint64));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInteger64v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_data; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInteger64v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetIntegeri_v_enc(void *self , GLenum target, GLuint index, GLint* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetIntegeri_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_data; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetIntegeri_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetInteger64i_v_enc(void *self , GLenum target, GLuint index, GLint64* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLint64));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetInteger64i_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_data; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetInteger64i_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glTexImage3D_enc(void *self , GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalFormat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage3D_enc(void *self , GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &levels, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  glesv2_enc::pixelDataSize3D(self, width, height, depth, format, type, 0) : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glTexSubImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexSubImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexImage3D_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &border, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCompressedTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data = ((data != NULL) ?  imageSize : 0);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + __size_data + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	stream->flush();
+	stream->writeFully(&__size_data,4);
+	if (useChecksum) checksumCalculator->addBuffer(&__size_data,4);
+	if (data != NULL) {
+		stream->writeFully(data, __size_data);
+		if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	}
+	buf = stream->alloc(checksumSize);
+	if (useChecksum) checksumCalculator->writeChecksum(buf, checksumSize);
+
+}
+
+void glCompressedTexSubImage3DOffsetAEMU_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCompressedTexSubImage3DOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &depth, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+		memcpy(ptr, &imageSize, 4); ptr += 4;
+		memcpy(ptr, &data, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glCopyTexSubImage3D_enc(void *self , GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCopyTexSubImage3D;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &xoffset, 4); ptr += 4;
+		memcpy(ptr, &yoffset, 4); ptr += 4;
+		memcpy(ptr, &zoffset, 4); ptr += 4;
+		memcpy(ptr, &x, 4); ptr += 4;
+		memcpy(ptr, &y, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetBooleani_v_enc(void *self , GLenum target, GLuint index, GLboolean* data)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_data =  (sizeof(GLboolean));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetBooleani_v;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_data; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(data, __size_data);
+	if (useChecksum) checksumCalculator->addBuffer(data, __size_data);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetBooleani_v: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glMemoryBarrier_enc(void *self , GLbitfield barriers)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMemoryBarrier;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &barriers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glMemoryBarrierByRegion_enc(void *self , GLbitfield barriers)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glMemoryBarrierByRegion;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &barriers, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGenProgramPipelines_enc(void *self , GLsizei n, GLuint* pipelines)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pipelines =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGenProgramPipelines;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_pipelines; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(pipelines, __size_pipelines);
+	if (useChecksum) checksumCalculator->addBuffer(pipelines, __size_pipelines);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGenProgramPipelines: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glDeleteProgramPipelines_enc(void *self , GLsizei n, const GLuint* pipelines)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_pipelines =  (n * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_pipelines + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDeleteProgramPipelines;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &n, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_pipelines; ptr += 4;
+	memcpy(ptr, pipelines, __size_pipelines);ptr += __size_pipelines;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindProgramPipeline_enc(void *self , GLuint pipeline)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramPipelineiv_enc(void *self , GLuint pipeline, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramPipelineiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramPipelineiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramPipelineInfoLog_enc(void *self , GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  sizeof(GLsizei) : 0);
+	const unsigned int __size_infoLog =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramPipelineInfoLog;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_infoLog; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(infoLog, __size_infoLog);
+	if (useChecksum) checksumCalculator->addBuffer(infoLog, __size_infoLog);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramPipelineInfoLog: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glValidateProgramPipeline_enc(void *self , GLuint pipeline)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glValidateProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLboolean glIsProgramPipeline_enc(void *self , GLuint pipeline)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glIsProgramPipeline;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLboolean retval;
+	stream->readback(&retval, 1);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 1);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glIsProgramPipeline: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glUseProgramStages_enc(void *self , GLuint pipeline, GLbitfield stages, GLuint program)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glUseProgramStages;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pipeline, 4); ptr += 4;
+		memcpy(ptr, &stages, 4); ptr += 4;
+		memcpy(ptr, &program, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+GLuint glCreateShaderProgramvAEMU_enc(void *self , GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_packedStrings =  packedLen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_packedStrings + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glCreateShaderProgramvAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_packedStrings; ptr += 4;
+	memcpy(ptr, packedStrings, __size_packedStrings);ptr += __size_packedStrings;
+		memcpy(ptr, &packedLen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glCreateShaderProgramvAEMU: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glProgramUniform1f_enc(void *self , GLuint program, GLint location, GLfloat v0)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4f_enc(void *self , GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4f;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1i_enc(void *self , GLuint program, GLint location, GLint v0)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4i_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4i;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1ui_enc(void *self , GLuint program, GLint location, GLuint v0)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2ui_enc(void *self , GLuint program, GLint location, GLint v0, GLuint v1)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3ui_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4ui_enc(void *self , GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4ui;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &v0, 4); ptr += 4;
+		memcpy(ptr, &v1, 4); ptr += 4;
+		memcpy(ptr, &v2, 4); ptr += 4;
+		memcpy(ptr, &v3, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4fv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4iv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4iv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform1uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform1uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform2uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform2uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform3uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform3uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniform4uiv_enc(void *self , GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * sizeof(GLuint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniform4uiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 4 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 9 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 16 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2x3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3x2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 6 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix2x4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix2x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4x2fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 8 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4x2fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix3x4fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix3x4fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glProgramUniformMatrix4x3fv_enc(void *self , GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_value =  (count * 12 * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + __size_value + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glProgramUniformMatrix4x3fv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &location, 4); ptr += 4;
+		memcpy(ptr, &count, 4); ptr += 4;
+		memcpy(ptr, &transpose, 1); ptr += 1;
+	*(unsigned int *)(ptr) = __size_value; ptr += 4;
+	memcpy(ptr, value, __size_value);ptr += __size_value;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetProgramInterfaceiv_enc(void *self , GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramInterfaceiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramInterfaceiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetProgramResourceiv_enc(void *self , GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_props =  (propCount * sizeof(GLenum));
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_params =  (bufSize * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + __size_props + 4 + 0 + 0 + 3*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceiv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &propCount, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_props; ptr += 4;
+	memcpy(ptr, props, __size_props);ptr += __size_props;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceiv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+GLuint glGetProgramResourceIndex_enc(void *self , GLuint program, GLenum programInterface, const char* name)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceIndex;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_name; ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLuint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceIndex: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+GLint glGetProgramResourceLocation_enc(void *self , GLuint program, GLenum programInterface, const char* name)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_name =  (strlen(name) + 1);
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_name + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceLocation;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_name; ptr += 4;
+	memcpy(ptr, name, __size_name);ptr += __size_name;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+
+	GLint retval;
+	stream->readback(&retval, 4);
+	if (useChecksum) checksumCalculator->addBuffer(&retval, 4);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceLocation: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+	return retval;
+}
+
+void glGetProgramResourceName_enc(void *self , GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_length = ((length != NULL) ?  (sizeof(GLsizei)) : 0);
+	const unsigned int __size_name =  bufSize;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 0 + 0 + 2*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetProgramResourceName;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &program, 4); ptr += 4;
+		memcpy(ptr, &programInterface, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+		memcpy(ptr, &bufSize, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_length; ptr += 4;
+	*(unsigned int *)(ptr) = __size_name; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	if (length != NULL) {
+		stream->readback(length, __size_length);
+		if (useChecksum) checksumCalculator->addBuffer(length, __size_length);
+	}
+	stream->readback(name, __size_name);
+	if (useChecksum) checksumCalculator->addBuffer(name, __size_name);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetProgramResourceName: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glBindImageTexture_enc(void *self , GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindImageTexture;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &unit, 4); ptr += 4;
+		memcpy(ptr, &texture, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &layered, 1); ptr += 1;
+		memcpy(ptr, &layer, 4); ptr += 4;
+		memcpy(ptr, &access, 4); ptr += 4;
+		memcpy(ptr, &format, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDispatchCompute_enc(void *self , GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDispatchCompute;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &num_groups_x, 4); ptr += 4;
+		memcpy(ptr, &num_groups_y, 4); ptr += 4;
+		memcpy(ptr, &num_groups_z, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDispatchComputeIndirect_enc(void *self , GLintptr indirect)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDispatchComputeIndirect;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &indirect, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glBindVertexBuffer_enc(void *self , GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glBindVertexBuffer;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+		memcpy(ptr, &buffer, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+		memcpy(ptr, &stride, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribBinding_enc(void *self , GLuint attribindex, GLuint bindingindex)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribBinding;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribFormat_enc(void *self , GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 1 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribFormat;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &normalized, 1); ptr += 1;
+		memcpy(ptr, &relativeoffset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexAttribIFormat_enc(void *self , GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexAttribIFormat;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &attribindex, 4); ptr += 4;
+		memcpy(ptr, &size, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &relativeoffset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glVertexBindingDivisor_enc(void *self , GLuint bindingindex, GLuint divisor)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glVertexBindingDivisor;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &bindingindex, 4); ptr += 4;
+		memcpy(ptr, &divisor, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysIndirectDataAEMU_enc(void *self , GLenum mode, const void* indirect, GLuint datalen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indirect =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + __size_indirect + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysIndirectDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_indirect; ptr += 4;
+	memcpy(ptr, indirect, __size_indirect);ptr += __size_indirect;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawArraysIndirectOffsetAEMU_enc(void *self , GLenum mode, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawArraysIndirectOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsIndirectDataAEMU_enc(void *self , GLenum mode, GLenum type, const void* indirect, GLuint datalen)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_indirect =  datalen;
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + __size_indirect + 4 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsIndirectDataAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_indirect; ptr += 4;
+	memcpy(ptr, indirect, __size_indirect);ptr += __size_indirect;
+		memcpy(ptr, &datalen, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glDrawElementsIndirectOffsetAEMU_enc(void *self , GLenum mode, GLenum type, GLuint offset)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glDrawElementsIndirectOffsetAEMU;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &mode, 4); ptr += 4;
+		memcpy(ptr, &type, 4); ptr += 4;
+		memcpy(ptr, &offset, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glTexStorage2DMultisample_enc(void *self , GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 4 + 4 + 1;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glTexStorage2DMultisample;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &samples, 4); ptr += 4;
+		memcpy(ptr, &internalformat, 4); ptr += 4;
+		memcpy(ptr, &width, 4); ptr += 4;
+		memcpy(ptr, &height, 4); ptr += 4;
+		memcpy(ptr, &fixedsamplelocations, 1); ptr += 1;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glSampleMaski_enc(void *self , GLuint maskNumber, GLbitfield mask)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glSampleMaski;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &maskNumber, 4); ptr += 4;
+		memcpy(ptr, &mask, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetMultisamplefv_enc(void *self , GLenum pname, GLuint index, GLfloat* val)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_val =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetMultisamplefv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &index, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_val; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(val, __size_val);
+	if (useChecksum) checksumCalculator->addBuffer(val, __size_val);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetMultisamplefv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glFramebufferParameteri_enc(void *self , GLenum target, GLenum pname, GLint param)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glFramebufferParameteri;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+		memcpy(ptr, &param, 4); ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+}
+
+void glGetFramebufferParameteriv_enc(void *self , GLenum target, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetFramebufferParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetFramebufferParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexLevelParameterfv_enc(void *self , GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLfloat));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexLevelParameterfv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexLevelParameterfv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
+void glGetTexLevelParameteriv_enc(void *self , GLenum target, GLint level, GLenum pname, GLint* params)
+{
+
+	gl2_encoder_context_t *ctx = (gl2_encoder_context_t *)self;
+	IOStream *stream = ctx->m_stream;
+	ChecksumCalculator *checksumCalculator = ctx->m_checksumCalculator;
+	bool useChecksum = checksumCalculator->getVersion() > 0;
+
+	const unsigned int __size_params =  (glUtilsParamSize(pname) * sizeof(GLint));
+	 unsigned char *ptr;
+	 unsigned char *buf;
+	 const size_t sizeWithoutChecksum = 8 + 4 + 4 + 4 + 0 + 1*4;
+	 const size_t checksumSize = checksumCalculator->checksumByteSize();
+	 const size_t totalSize = sizeWithoutChecksum + checksumSize;
+	buf = stream->alloc(totalSize);
+	ptr = buf;
+	int tmp = OP_glGetTexLevelParameteriv;memcpy(ptr, &tmp, 4); ptr += 4;
+	memcpy(ptr, &totalSize, 4);  ptr += 4;
+
+		memcpy(ptr, &target, 4); ptr += 4;
+		memcpy(ptr, &level, 4); ptr += 4;
+		memcpy(ptr, &pname, 4); ptr += 4;
+	*(unsigned int *)(ptr) = __size_params; ptr += 4;
+
+	if (useChecksum) checksumCalculator->addBuffer(buf, ptr-buf);
+	if (useChecksum) checksumCalculator->writeChecksum(ptr, checksumSize); ptr += checksumSize;
+
+	stream->readback(params, __size_params);
+	if (useChecksum) checksumCalculator->addBuffer(params, __size_params);
+	if (useChecksum) {
+		unsigned char *checksumBufPtr = NULL;
+		unsigned char checksumBuf[ChecksumCalculator::kMaxChecksumSize];
+		if (checksumSize > 0) checksumBufPtr = &checksumBuf[0];
+		stream->readback(checksumBufPtr, checksumSize);
+		if (!checksumCalculator->validate(checksumBufPtr, checksumSize)) {
+			ALOGE("glGetTexLevelParameteriv: GL communication error, please report this issue to b.android.com.\n");
+			abort();
+		}
+	}
+}
+
 }  // namespace
 
 gl2_encoder_context_t::gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator)
@@ -5274,5 +11225,201 @@
 	this->glGetCompressedTextureFormats = &glGetCompressedTextureFormats_enc;
 	this->glShaderString = &glShaderString_enc;
 	this->glFinishRoundTrip = &glFinishRoundTrip_enc;
+	this->glGenVertexArrays = &glGenVertexArrays_enc;
+	this->glBindVertexArray = &glBindVertexArray_enc;
+	this->glDeleteVertexArrays = &glDeleteVertexArrays_enc;
+	this->glIsVertexArray = &glIsVertexArray_enc;
+	this->glMapBufferRange = (glMapBufferRange_client_proc_t) &enc_unsupported;
+	this->glUnmapBuffer = (glUnmapBuffer_client_proc_t) &enc_unsupported;
+	this->glFlushMappedBufferRange = (glFlushMappedBufferRange_client_proc_t) &enc_unsupported;
+	this->glMapBufferRangeAEMU = &glMapBufferRangeAEMU_enc;
+	this->glUnmapBufferAEMU = &glUnmapBufferAEMU_enc;
+	this->glFlushMappedBufferRangeAEMU = &glFlushMappedBufferRangeAEMU_enc;
+	this->glReadPixelsOffsetAEMU = &glReadPixelsOffsetAEMU_enc;
+	this->glCompressedTexImage2DOffsetAEMU = &glCompressedTexImage2DOffsetAEMU_enc;
+	this->glCompressedTexSubImage2DOffsetAEMU = &glCompressedTexSubImage2DOffsetAEMU_enc;
+	this->glTexImage2DOffsetAEMU = &glTexImage2DOffsetAEMU_enc;
+	this->glTexSubImage2DOffsetAEMU = &glTexSubImage2DOffsetAEMU_enc;
+	this->glBindBufferRange = &glBindBufferRange_enc;
+	this->glBindBufferBase = &glBindBufferBase_enc;
+	this->glCopyBufferSubData = &glCopyBufferSubData_enc;
+	this->glClearBufferiv = &glClearBufferiv_enc;
+	this->glClearBufferuiv = &glClearBufferuiv_enc;
+	this->glClearBufferfv = &glClearBufferfv_enc;
+	this->glClearBufferfi = &glClearBufferfi_enc;
+	this->glGetBufferParameteri64v = (glGetBufferParameteri64v_client_proc_t) &enc_unsupported;
+	this->glGetBufferPointerv = (glGetBufferPointerv_client_proc_t) &enc_unsupported;
+	this->glUniformBlockBinding = &glUniformBlockBinding_enc;
+	this->glGetUniformBlockIndex = &glGetUniformBlockIndex_enc;
+	this->glGetUniformIndices = (glGetUniformIndices_client_proc_t) &enc_unsupported;
+	this->glGetUniformIndicesAEMU = &glGetUniformIndicesAEMU_enc;
+	this->glGetActiveUniformBlockiv = &glGetActiveUniformBlockiv_enc;
+	this->glGetActiveUniformBlockName = &glGetActiveUniformBlockName_enc;
+	this->glUniform1ui = &glUniform1ui_enc;
+	this->glUniform2ui = &glUniform2ui_enc;
+	this->glUniform3ui = &glUniform3ui_enc;
+	this->glUniform4ui = &glUniform4ui_enc;
+	this->glUniform1uiv = &glUniform1uiv_enc;
+	this->glUniform2uiv = &glUniform2uiv_enc;
+	this->glUniform3uiv = &glUniform3uiv_enc;
+	this->glUniform4uiv = &glUniform4uiv_enc;
+	this->glUniformMatrix2x3fv = &glUniformMatrix2x3fv_enc;
+	this->glUniformMatrix3x2fv = &glUniformMatrix3x2fv_enc;
+	this->glUniformMatrix2x4fv = &glUniformMatrix2x4fv_enc;
+	this->glUniformMatrix4x2fv = &glUniformMatrix4x2fv_enc;
+	this->glUniformMatrix3x4fv = &glUniformMatrix3x4fv_enc;
+	this->glUniformMatrix4x3fv = &glUniformMatrix4x3fv_enc;
+	this->glGetUniformuiv = &glGetUniformuiv_enc;
+	this->glGetActiveUniformsiv = &glGetActiveUniformsiv_enc;
+	this->glVertexAttribI4i = &glVertexAttribI4i_enc;
+	this->glVertexAttribI4ui = &glVertexAttribI4ui_enc;
+	this->glVertexAttribI4iv = &glVertexAttribI4iv_enc;
+	this->glVertexAttribI4uiv = &glVertexAttribI4uiv_enc;
+	this->glVertexAttribIPointer = (glVertexAttribIPointer_client_proc_t) &enc_unsupported;
+	this->glVertexAttribIPointerOffsetAEMU = &glVertexAttribIPointerOffsetAEMU_enc;
+	this->glVertexAttribIPointerDataAEMU = &glVertexAttribIPointerDataAEMU_enc;
+	this->glGetVertexAttribIiv = &glGetVertexAttribIiv_enc;
+	this->glGetVertexAttribIuiv = &glGetVertexAttribIuiv_enc;
+	this->glVertexAttribDivisor = &glVertexAttribDivisor_enc;
+	this->glDrawArraysInstanced = &glDrawArraysInstanced_enc;
+	this->glDrawElementsInstanced = (glDrawElementsInstanced_client_proc_t) &enc_unsupported;
+	this->glDrawElementsInstancedDataAEMU = &glDrawElementsInstancedDataAEMU_enc;
+	this->glDrawElementsInstancedOffsetAEMU = &glDrawElementsInstancedOffsetAEMU_enc;
+	this->glDrawRangeElements = (glDrawRangeElements_client_proc_t) &enc_unsupported;
+	this->glDrawRangeElementsDataAEMU = &glDrawRangeElementsDataAEMU_enc;
+	this->glDrawRangeElementsOffsetAEMU = &glDrawRangeElementsOffsetAEMU_enc;
+	this->glFenceSync = &glFenceSync_enc;
+	this->glClientWaitSync = &glClientWaitSync_enc;
+	this->glWaitSync = &glWaitSync_enc;
+	this->glDeleteSync = &glDeleteSync_enc;
+	this->glIsSync = &glIsSync_enc;
+	this->glGetSynciv = &glGetSynciv_enc;
+	this->glDrawBuffers = &glDrawBuffers_enc;
+	this->glReadBuffer = &glReadBuffer_enc;
+	this->glBlitFramebuffer = &glBlitFramebuffer_enc;
+	this->glInvalidateFramebuffer = &glInvalidateFramebuffer_enc;
+	this->glInvalidateSubFramebuffer = &glInvalidateSubFramebuffer_enc;
+	this->glFramebufferTextureLayer = &glFramebufferTextureLayer_enc;
+	this->glRenderbufferStorageMultisample = &glRenderbufferStorageMultisample_enc;
+	this->glTexStorage2D = &glTexStorage2D_enc;
+	this->glGetInternalformativ = &glGetInternalformativ_enc;
+	this->glBeginTransformFeedback = &glBeginTransformFeedback_enc;
+	this->glEndTransformFeedback = &glEndTransformFeedback_enc;
+	this->glGenTransformFeedbacks = &glGenTransformFeedbacks_enc;
+	this->glDeleteTransformFeedbacks = &glDeleteTransformFeedbacks_enc;
+	this->glBindTransformFeedback = &glBindTransformFeedback_enc;
+	this->glPauseTransformFeedback = &glPauseTransformFeedback_enc;
+	this->glResumeTransformFeedback = &glResumeTransformFeedback_enc;
+	this->glIsTransformFeedback = &glIsTransformFeedback_enc;
+	this->glTransformFeedbackVaryings = (glTransformFeedbackVaryings_client_proc_t) &enc_unsupported;
+	this->glTransformFeedbackVaryingsAEMU = &glTransformFeedbackVaryingsAEMU_enc;
+	this->glGetTransformFeedbackVarying = &glGetTransformFeedbackVarying_enc;
+	this->glGenSamplers = &glGenSamplers_enc;
+	this->glDeleteSamplers = &glDeleteSamplers_enc;
+	this->glBindSampler = &glBindSampler_enc;
+	this->glSamplerParameterf = &glSamplerParameterf_enc;
+	this->glSamplerParameteri = &glSamplerParameteri_enc;
+	this->glSamplerParameterfv = &glSamplerParameterfv_enc;
+	this->glSamplerParameteriv = &glSamplerParameteriv_enc;
+	this->glGetSamplerParameterfv = &glGetSamplerParameterfv_enc;
+	this->glGetSamplerParameteriv = &glGetSamplerParameteriv_enc;
+	this->glIsSampler = &glIsSampler_enc;
+	this->glGenQueries = &glGenQueries_enc;
+	this->glDeleteQueries = &glDeleteQueries_enc;
+	this->glBeginQuery = &glBeginQuery_enc;
+	this->glEndQuery = &glEndQuery_enc;
+	this->glGetQueryiv = &glGetQueryiv_enc;
+	this->glGetQueryObjectuiv = &glGetQueryObjectuiv_enc;
+	this->glIsQuery = &glIsQuery_enc;
+	this->glProgramParameteri = &glProgramParameteri_enc;
+	this->glProgramBinary = &glProgramBinary_enc;
+	this->glGetProgramBinary = &glGetProgramBinary_enc;
+	this->glGetFragDataLocation = &glGetFragDataLocation_enc;
+	this->glGetInteger64v = &glGetInteger64v_enc;
+	this->glGetIntegeri_v = &glGetIntegeri_v_enc;
+	this->glGetInteger64i_v = &glGetInteger64i_v_enc;
+	this->glTexImage3D = &glTexImage3D_enc;
+	this->glTexImage3DOffsetAEMU = &glTexImage3DOffsetAEMU_enc;
+	this->glTexStorage3D = &glTexStorage3D_enc;
+	this->glTexSubImage3D = &glTexSubImage3D_enc;
+	this->glTexSubImage3DOffsetAEMU = &glTexSubImage3DOffsetAEMU_enc;
+	this->glCompressedTexImage3D = &glCompressedTexImage3D_enc;
+	this->glCompressedTexImage3DOffsetAEMU = &glCompressedTexImage3DOffsetAEMU_enc;
+	this->glCompressedTexSubImage3D = &glCompressedTexSubImage3D_enc;
+	this->glCompressedTexSubImage3DOffsetAEMU = &glCompressedTexSubImage3DOffsetAEMU_enc;
+	this->glCopyTexSubImage3D = &glCopyTexSubImage3D_enc;
+	this->glGetStringi = (glGetStringi_client_proc_t) &enc_unsupported;
+	this->glGetBooleani_v = &glGetBooleani_v_enc;
+	this->glMemoryBarrier = &glMemoryBarrier_enc;
+	this->glMemoryBarrierByRegion = &glMemoryBarrierByRegion_enc;
+	this->glGenProgramPipelines = &glGenProgramPipelines_enc;
+	this->glDeleteProgramPipelines = &glDeleteProgramPipelines_enc;
+	this->glBindProgramPipeline = &glBindProgramPipeline_enc;
+	this->glGetProgramPipelineiv = &glGetProgramPipelineiv_enc;
+	this->glGetProgramPipelineInfoLog = &glGetProgramPipelineInfoLog_enc;
+	this->glValidateProgramPipeline = &glValidateProgramPipeline_enc;
+	this->glIsProgramPipeline = &glIsProgramPipeline_enc;
+	this->glUseProgramStages = &glUseProgramStages_enc;
+	this->glCreateShaderProgramv = (glCreateShaderProgramv_client_proc_t) &enc_unsupported;
+	this->glCreateShaderProgramvAEMU = &glCreateShaderProgramvAEMU_enc;
+	this->glProgramUniform1f = &glProgramUniform1f_enc;
+	this->glProgramUniform2f = &glProgramUniform2f_enc;
+	this->glProgramUniform3f = &glProgramUniform3f_enc;
+	this->glProgramUniform4f = &glProgramUniform4f_enc;
+	this->glProgramUniform1i = &glProgramUniform1i_enc;
+	this->glProgramUniform2i = &glProgramUniform2i_enc;
+	this->glProgramUniform3i = &glProgramUniform3i_enc;
+	this->glProgramUniform4i = &glProgramUniform4i_enc;
+	this->glProgramUniform1ui = &glProgramUniform1ui_enc;
+	this->glProgramUniform2ui = &glProgramUniform2ui_enc;
+	this->glProgramUniform3ui = &glProgramUniform3ui_enc;
+	this->glProgramUniform4ui = &glProgramUniform4ui_enc;
+	this->glProgramUniform1fv = &glProgramUniform1fv_enc;
+	this->glProgramUniform2fv = &glProgramUniform2fv_enc;
+	this->glProgramUniform3fv = &glProgramUniform3fv_enc;
+	this->glProgramUniform4fv = &glProgramUniform4fv_enc;
+	this->glProgramUniform1iv = &glProgramUniform1iv_enc;
+	this->glProgramUniform2iv = &glProgramUniform2iv_enc;
+	this->glProgramUniform3iv = &glProgramUniform3iv_enc;
+	this->glProgramUniform4iv = &glProgramUniform4iv_enc;
+	this->glProgramUniform1uiv = &glProgramUniform1uiv_enc;
+	this->glProgramUniform2uiv = &glProgramUniform2uiv_enc;
+	this->glProgramUniform3uiv = &glProgramUniform3uiv_enc;
+	this->glProgramUniform4uiv = &glProgramUniform4uiv_enc;
+	this->glProgramUniformMatrix2fv = &glProgramUniformMatrix2fv_enc;
+	this->glProgramUniformMatrix3fv = &glProgramUniformMatrix3fv_enc;
+	this->glProgramUniformMatrix4fv = &glProgramUniformMatrix4fv_enc;
+	this->glProgramUniformMatrix2x3fv = &glProgramUniformMatrix2x3fv_enc;
+	this->glProgramUniformMatrix3x2fv = &glProgramUniformMatrix3x2fv_enc;
+	this->glProgramUniformMatrix2x4fv = &glProgramUniformMatrix2x4fv_enc;
+	this->glProgramUniformMatrix4x2fv = &glProgramUniformMatrix4x2fv_enc;
+	this->glProgramUniformMatrix3x4fv = &glProgramUniformMatrix3x4fv_enc;
+	this->glProgramUniformMatrix4x3fv = &glProgramUniformMatrix4x3fv_enc;
+	this->glGetProgramInterfaceiv = &glGetProgramInterfaceiv_enc;
+	this->glGetProgramResourceiv = &glGetProgramResourceiv_enc;
+	this->glGetProgramResourceIndex = &glGetProgramResourceIndex_enc;
+	this->glGetProgramResourceLocation = &glGetProgramResourceLocation_enc;
+	this->glGetProgramResourceName = &glGetProgramResourceName_enc;
+	this->glBindImageTexture = &glBindImageTexture_enc;
+	this->glDispatchCompute = &glDispatchCompute_enc;
+	this->glDispatchComputeIndirect = &glDispatchComputeIndirect_enc;
+	this->glBindVertexBuffer = &glBindVertexBuffer_enc;
+	this->glVertexAttribBinding = &glVertexAttribBinding_enc;
+	this->glVertexAttribFormat = &glVertexAttribFormat_enc;
+	this->glVertexAttribIFormat = &glVertexAttribIFormat_enc;
+	this->glVertexBindingDivisor = &glVertexBindingDivisor_enc;
+	this->glDrawArraysIndirect = (glDrawArraysIndirect_client_proc_t) &enc_unsupported;
+	this->glDrawArraysIndirectDataAEMU = &glDrawArraysIndirectDataAEMU_enc;
+	this->glDrawArraysIndirectOffsetAEMU = &glDrawArraysIndirectOffsetAEMU_enc;
+	this->glDrawElementsIndirect = (glDrawElementsIndirect_client_proc_t) &enc_unsupported;
+	this->glDrawElementsIndirectDataAEMU = &glDrawElementsIndirectDataAEMU_enc;
+	this->glDrawElementsIndirectOffsetAEMU = &glDrawElementsIndirectOffsetAEMU_enc;
+	this->glTexStorage2DMultisample = &glTexStorage2DMultisample_enc;
+	this->glSampleMaski = &glSampleMaski_enc;
+	this->glGetMultisamplefv = &glGetMultisamplefv_enc;
+	this->glFramebufferParameteri = &glFramebufferParameteri_enc;
+	this->glGetFramebufferParameteriv = &glGetFramebufferParameteriv_enc;
+	this->glGetTexLevelParameterfv = &glGetTexLevelParameterfv_enc;
+	this->glGetTexLevelParameteriv = &glGetTexLevelParameteriv_enc;
 }
 
diff --git a/system/GLESv2_enc/gl2_enc.h b/system/GLESv2_enc/gl2_enc.h
index 760d729..4129b9d 100644
--- a/system/GLESv2_enc/gl2_enc.h
+++ b/system/GLESv2_enc/gl2_enc.h
@@ -19,6 +19,7 @@
 	ChecksumCalculator *m_checksumCalculator;
 
 	gl2_encoder_context_t(IOStream *stream, ChecksumCalculator *checksumCalculator);
+	virtual uint64_t lockAndWriteDma(void* data, uint32_t sz) { return 0; }
 };
 
-#endif  // GUARD_gl2_encoder_context_t
\ No newline at end of file
+#endif  // GUARD_gl2_encoder_context_t
diff --git a/system/GLESv2_enc/gl2_entry.cpp b/system/GLESv2_enc/gl2_entry.cpp
index 3812aae..bf79c39 100644
--- a/system/GLESv2_enc/gl2_entry.cpp
+++ b/system/GLESv2_enc/gl2_entry.cpp
@@ -214,6 +214,202 @@
 	void glGetCompressedTextureFormats(int count, GLint* formats);
 	void glShaderString(GLuint shader, const GLchar* string, GLsizei len);
 	int glFinishRoundTrip();
+	void glGenVertexArrays(GLsizei n, GLuint* arrays);
+	void glBindVertexArray(GLuint array);
+	void glDeleteVertexArrays(GLsizei n, const GLuint* arrays);
+	GLboolean glIsVertexArray(GLuint array);
+	void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access);
+	GLboolean glUnmapBuffer(GLenum target);
+	void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length);
+	void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped);
+	void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res);
+	void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer);
+	void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
+	void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset);
+	void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset);
+	void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset);
+	void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset);
+	void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size);
+	void glBindBufferBase(GLenum target, GLuint index, GLuint buffer);
+	void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size);
+	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);
+	void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data);
+	void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params);
+	void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding);
+	GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName);
+	void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices);
+	void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices);
+	void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params);
+	void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName);
+	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, GLint 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 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 glGetUniformuiv(GLuint program, GLint location, GLuint* params);
+	void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params);
+	void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3);
+	void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3);
+	void glVertexAttribI4iv(GLuint index, const GLint* v);
+	void glVertexAttribI4uiv(GLuint index, const GLuint* v);
+	void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer);
+	void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset);
+	void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen);
+	void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params);
+	void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params);
+	void glVertexAttribDivisor(GLuint index, GLuint divisor);
+	void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount);
+	void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount);
+	void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen);
+	void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount);
+	void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices);
+	void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen);
+	void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset);
+	GLsync glFenceSync(GLenum condition, GLbitfield flags);
+	GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+	void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout);
+	void glDeleteSync(GLsync to_delete);
+	GLboolean glIsSync(GLsync sync);
+	void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values);
+	void glDrawBuffers(GLsizei n, const GLenum* bufs);
+	void glReadBuffer(GLenum src);
+	void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter);
+	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 glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer);
+	void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height);
+	void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
+	void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params);
+	void glBeginTransformFeedback(GLenum primitiveMode);
+	void glEndTransformFeedback();
+	void glGenTransformFeedbacks(GLsizei n, GLuint* ids);
+	void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids);
+	void glBindTransformFeedback(GLenum target, GLuint id);
+	void glPauseTransformFeedback();
+	void glResumeTransformFeedback();
+	GLboolean glIsTransformFeedback(GLuint id);
+	void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode);
+	void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode);
+	void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name);
+	void glGenSamplers(GLsizei n, GLuint* samplers);
+	void glDeleteSamplers(GLsizei n, const GLuint* samplers);
+	void glBindSampler(GLuint unit, GLuint sampler);
+	void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param);
+	void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param);
+	void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params);
+	void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params);
+	void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params);
+	void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params);
+	GLboolean glIsSampler(GLuint sampler);
+	void glGenQueries(GLsizei n, GLuint* queries);
+	void glDeleteQueries(GLsizei n, const GLuint* queries);
+	void glBeginQuery(GLenum target, GLuint query);
+	void glEndQuery(GLenum target);
+	void glGetQueryiv(GLenum target, GLenum pname, GLint* params);
+	void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params);
+	GLboolean glIsQuery(GLuint query);
+	void glProgramParameteri(GLuint program, GLenum pname, GLint value);
+	void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length);
+	void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary);
+	GLint glGetFragDataLocation(GLuint program, const char* name);
+	void glGetInteger64v(GLenum pname, GLint64* data);
+	void glGetIntegeri_v(GLenum target, GLuint index, GLint* data);
+	void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data);
+	void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data);
+	void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset);
+	void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
+	void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data);
+	void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset);
+	void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data);
+	void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint 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 glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data);
+	void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height);
+	const GLubyte* glGetStringi(GLenum name, GLuint index);
+	void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data);
+	void glMemoryBarrier(GLbitfield barriers);
+	void glMemoryBarrierByRegion(GLbitfield barriers);
+	void glGenProgramPipelines(GLsizei n, GLuint* pipelines);
+	void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines);
+	void glBindProgramPipeline(GLuint pipeline);
+	void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params);
+	void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog);
+	void glValidateProgramPipeline(GLuint pipeline);
+	GLboolean glIsProgramPipeline(GLuint pipeline);
+	void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program);
+	GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings);
+	GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen);
+	void glProgramUniform1f(GLuint program, GLint location, GLfloat v0);
+	void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1);
+	void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2);
+	void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3);
+	void glProgramUniform1i(GLuint program, GLint location, GLint v0);
+	void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1);
+	void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2);
+	void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3);
+	void glProgramUniform1ui(GLuint program, GLint location, GLuint v0);
+	void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1);
+	void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2);
+	void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3);
+	void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value);
+	void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value);
+	void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value);
+	void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value);
+	void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params);
+	void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params);
+	GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name);
+	GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name);
+	void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name);
+	void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
+	void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z);
+	void glDispatchComputeIndirect(GLintptr indirect);
+	void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride);
+	void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex);
+	void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset);
+	void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset);
+	void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor);
+	void glDrawArraysIndirect(GLenum mode, const void* indirect);
+	void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen);
+	void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset);
+	void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect);
+	void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen);
+	void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset);
+	void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations);
+	void glSampleMaski(GLuint maskNumber, GLbitfield mask);
+	void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val);
+	void glFramebufferParameteri(GLenum target, GLenum pname, GLint param);
+	void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params);
+	void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params);
+	void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params);
 };
 
 #endif
@@ -352,12 +548,14 @@
 void glCompressedTexImage2D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, const GLvoid* data)
 {
 	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glCompressedTexImage2D(ctx, target, level, internalformat, width, height, border, imageSize, data);
 }
 
 void glCompressedTexSubImage2D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, const GLvoid* data)
 {
 	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glCompressedTexSubImage2D(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, data);
 }
 
@@ -558,12 +756,14 @@
 void glGetActiveAttrib(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
 {
 	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glGetActiveAttrib(ctx, program, index, bufsize, length, size, type, name);
 }
 
 void glGetActiveUniform(GLuint program, GLuint index, GLsizei bufsize, GLsizei* length, GLint* size, GLenum* type, GLchar* name)
 {
 	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glGetActiveUniform(ctx, program, index, bufsize, length, size, type, name);
 }
 
@@ -624,6 +824,7 @@
 void glGetProgramInfoLog(GLuint program, GLsizei bufsize, GLsizei* length, GLchar* infolog)
 {
 	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glGetProgramInfoLog(ctx, program, bufsize, length, infolog);
 }
 
@@ -642,6 +843,7 @@
 void glGetShaderInfoLog(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* infolog)
 {
 	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glGetShaderInfoLog(ctx, shader, bufsize, length, infolog);
 }
 
@@ -654,6 +856,7 @@
 void glGetShaderSource(GLuint shader, GLsizei bufsize, GLsizei* length, GLchar* source)
 {
 	GET_CONTEXT;
+	 if(bufsize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glGetShaderSource(ctx, shader, bufsize, length, source);
 }
 
@@ -1140,12 +1343,14 @@
 void glCompressedTexImage3DOES(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
 {
 	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glCompressedTexImage3DOES(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
 }
 
 void glCompressedTexSubImage3DOES(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid* data)
 {
 	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
 	ctx->glCompressedTexSubImage3DOES(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
 }
 
@@ -1481,3 +1686,1197 @@
 	return ctx->glFinishRoundTrip(ctx);
 }
 
+void glGenVertexArrays(GLsizei n, GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenVertexArrays(ctx, n, arrays);
+}
+
+void glBindVertexArray(GLuint array)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexArray(ctx, array);
+}
+
+void glDeleteVertexArrays(GLsizei n, const GLuint* arrays)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteVertexArrays(ctx, n, arrays);
+}
+
+GLboolean glIsVertexArray(GLuint array)
+{
+	GET_CONTEXT;
+	return ctx->glIsVertexArray(ctx, array);
+}
+
+void* glMapBufferRange(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access)
+{
+	GET_CONTEXT;
+	return ctx->glMapBufferRange(ctx, target, offset, length, access);
+}
+
+GLboolean glUnmapBuffer(GLenum target)
+{
+	GET_CONTEXT;
+	return ctx->glUnmapBuffer(ctx, target);
+}
+
+void glFlushMappedBufferRange(GLenum target, GLintptr offset, GLsizeiptr length)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRange(ctx, target, offset, length);
+}
+
+void glMapBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* mapped)
+{
+	GET_CONTEXT;
+	ctx->glMapBufferRangeAEMU(ctx, target, offset, length, access, mapped);
+}
+
+void glUnmapBufferAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer, GLboolean* out_res)
+{
+	GET_CONTEXT;
+	ctx->glUnmapBufferAEMU(ctx, target, offset, length, access, guest_buffer, out_res);
+}
+
+void glFlushMappedBufferRangeAEMU(GLenum target, GLintptr offset, GLsizeiptr length, GLbitfield access, void* guest_buffer)
+{
+	GET_CONTEXT;
+	ctx->glFlushMappedBufferRangeAEMU(ctx, target, offset, length, access, guest_buffer);
+}
+
+void glReadPixelsOffsetAEMU(GLint x, GLint y, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glReadPixelsOffsetAEMU(ctx, x, y, width, height, format, type, offset);
+}
+
+void glCompressedTexImage2DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLint border, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, imageSize, offset);
+}
+
+void glCompressedTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, imageSize, offset);
+}
+
+void glTexImage2DOffsetAEMU(GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexImage2DOffsetAEMU(ctx, target, level, internalformat, width, height, border, format, type, offset);
+}
+
+void glTexSubImage2DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLsizei width, GLsizei height, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage2DOffsetAEMU(ctx, target, level, xoffset, yoffset, width, height, format, type, offset);
+}
+
+void glBindBufferRange(GLenum target, GLuint index, GLuint buffer, GLintptr offset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glBindBufferRange(ctx, target, index, buffer, offset, size);
+}
+
+void glBindBufferBase(GLenum target, GLuint index, GLuint buffer)
+{
+	GET_CONTEXT;
+	ctx->glBindBufferBase(ctx, target, index, buffer);
+}
+
+void glCopyBufferSubData(GLenum readtarget, GLenum writetarget, GLintptr readoffset, GLintptr writeoffset, GLsizeiptr size)
+{
+	GET_CONTEXT;
+	ctx->glCopyBufferSubData(ctx, readtarget, writetarget, readoffset, writeoffset, size);
+}
+
+void glClearBufferiv(GLenum buffer, GLint drawBuffer, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferiv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferuiv(GLenum buffer, GLint drawBuffer, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferuiv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferfv(GLenum buffer, GLint drawBuffer, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferfv(ctx, buffer, drawBuffer, value);
+}
+
+void glClearBufferfi(GLenum buffer, GLint drawBuffer, GLfloat depth, GLint stencil)
+{
+	GET_CONTEXT;
+	ctx->glClearBufferfi(ctx, buffer, drawBuffer, depth, stencil);
+}
+
+void glGetBufferParameteri64v(GLenum target, GLenum value, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferParameteri64v(ctx, target, value, data);
+}
+
+void glGetBufferPointerv(GLenum target, GLenum pname, GLvoid** params)
+{
+	GET_CONTEXT;
+	ctx->glGetBufferPointerv(ctx, target, pname, params);
+}
+
+void glUniformBlockBinding(GLuint program, GLuint uniformBlockIndex, GLuint uniformBlockBinding)
+{
+	GET_CONTEXT;
+	ctx->glUniformBlockBinding(ctx, program, uniformBlockIndex, uniformBlockBinding);
+}
+
+GLuint glGetUniformBlockIndex(GLuint program, const GLchar* uniformBlockName)
+{
+	GET_CONTEXT;
+	return ctx->glGetUniformBlockIndex(ctx, program, uniformBlockName);
+}
+
+void glGetUniformIndices(GLuint program, GLsizei uniformCount, const GLchar** uniformNames, GLuint* uniformIndices)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformIndices(ctx, program, uniformCount, uniformNames, uniformIndices);
+}
+
+void glGetUniformIndicesAEMU(GLuint program, GLsizei uniformCount, const GLchar* packedUniformNames, GLsizei packedLen, GLuint* uniformIndices)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformIndicesAEMU(ctx, program, uniformCount, packedUniformNames, packedLen, uniformIndices);
+}
+
+void glGetActiveUniformBlockiv(GLuint program, GLuint uniformBlockIndex, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetActiveUniformBlockiv(ctx, program, uniformBlockIndex, pname, params);
+}
+
+void glGetActiveUniformBlockName(GLuint program, GLuint uniformBlockIndex, GLsizei bufSize, GLsizei* length, GLchar* uniformBlockName)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetActiveUniformBlockName(ctx, program, uniformBlockIndex, bufSize, length, uniformBlockName);
+}
+
+void glUniform1ui(GLint location, GLuint v0)
+{
+	GET_CONTEXT;
+	ctx->glUniform1ui(ctx, location, v0);
+}
+
+void glUniform2ui(GLint location, GLuint v0, GLuint v1)
+{
+	GET_CONTEXT;
+	ctx->glUniform2ui(ctx, location, v0, v1);
+}
+
+void glUniform3ui(GLint location, GLuint v0, GLuint v1, GLuint v2)
+{
+	GET_CONTEXT;
+	ctx->glUniform3ui(ctx, location, v0, v1, v2);
+}
+
+void glUniform4ui(GLint location, GLint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glUniform4ui(ctx, location, v0, v1, v2, v3);
+}
+
+void glUniform1uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform1uiv(ctx, location, count, value);
+}
+
+void glUniform2uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform2uiv(ctx, location, count, value);
+}
+
+void glUniform3uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform3uiv(ctx, location, count, value);
+}
+
+void glUniform4uiv(GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glUniform4uiv(ctx, location, count, value);
+}
+
+void glUniformMatrix2x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix2x3fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix3x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix3x2fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix2x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix2x4fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix4x2fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix4x2fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix3x4fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix3x4fv(ctx, location, count, transpose, value);
+}
+
+void glUniformMatrix4x3fv(GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glUniformMatrix4x3fv(ctx, location, count, transpose, value);
+}
+
+void glGetUniformuiv(GLuint program, GLint location, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetUniformuiv(ctx, program, location, params);
+}
+
+void glGetActiveUniformsiv(GLuint program, GLsizei uniformCount, const GLuint* uniformIndices, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetActiveUniformsiv(ctx, program, uniformCount, uniformIndices, pname, params);
+}
+
+void glVertexAttribI4i(GLuint index, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4i(ctx, index, v0, v1, v2, v3);
+}
+
+void glVertexAttribI4ui(GLuint index, GLuint v0, GLuint v1, GLuint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4ui(ctx, index, v0, v1, v2, v3);
+}
+
+void glVertexAttribI4iv(GLuint index, const GLint* v)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4iv(ctx, index, v);
+}
+
+void glVertexAttribI4uiv(GLuint index, const GLuint* v)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribI4uiv(ctx, index, v);
+}
+
+void glVertexAttribIPointer(GLuint index, GLint size, GLenum type, GLsizei stride, const GLvoid* pointer)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointer(ctx, index, size, type, stride, pointer);
+}
+
+void glVertexAttribIPointerOffsetAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointerOffsetAEMU(ctx, index, size, type, stride, offset);
+}
+
+void glVertexAttribIPointerDataAEMU(GLuint index, GLint size, GLenum type, GLsizei stride, void* data, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIPointerDataAEMU(ctx, index, size, type, stride, data, datalen);
+}
+
+void glGetVertexAttribIiv(GLuint index, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribIiv(ctx, index, pname, params);
+}
+
+void glGetVertexAttribIuiv(GLuint index, GLenum pname, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetVertexAttribIuiv(ctx, index, pname, params);
+}
+
+void glVertexAttribDivisor(GLuint index, GLuint divisor)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribDivisor(ctx, index, divisor);
+}
+
+void glDrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysInstanced(ctx, mode, first, count, primcount);
+}
+
+void glDrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstanced(ctx, mode, count, type, indices, primcount);
+}
+
+void glDrawElementsInstancedDataAEMU(GLenum mode, GLsizei count, GLenum type, const void* indices, GLsizei primcount, GLsizei datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstancedDataAEMU(ctx, mode, count, type, indices, primcount, datalen);
+}
+
+void glDrawElementsInstancedOffsetAEMU(GLenum mode, GLsizei count, GLenum type, GLuint offset, GLsizei primcount)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsInstancedOffsetAEMU(ctx, mode, count, type, offset, primcount);
+}
+
+void glDrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElements(ctx, mode, start, end, count, type, indices);
+}
+
+void glDrawRangeElementsDataAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, const GLvoid* indices, GLsizei datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElementsDataAEMU(ctx, mode, start, end, count, type, indices, datalen);
+}
+
+void glDrawRangeElementsOffsetAEMU(GLenum mode, GLuint start, GLuint end, GLsizei count, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawRangeElementsOffsetAEMU(ctx, mode, start, end, count, type, offset);
+}
+
+GLsync glFenceSync(GLenum condition, GLbitfield flags)
+{
+	GET_CONTEXT;
+	return ctx->glFenceSync(ctx, condition, flags);
+}
+
+GLenum glClientWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	return ctx->glClientWaitSync(ctx, wait_on, flags, timeout);
+}
+
+void glWaitSync(GLsync wait_on, GLbitfield flags, GLuint64 timeout)
+{
+	GET_CONTEXT;
+	ctx->glWaitSync(ctx, wait_on, flags, timeout);
+}
+
+void glDeleteSync(GLsync to_delete)
+{
+	GET_CONTEXT;
+	ctx->glDeleteSync(ctx, to_delete);
+}
+
+GLboolean glIsSync(GLsync sync)
+{
+	GET_CONTEXT;
+	return ctx->glIsSync(ctx, sync);
+}
+
+void glGetSynciv(GLsync sync, GLenum pname, GLsizei bufSize, GLsizei* length, GLint* values)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetSynciv(ctx, sync, pname, bufSize, length, values);
+}
+
+void glDrawBuffers(GLsizei n, const GLenum* bufs)
+{
+	GET_CONTEXT;
+	ctx->glDrawBuffers(ctx, n, bufs);
+}
+
+void glReadBuffer(GLenum src)
+{
+	GET_CONTEXT;
+	ctx->glReadBuffer(ctx, src);
+}
+
+void glBlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)
+{
+	GET_CONTEXT;
+	ctx->glBlitFramebuffer(ctx, srcX0, srcY0, srcX1, srcY1, dstX0, dstY0, dstX1, dstY1, mask, filter);
+}
+
+void glInvalidateFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments)
+{
+	GET_CONTEXT;
+	ctx->glInvalidateFramebuffer(ctx, target, numAttachments, attachments);
+}
+
+void glInvalidateSubFramebuffer(GLenum target, GLsizei numAttachments, const GLenum* attachments, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glInvalidateSubFramebuffer(ctx, target, numAttachments, attachments, x, y, width, height);
+}
+
+void glFramebufferTextureLayer(GLenum target, GLenum attachment, GLuint texture, GLint level, GLint layer)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferTextureLayer(ctx, target, attachment, texture, level, layer);
+}
+
+void glRenderbufferStorageMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glRenderbufferStorageMultisample(ctx, target, samples, internalformat, width, height);
+}
+
+void glTexStorage2D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage2D(ctx, target, levels, internalformat, width, height);
+}
+
+void glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetInternalformativ(ctx, target, internalformat, pname, bufSize, params);
+}
+
+void glBeginTransformFeedback(GLenum primitiveMode)
+{
+	GET_CONTEXT;
+	ctx->glBeginTransformFeedback(ctx, primitiveMode);
+}
+
+void glEndTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glEndTransformFeedback(ctx);
+}
+
+void glGenTransformFeedbacks(GLsizei n, GLuint* ids)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenTransformFeedbacks(ctx, n, ids);
+}
+
+void glDeleteTransformFeedbacks(GLsizei n, const GLuint* ids)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteTransformFeedbacks(ctx, n, ids);
+}
+
+void glBindTransformFeedback(GLenum target, GLuint id)
+{
+	GET_CONTEXT;
+	ctx->glBindTransformFeedback(ctx, target, id);
+}
+
+void glPauseTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glPauseTransformFeedback(ctx);
+}
+
+void glResumeTransformFeedback()
+{
+	GET_CONTEXT;
+	ctx->glResumeTransformFeedback(ctx);
+}
+
+GLboolean glIsTransformFeedback(GLuint id)
+{
+	GET_CONTEXT;
+	return ctx->glIsTransformFeedback(ctx, id);
+}
+
+void glTransformFeedbackVaryings(GLuint program, GLsizei count, const char** varyings, GLenum bufferMode)
+{
+	GET_CONTEXT;
+	ctx->glTransformFeedbackVaryings(ctx, program, count, varyings, bufferMode);
+}
+
+void glTransformFeedbackVaryingsAEMU(GLuint program, GLsizei count, const char* packedVaryings, GLuint packedVaryingsLen, GLenum bufferMode)
+{
+	GET_CONTEXT;
+	ctx->glTransformFeedbackVaryingsAEMU(ctx, program, count, packedVaryings, packedVaryingsLen, bufferMode);
+}
+
+void glGetTransformFeedbackVarying(GLuint program, GLuint index, GLsizei bufSize, GLsizei* length, GLsizei* size, GLenum* type, char* name)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetTransformFeedbackVarying(ctx, program, index, bufSize, length, size, type, name);
+}
+
+void glGenSamplers(GLsizei n, GLuint* samplers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenSamplers(ctx, n, samplers);
+}
+
+void glDeleteSamplers(GLsizei n, const GLuint* samplers)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteSamplers(ctx, n, samplers);
+}
+
+void glBindSampler(GLuint unit, GLuint sampler)
+{
+	GET_CONTEXT;
+	ctx->glBindSampler(ctx, unit, sampler);
+}
+
+void glSamplerParameterf(GLuint sampler, GLenum pname, GLfloat param)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameterf(ctx, sampler, pname, param);
+}
+
+void glSamplerParameteri(GLuint sampler, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameteri(ctx, sampler, pname, param);
+}
+
+void glSamplerParameterfv(GLuint sampler, GLenum pname, const GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameterfv(ctx, sampler, pname, params);
+}
+
+void glSamplerParameteriv(GLuint sampler, GLenum pname, const GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glSamplerParameteriv(ctx, sampler, pname, params);
+}
+
+void glGetSamplerParameterfv(GLuint sampler, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetSamplerParameterfv(ctx, sampler, pname, params);
+}
+
+void glGetSamplerParameteriv(GLuint sampler, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetSamplerParameteriv(ctx, sampler, pname, params);
+}
+
+GLboolean glIsSampler(GLuint sampler)
+{
+	GET_CONTEXT;
+	return ctx->glIsSampler(ctx, sampler);
+}
+
+void glGenQueries(GLsizei n, GLuint* queries)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGenQueries(ctx, n, queries);
+}
+
+void glDeleteQueries(GLsizei n, const GLuint* queries)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteQueries(ctx, n, queries);
+}
+
+void glBeginQuery(GLenum target, GLuint query)
+{
+	GET_CONTEXT;
+	ctx->glBeginQuery(ctx, target, query);
+}
+
+void glEndQuery(GLenum target)
+{
+	GET_CONTEXT;
+	ctx->glEndQuery(ctx, target);
+}
+
+void glGetQueryiv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetQueryiv(ctx, target, pname, params);
+}
+
+void glGetQueryObjectuiv(GLuint query, GLenum pname, GLuint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetQueryObjectuiv(ctx, query, pname, params);
+}
+
+GLboolean glIsQuery(GLuint query)
+{
+	GET_CONTEXT;
+	return ctx->glIsQuery(ctx, query);
+}
+
+void glProgramParameteri(GLuint program, GLenum pname, GLint value)
+{
+	GET_CONTEXT;
+	ctx->glProgramParameteri(ctx, program, pname, value);
+}
+
+void glProgramBinary(GLuint program, GLenum binaryFormat, const void* binary, GLsizei length)
+{
+	GET_CONTEXT;
+	ctx->glProgramBinary(ctx, program, binaryFormat, binary, length);
+}
+
+void glGetProgramBinary(GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, void* binary)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramBinary(ctx, program, bufSize, length, binaryFormat, binary);
+}
+
+GLint glGetFragDataLocation(GLuint program, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetFragDataLocation(ctx, program, name);
+}
+
+void glGetInteger64v(GLenum pname, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetInteger64v(ctx, pname, data);
+}
+
+void glGetIntegeri_v(GLenum target, GLuint index, GLint* data)
+{
+	GET_CONTEXT;
+	ctx->glGetIntegeri_v(ctx, target, index, data);
+}
+
+void glGetInteger64i_v(GLenum target, GLuint index, GLint64* data)
+{
+	GET_CONTEXT;
+	ctx->glGetInteger64i_v(ctx, target, index, data);
+}
+
+void glTexImage3D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glTexImage3D(ctx, target, level, internalFormat, width, height, depth, border, format, type, data);
+}
+
+void glTexImage3DOffsetAEMU(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexImage3DOffsetAEMU(ctx, target, level, internalFormat, width, height, depth, border, format, type, offset);
+}
+
+void glTexStorage3D(GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage3D(ctx, target, levels, internalformat, width, height, depth);
+}
+
+void glTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* data)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, data);
+}
+
+void glTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, type, offset);
+}
+
+void glCompressedTexImage3D(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexImage3D(ctx, target, level, internalformat, width, height, depth, border, imageSize, data);
+}
+
+void glCompressedTexImage3DOffsetAEMU(GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexImage3DOffsetAEMU(ctx, target, level, internalformat, width, height, depth, border, imageSize, 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)
+{
+	GET_CONTEXT;
+	 if(imageSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glCompressedTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+void glCompressedTexSubImage3DOffsetAEMU(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, GLuint data)
+{
+	GET_CONTEXT;
+	ctx->glCompressedTexSubImage3DOffsetAEMU(ctx, target, level, xoffset, yoffset, zoffset, width, height, depth, format, imageSize, data);
+}
+
+void glCopyTexSubImage3D(GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)
+{
+	GET_CONTEXT;
+	ctx->glCopyTexSubImage3D(ctx, target, level, xoffset, yoffset, zoffset, x, y, width, height);
+}
+
+const GLubyte* glGetStringi(GLenum name, GLuint index)
+{
+	GET_CONTEXT;
+	return ctx->glGetStringi(ctx, name, index);
+}
+
+void glGetBooleani_v(GLenum target, GLuint index, GLboolean* data)
+{
+	GET_CONTEXT;
+	ctx->glGetBooleani_v(ctx, target, index, data);
+}
+
+void glMemoryBarrier(GLbitfield barriers)
+{
+	GET_CONTEXT;
+	ctx->glMemoryBarrier(ctx, barriers);
+}
+
+void glMemoryBarrierByRegion(GLbitfield barriers)
+{
+	GET_CONTEXT;
+	ctx->glMemoryBarrierByRegion(ctx, barriers);
+}
+
+void glGenProgramPipelines(GLsizei n, GLuint* pipelines)
+{
+	GET_CONTEXT;
+	ctx->glGenProgramPipelines(ctx, n, pipelines);
+}
+
+void glDeleteProgramPipelines(GLsizei n, const GLuint* pipelines)
+{
+	GET_CONTEXT;
+	 if(n<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glDeleteProgramPipelines(ctx, n, pipelines);
+}
+
+void glBindProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	ctx->glBindProgramPipeline(ctx, pipeline);
+}
+
+void glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramPipelineiv(ctx, pipeline, pname, params);
+}
+
+void glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei* length, GLchar* infoLog)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramPipelineInfoLog(ctx, pipeline, bufSize, length, infoLog);
+}
+
+void glValidateProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	ctx->glValidateProgramPipeline(ctx, pipeline);
+}
+
+GLboolean glIsProgramPipeline(GLuint pipeline)
+{
+	GET_CONTEXT;
+	return ctx->glIsProgramPipeline(ctx, pipeline);
+}
+
+void glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program)
+{
+	GET_CONTEXT;
+	ctx->glUseProgramStages(ctx, pipeline, stages, program);
+}
+
+GLuint glCreateShaderProgramv(GLenum type, GLsizei count, const char** strings)
+{
+	GET_CONTEXT;
+	return ctx->glCreateShaderProgramv(ctx, type, count, strings);
+}
+
+GLuint glCreateShaderProgramvAEMU(GLenum type, GLsizei count, const char* packedStrings, GLuint packedLen)
+{
+	GET_CONTEXT;
+	return ctx->glCreateShaderProgramvAEMU(ctx, type, count, packedStrings, packedLen);
+}
+
+void glProgramUniform1f(GLuint program, GLint location, GLfloat v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1f(ctx, program, location, v0);
+}
+
+void glProgramUniform2f(GLuint program, GLint location, GLfloat v0, GLfloat v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2f(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3f(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4f(GLuint program, GLint location, GLfloat v0, GLfloat v1, GLfloat v2, GLfloat v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4f(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1i(GLuint program, GLint location, GLint v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1i(ctx, program, location, v0);
+}
+
+void glProgramUniform2i(GLuint program, GLint location, GLint v0, GLint v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2i(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3i(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4i(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLint v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4i(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1ui(GLuint program, GLint location, GLuint v0)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1ui(ctx, program, location, v0);
+}
+
+void glProgramUniform2ui(GLuint program, GLint location, GLint v0, GLuint v1)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2ui(ctx, program, location, v0, v1);
+}
+
+void glProgramUniform3ui(GLuint program, GLint location, GLint v0, GLint v1, GLuint v2)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3ui(ctx, program, location, v0, v1, v2);
+}
+
+void glProgramUniform4ui(GLuint program, GLint location, GLint v0, GLint v1, GLint v2, GLuint v3)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4ui(ctx, program, location, v0, v1, v2, v3);
+}
+
+void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4fv(ctx, program, location, count, value);
+}
+
+void glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4iv(ctx, program, location, count, value);
+}
+
+void glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform1uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform2uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform3uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniform4uiv(ctx, program, location, count, value);
+}
+
+void glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2x3fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3x2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix2x4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4x2fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix3x4fv(ctx, program, location, count, transpose, value);
+}
+
+void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat* value)
+{
+	GET_CONTEXT;
+	ctx->glProgramUniformMatrix4x3fv(ctx, program, location, count, transpose, value);
+}
+
+void glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetProgramInterfaceiv(ctx, program, programInterface, pname, params);
+}
+
+void glGetProgramResourceiv(GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum* props, GLsizei bufSize, GLsizei* length, GLint* params)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramResourceiv(ctx, program, programInterface, index, propCount, props, bufSize, length, params);
+}
+
+GLuint glGetProgramResourceIndex(GLuint program, GLenum programInterface, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetProgramResourceIndex(ctx, program, programInterface, name);
+}
+
+GLint glGetProgramResourceLocation(GLuint program, GLenum programInterface, const char* name)
+{
+	GET_CONTEXT;
+	return ctx->glGetProgramResourceLocation(ctx, program, programInterface, name);
+}
+
+void glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei* length, char* name)
+{
+	GET_CONTEXT;
+	 if(bufSize<0){ ctx->setError(GL_INVALID_VALUE); return; }
+	ctx->glGetProgramResourceName(ctx, program, programInterface, index, bufSize, length, name);
+}
+
+void glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)
+{
+	GET_CONTEXT;
+	ctx->glBindImageTexture(ctx, unit, texture, level, layered, layer, access, format);
+}
+
+void glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)
+{
+	GET_CONTEXT;
+	ctx->glDispatchCompute(ctx, num_groups_x, num_groups_y, num_groups_z);
+}
+
+void glDispatchComputeIndirect(GLintptr indirect)
+{
+	GET_CONTEXT;
+	ctx->glDispatchComputeIndirect(ctx, indirect);
+}
+
+void glBindVertexBuffer(GLuint bindingindex, GLuint buffer, GLintptr offset, GLintptr stride)
+{
+	GET_CONTEXT;
+	ctx->glBindVertexBuffer(ctx, bindingindex, buffer, offset, stride);
+}
+
+void glVertexAttribBinding(GLuint attribindex, GLuint bindingindex)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribBinding(ctx, attribindex, bindingindex);
+}
+
+void glVertexAttribFormat(GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribFormat(ctx, attribindex, size, type, normalized, relativeoffset);
+}
+
+void glVertexAttribIFormat(GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)
+{
+	GET_CONTEXT;
+	ctx->glVertexAttribIFormat(ctx, attribindex, size, type, relativeoffset);
+}
+
+void glVertexBindingDivisor(GLuint bindingindex, GLuint divisor)
+{
+	GET_CONTEXT;
+	ctx->glVertexBindingDivisor(ctx, bindingindex, divisor);
+}
+
+void glDrawArraysIndirect(GLenum mode, const void* indirect)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirect(ctx, mode, indirect);
+}
+
+void glDrawArraysIndirectDataAEMU(GLenum mode, const void* indirect, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirectDataAEMU(ctx, mode, indirect, datalen);
+}
+
+void glDrawArraysIndirectOffsetAEMU(GLenum mode, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawArraysIndirectOffsetAEMU(ctx, mode, offset);
+}
+
+void glDrawElementsIndirect(GLenum mode, GLenum type, const void* indirect)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirect(ctx, mode, type, indirect);
+}
+
+void glDrawElementsIndirectDataAEMU(GLenum mode, GLenum type, const void* indirect, GLuint datalen)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirectDataAEMU(ctx, mode, type, indirect, datalen);
+}
+
+void glDrawElementsIndirectOffsetAEMU(GLenum mode, GLenum type, GLuint offset)
+{
+	GET_CONTEXT;
+	ctx->glDrawElementsIndirectOffsetAEMU(ctx, mode, type, offset);
+}
+
+void glTexStorage2DMultisample(GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)
+{
+	GET_CONTEXT;
+	ctx->glTexStorage2DMultisample(ctx, target, samples, internalformat, width, height, fixedsamplelocations);
+}
+
+void glSampleMaski(GLuint maskNumber, GLbitfield mask)
+{
+	GET_CONTEXT;
+	ctx->glSampleMaski(ctx, maskNumber, mask);
+}
+
+void glGetMultisamplefv(GLenum pname, GLuint index, GLfloat* val)
+{
+	GET_CONTEXT;
+	ctx->glGetMultisamplefv(ctx, pname, index, val);
+}
+
+void glFramebufferParameteri(GLenum target, GLenum pname, GLint param)
+{
+	GET_CONTEXT;
+	ctx->glFramebufferParameteri(ctx, target, pname, param);
+}
+
+void glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetFramebufferParameteriv(ctx, target, pname, params);
+}
+
+void glGetTexLevelParameterfv(GLenum target, GLint level, GLenum pname, GLfloat* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexLevelParameterfv(ctx, target, level, pname, params);
+}
+
+void glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint* params)
+{
+	GET_CONTEXT;
+	ctx->glGetTexLevelParameteriv(ctx, target, level, pname, params);
+}
+
diff --git a/system/GLESv2_enc/gl2_ftable.h b/system/GLESv2_enc/gl2_ftable.h
index 25df4f0..82fa018 100644
--- a/system/GLESv2_enc/gl2_ftable.h
+++ b/system/GLESv2_enc/gl2_ftable.h
@@ -209,6 +209,177 @@
 	{"glExtGetProgramBinarySourceQCOM", (void*)glExtGetProgramBinarySourceQCOM},
 	{"glStartTilingQCOM", (void*)glStartTilingQCOM},
 	{"glEndTilingQCOM", (void*)glEndTilingQCOM},
+	{"glGenVertexArrays", (void*)glGenVertexArrays},
+	{"glBindVertexArray", (void*)glBindVertexArray},
+	{"glDeleteVertexArrays", (void*)glDeleteVertexArrays},
+	{"glIsVertexArray", (void*)glIsVertexArray},
+	{"glMapBufferRange", (void*)glMapBufferRange},
+	{"glUnmapBuffer", (void*)glUnmapBuffer},
+	{"glFlushMappedBufferRange", (void*)glFlushMappedBufferRange},
+	{"glBindBufferRange", (void*)glBindBufferRange},
+	{"glBindBufferBase", (void*)glBindBufferBase},
+	{"glCopyBufferSubData", (void*)glCopyBufferSubData},
+	{"glClearBufferiv", (void*)glClearBufferiv},
+	{"glClearBufferuiv", (void*)glClearBufferuiv},
+	{"glClearBufferfv", (void*)glClearBufferfv},
+	{"glClearBufferfi", (void*)glClearBufferfi},
+	{"glGetBufferParameteri64v", (void*)glGetBufferParameteri64v},
+	{"glGetBufferPointerv", (void*)glGetBufferPointerv},
+	{"glUniformBlockBinding", (void*)glUniformBlockBinding},
+	{"glGetUniformBlockIndex", (void*)glGetUniformBlockIndex},
+	{"glGetUniformIndices", (void*)glGetUniformIndices},
+	{"glGetActiveUniformBlockiv", (void*)glGetActiveUniformBlockiv},
+	{"glGetActiveUniformBlockName", (void*)glGetActiveUniformBlockName},
+	{"glUniform1ui", (void*)glUniform1ui},
+	{"glUniform2ui", (void*)glUniform2ui},
+	{"glUniform3ui", (void*)glUniform3ui},
+	{"glUniform4ui", (void*)glUniform4ui},
+	{"glUniform1uiv", (void*)glUniform1uiv},
+	{"glUniform2uiv", (void*)glUniform2uiv},
+	{"glUniform3uiv", (void*)glUniform3uiv},
+	{"glUniform4uiv", (void*)glUniform4uiv},
+	{"glUniformMatrix2x3fv", (void*)glUniformMatrix2x3fv},
+	{"glUniformMatrix3x2fv", (void*)glUniformMatrix3x2fv},
+	{"glUniformMatrix2x4fv", (void*)glUniformMatrix2x4fv},
+	{"glUniformMatrix4x2fv", (void*)glUniformMatrix4x2fv},
+	{"glUniformMatrix3x4fv", (void*)glUniformMatrix3x4fv},
+	{"glUniformMatrix4x3fv", (void*)glUniformMatrix4x3fv},
+	{"glGetUniformuiv", (void*)glGetUniformuiv},
+	{"glGetActiveUniformsiv", (void*)glGetActiveUniformsiv},
+	{"glVertexAttribI4i", (void*)glVertexAttribI4i},
+	{"glVertexAttribI4ui", (void*)glVertexAttribI4ui},
+	{"glVertexAttribI4iv", (void*)glVertexAttribI4iv},
+	{"glVertexAttribI4uiv", (void*)glVertexAttribI4uiv},
+	{"glVertexAttribIPointer", (void*)glVertexAttribIPointer},
+	{"glGetVertexAttribIiv", (void*)glGetVertexAttribIiv},
+	{"glGetVertexAttribIuiv", (void*)glGetVertexAttribIuiv},
+	{"glVertexAttribDivisor", (void*)glVertexAttribDivisor},
+	{"glDrawArraysInstanced", (void*)glDrawArraysInstanced},
+	{"glDrawElementsInstanced", (void*)glDrawElementsInstanced},
+	{"glDrawRangeElements", (void*)glDrawRangeElements},
+	{"glFenceSync", (void*)glFenceSync},
+	{"glClientWaitSync", (void*)glClientWaitSync},
+	{"glWaitSync", (void*)glWaitSync},
+	{"glDeleteSync", (void*)glDeleteSync},
+	{"glIsSync", (void*)glIsSync},
+	{"glGetSynciv", (void*)glGetSynciv},
+	{"glDrawBuffers", (void*)glDrawBuffers},
+	{"glReadBuffer", (void*)glReadBuffer},
+	{"glBlitFramebuffer", (void*)glBlitFramebuffer},
+	{"glInvalidateFramebuffer", (void*)glInvalidateFramebuffer},
+	{"glInvalidateSubFramebuffer", (void*)glInvalidateSubFramebuffer},
+	{"glFramebufferTextureLayer", (void*)glFramebufferTextureLayer},
+	{"glRenderbufferStorageMultisample", (void*)glRenderbufferStorageMultisample},
+	{"glTexStorage2D", (void*)glTexStorage2D},
+	{"glGetInternalformativ", (void*)glGetInternalformativ},
+	{"glBeginTransformFeedback", (void*)glBeginTransformFeedback},
+	{"glEndTransformFeedback", (void*)glEndTransformFeedback},
+	{"glGenTransformFeedbacks", (void*)glGenTransformFeedbacks},
+	{"glDeleteTransformFeedbacks", (void*)glDeleteTransformFeedbacks},
+	{"glBindTransformFeedback", (void*)glBindTransformFeedback},
+	{"glPauseTransformFeedback", (void*)glPauseTransformFeedback},
+	{"glResumeTransformFeedback", (void*)glResumeTransformFeedback},
+	{"glIsTransformFeedback", (void*)glIsTransformFeedback},
+	{"glTransformFeedbackVaryings", (void*)glTransformFeedbackVaryings},
+	{"glGetTransformFeedbackVarying", (void*)glGetTransformFeedbackVarying},
+	{"glGenSamplers", (void*)glGenSamplers},
+	{"glDeleteSamplers", (void*)glDeleteSamplers},
+	{"glBindSampler", (void*)glBindSampler},
+	{"glSamplerParameterf", (void*)glSamplerParameterf},
+	{"glSamplerParameteri", (void*)glSamplerParameteri},
+	{"glSamplerParameterfv", (void*)glSamplerParameterfv},
+	{"glSamplerParameteriv", (void*)glSamplerParameteriv},
+	{"glGetSamplerParameterfv", (void*)glGetSamplerParameterfv},
+	{"glGetSamplerParameteriv", (void*)glGetSamplerParameteriv},
+	{"glIsSampler", (void*)glIsSampler},
+	{"glGenQueries", (void*)glGenQueries},
+	{"glDeleteQueries", (void*)glDeleteQueries},
+	{"glBeginQuery", (void*)glBeginQuery},
+	{"glEndQuery", (void*)glEndQuery},
+	{"glGetQueryiv", (void*)glGetQueryiv},
+	{"glGetQueryObjectuiv", (void*)glGetQueryObjectuiv},
+	{"glIsQuery", (void*)glIsQuery},
+	{"glProgramParameteri", (void*)glProgramParameteri},
+	{"glProgramBinary", (void*)glProgramBinary},
+	{"glGetProgramBinary", (void*)glGetProgramBinary},
+	{"glGetFragDataLocation", (void*)glGetFragDataLocation},
+	{"glGetInteger64v", (void*)glGetInteger64v},
+	{"glGetIntegeri_v", (void*)glGetIntegeri_v},
+	{"glGetInteger64i_v", (void*)glGetInteger64i_v},
+	{"glTexImage3D", (void*)glTexImage3D},
+	{"glTexStorage3D", (void*)glTexStorage3D},
+	{"glTexSubImage3D", (void*)glTexSubImage3D},
+	{"glCompressedTexImage3D", (void*)glCompressedTexImage3D},
+	{"glCompressedTexSubImage3D", (void*)glCompressedTexSubImage3D},
+	{"glCopyTexSubImage3D", (void*)glCopyTexSubImage3D},
+	{"glGetStringi", (void*)glGetStringi},
+	{"glGetBooleani_v", (void*)glGetBooleani_v},
+	{"glMemoryBarrier", (void*)glMemoryBarrier},
+	{"glMemoryBarrierByRegion", (void*)glMemoryBarrierByRegion},
+	{"glGenProgramPipelines", (void*)glGenProgramPipelines},
+	{"glDeleteProgramPipelines", (void*)glDeleteProgramPipelines},
+	{"glBindProgramPipeline", (void*)glBindProgramPipeline},
+	{"glGetProgramPipelineiv", (void*)glGetProgramPipelineiv},
+	{"glGetProgramPipelineInfoLog", (void*)glGetProgramPipelineInfoLog},
+	{"glValidateProgramPipeline", (void*)glValidateProgramPipeline},
+	{"glIsProgramPipeline", (void*)glIsProgramPipeline},
+	{"glUseProgramStages", (void*)glUseProgramStages},
+	{"glCreateShaderProgramv", (void*)glCreateShaderProgramv},
+	{"glProgramUniform1f", (void*)glProgramUniform1f},
+	{"glProgramUniform2f", (void*)glProgramUniform2f},
+	{"glProgramUniform3f", (void*)glProgramUniform3f},
+	{"glProgramUniform4f", (void*)glProgramUniform4f},
+	{"glProgramUniform1i", (void*)glProgramUniform1i},
+	{"glProgramUniform2i", (void*)glProgramUniform2i},
+	{"glProgramUniform3i", (void*)glProgramUniform3i},
+	{"glProgramUniform4i", (void*)glProgramUniform4i},
+	{"glProgramUniform1ui", (void*)glProgramUniform1ui},
+	{"glProgramUniform2ui", (void*)glProgramUniform2ui},
+	{"glProgramUniform3ui", (void*)glProgramUniform3ui},
+	{"glProgramUniform4ui", (void*)glProgramUniform4ui},
+	{"glProgramUniform1fv", (void*)glProgramUniform1fv},
+	{"glProgramUniform2fv", (void*)glProgramUniform2fv},
+	{"glProgramUniform3fv", (void*)glProgramUniform3fv},
+	{"glProgramUniform4fv", (void*)glProgramUniform4fv},
+	{"glProgramUniform1iv", (void*)glProgramUniform1iv},
+	{"glProgramUniform2iv", (void*)glProgramUniform2iv},
+	{"glProgramUniform3iv", (void*)glProgramUniform3iv},
+	{"glProgramUniform4iv", (void*)glProgramUniform4iv},
+	{"glProgramUniform1uiv", (void*)glProgramUniform1uiv},
+	{"glProgramUniform2uiv", (void*)glProgramUniform2uiv},
+	{"glProgramUniform3uiv", (void*)glProgramUniform3uiv},
+	{"glProgramUniform4uiv", (void*)glProgramUniform4uiv},
+	{"glProgramUniformMatrix2fv", (void*)glProgramUniformMatrix2fv},
+	{"glProgramUniformMatrix3fv", (void*)glProgramUniformMatrix3fv},
+	{"glProgramUniformMatrix4fv", (void*)glProgramUniformMatrix4fv},
+	{"glProgramUniformMatrix2x3fv", (void*)glProgramUniformMatrix2x3fv},
+	{"glProgramUniformMatrix3x2fv", (void*)glProgramUniformMatrix3x2fv},
+	{"glProgramUniformMatrix2x4fv", (void*)glProgramUniformMatrix2x4fv},
+	{"glProgramUniformMatrix4x2fv", (void*)glProgramUniformMatrix4x2fv},
+	{"glProgramUniformMatrix3x4fv", (void*)glProgramUniformMatrix3x4fv},
+	{"glProgramUniformMatrix4x3fv", (void*)glProgramUniformMatrix4x3fv},
+	{"glGetProgramInterfaceiv", (void*)glGetProgramInterfaceiv},
+	{"glGetProgramResourceiv", (void*)glGetProgramResourceiv},
+	{"glGetProgramResourceIndex", (void*)glGetProgramResourceIndex},
+	{"glGetProgramResourceLocation", (void*)glGetProgramResourceLocation},
+	{"glGetProgramResourceName", (void*)glGetProgramResourceName},
+	{"glBindImageTexture", (void*)glBindImageTexture},
+	{"glDispatchCompute", (void*)glDispatchCompute},
+	{"glDispatchComputeIndirect", (void*)glDispatchComputeIndirect},
+	{"glBindVertexBuffer", (void*)glBindVertexBuffer},
+	{"glVertexAttribBinding", (void*)glVertexAttribBinding},
+	{"glVertexAttribFormat", (void*)glVertexAttribFormat},
+	{"glVertexAttribIFormat", (void*)glVertexAttribIFormat},
+	{"glVertexBindingDivisor", (void*)glVertexBindingDivisor},
+	{"glDrawArraysIndirect", (void*)glDrawArraysIndirect},
+	{"glDrawElementsIndirect", (void*)glDrawElementsIndirect},
+	{"glTexStorage2DMultisample", (void*)glTexStorage2DMultisample},
+	{"glSampleMaski", (void*)glSampleMaski},
+	{"glGetMultisamplefv", (void*)glGetMultisamplefv},
+	{"glFramebufferParameteri", (void*)glFramebufferParameteri},
+	{"glGetFramebufferParameteriv", (void*)glGetFramebufferParameteriv},
+	{"glGetTexLevelParameterfv", (void*)glGetTexLevelParameterfv},
+	{"glGetTexLevelParameteriv", (void*)glGetTexLevelParameteriv},
 };
 static const int gl2_num_funcs = sizeof(gl2_funcs_by_name) / sizeof(struct _gl2_funcs_by_name);
 
diff --git a/system/GLESv2_enc/gl2_opcodes.h b/system/GLESv2_enc/gl2_opcodes.h
index 5e7857f..eb4c635 100644
--- a/system/GLESv2_enc/gl2_opcodes.h
+++ b/system/GLESv2_enc/gl2_opcodes.h
@@ -211,7 +211,203 @@
 #define OP_glGetCompressedTextureFormats 					2253
 #define OP_glShaderString 					2254
 #define OP_glFinishRoundTrip 					2255
-#define OP_last 					2256
+#define OP_glGenVertexArrays 					2256
+#define OP_glBindVertexArray 					2257
+#define OP_glDeleteVertexArrays 					2258
+#define OP_glIsVertexArray 					2259
+#define OP_glMapBufferRange 					2260
+#define OP_glUnmapBuffer 					2261
+#define OP_glFlushMappedBufferRange 					2262
+#define OP_glMapBufferRangeAEMU 					2263
+#define OP_glUnmapBufferAEMU 					2264
+#define OP_glFlushMappedBufferRangeAEMU 					2265
+#define OP_glReadPixelsOffsetAEMU 					2266
+#define OP_glCompressedTexImage2DOffsetAEMU 					2267
+#define OP_glCompressedTexSubImage2DOffsetAEMU 					2268
+#define OP_glTexImage2DOffsetAEMU 					2269
+#define OP_glTexSubImage2DOffsetAEMU 					2270
+#define OP_glBindBufferRange 					2271
+#define OP_glBindBufferBase 					2272
+#define OP_glCopyBufferSubData 					2273
+#define OP_glClearBufferiv 					2274
+#define OP_glClearBufferuiv 					2275
+#define OP_glClearBufferfv 					2276
+#define OP_glClearBufferfi 					2277
+#define OP_glGetBufferParameteri64v 					2278
+#define OP_glGetBufferPointerv 					2279
+#define OP_glUniformBlockBinding 					2280
+#define OP_glGetUniformBlockIndex 					2281
+#define OP_glGetUniformIndices 					2282
+#define OP_glGetUniformIndicesAEMU 					2283
+#define OP_glGetActiveUniformBlockiv 					2284
+#define OP_glGetActiveUniformBlockName 					2285
+#define OP_glUniform1ui 					2286
+#define OP_glUniform2ui 					2287
+#define OP_glUniform3ui 					2288
+#define OP_glUniform4ui 					2289
+#define OP_glUniform1uiv 					2290
+#define OP_glUniform2uiv 					2291
+#define OP_glUniform3uiv 					2292
+#define OP_glUniform4uiv 					2293
+#define OP_glUniformMatrix2x3fv 					2294
+#define OP_glUniformMatrix3x2fv 					2295
+#define OP_glUniformMatrix2x4fv 					2296
+#define OP_glUniformMatrix4x2fv 					2297
+#define OP_glUniformMatrix3x4fv 					2298
+#define OP_glUniformMatrix4x3fv 					2299
+#define OP_glGetUniformuiv 					2300
+#define OP_glGetActiveUniformsiv 					2301
+#define OP_glVertexAttribI4i 					2302
+#define OP_glVertexAttribI4ui 					2303
+#define OP_glVertexAttribI4iv 					2304
+#define OP_glVertexAttribI4uiv 					2305
+#define OP_glVertexAttribIPointer 					2306
+#define OP_glVertexAttribIPointerOffsetAEMU 					2307
+#define OP_glVertexAttribIPointerDataAEMU 					2308
+#define OP_glGetVertexAttribIiv 					2309
+#define OP_glGetVertexAttribIuiv 					2310
+#define OP_glVertexAttribDivisor 					2311
+#define OP_glDrawArraysInstanced 					2312
+#define OP_glDrawElementsInstanced 					2313
+#define OP_glDrawElementsInstancedDataAEMU 					2314
+#define OP_glDrawElementsInstancedOffsetAEMU 					2315
+#define OP_glDrawRangeElements 					2316
+#define OP_glDrawRangeElementsDataAEMU 					2317
+#define OP_glDrawRangeElementsOffsetAEMU 					2318
+#define OP_glFenceSync 					2319
+#define OP_glClientWaitSync 					2320
+#define OP_glWaitSync 					2321
+#define OP_glDeleteSync 					2322
+#define OP_glIsSync 					2323
+#define OP_glGetSynciv 					2324
+#define OP_glDrawBuffers 					2325
+#define OP_glReadBuffer 					2326
+#define OP_glBlitFramebuffer 					2327
+#define OP_glInvalidateFramebuffer 					2328
+#define OP_glInvalidateSubFramebuffer 					2329
+#define OP_glFramebufferTextureLayer 					2330
+#define OP_glRenderbufferStorageMultisample 					2331
+#define OP_glTexStorage2D 					2332
+#define OP_glGetInternalformativ 					2333
+#define OP_glBeginTransformFeedback 					2334
+#define OP_glEndTransformFeedback 					2335
+#define OP_glGenTransformFeedbacks 					2336
+#define OP_glDeleteTransformFeedbacks 					2337
+#define OP_glBindTransformFeedback 					2338
+#define OP_glPauseTransformFeedback 					2339
+#define OP_glResumeTransformFeedback 					2340
+#define OP_glIsTransformFeedback 					2341
+#define OP_glTransformFeedbackVaryings 					2342
+#define OP_glTransformFeedbackVaryingsAEMU 					2343
+#define OP_glGetTransformFeedbackVarying 					2344
+#define OP_glGenSamplers 					2345
+#define OP_glDeleteSamplers 					2346
+#define OP_glBindSampler 					2347
+#define OP_glSamplerParameterf 					2348
+#define OP_glSamplerParameteri 					2349
+#define OP_glSamplerParameterfv 					2350
+#define OP_glSamplerParameteriv 					2351
+#define OP_glGetSamplerParameterfv 					2352
+#define OP_glGetSamplerParameteriv 					2353
+#define OP_glIsSampler 					2354
+#define OP_glGenQueries 					2355
+#define OP_glDeleteQueries 					2356
+#define OP_glBeginQuery 					2357
+#define OP_glEndQuery 					2358
+#define OP_glGetQueryiv 					2359
+#define OP_glGetQueryObjectuiv 					2360
+#define OP_glIsQuery 					2361
+#define OP_glProgramParameteri 					2362
+#define OP_glProgramBinary 					2363
+#define OP_glGetProgramBinary 					2364
+#define OP_glGetFragDataLocation 					2365
+#define OP_glGetInteger64v 					2366
+#define OP_glGetIntegeri_v 					2367
+#define OP_glGetInteger64i_v 					2368
+#define OP_glTexImage3D 					2369
+#define OP_glTexImage3DOffsetAEMU 					2370
+#define OP_glTexStorage3D 					2371
+#define OP_glTexSubImage3D 					2372
+#define OP_glTexSubImage3DOffsetAEMU 					2373
+#define OP_glCompressedTexImage3D 					2374
+#define OP_glCompressedTexImage3DOffsetAEMU 					2375
+#define OP_glCompressedTexSubImage3D 					2376
+#define OP_glCompressedTexSubImage3DOffsetAEMU 					2377
+#define OP_glCopyTexSubImage3D 					2378
+#define OP_glGetStringi 					2379
+#define OP_glGetBooleani_v 					2380
+#define OP_glMemoryBarrier 					2381
+#define OP_glMemoryBarrierByRegion 					2382
+#define OP_glGenProgramPipelines 					2383
+#define OP_glDeleteProgramPipelines 					2384
+#define OP_glBindProgramPipeline 					2385
+#define OP_glGetProgramPipelineiv 					2386
+#define OP_glGetProgramPipelineInfoLog 					2387
+#define OP_glValidateProgramPipeline 					2388
+#define OP_glIsProgramPipeline 					2389
+#define OP_glUseProgramStages 					2390
+#define OP_glCreateShaderProgramv 					2391
+#define OP_glCreateShaderProgramvAEMU 					2392
+#define OP_glProgramUniform1f 					2393
+#define OP_glProgramUniform2f 					2394
+#define OP_glProgramUniform3f 					2395
+#define OP_glProgramUniform4f 					2396
+#define OP_glProgramUniform1i 					2397
+#define OP_glProgramUniform2i 					2398
+#define OP_glProgramUniform3i 					2399
+#define OP_glProgramUniform4i 					2400
+#define OP_glProgramUniform1ui 					2401
+#define OP_glProgramUniform2ui 					2402
+#define OP_glProgramUniform3ui 					2403
+#define OP_glProgramUniform4ui 					2404
+#define OP_glProgramUniform1fv 					2405
+#define OP_glProgramUniform2fv 					2406
+#define OP_glProgramUniform3fv 					2407
+#define OP_glProgramUniform4fv 					2408
+#define OP_glProgramUniform1iv 					2409
+#define OP_glProgramUniform2iv 					2410
+#define OP_glProgramUniform3iv 					2411
+#define OP_glProgramUniform4iv 					2412
+#define OP_glProgramUniform1uiv 					2413
+#define OP_glProgramUniform2uiv 					2414
+#define OP_glProgramUniform3uiv 					2415
+#define OP_glProgramUniform4uiv 					2416
+#define OP_glProgramUniformMatrix2fv 					2417
+#define OP_glProgramUniformMatrix3fv 					2418
+#define OP_glProgramUniformMatrix4fv 					2419
+#define OP_glProgramUniformMatrix2x3fv 					2420
+#define OP_glProgramUniformMatrix3x2fv 					2421
+#define OP_glProgramUniformMatrix2x4fv 					2422
+#define OP_glProgramUniformMatrix4x2fv 					2423
+#define OP_glProgramUniformMatrix3x4fv 					2424
+#define OP_glProgramUniformMatrix4x3fv 					2425
+#define OP_glGetProgramInterfaceiv 					2426
+#define OP_glGetProgramResourceiv 					2427
+#define OP_glGetProgramResourceIndex 					2428
+#define OP_glGetProgramResourceLocation 					2429
+#define OP_glGetProgramResourceName 					2430
+#define OP_glBindImageTexture 					2431
+#define OP_glDispatchCompute 					2432
+#define OP_glDispatchComputeIndirect 					2433
+#define OP_glBindVertexBuffer 					2434
+#define OP_glVertexAttribBinding 					2435
+#define OP_glVertexAttribFormat 					2436
+#define OP_glVertexAttribIFormat 					2437
+#define OP_glVertexBindingDivisor 					2438
+#define OP_glDrawArraysIndirect 					2439
+#define OP_glDrawArraysIndirectDataAEMU 					2440
+#define OP_glDrawArraysIndirectOffsetAEMU 					2441
+#define OP_glDrawElementsIndirect 					2442
+#define OP_glDrawElementsIndirectDataAEMU 					2443
+#define OP_glDrawElementsIndirectOffsetAEMU 					2444
+#define OP_glTexStorage2DMultisample 					2445
+#define OP_glSampleMaski 					2446
+#define OP_glGetMultisamplefv 					2447
+#define OP_glFramebufferParameteri 					2448
+#define OP_glGetFramebufferParameteriv 					2449
+#define OP_glGetTexLevelParameterfv 					2450
+#define OP_glGetTexLevelParameteriv 					2451
+#define OP_last 					2452
 
 
 #endif
diff --git a/system/OpenglSystemCommon/EGLClientIface.h b/system/OpenglSystemCommon/EGLClientIface.h
index 3c8cb55..35b66bf 100644
--- a/system/OpenglSystemCommon/EGLClientIface.h
+++ b/system/OpenglSystemCommon/EGLClientIface.h
@@ -28,6 +28,7 @@
     void* (*getProcAddress)(const char *funcName);
     void (*init)();
     void (*finish)();
+    void (*getIntegerv)(unsigned int pname, int* param);
 } EGLClient_glesInterface;
 
 //
diff --git a/system/OpenglSystemCommon/HostConnection.cpp b/system/OpenglSystemCommon/HostConnection.cpp
index bb03457..958d011 100644
--- a/system/OpenglSystemCommon/HostConnection.cpp
+++ b/system/OpenglSystemCommon/HostConnection.cpp
@@ -154,6 +154,7 @@
         setChecksumHelper(m_rcEnc);
         queryAndSetSyncImpl(m_rcEnc);
         queryAndSetDmaImpl(m_rcEnc);
+        queryAndSetGLESMaxVersion(m_rcEnc);
         processPipeInit(m_rcEnc);
     }
     return m_rcEnc;
@@ -249,3 +250,24 @@
     }
 #endif
 }
+
+void HostConnection::queryAndSetGLESMaxVersion(ExtendedRCEncoderContext* rcEnc) {
+    std::string glExtensions = queryGLExtensions(rcEnc);
+#if PLATFORM_SDK_VERSION <= 22 || (!defined(__i386__) && !defined(__x86_64__))
+    rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_2);
+#else
+    if (glExtensions.find(kGLESMaxVersion_2) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_2);
+    } else if (glExtensions.find(kGLESMaxVersion_3_0) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_0);
+    } else if (glExtensions.find(kGLESMaxVersion_3_1) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_1);
+    } else if (glExtensions.find(kGLESMaxVersion_3_2) != std::string::npos) {
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_3_2);
+    } else {
+        ALOGW("Unrecognized GLES max version string in extensions: %s",
+              glExtensions.c_str());
+        rcEnc->setGLESMaxVersion(GLES_MAX_VERSION_2);
+    }
+#endif
+}
diff --git a/system/OpenglSystemCommon/HostConnection.h b/system/OpenglSystemCommon/HostConnection.h
index b81dd06..2c81517 100644
--- a/system/OpenglSystemCommon/HostConnection.h
+++ b/system/OpenglSystemCommon/HostConnection.h
@@ -59,6 +59,19 @@
 
 static const char kDmaExtStr_v1[] = "ANDROID_EMU_dma_v1";
 
+// OpenGL ES max supported version
+enum GLESMaxVersion {
+    GLES_MAX_VERSION_2 = 0,
+    GLES_MAX_VERSION_3_0 = 1,
+    GLES_MAX_VERSION_3_1 = 2,
+    GLES_MAX_VERSION_3_2 = 3,
+};
+
+static const char kGLESMaxVersion_2[] = "ANDROID_EMU_gles_max_version_2";
+static const char kGLESMaxVersion_3_0[] = "ANDROID_EMU_gles_max_version_3_0";
+static const char kGLESMaxVersion_3_1[] = "ANDROID_EMU_gles_max_version_3_1";
+static const char kGLESMaxVersion_3_2[] = "ANDROID_EMU_gles_max_version_3_2";
+
 // ExtendedRCEncoderContext is an extended version of renderControl_encoder_context_t
 // that will be used to track SyncImpl.
 class ExtendedRCEncoderContext : public renderControl_encoder_context_t {
@@ -85,10 +98,13 @@
         ALOGV("%s: paddr=0x%llx", __FUNCTION__, paddr);
         return paddr;
     }
+    void setGLESMaxVersion(GLESMaxVersion ver) { m_glesMaxVersion = ver; }
+    GLESMaxVersion getGLESMaxVersion() const { return m_glesMaxVersion; }
 private:
     SyncImpl m_syncImpl;
     DmaImpl m_dmaImpl;
     struct goldfish_dma_context* m_dmaCxt;
+    GLESMaxVersion m_glesMaxVersion;
 };
 
 class HostConnection
@@ -128,6 +144,7 @@
     void setChecksumHelper(ExtendedRCEncoderContext *rcEnc);
     void queryAndSetSyncImpl(ExtendedRCEncoderContext *rcEnc);
     void queryAndSetDmaImpl(ExtendedRCEncoderContext *rcEnc);
+    void queryAndSetGLESMaxVersion(ExtendedRCEncoderContext *rcEnc);
 
 private:
     IOStream *m_stream;
diff --git a/system/egl/ClientAPIExts.cpp b/system/egl/ClientAPIExts.cpp
index a18754d..0f02dcb 100644
--- a/system/egl/ClientAPIExts.cpp
+++ b/system/egl/ClientAPIExts.cpp
@@ -97,7 +97,7 @@
         if (!thread->currentContext) { \
             return; \
         } \
-        int idx = (int)thread->currentContext->version - 1; \
+        int idx = (int)thread->currentContext->majorVersion - 1; \
         if (!s_client_extensions[idx].fname) { \
             return; \
         } \
@@ -111,7 +111,7 @@
         if (!thread->currentContext) { \
             return (rtype)0; \
         } \
-        int idx = (int)thread->currentContext->version - 1; \
+        int idx = (int)thread->currentContext->majorVersion - 1; \
         if (!s_client_extensions[idx].fname) { \
             return (rtype)0; \
         } \
diff --git a/system/egl/egl.cpp b/system/egl/egl.cpp
index ea0ac2e..a3048f0 100644
--- a/system/egl/egl.cpp
+++ b/system/egl/egl.cpp
@@ -36,6 +36,8 @@
 #include "GL2Encoder.h"
 #endif
 
+#include <GLES3/gl31.h>
+
 #if PLATFORM_SDK_VERSION >= 16
 #include <system/window.h>
 #else // PLATFORM_SDK_VERSION >= 16
@@ -156,7 +158,7 @@
 // The one and only supported display object.
 static eglDisplay s_display;
 
-EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx) :
+EGLContext_t::EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min) :
     dpy(dpy),
     config(config),
     read(EGL_NO_SURFACE),
@@ -164,6 +166,8 @@
     shareCtx(shareCtx),
     rcContext(0),
     versionString(NULL),
+    majorVersion(maj),
+    minorVersion(min),
     vendorString(NULL),
     rendererString(NULL),
     shaderVersionString(NULL),
@@ -172,9 +176,8 @@
     goldfishSyncFd(-1)
 {
     flags = 0;
-    version = 1;
-    clientState = new GLClientState();
-    if (shareCtx)
+    clientState = new GLClientState(majorVersion, minorVersion);
+     if (shareCtx)
         sharedGroup = shareCtx->getSharedGroup();
     else
         sharedGroup = GLSharedGroupPtr(new GLSharedGroup());
@@ -620,13 +623,6 @@
         return NULL;
     }
 
-    if (*strPtr != NULL) {
-        //
-        // string is already cached
-        //
-        return *strPtr;
-    }
-
     //
     // first query of that string - need to query host
     //
@@ -1103,7 +1099,7 @@
             // with the only issue that we do not require a valid display here.
             DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_FALSE);
             rcEnc->rcMakeCurrent(rcEnc, 0, 0, 0);
-             if (context->version == 2) {
+             if (context->majorVersion > 1) {
                 hostCon->gl2Encoder()->setClientState(NULL);
                 hostCon->gl2Encoder()->setSharedGroup(GLSharedGroupPtr());
             }
@@ -1253,22 +1249,86 @@
     VALIDATE_DISPLAY_INIT(dpy, EGL_NO_CONTEXT);
     VALIDATE_CONFIG(config, EGL_NO_CONTEXT);
 
-    EGLint version = 1; //default
+    EGLint majorVersion = 1; //default
+    EGLint minorVersion = 0;
+    EGLint context_flags = 0;
+    EGLint profile_mask = 0;
+    EGLint reset_notification_strategy = 0;
     while (attrib_list && attrib_list[0] != EGL_NONE) {
-        if (attrib_list[0] == EGL_CONTEXT_CLIENT_VERSION) {
-            version = attrib_list[1];
-        } else if (attrib_list[0] == EGL_CONTEXT_PRIORITY_LEVEL_IMG) {
-            // https://www.khronos.org/registry/egl/extensions/IMG/EGL_IMG_context_priority.txt
-            // It it not yet supported in the emulator.
-            ALOGW("EGL_CONTEXT_PRIORITY_LEVEL_IMG not supported, ignored");
-        } else { // Only the attribute EGL_CONTEXT_CLIENT_VERSION may be specified.
+           EGLint attrib_val = attrib_list[1];
+        switch(attrib_list[0]) {
+        case EGL_CONTEXT_MAJOR_VERSION_KHR:
+            majorVersion = attrib_val;
+            break;
+        case EGL_CONTEXT_MINOR_VERSION_KHR:
+            minorVersion = attrib_val;
+            break;
+        case EGL_CONTEXT_FLAGS_KHR:
+            if ((attrib_val | EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR) ||
+                (attrib_val | EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR)  ||
+                (attrib_val | EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR)) {
+                context_flags = attrib_val;
+            } else {
+                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
+            }
+            break;
+        case EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR:
+            if ((attrib_val | EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR) ||
+                (attrib_val | EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR)) {
+                profile_mask = attrib_val;
+            } else {
+                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
+            }
+            break;
+        case EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR:
+            switch (attrib_val) {
+            case EGL_NO_RESET_NOTIFICATION_KHR:
+            case EGL_LOSE_CONTEXT_ON_RESET_KHR:
+                break;
+            default:
+                RETURN_ERROR(EGL_NO_CONTEXT,EGL_BAD_ATTRIBUTE);
+            }
+            reset_notification_strategy = attrib_val;
+            break;
+        default:
             setErrorReturn(EGL_BAD_ATTRIBUTE, EGL_NO_CONTEXT);
         }
         attrib_list+=2;
     }
 
-    // Currently only support GLES1 and 2
-    if (version != 1 && version != 2) {
+    // Support up to GLES 3.2 depending on advertised version from the host system.
+    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_CONTEXT);
+    switch (majorVersion) {
+    case 1:
+    case 2:
+        break;
+    case 3:
+        if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_0) {
+            ALOGE("%s: EGL_BAD_CONFIG: no ES 3 support", __FUNCTION__);
+            setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+        }
+        switch (minorVersion) {
+            case 0:
+                break;
+            case 1:
+                if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_1) {
+                    ALOGE("%s: EGL_BAD_CONFIG: no ES 3.1 support", __FUNCTION__);
+                    setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+                }
+                break;
+            case 2:
+                if (rcEnc->getGLESMaxVersion() < GLES_MAX_VERSION_3_2) {
+                    ALOGE("%s: EGL_BAD_CONFIG: no ES 3.2 support", __FUNCTION__);
+                    setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+                }
+                break;
+            default:
+                ALOGE("%s: EGL_BAD_CONFIG: Unknown ES version %d.%d",
+                      __FUNCTION__, majorVersion, minorVersion);
+                setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
+        }
+        break;
+    default:
         setErrorReturn(EGL_BAD_CONFIG, EGL_NO_CONTEXT);
     }
 
@@ -1281,25 +1341,31 @@
             setErrorReturn(EGL_BAD_MATCH, EGL_NO_CONTEXT);
     }
 
-    DEFINE_AND_VALIDATE_HOST_CONNECTION(EGL_NO_CONTEXT);
     // We've created EGL context. Disconnecting
     // would be dangerous at this point.
     hostCon->setGrallocOnly(false);
 
-    uint32_t rcContext = rcEnc->rcCreateContext(rcEnc, (uintptr_t)config, rcShareCtx, version);
+    int rcMajorVersion = majorVersion;
+    if (majorVersion == 3 && minorVersion == 1) {
+        rcMajorVersion = 4;
+    }
+    if (majorVersion == 3 && minorVersion == 2) {
+        rcMajorVersion = 4;
+    }
+    ALOGD("%s: maj %d min %d rcv %d", __FUNCTION__, majorVersion, minorVersion, rcMajorVersion);
+    uint32_t rcContext = rcEnc->rcCreateContext(rcEnc, (uintptr_t)config, rcShareCtx, rcMajorVersion);
     if (!rcContext) {
         ALOGE("rcCreateContext returned 0");
         setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
     }
 
-    EGLContext_t * context = new EGLContext_t(dpy, config, shareCtx);
-    if (!context)
+    EGLContext_t * context = new EGLContext_t(dpy, config, shareCtx, majorVersion, minorVersion);
+    if (!context) {
+        ALOGE("could not alloc egl context!");
         setErrorReturn(EGL_BAD_ALLOC, EGL_NO_CONTEXT);
+    }
 
-    context->version = version;
     context->rcContext = rcContext;
-
-
     return context;
 }
 
@@ -1383,9 +1449,58 @@
         context->draw = draw;
         context->read = read;
         context->flags |= EGLContext_t::IS_CURRENT;
+        GLClientState* contextState =
+            context->getClientState();
+
+        if (!hostCon->gl2Encoder()->isInitialized()) {
+            s_display.gles2_iface()->init();
+            hostCon->gl2Encoder()->setInitialized();
+            ClientAPIExts::initClientFuncs(s_display.gles2_iface(), 1);
+        }
+        if (contextState->needsInitFromCaps()) {
+            // Get caps for indexed buffers from host.
+            // Some need a current context.
+            int max_transform_feedback_separate_attribs = 0;
+            int max_uniform_buffer_bindings = 0;
+            int max_atomic_counter_buffer_bindings = 0;
+            int max_shader_storage_buffer_bindings = 0;
+            int max_vertex_attrib_bindings = 0;
+            int max_color_attachments = 1;
+            int max_draw_buffers = 1;
+            if (context->majorVersion > 2) {
+                s_display.gles2_iface()->getIntegerv(
+                        GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &max_transform_feedback_separate_attribs);
+                s_display.gles2_iface()->getIntegerv(
+                        GL_MAX_UNIFORM_BUFFER_BINDINGS, &max_uniform_buffer_bindings);
+                if (context->minorVersion > 0) {
+                    s_display.gles2_iface()->getIntegerv(
+                            GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS, &max_atomic_counter_buffer_bindings);
+                    s_display.gles2_iface()->getIntegerv(
+                            GL_MAX_SHADER_STORAGE_BUFFER_BINDINGS, &max_shader_storage_buffer_bindings);
+                    s_display.gles2_iface()->getIntegerv(
+                            GL_MAX_VERTEX_ATTRIB_BINDINGS, &max_vertex_attrib_bindings);
+                }
+                s_display.gles2_iface()->getIntegerv(
+                        GL_MAX_COLOR_ATTACHMENTS, &max_color_attachments);
+                s_display.gles2_iface()->getIntegerv(
+                        GL_MAX_DRAW_BUFFERS, &max_draw_buffers);
+            }
+            contextState->initFromCaps(
+                    max_transform_feedback_separate_attribs,
+                    max_uniform_buffer_bindings,
+                    max_atomic_counter_buffer_bindings,
+                    max_shader_storage_buffer_bindings,
+                    max_vertex_attrib_bindings,
+                    max_color_attachments,
+                    max_draw_buffers);
+        }
+
         //set the client state
-        if (context->version == 2) {
-            hostCon->gl2Encoder()->setClientStateMakeCurrent(context->getClientState());
+        if (context->majorVersion > 1) {
+            hostCon->gl2Encoder()->setClientStateMakeCurrent(
+                    contextState,
+                    context->majorVersion,
+                    context->minorVersion);
             hostCon->gl2Encoder()->setSharedGroup(context->getSharedGroup());
         }
         else {
@@ -1395,7 +1510,7 @@
     }
     else if (tInfo->currentContext) {
         //release ClientState & SharedGroup
-        if (tInfo->currentContext->version == 2) {
+        if (tInfo->currentContext->majorVersion > 1) {
             hostCon->gl2Encoder()->setClientState(NULL);
             hostCon->gl2Encoder()->setSharedGroup(GLSharedGroupPtr(NULL));
         }
@@ -1414,7 +1529,7 @@
 
     //Check maybe we need to init the encoder, if it's first eglMakeCurrent
     if (tInfo->currentContext) {
-        if (tInfo->currentContext->version == 2) {
+        if (tInfo->currentContext->majorVersion  > 1) {
             if (!hostCon->gl2Encoder()->isInitialized()) {
                 s_display.gles2_iface()->init();
                 hostCon->gl2Encoder()->setInitialized();
@@ -1479,7 +1594,7 @@
             *value = EGL_OPENGL_ES_API;
             break;
         case EGL_CONTEXT_CLIENT_VERSION:
-            *value = context->version;
+            *value = context->majorVersion;
             break;
         case EGL_RENDER_BUFFER:
             if (!context->draw)
@@ -1503,7 +1618,7 @@
         return EGL_FALSE;
     }
 
-    if (tInfo->currentContext->version == 2) {
+    if (tInfo->currentContext->majorVersion > 1) {
         s_display.gles2_iface()->finish();
     }
     else {
@@ -1622,7 +1737,7 @@
 
         return (EGLImageKHR)image;
     }
-    
+
     setErrorReturn(EGL_BAD_PARAMETER, EGL_NO_IMAGE_KHR);
 }
 
diff --git a/system/egl/eglContext.h b/system/egl/eglContext.h
index 7a3e11b..0984591 100644
--- a/system/egl/eglContext.h
+++ b/system/egl/eglContext.h
@@ -26,7 +26,7 @@
         NEVER_CURRENT   =   0x00020000
     };
 
-    EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx);
+    EGLContext_t(EGLDisplay dpy, EGLConfig config, EGLContext_t* shareCtx, int maj, int min);
     ~EGLContext_t();
     uint32_t            flags;
     EGLDisplay          dpy;
@@ -34,9 +34,10 @@
     EGLSurface          read;
     EGLSurface          draw;
     EGLContext_t    *   shareCtx;
-    EGLint                version;
-    uint32_t             rcContext;
+    uint32_t            rcContext;
     const char*         versionString;
+    EGLint              majorVersion;
+    EGLint              minorVersion;
     const char*         vendorString;
     const char*         rendererString;
     const char*         shaderVersionString;
diff --git a/system/renderControl_enc/renderControl_enc.h b/system/renderControl_enc/renderControl_enc.h
index 7db4964..9c7b45f 100644
--- a/system/renderControl_enc/renderControl_enc.h
+++ b/system/renderControl_enc/renderControl_enc.h
@@ -22,4 +22,4 @@
 	virtual uint64_t lockAndWriteDma(void* data, uint32_t sz) { return 0; }
 };
 
-#endif  // GUARD_renderControl_encoder_context_t
\ No newline at end of file
+#endif  // GUARD_renderControl_encoder_context_t