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, ¶m, 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, ¶m, 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, ¶m, 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)
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;
}
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
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);
}
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);
}
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);
}
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);
}
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);
}
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);
}
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);
+}
+