Lines Matching refs:ctx
44 ctx->setError(err); \
52 ctx->setError(err); \
58 ctx->setError(err); \
66 ctx->setError(err); \
387 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetError() local
388 GLenum err = ctx->getError(); in s_glGetError()
390 ctx->m_glGetError_enc(ctx); // also clear host error in s_glGetError()
391 ctx->setError(GL_NO_ERROR); in s_glGetError()
395 if (ctx->m_noHostError) { in s_glGetError()
398 return ctx->m_glGetError_enc(self); in s_glGetError()
404 ErrorUpdater(GL2Encoder* ctx) : in ErrorUpdater() argument
405 mCtx(ctx), in ErrorUpdater()
406 guest_error(ctx->getError()), in ErrorUpdater()
407 host_error(ctx->m_glGetError_enc(ctx)) { in ErrorUpdater()
444 ScopedQueryUpdate(GL2Encoder* ctx, uint32_t bytes, T* target) : in ScopedQueryUpdate() argument
445 mCtx(ctx), in ScopedQueryUpdate()
448 mErrorUpdater(ctx) { in ScopedQueryUpdate()
504 GL2Encoder *ctx = (GL2Encoder *) self; in s_glFlush() local
505 ctx->m_glFlush_enc(self); in s_glFlush()
506 ctx->m_stream->flush(); in s_glFlush()
511 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetString() local
540 GL2Encoder *ctx = (GL2Encoder *)self; in s_glPixelStorei() local
541 SET_ERROR_IF(!GLESv2Validation::pixelStoreParam(ctx, param), GL_INVALID_ENUM); in s_glPixelStorei()
543 ctx->m_glPixelStorei_enc(ctx, param, value); in s_glPixelStorei()
544 assert(ctx->m_state != NULL); in s_glPixelStorei()
545 ctx->m_state->setPixelStore(param, value); in s_glPixelStorei()
549 GL2Encoder *ctx = (GL2Encoder *) self; in s_glBindBuffer() local
550 assert(ctx->m_state != NULL); in s_glBindBuffer()
551 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBindBuffer()
553 bool nop = ctx->m_state->isNonIndexedBindNoOp(target, id); in s_glBindBuffer()
557 ctx->m_state->bindBuffer(target, id); in s_glBindBuffer()
558 ctx->m_state->addBuffer(id); in s_glBindBuffer()
559 ctx->m_glBindBuffer_enc(ctx, target, id); in s_glBindBuffer()
560 ctx->m_state->setLastEncodedBufferBind(target, id); in s_glBindBuffer()
575 GL2Encoder *ctx = (GL2Encoder *) self; in s_glBufferData() local
576 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBufferData()
577 GLuint bufferId = ctx->m_state->getBuffer(target); in s_glBufferData()
581 ctx->m_shared->updateBufferData(bufferId, size, data); in s_glBufferData()
582 ctx->m_shared->setBufferUsage(bufferId, usage); in s_glBufferData()
583 ctx->m_glBufferData_enc(self, target, size, data, usage); in s_glBufferData()
588 GL2Encoder *ctx = (GL2Encoder *) self; in s_glBufferSubData() local
589 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBufferSubData()
590 GLuint bufferId = ctx->m_state->getBuffer(target); in s_glBufferSubData()
592 SET_ERROR_IF(ctx->isBufferTargetMapped(target), GL_INVALID_OPERATION); in s_glBufferSubData()
594 GLenum res = ctx->m_shared->subUpdateBufferData(bufferId, offset, size, data); in s_glBufferSubData()
597 ctx->m_glBufferSubData_enc(self, target, offset, size, data); in s_glBufferSubData()
601 GL2Encoder *ctx = (GL2Encoder *) self; in s_glGenBuffers() local
603 ctx->m_glGenBuffers_enc(self, n, buffers); in s_glGenBuffers()
605 ctx->m_state->addBuffer(buffers[i]); in s_glGenBuffers()
611 GL2Encoder *ctx = (GL2Encoder *) self; in s_glDeleteBuffers() local
616 ctx->m_shared->deleteBufferData(buffers[i]); in s_glDeleteBuffers()
617 ctx->m_state->unBindBuffer(buffers[i]); in s_glDeleteBuffers()
618 ctx->m_state->removeBuffer(buffers[i]); in s_glDeleteBuffers()
619 ctx->m_glDeleteBuffers_enc(self,1,&buffers[i]); in s_glDeleteBuffers()
625 GL2Encoder *ctx = (GL2Encoder *)self; in isValidVertexAttribIndex() local
627 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in isValidVertexAttribIndex()
634 GLESv2Validation::vertexAttribIndexRangeErrorMsg, (ctx, index)); \
638 GL2Encoder *ctx = (GL2Encoder *)self; in s_glVertexAttribPointer() local
639 assert(ctx->m_state != NULL); in s_glVertexAttribPointer()
642 SET_ERROR_IF(!GLESv2Validation::vertexAttribType(ctx, type), GL_INVALID_ENUM); in s_glVertexAttribPointer()
648 ctx->m_state->setVertexAttribBinding(indx, indx); in s_glVertexAttribPointer()
649 ctx->m_state->setVertexAttribFormat(indx, size, type, normalized, 0, false); in s_glVertexAttribPointer()
664 …ctx->m_state->bindIndexedBuffer(0, indx, ctx->m_state->currentArrayVbo(), (uintptr_t)ptr, 0, strid… in s_glVertexAttribPointer()
666 if (ctx->m_state->currentArrayVbo() != 0) { in s_glVertexAttribPointer()
667 ctx->glVertexAttribPointerOffset(ctx, indx, size, type, normalized, stride, (uintptr_t)ptr); in s_glVertexAttribPointer()
669 SET_ERROR_IF(ctx->m_state->currentVertexArrayObject() != 0 && ptr, GL_INVALID_OPERATION); in s_glVertexAttribPointer()
676 GL2Encoder *ctx = (GL2Encoder *) self; in s_glGetIntegerv() local
677 GLClientState* state = ctx->m_state; in s_glGetIntegerv()
681 *ptr = (int)ctx->m_currExtensionsArray.size(); in s_glGetIntegerv()
684 *ptr = ctx->m_deviceMajorVersion; in s_glGetIntegerv()
687 *ptr = ctx->m_deviceMinorVersion; in s_glGetIntegerv()
697 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats(); in s_glGetIntegerv()
698 if (ctx->m_num_compressedTextureFormats > 0 && in s_glGetIntegerv()
701 ctx->m_num_compressedTextureFormats * sizeof(GLint)); in s_glGetIntegerv()
707 if (ctx->m_max_combinedTextureImageUnits != 0) { in s_glGetIntegerv()
708 *ptr = ctx->m_max_combinedTextureImageUnits; in s_glGetIntegerv()
710 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
711 ctx->m_max_combinedTextureImageUnits = *ptr; in s_glGetIntegerv()
715 if (ctx->m_max_vertexTextureImageUnits != 0) { in s_glGetIntegerv()
716 *ptr = ctx->m_max_vertexTextureImageUnits; in s_glGetIntegerv()
718 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
719 ctx->m_max_vertexTextureImageUnits = *ptr; in s_glGetIntegerv()
723 if (ctx->m_max_textureImageUnits != 0) { in s_glGetIntegerv()
724 *ptr = ctx->m_max_textureImageUnits; in s_glGetIntegerv()
726 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
727 ctx->m_max_textureImageUnits = *ptr; in s_glGetIntegerv()
742 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
747 if (ctx->m_max_vertexAttribStride != 0) { in s_glGetIntegerv()
748 *ptr = ctx->m_max_vertexAttribStride; in s_glGetIntegerv()
750 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
751 ctx->m_max_vertexAttribStride = *ptr; in s_glGetIntegerv()
755 if (ctx->m_max_cubeMapTextureSize != 0) { in s_glGetIntegerv()
756 *ptr = ctx->m_max_cubeMapTextureSize; in s_glGetIntegerv()
758 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
759 ctx->m_max_cubeMapTextureSize = *ptr; in s_glGetIntegerv()
763 if (ctx->m_max_renderBufferSize != 0) { in s_glGetIntegerv()
764 *ptr = ctx->m_max_renderBufferSize; in s_glGetIntegerv()
766 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
767 ctx->m_max_renderBufferSize = *ptr; in s_glGetIntegerv()
771 if (ctx->m_max_textureSize != 0) { in s_glGetIntegerv()
772 *ptr = ctx->m_max_textureSize; in s_glGetIntegerv()
774 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
775 ctx->m_max_textureSize = *ptr; in s_glGetIntegerv()
779 if (ctx->m_max_3d_textureSize != 0) { in s_glGetIntegerv()
780 *ptr = ctx->m_max_3d_textureSize; in s_glGetIntegerv()
782 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
783 ctx->m_max_3d_textureSize = *ptr; in s_glGetIntegerv()
787 if (ctx->m_ssbo_offset_align != 0) { in s_glGetIntegerv()
788 *ptr = ctx->m_ssbo_offset_align; in s_glGetIntegerv()
790 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
791 ctx->m_ssbo_offset_align = *ptr; in s_glGetIntegerv()
795 if (ctx->m_ubo_offset_align != 0) { in s_glGetIntegerv()
796 *ptr = ctx->m_ubo_offset_align; in s_glGetIntegerv()
798 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
799 ctx->m_ubo_offset_align = *ptr; in s_glGetIntegerv()
813 SET_ERROR_IF(ctx->majorVersion() < 3, GL_INVALID_ENUM); in s_glGetIntegerv()
814 if (ctx->m_max_transformFeedbackSeparateAttribs != 0) { in s_glGetIntegerv()
815 *ptr = ctx->m_max_transformFeedbackSeparateAttribs; in s_glGetIntegerv()
817 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
818 ctx->m_max_transformFeedbackSeparateAttribs = *ptr; in s_glGetIntegerv()
822 SET_ERROR_IF(ctx->majorVersion() < 3, GL_INVALID_ENUM); in s_glGetIntegerv()
823 if (ctx->m_max_uniformBufferBindings != 0) { in s_glGetIntegerv()
824 *ptr = ctx->m_max_uniformBufferBindings; in s_glGetIntegerv()
826 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
827 ctx->m_max_uniformBufferBindings = *ptr; in s_glGetIntegerv()
831 SET_ERROR_IF(ctx->majorVersion() < 3 && in s_glGetIntegerv()
832 !ctx->hasExtension("GL_EXT_draw_buffers"), GL_INVALID_ENUM); in s_glGetIntegerv()
833 if (ctx->m_max_colorAttachments != 0) { in s_glGetIntegerv()
834 *ptr = ctx->m_max_colorAttachments; in s_glGetIntegerv()
836 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
837 ctx->m_max_colorAttachments = *ptr; in s_glGetIntegerv()
841 SET_ERROR_IF(ctx->majorVersion() < 3 && in s_glGetIntegerv()
842 !ctx->hasExtension("GL_EXT_draw_buffers"), GL_INVALID_ENUM); in s_glGetIntegerv()
843 if (ctx->m_max_drawBuffers != 0) { in s_glGetIntegerv()
844 *ptr = ctx->m_max_drawBuffers; in s_glGetIntegerv()
846 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
847 ctx->m_max_drawBuffers = *ptr; in s_glGetIntegerv()
852 SET_ERROR_IF(ctx->majorVersion() < 3 || in s_glGetIntegerv()
853 (ctx->majorVersion() == 3 && in s_glGetIntegerv()
854 ctx->minorVersion() == 0), GL_INVALID_ENUM); in s_glGetIntegerv()
855 if (ctx->m_max_atomicCounterBufferBindings != 0) { in s_glGetIntegerv()
856 *ptr = ctx->m_max_atomicCounterBufferBindings; in s_glGetIntegerv()
858 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
859 ctx->m_max_atomicCounterBufferBindings = *ptr; in s_glGetIntegerv()
863 SET_ERROR_IF(ctx->majorVersion() < 3 || in s_glGetIntegerv()
864 (ctx->majorVersion() == 3 && in s_glGetIntegerv()
865 ctx->minorVersion() == 0), GL_INVALID_ENUM); in s_glGetIntegerv()
866 if (ctx->m_max_shaderStorageBufferBindings != 0) { in s_glGetIntegerv()
867 *ptr = ctx->m_max_shaderStorageBufferBindings; in s_glGetIntegerv()
869 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
870 ctx->m_max_shaderStorageBufferBindings = *ptr; in s_glGetIntegerv()
874 SET_ERROR_IF(ctx->majorVersion() < 3 || in s_glGetIntegerv()
875 (ctx->majorVersion() == 3 && in s_glGetIntegerv()
876 ctx->minorVersion() == 0), GL_INVALID_ENUM); in s_glGetIntegerv()
877 if (ctx->m_max_vertexAttribBindings != 0) { in s_glGetIntegerv()
878 *ptr = ctx->m_max_vertexAttribBindings; in s_glGetIntegerv()
880 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
881 ctx->m_max_vertexAttribBindings = *ptr; in s_glGetIntegerv()
891 ctx->safe_glGetIntegerv(param, ptr); in s_glGetIntegerv()
900 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetFloatv() local
901 GLClientState* state = ctx->m_state; in s_glGetFloatv()
912 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats(); in s_glGetFloatv()
913 if (ctx->m_num_compressedTextureFormats > 0 && in s_glGetFloatv()
915 for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) { in s_glGetFloatv()
947 s_glGetIntegerv(ctx, param, &res); in s_glGetFloatv()
955 ctx->safe_glGetFloatv(param, ptr); in s_glGetFloatv()
964 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetBooleanv() local
965 GLClientState* state = ctx->m_state; in s_glGetBooleanv()
976 GLint *compressedTextureFormats = ctx->getCompressedTextureFormats(); in s_glGetBooleanv()
977 if (ctx->m_num_compressedTextureFormats > 0 && in s_glGetBooleanv()
979 for (int i = 0; i < ctx->m_num_compressedTextureFormats; i++) { in s_glGetBooleanv()
1011 s_glGetIntegerv(ctx, param, &res); in s_glGetBooleanv()
1019 ctx->safe_glGetBooleanv(param, ptr); in s_glGetBooleanv()
1029 GL2Encoder *ctx = (GL2Encoder *)self; in s_glEnableVertexAttribArray() local
1030 assert(ctx->m_state); in s_glEnableVertexAttribArray()
1032 ctx->m_glEnableVertexAttribArray_enc(ctx, index); in s_glEnableVertexAttribArray()
1033 ctx->m_state->enable(index, 1); in s_glEnableVertexAttribArray()
1038 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDisableVertexAttribArray() local
1039 assert(ctx->m_state); in s_glDisableVertexAttribArray()
1041 ctx->m_glDisableVertexAttribArray_enc(ctx, index); in s_glDisableVertexAttribArray()
1042 ctx->m_state->enable(index, 0); in s_glDisableVertexAttribArray()
1048 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetVertexAttribiv() local
1049 assert(ctx->m_state); in s_glGetVertexAttribiv()
1051 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in s_glGetVertexAttribiv()
1054 if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) { in s_glGetVertexAttribiv()
1055 ctx->m_glGetVertexAttribiv_enc(self, index, pname, params); in s_glGetVertexAttribiv()
1061 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetVertexAttribfv() local
1062 assert(ctx->m_state); in s_glGetVertexAttribfv()
1064 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in s_glGetVertexAttribfv()
1067 if (!ctx->m_state->getVertexAttribParameter<GLfloat>(index, pname, params)) { in s_glGetVertexAttribfv()
1068 ctx->m_glGetVertexAttribfv_enc(self, index, pname, params); in s_glGetVertexAttribfv()
1074 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetVertexAttribPointerv() local
1075 if (ctx->m_state == NULL) return; in s_glGetVertexAttribPointerv()
1077 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in s_glGetVertexAttribPointerv()
1082 *pointer = (GLvoid*)(ctx->m_state->getCurrAttributeBindingInfo(index).offset); in s_glGetVertexAttribPointerv()
1323 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawArrays() local
1324 assert(ctx->m_state != NULL); in s_glDrawArrays()
1330 ctx->getVBOUsage(&has_client_vertex_arrays, in s_glDrawArrays()
1336 ctx->sendVertexAttributes(first, count, true); in s_glDrawArrays()
1337 ctx->m_glDrawArrays_enc(ctx, mode, 0, count); in s_glDrawArrays()
1339 ctx->m_glDrawArrays_enc(ctx, mode, first, count); in s_glDrawArrays()
1347 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawElements() local
1348 assert(ctx->m_state != NULL); in s_glDrawElements()
1352 SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION); in s_glDrawElements()
1358 ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays); in s_glDrawElements()
1362 GLenum status = ctx->m_glCheckFramebufferStatus_enc(self, GL_FRAMEBUFFER); in s_glDrawElements()
1375 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElements()
1376 buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo()); in s_glDrawElements()
1379 ctx->getBufferIndexRange(buf, in s_glDrawElements()
1390 ctx->calcIndexRange(indices, in s_glDrawElements()
1400 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElements()
1402 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo()); in s_glDrawElements()
1403 ctx->glDrawElementsOffset(ctx, mode, count, type, offset); in s_glDrawElements()
1404 ctx->flushDrawCall(); in s_glDrawElements()
1407 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0); in s_glDrawElements()
1412 ctx->recenterIndices(indices, in s_glDrawElements()
1418 ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true); in s_glDrawElements()
1419 ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices, in s_glDrawElements()
1435 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawArraysNullAEMU() local
1436 assert(ctx->m_state != NULL); in s_glDrawArraysNullAEMU()
1442 ctx->getVBOUsage(&has_client_vertex_arrays, in s_glDrawArraysNullAEMU()
1448 ctx->sendVertexAttributes(first, count, true); in s_glDrawArraysNullAEMU()
1449 ctx->m_glDrawArraysNullAEMU_enc(ctx, mode, 0, count); in s_glDrawArraysNullAEMU()
1451 ctx->m_glDrawArraysNullAEMU_enc(ctx, mode, first, count); in s_glDrawArraysNullAEMU()
1453 ctx->flushDrawCall(); in s_glDrawArraysNullAEMU()
1459 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawElementsNullAEMU() local
1460 assert(ctx->m_state != NULL); in s_glDrawElementsNullAEMU()
1464 SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION); in s_glDrawElementsNullAEMU()
1470 ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays); in s_glDrawElementsNullAEMU()
1474 GLenum status = ctx->m_glCheckFramebufferStatus_enc(self, GL_FRAMEBUFFER); in s_glDrawElementsNullAEMU()
1487 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElementsNullAEMU()
1491 buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo()); in s_glDrawElementsNullAEMU()
1494 ctx->getBufferIndexRange(buf, in s_glDrawElementsNullAEMU()
1506 ctx->calcIndexRange(indices, in s_glDrawElementsNullAEMU()
1516 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElementsNullAEMU()
1518 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo()); in s_glDrawElementsNullAEMU()
1519 ctx->glDrawElementsOffsetNullAEMU(ctx, mode, count, type, offset); in s_glDrawElementsNullAEMU()
1520 ctx->flushDrawCall(); in s_glDrawElementsNullAEMU()
1523 ctx->m_glBindBuffer_enc(self, GL_ELEMENT_ARRAY_BUFFER, 0); in s_glDrawElementsNullAEMU()
1528 ctx->recenterIndices(indices, in s_glDrawElementsNullAEMU()
1534 ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true); in s_glDrawElementsNullAEMU()
1535 ctx->glDrawElementsDataNullAEMU(ctx, mode, count, type, adjustedIndices, in s_glDrawElementsNullAEMU()
1736 GL2Encoder* ctx = (GL2Encoder*)self; in s_glShaderBinary() local
1742 GL2Encoder* ctx = (GL2Encoder*)self; in s_glShaderSource() local
1743 ShaderData* shaderData = ctx->m_shared->getShaderData(shader); in s_glShaderSource()
1744 SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(shader), GL_INVALID_VALUE); in s_glShaderSource()
1778 ctx->setError(GL_OUT_OF_MEMORY); in s_glShaderSource()
1781 ctx->glShaderString(ctx, shader, str, len + 1); in s_glShaderSource()
1787 GL2Encoder *ctx = (GL2Encoder *)self; in s_glFinish() local
1788 ctx->glFinishRoundTrip(self); in s_glFinish()
1793 GL2Encoder *ctx = (GL2Encoder *)self; in s_glLinkProgram() local
1794 bool isProgram = ctx->m_shared->isProgram(program); in s_glLinkProgram()
1795 SET_ERROR_IF(!isProgram && !ctx->m_shared->isShader(program), GL_INVALID_VALUE); in s_glLinkProgram()
1798 ctx->m_glLinkProgram_enc(self, program); in s_glLinkProgram()
1801 ctx->glGetProgramiv(self, program, GL_LINK_STATUS, &linkStatus); in s_glLinkProgram()
1808 ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORMS, &numUniforms); in s_glLinkProgram()
1809 ctx->m_shared->initProgramData(program,numUniforms); in s_glLinkProgram()
1813 ctx->glGetProgramiv(self, program, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength); in s_glLinkProgram()
1822 ctx->glGetActiveUniform(self, program, i, maxLength, NULL, &size, &type, name); in s_glLinkProgram()
1823 location = ctx->m_glGetUniformLocation_enc(self, program, name); in s_glLinkProgram()
1824 ctx->m_shared->setProgramIndexInfo(program, i, location, size, type, name); in s_glLinkProgram()
1832 GL2Encoder *ctx = (GL2Encoder*)self; in s_glDeleteProgram() local
1833 ctx->m_glDeleteProgram_enc(self, program); in s_glDeleteProgram()
1835 ctx->m_shared->deleteProgramData(program); in s_glDeleteProgram()
1840 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetUniformiv() local
1841 SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE); in s_glGetUniformiv()
1842 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); in s_glGetUniformiv()
1843 SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION); in s_glGetUniformiv()
1845 SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION); in s_glGetUniformiv()
1846 ctx->m_glGetUniformiv_enc(self, program, hostLoc, params); in s_glGetUniformiv()
1850 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetUniformfv() local
1851 SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE); in s_glGetUniformfv()
1852 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); in s_glGetUniformfv()
1853 SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION); in s_glGetUniformfv()
1855 SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION); in s_glGetUniformfv()
1856 ctx->m_glGetUniformfv_enc(self, program, hostLoc, params); in s_glGetUniformfv()
1861 GL2Encoder *ctx = (GL2Encoder*)self; in s_glCreateProgram() local
1862 GLuint program = ctx->m_glCreateProgram_enc(self); in s_glCreateProgram()
1864 ctx->m_shared->addProgramData(program); in s_glCreateProgram()
1870 GL2Encoder *ctx = (GL2Encoder*)self; in s_glCreateShader() local
1871 RET_AND_SET_ERROR_IF(!GLESv2Validation::shaderType(ctx, shaderType), GL_INVALID_ENUM, 0); in s_glCreateShader()
1872 GLuint shader = ctx->m_glCreateShader_enc(self, shaderType); in s_glCreateShader()
1874 if (!ctx->m_shared->addShaderData(shader)) { in s_glCreateShader()
1875 ctx->m_glDeleteShader_enc(self, shader); in s_glCreateShader()
1885 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetAttachedShaders() local
1887 ctx->m_glGetAttachedShaders_enc(self, program, maxCount, count, shaders); in s_glGetAttachedShaders()
1893 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetShaderSource() local
1895 ctx->m_glGetShaderSource_enc(self, shader, bufsize, length, source); in s_glGetShaderSource()
1896 ShaderData* shaderData = ctx->m_shared->getShaderData(shader); in s_glGetShaderSource()
1918 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetShaderInfoLog() local
1920 ctx->m_glGetShaderInfoLog_enc(self, shader, bufsize, length, infolog); in s_glGetShaderInfoLog()
1926 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramInfoLog() local
1928 ctx->m_glGetProgramInfoLog_enc(self, program, bufsize, length, infolog); in s_glGetProgramInfoLog()
1933 GL2Encoder *ctx = (GL2Encoder*)self; in s_glDeleteShader() local
1934 ctx->m_glDeleteShader_enc(self,shader); in s_glDeleteShader()
1935 ctx->m_shared->unrefShaderData(shader); in s_glDeleteShader()
1940 GL2Encoder *ctx = (GL2Encoder*)self; in s_glAttachShader() local
1941 ctx->m_glAttachShader_enc(self, program, shader); in s_glAttachShader()
1942 ctx->m_shared->attachShader(program, shader); in s_glAttachShader()
1947 GL2Encoder *ctx = (GL2Encoder*)self; in s_glDetachShader() local
1948 ctx->m_glDetachShader_enc(self, program, shader); in s_glDetachShader()
1949 ctx->m_shared->detachShader(program, shader); in s_glDetachShader()
1968 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetUniformLocation() local
1969 return ctx->m_glGetUniformLocation_enc(self, program, name); in s_glGetUniformLocation()
1998 GL2Encoder *ctx = this; in updateHostTexture2DBindingsFromProgramData() local
1999 GLClientState* state = ctx->m_state; in updateHostTexture2DBindingsFromProgramData()
2000 GLSharedGroupPtr shared = ctx->m_shared; in updateHostTexture2DBindingsFromProgramData()
2010 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + samplerVal, in updateHostTexture2DBindingsFromProgramData()
2018 ctx->m_glActiveTexture_enc(ctx, origActiveTexture); in updateHostTexture2DBindingsFromProgramData()
2024 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUseProgram() local
2025 GLSharedGroupPtr shared = ctx->m_shared; in s_glUseProgram()
2030 ctx->m_glUseProgram_enc(self, program); in s_glUseProgram()
2031 ctx->m_state->setCurrentProgram(program); in s_glUseProgram()
2032 ctx->m_state->setCurrentShaderProgram(program); in s_glUseProgram()
2034 ctx->updateHostTexture2DBindingsFromProgramData(program); in s_glUseProgram()
2039 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1f() local
2041 ctx->m_glUniform1f_enc(self, hostLoc, x); in s_glUniform1f()
2046 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1fv() local
2048 ctx->m_glUniform1fv_enc(self, hostLoc, count, v); in s_glUniform1fv()
2053 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1i() local
2054 GLClientState* state = ctx->m_state; in s_glUniform1i()
2055 GLSharedGroupPtr shared = ctx->m_shared; in s_glUniform1i()
2058 ctx->m_glUniform1i_enc(self, hostLoc, x); in s_glUniform1i()
2063 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + x, target)) { in s_glUniform1i()
2064 ctx->m_glActiveTexture_enc(self, origActiveTexture); in s_glUniform1i()
2072 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1iv() local
2074 ctx->m_glUniform1iv_enc(self, hostLoc, count, v); in s_glUniform1iv()
2079 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2f() local
2081 ctx->m_glUniform2f_enc(self, hostLoc, x, y); in s_glUniform2f()
2086 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2fv() local
2088 ctx->m_glUniform2fv_enc(self, hostLoc, count, v); in s_glUniform2fv()
2093 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2i() local
2095 ctx->m_glUniform2i_enc(self, hostLoc, x, y); in s_glUniform2i()
2100 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2iv() local
2102 ctx->m_glUniform2iv_enc(self, hostLoc, count, v); in s_glUniform2iv()
2107 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3f() local
2109 ctx->m_glUniform3f_enc(self, hostLoc, x, y, z); in s_glUniform3f()
2114 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3fv() local
2116 ctx->m_glUniform3fv_enc(self, hostLoc, count, v); in s_glUniform3fv()
2121 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3i() local
2123 ctx->m_glUniform3i_enc(self, hostLoc, x, y, z); in s_glUniform3i()
2128 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3iv() local
2130 ctx->m_glUniform3iv_enc(self, hostLoc, count, v); in s_glUniform3iv()
2135 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4f() local
2137 ctx->m_glUniform4f_enc(self, hostLoc, x, y, z, w); in s_glUniform4f()
2142 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4fv() local
2144 ctx->m_glUniform4fv_enc(self, hostLoc, count, v); in s_glUniform4fv()
2149 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4i() local
2151 ctx->m_glUniform4i_enc(self, hostLoc, x, y, z, w); in s_glUniform4i()
2156 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4iv() local
2158 ctx->m_glUniform4iv_enc(self, hostLoc, count, v); in s_glUniform4iv()
2163 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix2fv() local
2165 ctx->m_glUniformMatrix2fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix2fv()
2170 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix3fv() local
2172 ctx->m_glUniformMatrix3fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix3fv()
2177 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix4fv() local
2179 ctx->m_glUniformMatrix4fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix4fv()
2184 GL2Encoder* ctx = (GL2Encoder*)self; in s_glActiveTexture() local
2185 GLClientState* state = ctx->m_state; in s_glActiveTexture()
2190 ctx->m_glActiveTexture_enc(ctx, texture); in s_glActiveTexture()
2195 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindTexture() local
2196 GLClientState* state = ctx->m_state; in s_glBindTexture()
2200 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glBindTexture()
2204 ctx->m_glBindTexture_enc(ctx, target, texture); in s_glBindTexture()
2211 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture); in s_glBindTexture()
2212 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, in s_glBindTexture()
2214 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, in s_glBindTexture()
2216 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, in s_glBindTexture()
2220 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, in s_glBindTexture()
2226 ctx->m_glBindTexture_enc(ctx, GL_TEXTURE_2D, texture); in s_glBindTexture()
2232 GL2Encoder* ctx = (GL2Encoder*)self; in s_glDeleteTextures() local
2233 GLClientState* state = ctx->m_state; in s_glDeleteTextures()
2236 ctx->m_glDeleteTextures_enc(ctx, n, textures); in s_glDeleteTextures()
2242 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetTexParameterfv() local
2245 ctx->override2DTextureTarget(target); in s_glGetTexParameterfv()
2246 ctx->m_glGetTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params); in s_glGetTexParameterfv()
2247 ctx->restore2DTextureTarget(target); in s_glGetTexParameterfv()
2249 ctx->m_glGetTexParameterfv_enc(ctx, target, pname, params); in s_glGetTexParameterfv()
2256 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetTexParameteriv() local
2265 ctx->override2DTextureTarget(target); in s_glGetTexParameteriv()
2266 ctx->m_glGetTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params); in s_glGetTexParameteriv()
2267 ctx->restore2DTextureTarget(target); in s_glGetTexParameteriv()
2269 ctx->m_glGetTexParameteriv_enc(ctx, target, pname, params); in s_glGetTexParameteriv()
2294 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexParameterf() local
2301 ctx->override2DTextureTarget(target); in s_glTexParameterf()
2302 ctx->m_glTexParameterf_enc(ctx, GL_TEXTURE_2D, pname, param); in s_glTexParameterf()
2303 ctx->restore2DTextureTarget(target); in s_glTexParameterf()
2305 ctx->m_glTexParameterf_enc(ctx, target, pname, param); in s_glTexParameterf()
2312 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexParameterfv() local
2319 ctx->override2DTextureTarget(target); in s_glTexParameterfv()
2320 ctx->m_glTexParameterfv_enc(ctx, GL_TEXTURE_2D, pname, params); in s_glTexParameterfv()
2321 ctx->restore2DTextureTarget(target); in s_glTexParameterfv()
2323 ctx->m_glTexParameterfv_enc(ctx, target, pname, params); in s_glTexParameterfv()
2330 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexParameteri() local
2337 ctx->override2DTextureTarget(target); in s_glTexParameteri()
2338 ctx->m_glTexParameteri_enc(ctx, GL_TEXTURE_2D, pname, param); in s_glTexParameteri()
2339 ctx->restore2DTextureTarget(target); in s_glTexParameteri()
2341 ctx->m_glTexParameteri_enc(ctx, target, pname, param); in s_glTexParameteri()
2356 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexImage2D() local
2357 GLClientState* state = ctx->m_state; in s_glTexImage2D()
2359 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glTexImage2D()
2360 SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM); in s_glTexImage2D()
2361 SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM); in s_glTexImage2D()
2363 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glTexImage2D()
2367 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glTexImage2D()
2368 ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size); in s_glTexImage2D()
2380 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2381 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2382 (ctx->m_state->pboNeededDataSize(width, height, 1, format, type, 0) > in s_glTexImage2D()
2383 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glTexImage2D()
2385 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2386 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2387 (ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size % in s_glTexImage2D()
2390 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2391 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage2D()
2411 ctx->override2DTextureTarget(target); in s_glTexImage2D()
2414 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glTexImage2D()
2415 ctx->glTexImage2DOffsetAEMU( in s_glTexImage2D()
2416 ctx, target, level, internalformat, in s_glTexImage2D()
2420 ctx->m_glTexImage2D_enc( in s_glTexImage2D()
2421 ctx, target, level, internalformat, in s_glTexImage2D()
2427 ctx->restore2DTextureTarget(target); in s_glTexImage2D()
2435 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexSubImage2D() local
2436 GLClientState* state = ctx->m_state; in s_glTexSubImage2D()
2438 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glTexSubImage2D()
2439 SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM); in s_glTexSubImage2D()
2440 SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM); in s_glTexSubImage2D()
2442 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glTexSubImage2D()
2446 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glTexSubImage2D()
2447 ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size); in s_glTexSubImage2D()
2469 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage2D()
2470 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage2D()
2472 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glTexSubImage2D()
2474 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage2D()
2475 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage2D()
2476 (ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size % in s_glTexSubImage2D()
2479 SET_ERROR_IF(!ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && !pixels, GL_INVALID_OPERATION); in s_glTexSubImage2D()
2482 ctx->override2DTextureTarget(target); in s_glTexSubImage2D()
2485 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glTexSubImage2D()
2486 ctx->glTexSubImage2DOffsetAEMU( in s_glTexSubImage2D()
2487 ctx, target, level, in s_glTexSubImage2D()
2491 ctx->m_glTexSubImage2D_enc(ctx, target, level, xoffset, yoffset, width, in s_glTexSubImage2D()
2496 ctx->restore2DTextureTarget(target); in s_glTexSubImage2D()
2504 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCopyTexImage2D() local
2505 GLClientState* state = ctx->m_state; in s_glCopyTexImage2D()
2507 SET_ERROR_IF(ctx->glCheckFramebufferStatus(ctx, GL_FRAMEBUFFER) != GL_FRAMEBUFFER_COMPLETE, in s_glCopyTexImage2D()
2518 ctx->m_glCopyTexImage2D_enc(ctx, extraTarget, level, internalformat, in s_glCopyTexImage2D()
2522 ctx->m_glCopyTexImage2D_enc(ctx, target, level, internalformat, in s_glCopyTexImage2D()
2532 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexParameteriv() local
2539 ctx->override2DTextureTarget(target); in s_glTexParameteriv()
2540 ctx->m_glTexParameteriv_enc(ctx, GL_TEXTURE_2D, pname, params); in s_glTexParameteriv()
2541 ctx->restore2DTextureTarget(target); in s_glTexParameteriv()
2543 ctx->m_glTexParameteriv_enc(ctx, target, pname, params); in s_glTexParameteriv()
2608 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGenRenderbuffers() local
2609 GLClientState* state = ctx->m_state; in s_glGenRenderbuffers()
2613 ctx->m_glGenFramebuffers_enc(self, n, renderbuffers); in s_glGenRenderbuffers()
2619 GL2Encoder* ctx = (GL2Encoder*)self; in s_glDeleteRenderbuffers() local
2620 GLClientState* state = ctx->m_state; in s_glDeleteRenderbuffers()
2624 ctx->m_glDeleteRenderbuffers_enc(self, n, renderbuffers); in s_glDeleteRenderbuffers()
2642 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindRenderbuffer() local
2643 GLClientState* state = ctx->m_state; in s_glBindRenderbuffer()
2648 ctx->m_glBindRenderbuffer_enc(self, target, renderbuffer); in s_glBindRenderbuffer()
2655 GL2Encoder* ctx = (GL2Encoder*) self; in s_glRenderbufferStorage() local
2656 GLClientState* state = ctx->m_state; in s_glRenderbufferStorage()
2660 !GLESv2Validation::rboFormat(ctx, internalformat), in s_glRenderbufferStorage()
2666 ctx->m_glRenderbufferStorage_enc(self, target, internalformat, in s_glRenderbufferStorage()
2673 GL2Encoder* ctx = (GL2Encoder*)self; in s_glFramebufferRenderbuffer() local
2674 GLClientState* state = ctx->m_state; in s_glFramebufferRenderbuffer()
2676 SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM); in s_glFramebufferRenderbuffer()
2677 SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM); in s_glFramebufferRenderbuffer()
2680 … ctx->m_glFramebufferRenderbuffer_enc(self, target, attachment, renderbuffertarget, renderbuffer); in s_glFramebufferRenderbuffer()
2685 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGenFramebuffers() local
2686 GLClientState* state = ctx->m_state; in s_glGenFramebuffers()
2690 ctx->m_glGenFramebuffers_enc(self, n, framebuffers); in s_glGenFramebuffers()
2696 GL2Encoder* ctx = (GL2Encoder*)self; in s_glDeleteFramebuffers() local
2697 GLClientState* state = ctx->m_state; in s_glDeleteFramebuffers()
2701 ctx->m_glDeleteFramebuffers_enc(self, n, framebuffers); in s_glDeleteFramebuffers()
2707 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindFramebuffer() local
2708 GLClientState* state = ctx->m_state; in s_glBindFramebuffer()
2710 SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBindFramebuffer()
2714 ctx->m_glBindFramebuffer_enc(self, target, framebuffer); in s_glBindFramebuffer()
2720 GL2Encoder* ctx = (GL2Encoder*)self; in s_glFramebufferTexture2D() local
2721 GLClientState* state = ctx->m_state; in s_glFramebufferTexture2D()
2723 SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM); in s_glFramebufferTexture2D()
2724 SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM); in s_glFramebufferTexture2D()
2727 ctx->m_glFramebufferTexture2D_enc(self, target, attachment, textarget, texture, level); in s_glFramebufferTexture2D()
2733 GL2Encoder* ctx = (GL2Encoder*)self; in s_glFramebufferTexture3DOES() local
2734 GLClientState* state = ctx->m_state; in s_glFramebufferTexture3DOES()
2738 …ctx->m_glFramebufferTexture3DOES_enc(self, target, attachment, textarget, texture, level, zoffset); in s_glFramebufferTexture3DOES()
2743 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetFramebufferAttachmentParameteriv() local
2744 const GLClientState* state = ctx->m_state; in s_glGetFramebufferAttachmentParameteriv()
2745 SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM); in s_glGetFramebufferAttachmentParameteriv()
2767 ctx->m_glGetFramebufferAttachmentParameteriv_enc(self, target, attachment, pname, params); in s_glGetFramebufferAttachmentParameteriv()
2872 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCheckFramebufferStatus() local
2873 GLClientState* state = ctx->m_state; in s_glCheckFramebufferStatus()
2876 ctx->checkFramebufferCompleteness(target, state); in s_glCheckFramebufferStatus()
2883 GLenum host_checkstatus = ctx->m_glCheckFramebufferStatus_enc(self, target); in s_glCheckFramebufferStatus()
2891 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGenVertexArrays() local
2892 GLClientState* state = ctx->m_state; in s_glGenVertexArrays()
2895 ctx->m_glGenVertexArrays_enc(self, n, arrays); in s_glGenVertexArrays()
2903 GL2Encoder* ctx = (GL2Encoder*)self; in s_glDeleteVertexArrays() local
2904 GLClientState* state = ctx->m_state; in s_glDeleteVertexArrays()
2907 ctx->m_glDeleteVertexArrays_enc(self, n, arrays); in s_glDeleteVertexArrays()
2916 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindVertexArray() local
2917 GLClientState* state = ctx->m_state; in s_glBindVertexArray()
2919 ctx->m_glBindVertexArray_enc(self, array); in s_glBindVertexArray()
2924 GL2Encoder* ctx = (GL2Encoder*)self; in s_glMapBufferOES() local
2926 RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, NULL); in s_glMapBufferOES()
2928 GLuint boundBuffer = ctx->m_state->getBuffer(target); in s_glMapBufferOES()
2932 BufferData* buf = ctx->m_shared->getBufferData(boundBuffer); in s_glMapBufferOES()
2935 return ctx->glMapBufferRange(ctx, target, 0, buf->m_size, access); in s_glMapBufferOES()
2939 GL2Encoder* ctx = (GL2Encoder*)self; in s_glUnmapBufferOES() local
2941 return ctx->glUnmapBuffer(ctx, target); in s_glUnmapBufferOES()
2944 void* GL2Encoder::s_glMapBufferRangeAEMUImpl(GL2Encoder* ctx, GLenum target, in s_glMapBufferRangeAEMUImpl() argument
2953 ctx->glMapBufferRangeAEMU( in s_glMapBufferRangeAEMUImpl()
2954 ctx, target, in s_glMapBufferRangeAEMUImpl()
2964 GL2Encoder* ctx = (GL2Encoder*)self; in s_glMapBufferRange() local
2968 RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, NULL); in s_glMapBufferRange()
2970 GLuint boundBuffer = ctx->m_state->getBuffer(target); in s_glMapBufferRange()
2974 BufferData* buf = ctx->m_shared->getBufferData(boundBuffer); in s_glMapBufferRange()
3000 if (ctx->hasExtension("ANDROID_EMU_dma_v2")) { in s_glMapBufferRange()
3009 return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf); in s_glMapBufferRange()
3014 return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf); in s_glMapBufferRange()
3021 ctx->glMapBufferRangeDMA( in s_glMapBufferRange()
3022 ctx, target, in s_glMapBufferRange()
3029 return s_glMapBufferRangeAEMUImpl(ctx, target, offset, length, access, buf); in s_glMapBufferRange()
3034 GL2Encoder* ctx = (GL2Encoder*)self; in s_glUnmapBuffer() local
3036 RET_AND_SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM, GL_FALSE); in s_glUnmapBuffer()
3038 GLuint boundBuffer = ctx->m_state->getBuffer(target); in s_glUnmapBuffer()
3042 BufferData* buf = ctx->m_shared->getBufferData(boundBuffer); in s_glUnmapBuffer()
3062 ctx->glUnmapBufferDMA( in s_glUnmapBuffer()
3063 ctx, target, in s_glUnmapBuffer()
3070 if (ctx->m_hasAsyncUnmapBuffer) { in s_glUnmapBuffer()
3071 ctx->glUnmapBufferAsyncAEMU( in s_glUnmapBuffer()
3072 ctx, target, in s_glUnmapBuffer()
3080 ctx->glUnmapBufferAEMU( in s_glUnmapBuffer()
3081 ctx, target, in s_glUnmapBuffer()
3100 GL2Encoder* ctx = (GL2Encoder*)self; in s_glFlushMappedBufferRange() local
3102 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glFlushMappedBufferRange()
3104 GLuint boundBuffer = ctx->m_state->getBuffer(target); in s_glFlushMappedBufferRange()
3107 BufferData* buf = ctx->m_shared->getBufferData(boundBuffer); in s_glFlushMappedBufferRange()
3120 if (ctx->m_hasAsyncUnmapBuffer) { in s_glFlushMappedBufferRange()
3121 ctx->glFlushMappedBufferRangeAEMU2( in s_glFlushMappedBufferRange()
3122 ctx, target, in s_glFlushMappedBufferRange()
3128 ctx->glFlushMappedBufferRangeAEMU( in s_glFlushMappedBufferRange()
3129 ctx, target, in s_glFlushMappedBufferRange()
3138 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCompressedTexImage2D() local
3139 GLClientState* state = ctx->m_state; in s_glCompressedTexImage2D()
3141 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glCompressedTexImage2D()
3143 … SET_ERROR_IF(!GLESv2Validation::supportedCompressedFormat(ctx, internalformat), GL_INVALID_ENUM); in s_glCompressedTexImage2D()
3147 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glCompressedTexImage2D()
3148 ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size); in s_glCompressedTexImage2D()
3156 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glCompressedTexImage2D()
3159 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexImage2D()
3160 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexImage2D()
3161 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glCompressedTexImage2D()
3179 ctx->override2DTextureTarget(target); in s_glCompressedTexImage2D()
3182 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glCompressedTexImage2D()
3183 ctx->glCompressedTexImage2DOffsetAEMU( in s_glCompressedTexImage2D()
3184 ctx, target, level, internalformat, in s_glCompressedTexImage2D()
3188 ctx->m_glCompressedTexImage2D_enc( in s_glCompressedTexImage2D()
3189 ctx, target, level, internalformat, in s_glCompressedTexImage2D()
3195 ctx->restore2DTextureTarget(target); in s_glCompressedTexImage2D()
3200 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCompressedTexSubImage2D() local
3202 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glCompressedTexSubImage2D()
3204 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glCompressedTexSubImage2D()
3207 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glCompressedTexSubImage2D()
3208 ctx->glGetIntegerv(ctx, GL_MAX_CUBE_MAP_TEXTURE_SIZE, &max_cube_map_texture_size); in s_glCompressedTexSubImage2D()
3214 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexSubImage2D()
3215 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexSubImage2D()
3216 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glCompressedTexSubImage2D()
3221 ctx->override2DTextureTarget(target); in s_glCompressedTexSubImage2D()
3224 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glCompressedTexSubImage2D()
3225 ctx->glCompressedTexSubImage2DOffsetAEMU( in s_glCompressedTexSubImage2D()
3226 ctx, target, level, in s_glCompressedTexSubImage2D()
3231 ctx->m_glCompressedTexSubImage2D_enc( in s_glCompressedTexSubImage2D()
3232 ctx, target, level, in s_glCompressedTexSubImage2D()
3239 ctx->restore2DTextureTarget(target); in s_glCompressedTexSubImage2D()
3244 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindBufferRange() local
3245 GLClientState* state = ctx->m_state; in s_glBindBufferRange()
3247 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBindBufferRange()
3268 ctx->s_glGetIntegerv(ctx, GL_SHADER_STORAGE_BUFFER_OFFSET_ALIGNMENT, &ssbo_offset_align); in s_glBindBufferRange()
3269 ctx->s_glGetIntegerv(ctx, GL_UNIFORM_BUFFER_OFFSET_ALIGNMENT, &ubo_offset_align); in s_glBindBufferRange()
3277 if (ctx->m_state->isIndexedBindNoOp(target, index, buffer, offset, size, 0, 0)) return; in s_glBindBufferRange()
3280 ctx->m_state->addBuffer(buffer); in s_glBindBufferRange()
3283 ctx->m_glBindBufferRange_enc(ctx, target, index, buffer, offset, size); in s_glBindBufferRange()
3284 ctx->m_state->setLastEncodedBufferBind(target, buffer); in s_glBindBufferRange()
3288 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBindBufferBase() local
3289 GLClientState* state = ctx->m_state; in s_glBindBufferBase()
3291 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glBindBufferBase()
3305 BufferData* buf = ctx->getBufferDataById(buffer); in s_glBindBufferBase()
3308 if (ctx->m_state->isIndexedBindNoOp(target, index, buffer, 0, size, 0, 0)) return; in s_glBindBufferBase()
3311 ctx->m_state->addBuffer(buffer); in s_glBindBufferBase()
3315 ctx->m_glBindBufferBase_enc(ctx, target, index, buffer); in s_glBindBufferBase()
3316 ctx->m_state->setLastEncodedBufferBind(target, buffer); in s_glBindBufferBase()
3336 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCopyBufferSubData() local
3338 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, readtarget), GL_INVALID_ENUM); in s_glCopyBufferSubData()
3339 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, writetarget), GL_INVALID_ENUM); in s_glCopyBufferSubData()
3348 SET_ERROR_IF(!ctx->boundBuffer(readtarget), GL_INVALID_OPERATION); in s_glCopyBufferSubData()
3349 SET_ERROR_IF(!ctx->boundBuffer(writetarget), GL_INVALID_OPERATION); in s_glCopyBufferSubData()
3350 SET_ERROR_IF(ctx->isBufferTargetMapped(readtarget), GL_INVALID_OPERATION); in s_glCopyBufferSubData()
3351 SET_ERROR_IF(ctx->isBufferTargetMapped(writetarget), GL_INVALID_OPERATION); in s_glCopyBufferSubData()
3356 ctx->getBufferData(readtarget) && in s_glCopyBufferSubData()
3357 (readoffset + size > ctx->getBufferData(readtarget)->m_size), in s_glCopyBufferSubData()
3360 ctx->getBufferData(writetarget) && in s_glCopyBufferSubData()
3361 (writeoffset + size > ctx->getBufferData(writetarget)->m_size), in s_glCopyBufferSubData()
3368 ctx->m_glCopyBufferSubData_enc(self, readtarget, writetarget, readoffset, writeoffset, size); in s_glCopyBufferSubData()
3372 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetBufferParameteriv() local
3374 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glGetBufferParameteriv()
3385 SET_ERROR_IF(!GLESv2Validation::bufferParam(ctx, pname), GL_INVALID_ENUM); in s_glGetBufferParameteriv()
3386 SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION); in s_glGetBufferParameteriv()
3397 BufferData* buf = ctx->getBufferData(target); in s_glGetBufferParameteriv()
3424 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetBufferParameteri64v() local
3426 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glGetBufferParameteri64v()
3437 SET_ERROR_IF(!GLESv2Validation::bufferParam(ctx, pname), GL_INVALID_ENUM); in s_glGetBufferParameteri64v()
3438 SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION); in s_glGetBufferParameteri64v()
3449 BufferData* buf = ctx->getBufferData(target); in s_glGetBufferParameteri64v()
3476 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetBufferPointerv() local
3477 SET_ERROR_IF(!GLESv2Validation::bufferTarget(ctx, target), GL_INVALID_ENUM); in s_glGetBufferPointerv()
3485 SET_ERROR_IF(!ctx->boundBuffer(target), GL_INVALID_OPERATION); in s_glGetBufferPointerv()
3488 BufferData* buf = ctx->getBufferData(target); in s_glGetBufferPointerv()
3523 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetUniformIndices() local
3541 …ctx->glGetUniformIndicesAEMU(ctx, program, uniformCount, (const GLchar*)&packed[0], packed.size() … in s_glGetUniformIndices()
3545 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1ui() local
3546 GLClientState* state = ctx->m_state; in s_glUniform1ui()
3547 GLSharedGroupPtr shared = ctx->m_shared; in s_glUniform1ui()
3550 ctx->m_glUniform1ui_enc(self, hostLoc, v0); in s_glUniform1ui()
3555 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) { in s_glUniform1ui()
3556 ctx->m_glActiveTexture_enc(self, origActiveTexture); in s_glUniform1ui()
3563 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2ui() local
3565 ctx->m_glUniform2ui_enc(self, hostLoc, v0, v1); in s_glUniform2ui()
3569 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3ui() local
3571 ctx->m_glUniform3ui_enc(self, hostLoc, v0, v1, v2); in s_glUniform3ui()
3575 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4ui() local
3577 ctx->m_glUniform4ui_enc(self, hostLoc, v0, v1, v2, v3); in s_glUniform4ui()
3581 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform1uiv() local
3583 ctx->m_glUniform1uiv_enc(self, hostLoc, count, value); in s_glUniform1uiv()
3587 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform2uiv() local
3589 ctx->m_glUniform2uiv_enc(self, hostLoc, count, value); in s_glUniform2uiv()
3593 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform3uiv() local
3595 ctx->m_glUniform3uiv_enc(self, hostLoc, count, value); in s_glUniform3uiv()
3599 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniform4uiv() local
3601 ctx->m_glUniform4uiv_enc(self, hostLoc, count, value); in s_glUniform4uiv()
3605 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix2x3fv() local
3607 ctx->m_glUniformMatrix2x3fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix2x3fv()
3611 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix3x2fv() local
3613 ctx->m_glUniformMatrix3x2fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix3x2fv()
3617 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix2x4fv() local
3619 ctx->m_glUniformMatrix2x4fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix2x4fv()
3623 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix4x2fv() local
3625 ctx->m_glUniformMatrix4x2fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix4x2fv()
3629 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix3x4fv() local
3631 ctx->m_glUniformMatrix3x4fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix3x4fv()
3635 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUniformMatrix4x3fv() local
3637 ctx->m_glUniformMatrix4x3fv_enc(self, hostLoc, count, transpose, value); in s_glUniformMatrix4x3fv()
3641 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetUniformuiv() local
3642 SET_ERROR_IF(!ctx->m_shared->isShaderOrProgramObject(program), GL_INVALID_VALUE); in s_glGetUniformuiv()
3643 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); in s_glGetUniformuiv()
3644 SET_ERROR_IF(!ctx->m_shared->isProgramInitialized(program), GL_INVALID_OPERATION); in s_glGetUniformuiv()
3646 SET_ERROR_IF(ctx->m_shared->getProgramUniformType(program,hostLoc)==0, GL_INVALID_OPERATION); in s_glGetUniformuiv()
3647 ctx->m_glGetUniformuiv_enc(self, program, hostLoc, params); in s_glGetUniformuiv()
3651 GL2Encoder* ctx = (GL2Encoder*)self; in s_glGetActiveUniformBlockiv() local
3658 ctx->m_glGetActiveUniformBlockiv_enc(ctx, in s_glGetActiveUniformBlockiv()
3662 ctx->m_state->setNumActiveUniformsInUniformBlock( in s_glGetActiveUniformBlockiv()
3666 ctx->m_glGetActiveUniformBlockiv_enc(ctx, in s_glGetActiveUniformBlockiv()
3672 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetVertexAttribIiv() local
3673 assert(ctx->m_state); in s_glGetVertexAttribIiv()
3675 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in s_glGetVertexAttribIiv()
3678 if (!ctx->m_state->getVertexAttribParameter<GLint>(index, pname, params)) { in s_glGetVertexAttribIiv()
3679 ctx->m_glGetVertexAttribIiv_enc(self, index, pname, params); in s_glGetVertexAttribIiv()
3684 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetVertexAttribIuiv() local
3685 assert(ctx->m_state); in s_glGetVertexAttribIuiv()
3687 ctx->glGetIntegerv(self, GL_MAX_VERTEX_ATTRIBS, &maxIndex); in s_glGetVertexAttribIuiv()
3690 if (!ctx->m_state->getVertexAttribParameter<GLuint>(index, pname, params)) { in s_glGetVertexAttribIuiv()
3691 ctx->m_glGetVertexAttribIuiv_enc(self, index, pname, params); in s_glGetVertexAttribIuiv()
3696 GL2Encoder *ctx = (GL2Encoder *)self; in s_glVertexAttribIPointer() local
3697 assert(ctx->m_state != NULL); in s_glVertexAttribIPointer()
3710 ctx->m_state->setVertexAttribBinding(index, index); in s_glVertexAttribIPointer()
3711 ctx->m_state->setVertexAttribFormat(index, size, type, false, 0, true); in s_glVertexAttribIPointer()
3716 …ctx->m_state->bindIndexedBuffer(0, index, ctx->m_state->currentArrayVbo(), (uintptr_t)pointer, 0, … in s_glVertexAttribIPointer()
3718 if (ctx->m_state->currentArrayVbo() != 0) { in s_glVertexAttribIPointer()
3719 ctx->glVertexAttribIPointerOffsetAEMU(ctx, index, size, type, stride, (uintptr_t)pointer); in s_glVertexAttribIPointer()
3721 … SET_ERROR_IF(ctx->m_state->currentVertexArrayObject() != 0 && pointer, GL_INVALID_OPERATION); in s_glVertexAttribIPointer()
3727 GL2Encoder *ctx = (GL2Encoder *)self; in s_glVertexAttribDivisor() local
3728 assert(ctx->m_state != NULL); in s_glVertexAttribDivisor()
3730 ctx->m_state->setVertexAttribBinding(index, index); in s_glVertexAttribDivisor()
3731 ctx->m_state->setVertexBindingDivisor(index, divisor); in s_glVertexAttribDivisor()
3732 ctx->m_glVertexAttribDivisor_enc(ctx, index, divisor); in s_glVertexAttribDivisor()
3738 GL2Encoder *ctx = (GL2Encoder *)self; in s_glRenderbufferStorageMultisample() local
3739 GLClientState* state = ctx->m_state; in s_glRenderbufferStorageMultisample()
3742 SET_ERROR_IF(!GLESv2Validation::rboFormat(ctx, internalformat), GL_INVALID_ENUM); in s_glRenderbufferStorageMultisample()
3745 ctx->s_glGetInternalformativ(ctx, target, internalformat, GL_SAMPLES, 1, &max_samples); in s_glRenderbufferStorageMultisample()
3750 ctx->m_glRenderbufferStorageMultisample_enc( in s_glRenderbufferStorageMultisample()
3755 GL2Encoder* ctx = (GL2Encoder*)self; in s_glDrawBuffers() local
3756 … SET_ERROR_IF(!ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) && n > 1, GL_INVALID_OPERATION); in s_glDrawBuffers()
3757 SET_ERROR_IF(n < 0 || n > ctx->m_state->getMaxDrawBuffers(), GL_INVALID_VALUE); in s_glDrawBuffers()
3765 !ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) && in s_glDrawBuffers()
3769 ctx->m_state->boundFramebuffer(GL_DRAW_FRAMEBUFFER) && in s_glDrawBuffers()
3777 ctx->m_glDrawBuffers_enc(ctx, n, bufs); in s_glDrawBuffers()
3781 GL2Encoder* ctx = (GL2Encoder*)self; in s_glReadBuffer() local
3786 ctx->m_state->getMaxColorAttachments()), in s_glReadBuffer()
3794 ctx->m_state->getMaxColorAttachments(), in s_glReadBuffer()
3802 !ctx->m_state->boundFramebuffer(GL_READ_FRAMEBUFFER) && in s_glReadBuffer()
3807 ctx->m_state->boundFramebuffer(GL_READ_FRAMEBUFFER) && in s_glReadBuffer()
3812 ctx->m_glReadBuffer_enc(ctx, src); in s_glReadBuffer()
3816 GL2Encoder* ctx = (GL2Encoder*)self; in s_glFramebufferTextureLayer() local
3817 GLClientState* state = ctx->m_state; in s_glFramebufferTextureLayer()
3819 SET_ERROR_IF(!GLESv2Validation::framebufferTarget(ctx, target), GL_INVALID_ENUM); in s_glFramebufferTextureLayer()
3820 SET_ERROR_IF(!GLESv2Validation::framebufferAttachment(ctx, attachment), GL_INVALID_ENUM); in s_glFramebufferTextureLayer()
3828 ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max3DTextureSize); in s_glFramebufferTextureLayer()
3833 ctx->m_glFramebufferTextureLayer_enc(self, target, attachment, texture, level, layer); in s_glFramebufferTextureLayer()
3837 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexStorage2D() local
3838 GLClientState* state = ctx->m_state; in s_glTexStorage2D()
3856 ctx->override2DTextureTarget(target); in s_glTexStorage2D()
3859 ctx->m_glTexStorage2D_enc(ctx, target, levels, internalformat, width, height); in s_glTexStorage2D()
3862 ctx->restore2DTextureTarget(target); in s_glTexStorage2D()
3867 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTransformFeedbackVaryings() local
3869 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_VALUE); in s_glTransformFeedbackVaryings()
3872 ctx->glGetIntegerv(ctx, GL_MAX_TRANSFORM_FEEDBACK_SEPARATE_ATTRIBS, &maxCount); in s_glTransformFeedbackVaryings()
3889 …ctx->glTransformFeedbackVaryingsAEMU(ctx, program, count, (const char*)&packed[0], packed.size() +… in s_glTransformFeedbackVaryings()
3893 GL2Encoder* ctx = (GL2Encoder*)self; in s_glBeginTransformFeedback() local
3894 GLClientState* state = ctx->m_state; in s_glBeginTransformFeedback()
3895 ctx->m_glBeginTransformFeedback_enc(ctx, primitiveMode); in s_glBeginTransformFeedback()
3900 GL2Encoder* ctx = (GL2Encoder*)self; in s_glEndTransformFeedback() local
3901 GLClientState* state = ctx->m_state; in s_glEndTransformFeedback()
3902 ctx->m_glEndTransformFeedback_enc(ctx); in s_glEndTransformFeedback()
3907 GL2Encoder* ctx = (GL2Encoder*)self; in s_glPauseTransformFeedback() local
3908 GLClientState* state = ctx->m_state; in s_glPauseTransformFeedback()
3909 ctx->m_glPauseTransformFeedback_enc(ctx); in s_glPauseTransformFeedback()
3914 GL2Encoder* ctx = (GL2Encoder*)self; in s_glResumeTransformFeedback() local
3915 GLClientState* state = ctx->m_state; in s_glResumeTransformFeedback()
3916 ctx->m_glResumeTransformFeedback_enc(ctx); in s_glResumeTransformFeedback()
3923 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexImage3D() local
3924 GLClientState* state = ctx->m_state; in s_glTexImage3D()
3929 SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM); in s_glTexImage3D()
3930 SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM); in s_glTexImage3D()
3933 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glTexImage3D()
3937 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glTexImage3D()
3938 ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size); in s_glTexImage3D()
3952 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage3D()
3953 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage3D()
3954 (ctx->m_state->pboNeededDataSize(width, height, depth, format, type, 0) > in s_glTexImage3D()
3955 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glTexImage3D()
3957 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage3D()
3958 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexImage3D()
3959 (ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size % in s_glTexImage3D()
3969 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glTexImage3D()
3970 ctx->glTexImage3DOffsetAEMU( in s_glTexImage3D()
3971 ctx, target, level, internalFormat, in s_glTexImage3D()
3975 ctx->m_glTexImage3D_enc(ctx, in s_glTexImage3D()
3983 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexSubImage3D() local
3984 GLClientState* state = ctx->m_state; in s_glTexSubImage3D()
3989 SET_ERROR_IF(!GLESv2Validation::pixelType(ctx, type), GL_INVALID_ENUM); in s_glTexSubImage3D()
3990 SET_ERROR_IF(!GLESv2Validation::pixelFormat(ctx, format), GL_INVALID_ENUM); in s_glTexSubImage3D()
3992 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glTexSubImage3D()
3995 ctx->glGetIntegerv(ctx, GL_MAX_TEXTURE_SIZE, &max_texture_size); in s_glTexSubImage3D()
3996 ctx->glGetIntegerv(ctx, GL_MAX_3D_TEXTURE_SIZE, &max_3d_texture_size); in s_glTexSubImage3D()
4013 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage3D()
4014 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage3D()
4015 (ctx->m_state->pboNeededDataSize(width, height, depth, format, type, 0) > in s_glTexSubImage3D()
4016 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glTexSubImage3D()
4018 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage3D()
4019 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glTexSubImage3D()
4020 (ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size % in s_glTexSubImage3D()
4023 SET_ERROR_IF(!ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && !data, GL_INVALID_OPERATION); in s_glTexSubImage3D()
4026 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glTexSubImage3D()
4027 ctx->glTexSubImage3DOffsetAEMU(ctx, in s_glTexSubImage3D()
4033 ctx->m_glTexSubImage3D_enc(ctx, in s_glTexSubImage3D()
4042 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCompressedTexImage3D() local
4043 GLClientState* state = ctx->m_state; in s_glCompressedTexImage3D()
4046 … SET_ERROR_IF(!GLESv2Validation::supportedCompressedFormat(ctx, internalformat), GL_INVALID_ENUM); in s_glCompressedTexImage3D()
4048 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glCompressedTexImage3D()
4052 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexImage3D()
4053 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexImage3D()
4054 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glCompressedTexImage3D()
4062 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glCompressedTexImage3D()
4063 ctx->glCompressedTexImage3DOffsetAEMU( in s_glCompressedTexImage3D()
4064 ctx, target, level, internalformat, in s_glCompressedTexImage3D()
4068 ctx->m_glCompressedTexImage3D_enc( in s_glCompressedTexImage3D()
4069 ctx, target, level, internalformat, in s_glCompressedTexImage3D()
4076 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCompressedTexSubImage3D() local
4078 SET_ERROR_IF(!GLESv2Validation::textureTarget(ctx, target), GL_INVALID_ENUM); in s_glCompressedTexSubImage3D()
4080 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_UNPACK_BUFFER), GL_INVALID_OPERATION); in s_glCompressedTexSubImage3D()
4083 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexSubImage3D()
4084 ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER) && in s_glCompressedTexSubImage3D()
4085 (imageSize > ctx->getBufferData(GL_PIXEL_UNPACK_BUFFER)->m_size), in s_glCompressedTexSubImage3D()
4089 if (ctx->boundBuffer(GL_PIXEL_UNPACK_BUFFER)) { in s_glCompressedTexSubImage3D()
4090 ctx->glCompressedTexSubImage3DOffsetAEMU( in s_glCompressedTexSubImage3D()
4091 ctx, target, level, in s_glCompressedTexSubImage3D()
4096 ctx->m_glCompressedTexSubImage3D_enc( in s_glCompressedTexSubImage3D()
4097 ctx, target, level, in s_glCompressedTexSubImage3D()
4106 GL2Encoder* ctx = (GL2Encoder*)self; in s_glTexStorage3D() local
4107 GLClientState* state = ctx->m_state; in s_glTexStorage3D()
4123 ctx->m_glTexStorage3D_enc(ctx, target, levels, internalformat, width, height, depth); in s_glTexStorage3D()
4128 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawArraysInstanced() local
4129 assert(ctx->m_state != NULL); in s_glDrawArraysInstanced()
4136 ctx->getVBOUsage(&has_client_vertex_arrays, in s_glDrawArraysInstanced()
4142 ctx->sendVertexAttributes(first, count, true, primcount); in s_glDrawArraysInstanced()
4143 ctx->m_glDrawArraysInstanced_enc(ctx, mode, 0, count, primcount); in s_glDrawArraysInstanced()
4145 ctx->sendVertexAttributes(0, count, false, primcount); in s_glDrawArraysInstanced()
4146 ctx->m_glDrawArraysInstanced_enc(ctx, mode, first, count, primcount); in s_glDrawArraysInstanced()
4148 ctx->m_stream->flush(); in s_glDrawArraysInstanced()
4154 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawElementsInstanced() local
4155 assert(ctx->m_state != NULL); in s_glDrawElementsInstanced()
4160 SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION); in s_glDrawElementsInstanced()
4166 ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays); in s_glDrawElementsInstanced()
4170 GLenum status = ctx->m_glCheckFramebufferStatus_enc(self, GL_FRAMEBUFFER); in s_glDrawElementsInstanced()
4183 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElementsInstanced()
4184 buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo()); in s_glDrawElementsInstanced()
4187 ctx->getBufferIndexRange(buf, in s_glDrawElementsInstanced()
4198 ctx->calcIndexRange(indices, in s_glDrawElementsInstanced()
4208 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawElementsInstanced()
4210 ctx->sendVertexAttributes(0, maxIndex + 1, false, primcount); in s_glDrawElementsInstanced()
4211 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo()); in s_glDrawElementsInstanced()
4212 ctx->glDrawElementsInstancedOffsetAEMU(ctx, mode, count, type, offset, primcount); in s_glDrawElementsInstanced()
4213 ctx->flushDrawCall(); in s_glDrawElementsInstanced()
4216 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0); in s_glDrawElementsInstanced()
4221 ctx->recenterIndices(indices, in s_glDrawElementsInstanced()
4227 ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true, primcount); in s_glDrawElementsInstanced()
4228 …ctx->glDrawElementsInstancedDataAEMU(ctx, mode, count, type, adjustedIndices, primcount, count * g… in s_glDrawElementsInstanced()
4229 ctx->m_stream->flush(); in s_glDrawElementsInstanced()
4245 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDrawRangeElements() local
4246 assert(ctx->m_state != NULL); in s_glDrawRangeElements()
4251 SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION); in s_glDrawRangeElements()
4257 ctx->getVBOUsage(&has_client_vertex_arrays, &has_indirect_arrays); in s_glDrawRangeElements()
4261 GLenum status = ctx->m_glCheckFramebufferStatus_enc(self, GL_FRAMEBUFFER); in s_glDrawRangeElements()
4274 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawRangeElements()
4275 buf = ctx->m_shared->getBufferData(ctx->m_state->currentIndexVbo()); in s_glDrawRangeElements()
4284 ctx->getBufferIndexRange(buf, in s_glDrawRangeElements()
4295 ctx->calcIndexRange(indices, in s_glDrawRangeElements()
4305 if (ctx->m_state->currentIndexVbo() != 0) { in s_glDrawRangeElements()
4307 ctx->sendVertexAttributes(0, maxIndex + 1, false); in s_glDrawRangeElements()
4308 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, ctx->m_state->currentIndexVbo()); in s_glDrawRangeElements()
4309 ctx->glDrawElementsOffset(ctx, mode, count, type, offset); in s_glDrawRangeElements()
4310 ctx->flushDrawCall(); in s_glDrawRangeElements()
4313 ctx->doBindBufferEncodeCached(GL_ELEMENT_ARRAY_BUFFER, 0); in s_glDrawRangeElements()
4318 ctx->recenterIndices(indices, in s_glDrawRangeElements()
4324 ctx->sendVertexAttributes(minIndex, maxIndex - minIndex + 1, true); in s_glDrawRangeElements()
4325 … ctx->glDrawElementsData(ctx, mode, count, type, adjustedIndices, count * glSizeof(type)); in s_glDrawRangeElements()
4326 ctx->m_stream->flush(); in s_glDrawRangeElements()
4340 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetStringi() local
4361 index >= ctx->m_currExtensionsArray.size(), in s_glGetStringi()
4376 retval = (const GLubyte*)(ctx->m_currExtensionsArray[index].c_str()); in s_glGetStringi()
4384 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetProgramBinary() local
4386 SET_ERROR_IF(!ctx->m_shared->isProgram(program), GL_INVALID_OPERATION); in s_glGetProgramBinary()
4389 ctx->glGetProgramiv(self, program, GL_LINK_STATUS, &linkStatus); in s_glGetProgramBinary()
4391 ctx->glGetProgramiv(self, program, GL_PROGRAM_BINARY_LENGTH, &properLength); in s_glGetProgramBinary()
4396 ctx->m_glGetProgramBinary_enc(ctx, program, bufSize, length, binaryFormat, binary); in s_glGetProgramBinary()
4400 GL2Encoder *ctx = (GL2Encoder *)self; in s_glReadPixels() local
4405 SET_ERROR_IF(ctx->isBufferTargetMapped(GL_PIXEL_PACK_BUFFER), GL_INVALID_OPERATION); in s_glReadPixels()
4406 SET_ERROR_IF(ctx->boundBuffer(GL_PIXEL_PACK_BUFFER) && in s_glReadPixels()
4407 ctx->getBufferData(GL_PIXEL_PACK_BUFFER) && in s_glReadPixels()
4408 (ctx->m_state->pboNeededDataSize(width, height, 1, format, type, 1) > in s_glReadPixels()
4409 ctx->getBufferData(GL_PIXEL_PACK_BUFFER)->m_size), in s_glReadPixels()
4422 ctx->m_state->getBoundFramebufferFormat( in s_glReadPixels()
4430 if (ctx->boundBuffer(GL_PIXEL_PACK_BUFFER)) { in s_glReadPixels()
4431 ctx->glReadPixelsOffsetAEMU( in s_glReadPixels()
4432 ctx, x, y, width, height, in s_glReadPixels()
4435 ctx->m_glReadPixels_enc( in s_glReadPixels()
4436 ctx, x, y, width, height, in s_glReadPixels()
4444 GL2Encoder *ctx = (GL2Encoder *)self; in s_glEnable() local
4448 ctx->m_primitiveRestartEnabled = true; in s_glEnable()
4452 ctx->m_glEnable_enc(ctx, what); in s_glEnable()
4456 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDisable() local
4460 ctx->m_primitiveRestartEnabled = false; in s_glDisable()
4464 ctx->m_glDisable_enc(ctx, what); in s_glDisable()
4468 GL2Encoder *ctx = (GL2Encoder *)self; in s_glClearBufferiv() local
4472 ctx->m_glClearBufferiv_enc(ctx, buffer, drawBuffer, value); in s_glClearBufferiv()
4476 GL2Encoder *ctx = (GL2Encoder *)self; in s_glClearBufferuiv() local
4480 ctx->m_glClearBufferuiv_enc(ctx, buffer, drawBuffer, value); in s_glClearBufferuiv()
4484 GL2Encoder *ctx = (GL2Encoder *)self; in s_glClearBufferfv() local
4488 ctx->m_glClearBufferfv_enc(ctx, buffer, drawBuffer, value); in s_glClearBufferfv()
4492 GL2Encoder *ctx = (GL2Encoder *)self; in s_glBlitFramebuffer() local
4493 GLClientState* state = ctx->m_state; in s_glBlitFramebuffer()
4577 ctx->m_glBlitFramebuffer_enc(ctx, in s_glBlitFramebuffer()
4584 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetInternalformativ() local
4589 SET_ERROR_IF(!GLESv2Validation::internalFormatTarget(ctx, target), GL_INVALID_ENUM); in s_glGetInternalformativ()
4591 !GLESv2Validation::colorRenderableFormat(ctx, internalformat) && in s_glGetInternalformativ()
4592 !GLESv2Validation::depthRenderableFormat(ctx, internalformat) && in s_glGetInternalformativ()
4593 !GLESv2Validation::stencilRenderableFormat(ctx, internalformat), in s_glGetInternalformativ()
4616 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGenerateMipmap() local
4617 GLClientState* state = ctx->m_state; in s_glGenerateMipmap()
4632 !(GLESv2Validation::colorRenderableFormat(ctx, internalformat) && in s_glGenerateMipmap()
4633 GLESv2Validation::filterableTexFormat(ctx, internalformat)), in s_glGenerateMipmap()
4637 ctx->override2DTextureTarget(target); in s_glGenerateMipmap()
4640 ctx->m_glGenerateMipmap_enc(ctx, target); in s_glGenerateMipmap()
4643 ctx->restore2DTextureTarget(target); in s_glGenerateMipmap()
4648 GL2Encoder *ctx = (GL2Encoder *)self; in s_glBindSampler() local
4650 ctx->glGetIntegerv(ctx, GL_MAX_COMBINED_TEXTURE_IMAGE_UNITS, &maxCombinedUnits); in s_glBindSampler()
4653 ctx->doSamplerBindEncodeCached(unit, sampler); in s_glBindSampler()
4663 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDeleteSamplers() local
4664 ctx->m_state->onDeleteSamplers(n, samplers); in s_glDeleteSamplers()
4665 ctx->m_glDeleteSamplers_enc(ctx, n, samplers); in s_glDeleteSamplers()
4669 GL2Encoder *ctx = (GL2Encoder *)self; in s_glFenceSync() local
4670 uint64_t syncHandle = ctx->glFenceSyncAEMU(ctx, condition, flags); in s_glFenceSync()
4675 GL2Encoder *ctx = (GL2Encoder *)self; in s_glClientWaitSync() local
4676 return ctx->glClientWaitSyncAEMU(ctx, (uint64_t)(uintptr_t)wait_on, flags, timeout); in s_glClientWaitSync()
4680 GL2Encoder *ctx = (GL2Encoder *)self; in s_glWaitSync() local
4681 ctx->glWaitSyncAEMU(ctx, (uint64_t)(uintptr_t)wait_on, flags, timeout); in s_glWaitSync()
4685 GL2Encoder *ctx = (GL2Encoder *)self; in s_glDeleteSync() local
4689 ctx->glDeleteSyncAEMU(ctx, (uint64_t)(uintptr_t)sync); in s_glDeleteSync()
4693 GL2Encoder *ctx = (GL2Encoder *)self; in s_glIsSync() local
4694 return ctx->glIsSyncAEMU(ctx, (uint64_t)(uintptr_t)sync); in s_glIsSync()
4698 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetSynciv() local
4702 return ctx->glGetSyncivAEMU(ctx, (uint64_t)(uintptr_t)sync, pname, bufSize, length, values); in s_glGetSynciv()
4707 ctx->glGetIntegerv(ctx, lim, &limit); \
4712 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetIntegeri_v() local
4713 GLClientState* state = ctx->m_state; in s_glGetIntegeri_v()
4757 ctx->safe_glGetIntegeri_v(target, index, params); in s_glGetIntegeri_v()
4761 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetInteger64i_v() local
4762 GLClientState* state = ctx->m_state; in s_glGetInteger64i_v()
4806 ctx->safe_glGetInteger64i_v(target, index, params); in s_glGetInteger64i_v()
4810 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetInteger64v() local
4811 ctx->safe_glGetInteger64v(param, val); in s_glGetInteger64v()
4815 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetBooleani_v() local
4816 ctx->safe_glGetBooleani_v(param, index, val); in s_glGetBooleani_v()
4820 GL2Encoder *ctx = (GL2Encoder *)self; in s_glGetShaderiv() local
4821 ctx->m_glGetShaderiv_enc(self, shader, pname, params); in s_glGetShaderiv()
4823 ShaderData* shaderData = ctx->m_shared->getShaderData(shader); in s_glGetShaderiv()
4837 GL2Encoder *ctx = (GL2Encoder*)self; in s_glActiveShaderProgram() local
4838 GLClientState* state = ctx->m_state; in s_glActiveShaderProgram()
4839 GLSharedGroupPtr shared = ctx->m_shared; in s_glActiveShaderProgram()
4845 ctx->m_glActiveShaderProgram_enc(ctx, pipeline, program); in s_glActiveShaderProgram()
4854 GL2Encoder* ctx = (GL2Encoder*)self; in s_glCreateShaderProgramv() local
4862 uint32_t spDataId = ctx->m_shared->addNewShaderProgramData(); in s_glCreateShaderProgramv()
4863 ShaderProgramData* spData = ctx->m_shared->getShaderProgramDataById(spDataId); in s_glCreateShaderProgramv()
4867 ctx->setError(GL_OUT_OF_MEMORY); in s_glCreateShaderProgramv()
4868 ctx->m_shared->deleteShaderProgramDataById(spDataId); in s_glCreateShaderProgramv()
4872 GLuint res = ctx->glCreateShaderProgramvAEMU(ctx, type, count, str, len + 1); in s_glCreateShaderProgramv()
4877 ctx->glGetProgramiv(self, res, GL_LINK_STATUS ,&linkStatus); in s_glCreateShaderProgramv()
4879 ctx->m_shared->deleteShaderProgramDataById(spDataId); in s_glCreateShaderProgramv()
4883 ctx->m_shared->associateGLShaderProgram(res, spDataId); in s_glCreateShaderProgramv()
4886 ctx->glGetProgramiv(self, res, GL_ACTIVE_UNIFORMS, &numUniforms); in s_glCreateShaderProgramv()
4887 ctx->m_shared->initShaderProgramData(res, numUniforms); in s_glCreateShaderProgramv()
4890 ctx->glGetProgramiv(self, res, GL_ACTIVE_UNIFORM_MAX_LENGTH, &maxLength); in s_glCreateShaderProgramv()
4895 ctx->glGetActiveUniform(self, res, i, maxLength, NULL, &size, &uniformType, name); in s_glCreateShaderProgramv()
4896 GLint location = ctx->m_glGetUniformLocation_enc(self, res, name); in s_glCreateShaderProgramv()
4897 ctx->m_shared->setShaderProgramIndexInfo(res, i, location, size, uniformType, name); in s_glCreateShaderProgramv()
4907 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1f() local
4909 ctx->m_glProgramUniform1f_enc(self, program, hostLoc, v0); in s_glProgramUniform1f()
4914 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1fv() local
4916 ctx->m_glProgramUniform1fv_enc(self, program, hostLoc, count, value); in s_glProgramUniform1fv()
4921 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1i() local
4923 ctx->m_glProgramUniform1i_enc(self, program, hostLoc, v0); in s_glProgramUniform1i()
4925 GLClientState* state = ctx->m_state; in s_glProgramUniform1i()
4926 GLSharedGroupPtr shared = ctx->m_shared; in s_glProgramUniform1i()
4931 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) { in s_glProgramUniform1i()
4932 ctx->m_glActiveTexture_enc(self, origActiveTexture); in s_glProgramUniform1i()
4940 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1iv() local
4942 ctx->m_glProgramUniform1iv_enc(self, program, hostLoc, count, value); in s_glProgramUniform1iv()
4947 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1ui() local
4949 ctx->m_glProgramUniform1ui_enc(self, program, hostLoc, v0); in s_glProgramUniform1ui()
4951 GLClientState* state = ctx->m_state; in s_glProgramUniform1ui()
4952 GLSharedGroupPtr shared = ctx->m_shared; in s_glProgramUniform1ui()
4957 if (ctx->updateHostTexture2DBinding(GL_TEXTURE0 + v0, target)) { in s_glProgramUniform1ui()
4958 ctx->m_glActiveTexture_enc(self, origActiveTexture); in s_glProgramUniform1ui()
4966 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform1uiv() local
4968 ctx->m_glProgramUniform1uiv_enc(self, program, hostLoc, count, value); in s_glProgramUniform1uiv()
4973 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2f() local
4975 ctx->m_glProgramUniform2f_enc(self, program, hostLoc, v0, v1); in s_glProgramUniform2f()
4980 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2fv() local
4982 ctx->m_glProgramUniform2fv_enc(self, program, hostLoc, count, value); in s_glProgramUniform2fv()
4987 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2i() local
4989 ctx->m_glProgramUniform2i_enc(self, program, hostLoc, v0, v1); in s_glProgramUniform2i()
4994 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2iv() local
4996 ctx->m_glProgramUniform2iv_enc(self, program, hostLoc, count, value); in s_glProgramUniform2iv()
5001 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2ui() local
5003 ctx->m_glProgramUniform2ui_enc(self, program, hostLoc, v0, v1); in s_glProgramUniform2ui()
5008 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform2uiv() local
5010 ctx->m_glProgramUniform2uiv_enc(self, program, hostLoc, count, value); in s_glProgramUniform2uiv()
5015 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3f() local
5017 ctx->m_glProgramUniform3f_enc(self, program, hostLoc, v0, v1, v2); in s_glProgramUniform3f()
5022 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3fv() local
5024 ctx->m_glProgramUniform3fv_enc(self, program, hostLoc, count, value); in s_glProgramUniform3fv()
5029 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3i() local
5031 ctx->m_glProgramUniform3i_enc(self, program, hostLoc, v0, v1, v2); in s_glProgramUniform3i()
5036 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3iv() local
5038 ctx->m_glProgramUniform3iv_enc(self, program, hostLoc, count, value); in s_glProgramUniform3iv()
5043 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3ui() local
5045 ctx->m_glProgramUniform3ui_enc(self, program, hostLoc, v0, v1, v2); in s_glProgramUniform3ui()
5050 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform3uiv() local
5052 ctx->m_glProgramUniform3uiv_enc(self, program, hostLoc, count, value); in s_glProgramUniform3uiv()
5057 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4f() local
5059 ctx->m_glProgramUniform4f_enc(self, program, hostLoc, v0, v1, v2, v3); in s_glProgramUniform4f()
5064 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4fv() local
5066 ctx->m_glProgramUniform4fv_enc(self, program, hostLoc, count, value); in s_glProgramUniform4fv()
5071 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4i() local
5073 ctx->m_glProgramUniform4i_enc(self, program, hostLoc, v0, v1, v2, v3); in s_glProgramUniform4i()
5078 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4iv() local
5080 ctx->m_glProgramUniform4iv_enc(self, program, hostLoc, count, value); in s_glProgramUniform4iv()
5085 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4ui() local
5087 ctx->m_glProgramUniform4ui_enc(self, program, hostLoc, v0, v1, v2, v3); in s_glProgramUniform4ui()
5092 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniform4uiv() local
5094 ctx->m_glProgramUniform4uiv_enc(self, program, hostLoc, count, value); in s_glProgramUniform4uiv()
5099 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix2fv() local
5101 ctx->m_glProgramUniformMatrix2fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix2fv()
5106 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix2x3fv() local
5108 ctx->m_glProgramUniformMatrix2x3fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix2x3fv()
5113 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix2x4fv() local
5115 ctx->m_glProgramUniformMatrix2x4fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix2x4fv()
5120 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix3fv() local
5122 ctx->m_glProgramUniformMatrix3fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix3fv()
5127 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix3x2fv() local
5129 ctx->m_glProgramUniformMatrix3x2fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix3x2fv()
5134 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix3x4fv() local
5136 ctx->m_glProgramUniformMatrix3x4fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix3x4fv()
5141 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix4fv() local
5143 ctx->m_glProgramUniformMatrix4fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix4fv()
5148 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix4x2fv() local
5150 ctx->m_glProgramUniformMatrix4x2fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix4x2fv()
5155 GL2Encoder *ctx = (GL2Encoder*)self; in s_glProgramUniformMatrix4x3fv() local
5157 ctx->m_glProgramUniformMatrix4x3fv_enc(self, program, hostLoc, count, transpose, value); in s_glProgramUniformMatrix4x3fv()
5161 GL2Encoder* ctx = (GL2Encoder*)self; in s_glProgramParameteri() local
5162 ctx->m_glProgramParameteri_enc(self, program, pname, value); in s_glProgramParameteri()
5167 GL2Encoder *ctx = (GL2Encoder*)self; in s_glUseProgramStages() local
5168 GLClientState* state = ctx->m_state; in s_glUseProgramStages()
5169 GLSharedGroupPtr shared = ctx->m_shared; in s_glUseProgramStages()
5175 ctx->m_glUseProgramStages_enc(self, pipeline, stages, program); in s_glUseProgramStages()
5184 ctx->updateHostTexture2DBindingsFromProgramData(program); in s_glUseProgramStages()
5189 GL2Encoder *ctx = (GL2Encoder*)self; in s_glBindProgramPipeline() local
5190 GLClientState* state = ctx->m_state; in s_glBindProgramPipeline()
5192 ctx->m_glBindProgramPipeline_enc(self, pipeline); in s_glBindProgramPipeline()
5202 ctx->updateHostTexture2DBindingsFromProgramData(it->first); in s_glBindProgramPipeline()
5208 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramResourceiv() local
5220 …ctx->m_glGetProgramResourceiv_enc(self, program, programInterface, index, propCount, props, bufSiz… in s_glGetProgramResourceiv()
5230 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramResourceIndex() local
5231 return ctx->m_glGetProgramResourceIndex_enc(self, program, programInterface, name); in s_glGetProgramResourceIndex()
5235 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramResourceLocation() local
5236 return ctx->m_glGetProgramResourceLocation_enc(self, program, programInterface, name); in s_glGetProgramResourceLocation()
5240 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramResourceName() local
5252 …ctx->m_glGetProgramResourceName_enc(self, program, programInterface, index, bufSize, myLength, int… in s_glGetProgramResourceName()
5262 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetProgramPipelineInfoLog() local
5274 ctx->m_glGetProgramPipelineInfoLog_enc(self, pipeline, bufSize, myLength, intermediate); in s_glGetProgramPipelineInfoLog()
5284 GL2Encoder *ctx = (GL2Encoder*)self; in s_glVertexAttribFormat() local
5285 GLClientState* state = ctx->m_state; in s_glVertexAttribFormat()
5291 ctx->m_glVertexAttribFormat_enc(ctx, attribindex, size, type, normalized, relativeoffset); in s_glVertexAttribFormat()
5295 GL2Encoder *ctx = (GL2Encoder*)self; in s_glVertexAttribIFormat() local
5296 GLClientState* state = ctx->m_state; in s_glVertexAttribIFormat()
5302 ctx->m_glVertexAttribIFormat_enc(ctx, attribindex, size, type, relativeoffset); in s_glVertexAttribIFormat()
5306 GL2Encoder *ctx = (GL2Encoder*)self; in s_glVertexBindingDivisor() local
5307 GLClientState* state = ctx->m_state; in s_glVertexBindingDivisor()
5312 ctx->m_glVertexBindingDivisor_enc(ctx, bindingindex, divisor); in s_glVertexBindingDivisor()
5316 GL2Encoder *ctx = (GL2Encoder*)self; in s_glVertexAttribBinding() local
5317 GLClientState* state = ctx->m_state; in s_glVertexAttribBinding()
5322 ctx->m_glVertexAttribBinding_enc(ctx, attribindex, bindingindex); in s_glVertexAttribBinding()
5326 GL2Encoder *ctx = (GL2Encoder*)self; in s_glBindVertexBuffer() local
5327 GLClientState* state = ctx->m_state; in s_glBindVertexBuffer()
5332 ctx->glGetIntegerv(ctx, GL_MAX_VERTEX_ATTRIB_STRIDE, &maxStride); in s_glBindVertexBuffer()
5338 ctx->m_glBindVertexBuffer_enc(ctx, bindingindex, buffer, offset, stride); in s_glBindVertexBuffer()
5342 GL2Encoder *ctx = (GL2Encoder*)self; in s_glDrawArraysIndirect() local
5343 GLClientState* state = ctx->m_state; in s_glDrawArraysIndirect()
5347 ctx->getVBOUsage(&hasClientArrays, &hasVBOs); in s_glDrawArraysIndirect()
5351 SET_ERROR_IF(!ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER), GL_INVALID_OPERATION); in s_glDrawArraysIndirect()
5354 if (ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER)) { in s_glDrawArraysIndirect()
5359 ctx->glDrawArraysIndirectOffsetAEMU(ctx, mode, (uintptr_t)indirect); in s_glDrawArraysIndirect()
5363 ctx->glDrawArraysIndirectDataAEMU(ctx, mode, indirect, indirectStructSize); in s_glDrawArraysIndirect()
5368 GL2Encoder *ctx = (GL2Encoder*)self; in s_glDrawElementsIndirect() local
5370 GLClientState* state = ctx->m_state; in s_glDrawElementsIndirect()
5374 ctx->getVBOUsage(&hasClientArrays, &hasVBOs); in s_glDrawElementsIndirect()
5378 SET_ERROR_IF(!ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER), GL_INVALID_OPERATION); in s_glDrawElementsIndirect()
5380 SET_ERROR_IF(ctx->m_state->getTransformFeedbackActiveUnpaused(), GL_INVALID_OPERATION); in s_glDrawElementsIndirect()
5383 if (ctx->boundBuffer(GL_DRAW_INDIRECT_BUFFER)) { in s_glDrawElementsIndirect()
5388 ctx->glDrawElementsIndirectOffsetAEMU(ctx, mode, type, (uintptr_t)indirect); in s_glDrawElementsIndirect()
5392 ctx->glDrawElementsIndirectDataAEMU(ctx, mode, type, indirect, indirectStructSize); in s_glDrawElementsIndirect()
5398 GL2Encoder *ctx = (GL2Encoder*)self; in s_glTexStorage2DMultisample() local
5399 GLClientState* state = ctx->m_state; in s_glTexStorage2DMultisample()
5407 ctx->s_glGetInternalformativ(ctx, target, internalformat, GL_SAMPLES, 1, &max_samples); in s_glTexStorage2DMultisample()
5415 …ctx->m_glTexStorage2DMultisample_enc(ctx, target, samples, internalformat, width, height, fixedsam… in s_glTexStorage2DMultisample()
5426 GL2Encoder *ctx = (GL2Encoder*)self; in s_glReadnPixelsEXT() local
5434 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetnUniformfvEXT() local
5442 GL2Encoder *ctx = (GL2Encoder*)self; in s_glGetnUniformivEXT() local
5449 GL2Encoder *ctx = (GL2Encoder*)self; in s_glInvalidateFramebuffer() local
5451 ctx->m_glInvalidateFramebuffer_enc(ctx, target, numAttachments, attachments); in s_glInvalidateFramebuffer()
5455 GL2Encoder *ctx = (GL2Encoder*)self; in s_glInvalidateSubFramebuffer() local
5459 …ctx->m_glInvalidateSubFramebuffer_enc(ctx, target, numAttachments, attachments, x, y, width, heigh… in s_glInvalidateSubFramebuffer()