From c191a32b0dab11ae190a60f9c58c7d671259b388 Mon Sep 17 00:00:00 2001 From: Sangwon Ha Date: Wed, 6 May 2015 15:20:32 +0900 Subject: [PATCH 01/16] Disable bypass capability by default Change-Id: Ibe90ab34a0edff78f47a78b07dec4e6577126129 --- packaging/coregl.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packaging/coregl.spec b/packaging/coregl.spec index 378fa34..36d33fd 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -1,4 +1,4 @@ -%define BYPASS_COREGL 1 +%define BYPASS_COREGL 0 Name: coregl Summary: CoreGL FastPath Optimization -- 2.7.4 From f510aad8b2f64c6431925c2b02def1504dd7b3c0 Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Wed, 9 Sep 2015 13:11:47 +0900 Subject: [PATCH 02/16] Delete X11 dependency and enable png image dump Change-Id: If046b2aad937e2786c1bb63288094caac8c036ff --- CMakeLists.txt | 2 +- packaging/coregl.spec | 7 ++----- src/modules/tracepath/coregl_tracepath.c | 4 ++-- src/modules/tracepath/coregl_tracepath_gl.c | 3 +++ 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index d4ffd88..fc968c7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -77,8 +77,8 @@ SET(GLES2_SRCS_common #SET(HEADERS_common src/coregl_export.h src/coregl_fastpath.h src/coregl_fastpath_state.h src/coregl.h src/coregl_internal.h src/coregl_thread_pthread.h src/coregl_wrappath.h) INCLUDE(FindPkgConfig) -pkg_check_modules(pkg_common REQUIRED x11) pkg_check_modules(dlog REQUIRED dlog) +pkg_check_modules(libpng REQUIRED libpng) INCLUDE_DIRECTORIES(${dlog_INCLUDE_DIRS}) INCLUDE_DIRECTORIES(${dlog_INCLUDEDIR}) diff --git a/packaging/coregl.spec b/packaging/coregl.spec index 36d33fd..f4ef326 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -1,7 +1,7 @@ %define BYPASS_COREGL 0 Name: coregl -Summary: CoreGL FastPath Optimization +Summary: CoreGL FastPath Optimization Version: 0.1.10 Release: 02 ExclusiveArch: %arm @@ -10,12 +10,9 @@ License: Apache 2.0 URL: http://www.tizen.org Source: %{name}-%{version}.tar.gz -%if "%{BYPASS_COREGL}" != "1" -BuildRequires: pkgconfig(xfixes) -BuildRequires: pkgconfig(x11) BuildRequires: cmake -%endif BuildRequires: pkgconfig(dlog) +BuildRequires: pkgconfig(libpng) %description CoreGL provides the following capabilities: diff --git a/src/modules/tracepath/coregl_tracepath.c b/src/modules/tracepath/coregl_tracepath.c index 9086044..6b2125e 100644 --- a/src/modules/tracepath/coregl_tracepath.c +++ b/src/modules/tracepath/coregl_tracepath.c @@ -1128,7 +1128,7 @@ finish: return; } -#include "png.h" +#include void *png_lib_handle = NULL; @@ -1187,7 +1187,7 @@ _dump_surface(int force_output, int type, const char *position, Surface_Data *sd if (!png_lib_handle) { - png_lib_handle = dlopen("libpng.so.3", RTLD_NOW); + png_lib_handle = dlopen("libpng16.so.16", RTLD_NOW); dl_png_create_write_struct = dlsym(png_lib_handle, "png_create_write_struct"); dl_png_destroy_write_struct = dlsym(png_lib_handle, "png_destroy_write_struct"); diff --git a/src/modules/tracepath/coregl_tracepath_gl.c b/src/modules/tracepath/coregl_tracepath_gl.c index 0bd31d6..d4d263d 100644 --- a/src/modules/tracepath/coregl_tracepath_gl.c +++ b/src/modules/tracepath/coregl_tracepath_gl.c @@ -345,6 +345,8 @@ void tracepath_glBindTexture(GLenum target, GLuint texture) { _COREGL_TRACEPATH_FUNC_BEGIN(); + + _COREGL_TRACE_SURFACE(0, 1, "GLBINDTEXTURE"); _orig_tracepath_glBindTexture(target, texture); goto finish; @@ -3896,6 +3898,7 @@ void tracepath_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image) { _COREGL_TRACEPATH_FUNC_BEGIN(); + _COREGL_TRACE_SURFACE(0, 1, "TEXTURE2DOES"); _orig_tracepath_glEGLImageTargetTexture2DOES(target, image); goto finish; -- 2.7.4 From f4e7668efc024f219e848f65d96655ef04fccbe8 Mon Sep 17 00:00:00 2001 From: Keeho Song Date: Thu, 24 Sep 2015 16:04:29 +0900 Subject: [PATCH 03/16] Fix build error for 64bit architecture Change-Id: I43babdbfe40fb035e8719ecaffdb385f53b13e4c --- CMakeLists.txt | 11 ++++++++++- include_KHR/EGL/eglplatform.h | 2 +- packaging/coregl.spec | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index fc968c7..b4f61c8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ PROJECT(coregl C) SET(PREFIX ${CMAKE_INSTALL_PREFIX}) SET(EXEC_PREFIX "\${prefix}") -SET(LIBDIR "\${prefix}/lib") SET(INCLUDEDIR "\${prefix}/include_KHR") SET(COREGL_VERSION_MAJOR 4) SET(COREGL_VERSION_MINOR 0) @@ -14,6 +13,13 @@ SET(GLES2_VERSION_MINOR 0) SET(COREGL_VERSION "${COREGL_VERSION_MAJOR}.${COREGL_VERSION_MINOR}") SET(EGL_VERSION "${EGL_VERSION_MAJOR}.${EGL_VERSION_MINOR}") SET(GLES2_VERSION "${GLES2_VERSION_MAJOR}.${GLES2_VERSION_MINOR}") +SET(BUILD_ARCH "$ENV{RPM_ARCH}") + +IF(${BUILD_ARCH} MATCHES "aarch64") +SET(LIBDIR "/usr/lib64") +ELSE(${BUILD_ARCH} MATCHES "aarch64") +SET(LIBDIR "/usr/lib") +ENDIF(${BUILD_ARCH} MATCHES "aarch64") INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include_KHR) @@ -25,6 +31,9 @@ ADD_DEFINITIONS("-D_COREGL_COMPILE_DATE=\"${COMPILE_DATE}\"") IF(USE_ADRENO) ADD_DEFINITIONS("-D_COREGL_VENDOR_EGL_LIB_PATH=\"/usr/lib/egl/libEGL.so\"") ADD_DEFINITIONS("-D_COREGL_VENDOR_GL_LIB_PATH=\"/usr/lib/egl/libGLESv2.so\"") +ELSE(USE_ADRENO) +ADD_DEFINITIONS("-D_COREGL_VENDOR_EGL_LIB_PATH=\"${LIBDIR}/driver/libEGL.so\"") +ADD_DEFINITIONS("-D_COREGL_VENDOR_GL_LIB_PATH=\"${LIBDIR}/driver/libGLESv2.so\"") ENDIF(USE_ADRENO) SET(EXTRA_CFLAGS "${EXTRA_CFLAGS} -fvisibility=hidden") diff --git a/include_KHR/EGL/eglplatform.h b/include_KHR/EGL/eglplatform.h index eb69422..5f82bba 100644 --- a/include_KHR/EGL/eglplatform.h +++ b/include_KHR/EGL/eglplatform.h @@ -111,7 +111,7 @@ typedef void *EGLNativePixmapType; #else /* 20140708-sw815.ha: enable compilation even for unsupported platforms */ /* #error "Platform not recognized" */ -typedef int EGLNativeDisplayType; +typedef void *EGLNativeDisplayType; typedef void *EGLNativeWindowType; typedef void *EGLNativePixmapType; diff --git a/packaging/coregl.spec b/packaging/coregl.spec index f4ef326..6556b14 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -4,7 +4,7 @@ Name: coregl Summary: CoreGL FastPath Optimization Version: 0.1.10 Release: 02 -ExclusiveArch: %arm +ExclusiveArch: %arm aarch64 Group: Graphics License: Apache 2.0 URL: http://www.tizen.org -- 2.7.4 From 07e69c7bf4355aa72ecf6af0fb26daeb693e36df Mon Sep 17 00:00:00 2001 From: Xuelian Bai Date: Mon, 2 Nov 2015 05:40:49 +0800 Subject: [PATCH 04/16] Add fastpath APIs for OpenGLES_DDK 3.1 This patch adds fastpath APIs for OpenGLES_DDK 3.1 Change-Id: Ifec42bccefd3f544983cf9e5fdb32e66a6fbcab7 Signed-off-by: Xuelian Bai --- packaging/coregl.spec | 2 + src/coregl.c | 11 +- src/coregl_export_gl.c | 407 +++++++ src/coregl_internal.h | 1 + src/headers/gl.h | 7 + src/headers/sym_egl.h | 6 + src/headers/sym_gl.h | 71 ++ src/modules/fastpath/coregl_fastpath.c | 88 +- src/modules/fastpath/coregl_fastpath.h | 6 + src/modules/fastpath/coregl_fastpath_gl.c | 1496 +++++++++++++++++++++++++- src/modules/fastpath/coregl_fastpath_state.h | 13 +- src/modules/tracepath/coregl_tracepath.h | 5 +- src/modules/tracepath/coregl_tracepath_egl.c | 45 + src/modules/tracepath/coregl_tracepath_gl.c | 825 ++++++++++++++ src/wraps/coregl_gl.c | 402 +++++++ 15 files changed, 3369 insertions(+), 16 deletions(-) diff --git a/packaging/coregl.spec b/packaging/coregl.spec index 6556b14..1e2957c 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -70,6 +70,7 @@ mkdir -p %{buildroot}%{_includedir} cp -a include_KHR/EGL %{buildroot}%{_includedir} cp -a include_KHR/GLES %{buildroot}%{_includedir} cp -a include_KHR/GLES2 %{buildroot}%{_includedir} +cp -a include_KHR/GLES3 %{buildroot}%{_includedir} cp -a include_KHR/KHR %{buildroot}%{_includedir} cp -a pkgconfig/*.pc %{buildroot}%{_libdir}/pkgconfig/ @@ -95,5 +96,6 @@ rm -rf %{buildroot} %{_includedir}/EGL/* %{_includedir}/GLES/* %{_includedir}/GLES2/* +%{_includedir}/GLES3/* %{_includedir}/KHR/* %{_libdir}/pkgconfig/*.pc diff --git a/src/coregl.c b/src/coregl.c index f8f473d..891f264 100644 --- a/src/coregl.c +++ b/src/coregl.c @@ -181,11 +181,18 @@ _gl_lib_init(void) } // test for a GLES 3.0 symbol - if (dlsym(gl_lib_handle, "glReadBuffer")) + if (dlsym(gl_lib_handle, "glBindProgramPipeline")) + { + COREGL_LOG("[CoreGL] Driver GL version 3.1 \n"); + driver_gl_version = COREGL_GLAPI_31; + } + else if (dlsym(gl_lib_handle, "glReadBuffer")) { COREGL_LOG("[CoreGL] Driver GL version 3.0 \n"); driver_gl_version = COREGL_GLAPI_3; - }else { + } + else + { COREGL_LOG("[CoreGL] Driver GL version 2.0 \n"); } diff --git a/src/coregl_export_gl.c b/src/coregl_export_gl.c index 0c19820..6f84da3 100644 --- a/src/coregl_export_gl.c +++ b/src/coregl_export_gl.c @@ -1477,4 +1477,411 @@ coregl_api_glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pn ovr_glGetInternalformativ(target, internalformat, pname, bufSize, params); } +/* GLES3.1 API */ +GLuint +coregl_api_glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings) +{ + return ovr_glCreateShaderProgramv(type, count, strings); +} + +void +coregl_api_glGenProgramPipelines( GLsizei n, GLuint *pipelines) +{ + ovr_glGenProgramPipelines(n, pipelines); +} + +void +coregl_api_glBindProgramPipeline( GLuint pipeline) +{ + ovr_glBindProgramPipeline(pipeline); +} + +void +coregl_api_glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) +{ + ovr_glGetProgramPipelineiv(pipeline, pname, params); +} + +void +coregl_api_glDeleteProgramPipelines(GLsizei n, GLuint const *pipelines) +{ + ovr_glDeleteProgramPipelines(n, pipelines); +} + +GLboolean +coregl_api_glIsProgramPipeline( GLuint pipeline) +{ + return ovr_glIsProgramPipeline(pipeline); +} + +void +coregl_api_glValidateProgramPipeline(GLuint pipeline) +{ + ovr_glValidateProgramPipeline(pipeline); +} + +void +coregl_api_glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) +{ + ovr_glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); +} + +void +coregl_api_glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) +{ + ovr_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); +} + +void +coregl_api_glDispatchComputeIndirect( GLintptr indirect) +{ + ovr_glDispatchComputeIndirect(indirect); +} + +void +coregl_api_glDrawArraysIndirect(GLenum mode, GLvoid const *indirect) +{ + ovr_glDrawArraysIndirect(mode, indirect); +} + +void +coregl_api_glDrawElementsIndirect(GLenum mode, GLenum type, GLvoid const *indirect) +{ + ovr_glDrawElementsIndirect(mode, type, indirect); +} + +void +coregl_api_glFramebufferParameteri(GLenum target, GLenum pname, GLint param) +{ + ovr_glFramebufferParameteri(target, pname, param); +} + +void +coregl_api_glGetFramebufferParameteriv( GLenum target, GLenum pname, GLint * params) +{ + ovr_glGetFramebufferParameteriv(target, pname, params); +} + +void +coregl_api_glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params) +{ + ovr_glGetProgramInterfaceiv(program, programInterface, pname, params); +} + +GLuint +coregl_api_glGetProgramResourceIndex( GLuint program, GLenum programInterface, const char * name) +{ + return ovr_glGetProgramResourceIndex(program, programInterface, name); +} + +void +coregl_api_glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) +{ + ovr_glGetProgramResourceName(program, programInterface, index, bufSize, length, name); +} + +void +coregl_api_glGetProgramResourceiv( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) +{ + ovr_glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); +} + +GLint +coregl_api_glGetProgramResourceLocation(GLuint program, GLenum programInterface, GLchar const *name) +{ + return ovr_glGetProgramResourceLocation(program, programInterface, name); +} + +void +coregl_api_glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) +{ + ovr_glUseProgramStages(pipeline, stages, program); +} + +void +coregl_api_glActiveShaderProgram(GLuint pipeline, GLuint program) +{ + ovr_glActiveShaderProgram(pipeline, program); +} + +void +coregl_api_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform1iv(program, location, count, value); +} + +void +coregl_api_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform2iv(program, location, count, value); +} + +void +coregl_api_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform3iv(program, location, count, value); +} + +void +coregl_api_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform4iv(program, location, count, value); +} + +void +coregl_api_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform1fv(program, location, count, value); +} + +void +coregl_api_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform2fv(program, location, count, value); +} + +void +coregl_api_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform3fv(program, location, count, value); +} + +void +coregl_api_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform4fv(program, location, count, value); +} + +void +coregl_api_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniform1i(GLuint program, GLint location, GLint x) +{ + ovr_glProgramUniform1i(program, location, x); +} + +void +coregl_api_glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) +{ + ovr_glProgramUniform2i(program, location, x, y); +} +void +coregl_api_glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) +{ + ovr_glProgramUniform3i(program, location, x, y, z); +} + +void +coregl_api_glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) +{ + ovr_glProgramUniform4i(program, location, x, y, z, w); +} + +void +coregl_api_glProgramUniform1f(GLuint program, GLint location, GLfloat x) +{ + ovr_glProgramUniform1f(program, location, x); +} + +void +coregl_api_glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) +{ + ovr_glProgramUniform2f(program, location, x, y); +} + +void +coregl_api_glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) +{ + ovr_glProgramUniform3f(program, location, x, y, z); +} + +void +coregl_api_glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + ovr_glProgramUniform4f(program, location, x, y, z, w); +} + +void +coregl_api_glProgramUniform1ui(GLuint program, GLint location, GLuint x) +{ + ovr_glProgramUniform1i(program, location, x); +} + +void +coregl_api_glProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y) +{ + ovr_glProgramUniform2ui(program, location, x, y); +} + +void +coregl_api_glProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z) +{ + ovr_glProgramUniform3ui(program, location, x, y, z); +} + +void +coregl_api_glProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) +{ + ovr_glProgramUniform4ui(program, location, x, y, z, w); +} + +void +coregl_api_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform1uiv(program, location, count, value); +} + +void +coregl_api_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform2uiv(program, location, count, value); +} + +void +coregl_api_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform3uiv(program, location, count, value); +} + +void +coregl_api_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform4uiv(program, location, count, value); +} + +void +coregl_api_glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2x3fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3x2fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2x4fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4x2fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3x4fv(program, location, count, transpose, value); +} + +void +coregl_api_glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4x3fv(program, location, count, transpose, value); +} + +void +coregl_api_glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) +{ + ovr_glBindImageTexture (unit, texture, level, layered, layer, access, format); +} + +void +coregl_api_glGetBooleani_v (GLenum target, GLuint index, GLboolean *data) +{ + ovr_glGetBooleani_v (target, index, data); +} + +void +coregl_api_glMemoryBarrier (GLbitfield barriers) +{ + ovr_glMemoryBarrier (barriers); +} + +void +coregl_api_glMemoryBarrierByRegion (GLbitfield barriers) +{ + ovr_glMemoryBarrierByRegion (barriers); +} + +void +coregl_api_glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) +{ + ovr_glTexStorage2DMultisample (target, samples, internalformat, width, height, fixedsamplelocations); +} + +void +coregl_api_glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val) +{ + ovr_glGetMultisamplefv (pname, index, val); +} + +void +coregl_api_glSampleMaski (GLuint maskNumber, GLbitfield mask) +{ + ovr_glSampleMaski (maskNumber, mask); +} + +void +coregl_api_glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params) +{ + ovr_glGetTexLevelParameteriv (target, level, pname, params); +} + +void +coregl_api_glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params) +{ + ovr_glGetTexLevelParameterfv (target, level, pname, params); +} + +void +coregl_api_glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) +{ + ovr_glBindVertexBuffer (bindingindex, buffer, offset, stride); +} + +void +coregl_api_glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) +{ + ovr_glVertexAttribFormat (attribindex, size, type, normalized, relativeoffset); +} + +void +coregl_api_glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) +{ + ovr_glVertexAttribIFormat (attribindex, size, type, relativeoffset); +} + +void +coregl_api_glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) +{ + ovr_glVertexAttribBinding (attribindex, bindingindex); +} + +void +coregl_api_glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) +{ + ovr_glVertexBindingDivisor (bindingindex, divisor); +} \ No newline at end of file diff --git a/src/coregl_internal.h b/src/coregl_internal.h index b62ce46..8158e5a 100644 --- a/src/coregl_internal.h +++ b/src/coregl_internal.h @@ -68,6 +68,7 @@ static inline GLuint GET_UINT_FROM_FLOAT(GLfloat value) { return (GLuint)value; typedef GLvoid * GLvoidptr; typedef GLuint GLuintmask; +#define COREGL_GLAPI_31 4 #define COREGL_GLAPI_3 3 #define COREGL_GLAPI_2 2 diff --git a/src/headers/gl.h b/src/headers/gl.h index 3ceab22..f995e08 100644 --- a/src/headers/gl.h +++ b/src/headers/gl.h @@ -767,6 +767,13 @@ typedef struct __GLsync *GLsync; #define GL_NUM_SAMPLE_COUNTS 0x9380 #define GL_TEXTURE_IMMUTABLE_LEVELS 0x82DF +/* GLES 3.1 */ +#define GL_COMPUTE_SHADER 0x91B9 +#define GL_ACTIVE_PROGRAM 0x8259 +#define GL_PROGRAM_PIPELINE_BINDING 0x825A +#define GL_MAX_COMPUTE_WORK_GROUP_COUNT 0x91BE + + //---------------------------// // GLES extension defines /* GL_OES_EGL_image */ diff --git a/src/headers/sym_egl.h b/src/headers/sym_egl.h index 27c858c..8a812ac 100644 --- a/src/headers/sym_egl.h +++ b/src/headers/sym_egl.h @@ -79,6 +79,12 @@ _COREGL_EXT_SYMBOL(EGLBoolean, eglSwapBuffersWithDamageEXT, (EGLDisplay dpy, EGL _COREGL_EXT_SYMBOL(EGLBoolean, eglSwapBuffersRegionEXT, (EGLDisplay dpy, EGLSurface surface, EGLint numRects, const EGLint *rects)) +_COREGL_EXT_SYMBOL(EGLBoolean, eglBindWaylandDisplayWL, (EGLDisplay dpy, void* display)) + +_COREGL_EXT_SYMBOL(EGLBoolean, eglUnbindWaylandDisplayWL, (EGLDisplay dpy, void* display)) + +_COREGL_EXT_SYMBOL(EGLBoolean, eglQueryWaylandBufferWL, (EGLDisplay dpy, void* buffer, EGLint attribute, EGLint *value)) + /* Fastpath Verified extensions */ //_COREGL_EXT_SYMBOL_FASTPATH_PASS(eglSwapBuffersRegionSEC) _COREGL_EXT_SYMBOL_FASTPATH_PASS(eglCreateSyncKHR) diff --git a/src/headers/sym_gl.h b/src/headers/sym_gl.h index c31468e..cac9801 100644 --- a/src/headers/sym_gl.h +++ b/src/headers/sym_gl.h @@ -289,6 +289,77 @@ _COREGL_SYMBOL(void, glGetInternalformativ, (GLenum target, GLenum internalforma _COREGL_END_API(COREGL_GLAPI_3) +/* OpenGL ES 3.1 */ +_COREGL_START_API(COREGL_GLAPI_31) +_COREGL_SYMBOL(GLuint, glCreateShaderProgramv, (GLenum type, GLsizei count, const GLchar *const*strings)) +_COREGL_SYMBOL(void, glGenProgramPipelines, (GLsizei n, GLuint *pipelines)) +_COREGL_SYMBOL(void, glBindProgramPipeline, (GLuint pipeline)) +_COREGL_SYMBOL(void, glGetProgramPipelineiv, (GLuint pipeline, GLenum pname, GLint *params)) +_COREGL_SYMBOL(void, glDeleteProgramPipelines, (GLsizei n, GLuint const *pipelines)) +_COREGL_SYMBOL(GLboolean, glIsProgramPipeline, (GLuint pipeline)) +_COREGL_SYMBOL(void, glValidateProgramPipeline, (GLuint pipeline)) +_COREGL_SYMBOL(void, glGetProgramPipelineInfoLog, (GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog)) +_COREGL_SYMBOL(void, glDispatchCompute, (GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z)) +_COREGL_SYMBOL(void, glDispatchComputeIndirect, (GLintptr indirect)) +_COREGL_SYMBOL(void, glDrawArraysIndirect, (GLenum mode, GLvoid const *indirect)) +_COREGL_SYMBOL(void, glDrawElementsIndirect, (GLenum mode, GLenum type, GLvoid const *indirect)) +_COREGL_SYMBOL(void, glFramebufferParameteri, (GLenum target, GLenum pname, GLint param)) +_COREGL_SYMBOL(void, glGetFramebufferParameteriv, ( GLenum target, GLenum pname, GLint * params)) +_COREGL_SYMBOL(void, glGetProgramInterfaceiv, (GLuint program, GLenum programInterface, GLenum pname, GLint * params)) +_COREGL_SYMBOL(GLuint, glGetProgramResourceIndex, (GLuint program, GLenum programInterface, const char * name)) +_COREGL_SYMBOL(void, glGetProgramResourceName, (GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name)) +_COREGL_SYMBOL(void, glGetProgramResourceiv, (GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params)) +_COREGL_SYMBOL(GLint, glGetProgramResourceLocation, (GLuint program, GLenum programInterface, GLchar const *name)) +_COREGL_SYMBOL(void, glUseProgramStages, (GLuint pipeline, GLbitfield stages, GLuint program)) +_COREGL_SYMBOL(void, glActiveShaderProgram, (GLuint pipeline, GLuint program)) +_COREGL_SYMBOL(void, glProgramUniform1iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) +_COREGL_SYMBOL(void, glProgramUniform2iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) +_COREGL_SYMBOL(void, glProgramUniform3iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) +_COREGL_SYMBOL(void, glProgramUniform4iv, (GLuint program, GLint location, GLsizei count, const GLint *value)) +_COREGL_SYMBOL(void, glProgramUniform1fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniform2fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniform3fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniform4fv, (GLuint program, GLint location, GLsizei count, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniform1i, (GLuint program, GLint location, GLint x)) +_COREGL_SYMBOL(void, glProgramUniform2i, (GLuint program, GLint location, GLint x, GLint y)) +_COREGL_SYMBOL(void, glProgramUniform3i, (GLuint program, GLint location, GLint x, GLint y, GLint z)) +_COREGL_SYMBOL(void, glProgramUniform4i, (GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w)) +_COREGL_SYMBOL(void, glProgramUniform1f, (GLuint program, GLint location, GLfloat x)) +_COREGL_SYMBOL(void, glProgramUniform2f, (GLuint program, GLint location, GLfloat x, GLfloat y)) +_COREGL_SYMBOL(void, glProgramUniform3f, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z)) +_COREGL_SYMBOL(void, glProgramUniform4f, (GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w)) +_COREGL_SYMBOL(void, glProgramUniform1ui, (GLuint program, GLint location, GLuint x)) +_COREGL_SYMBOL(void, glProgramUniform2ui, (GLuint program, GLint location, GLuint x, GLuint y)) +_COREGL_SYMBOL(void, glProgramUniform3ui, (GLuint program, GLint location, GLuint x, GLuint y, GLuint z)) +_COREGL_SYMBOL(void, glProgramUniform4ui, (GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w)) +_COREGL_SYMBOL(void, glProgramUniform1uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) +_COREGL_SYMBOL(void, glProgramUniform2uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) +_COREGL_SYMBOL(void, glProgramUniform3uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) +_COREGL_SYMBOL(void, glProgramUniform4uiv, (GLuint program, GLint location, GLsizei count, const GLuint *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix2x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix3x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix4x2fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix2x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix3x4fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glProgramUniformMatrix4x3fv, (GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value)) +_COREGL_SYMBOL(void, glBindImageTexture, (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format)) +_COREGL_SYMBOL(void, glGetBooleani_v, (GLenum target, GLuint index, GLboolean *data)) +_COREGL_SYMBOL(void, glMemoryBarrier, (GLbitfield barriers)) +_COREGL_SYMBOL(void, glMemoryBarrierByRegion, (GLbitfield barriers)) +_COREGL_SYMBOL(void, glTexStorage2DMultisample, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations)) +_COREGL_SYMBOL(void, glGetMultisamplefv, (GLenum pname, GLuint index, GLfloat *val)) +_COREGL_SYMBOL(void, glSampleMaski, (GLuint maskNumber, GLbitfield mask)) +_COREGL_SYMBOL(void, glGetTexLevelParameteriv, (GLenum target, GLint level, GLenum pname, GLint *params)) +_COREGL_SYMBOL(void, glGetTexLevelParameterfv, (GLenum target, GLint level, GLenum pname, GLfloat *params)) +_COREGL_SYMBOL(void, glBindVertexBuffer, (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride)) +_COREGL_SYMBOL(void, glVertexAttribFormat, (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset)) +_COREGL_SYMBOL(void, glVertexAttribIFormat, (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset)) +_COREGL_SYMBOL(void, glVertexAttribBinding, (GLuint attribindex, GLuint bindingindex)) +_COREGL_SYMBOL(void, glVertexBindingDivisor, (GLuint bindingindex, GLuint divisor)) +_COREGL_END_API(COREGL_GLAPI_31) /* Extensions */ _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_EGL_image", 1.1, -1) diff --git a/src/modules/fastpath/coregl_fastpath.c b/src/modules/fastpath/coregl_fastpath.c index 71eac3a..b9842c9 100644 --- a/src/modules/fastpath/coregl_fastpath.c +++ b/src/modules/fastpath/coregl_fastpath.c @@ -487,6 +487,73 @@ fastpath_apply_overrides_gl(int enable) COREGL_OVERRIDE(fastpath_, glProgramParameteri); } // End of GLES 3.0 + if(driver_gl_version >= COREGL_GLAPI_31) + { + COREGL_OVERRIDE(fastpath_, glCreateShaderProgramv); + COREGL_OVERRIDE(fastpath_, glGenProgramPipelines); + COREGL_OVERRIDE(fastpath_, glGetProgramPipelineiv); + COREGL_OVERRIDE(fastpath_, glBindProgramPipeline); + COREGL_OVERRIDE(fastpath_, glDeleteProgramPipelines); + COREGL_OVERRIDE(fastpath_, glIsProgramPipeline); + COREGL_OVERRIDE(fastpath_, glValidateProgramPipeline); + COREGL_OVERRIDE(fastpath_, glGetProgramPipelineInfoLog); + COREGL_OVERRIDE(fastpath_, glDispatchCompute); + COREGL_OVERRIDE(fastpath_, glDispatchComputeIndirect); + COREGL_OVERRIDE(fastpath_, glGetProgramInterfaceiv); + COREGL_OVERRIDE(fastpath_, glGetProgramResourceIndex); + COREGL_OVERRIDE(fastpath_, glGetProgramResourceName); + COREGL_OVERRIDE(fastpath_, glGetProgramResourceiv); + COREGL_OVERRIDE(fastpath_, glGetProgramResourceLocation); + COREGL_OVERRIDE(fastpath_, glUseProgramStages); + COREGL_OVERRIDE(fastpath_, glActiveShaderProgram); + COREGL_OVERRIDE(fastpath_, glProgramUniform1iv); + COREGL_OVERRIDE(fastpath_, glProgramUniform2iv); + COREGL_OVERRIDE(fastpath_, glProgramUniform3iv); + COREGL_OVERRIDE(fastpath_, glProgramUniform4iv); + COREGL_OVERRIDE(fastpath_, glProgramUniform1fv); + COREGL_OVERRIDE(fastpath_, glProgramUniform2fv); + COREGL_OVERRIDE(fastpath_, glProgramUniform3fv); + COREGL_OVERRIDE(fastpath_, glProgramUniform4fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix2fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix3fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix4fv); + COREGL_OVERRIDE(fastpath_, glProgramUniform1i); + COREGL_OVERRIDE(fastpath_, glProgramUniform2i); + COREGL_OVERRIDE(fastpath_, glProgramUniform3i); + COREGL_OVERRIDE(fastpath_, glProgramUniform4i); + COREGL_OVERRIDE(fastpath_, glProgramUniform1f); + COREGL_OVERRIDE(fastpath_, glProgramUniform2f); + COREGL_OVERRIDE(fastpath_, glProgramUniform3f); + COREGL_OVERRIDE(fastpath_, glProgramUniform4f); + COREGL_OVERRIDE(fastpath_, glProgramUniform1uiv); + COREGL_OVERRIDE(fastpath_, glProgramUniform2uiv); + COREGL_OVERRIDE(fastpath_, glProgramUniform3uiv); + COREGL_OVERRIDE(fastpath_, glProgramUniform4uiv); + COREGL_OVERRIDE(fastpath_, glProgramUniform1ui); + COREGL_OVERRIDE(fastpath_, glProgramUniform2ui); + COREGL_OVERRIDE(fastpath_, glProgramUniform3ui); + COREGL_OVERRIDE(fastpath_, glProgramUniform4ui); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix2x3fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix3x2fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix4x2fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix2x4fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix3x4fv); + COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix4x3fv); + COREGL_OVERRIDE(fastpath_, glBindImageTexture); + COREGL_OVERRIDE(fastpath_, glGetBooleani_v); + COREGL_OVERRIDE(fastpath_, glMemoryBarrier); + COREGL_OVERRIDE(fastpath_, glMemoryBarrierByRegion); + COREGL_OVERRIDE(fastpath_, glTexStorage2DMultisample); + COREGL_OVERRIDE(fastpath_, glGetMultisamplefv); + COREGL_OVERRIDE(fastpath_, glSampleMaski); + COREGL_OVERRIDE(fastpath_, glGetTexLevelParameteriv); + COREGL_OVERRIDE(fastpath_, glGetTexLevelParameterfv); + COREGL_OVERRIDE(fastpath_, glBindVertexBuffer); + COREGL_OVERRIDE(fastpath_, glVertexAttribFormat); + COREGL_OVERRIDE(fastpath_, glVertexAttribIFormat); + COREGL_OVERRIDE(fastpath_, glVertexAttribBinding); + COREGL_OVERRIDE(fastpath_, glVertexBindingDivisor); + } } else { @@ -524,6 +591,9 @@ _lock_gl_object_hash(GL_Object_State *ostate, GL_Object_Type type) return &ostate->shared->sampler; case GL_OBJECT_TYPE_TRANSFORMFEEDBACK: return &ostate->transformfeedback; + case GL_OBJECT_TYPE_PROGRAMPIPELINE: + AST(mutex_lock(&ostate->shared->access_mutex) == 1); + return &ostate->shared->programpipeline; default: return NULL; } @@ -539,6 +609,7 @@ _unlock_gl_object_hash(GL_Object_State *ostate, GL_Object_Type type) case GL_OBJECT_TYPE_RENDERBUFFER: case GL_OBJECT_TYPE_PROGRAM: case GL_OBJECT_TYPE_SAMPLER: + case GL_OBJECT_TYPE_PROGRAMPIPELINE: AST(mutex_unlock(&ostate->shared->access_mutex) == 1); default: break; @@ -573,6 +644,9 @@ _lock_gl_object_hash_real(GL_Object_State *ostate, GL_Object_Type type) return &ostate->shared->sampler_real; case GL_OBJECT_TYPE_TRANSFORMFEEDBACK: return &ostate->transformfeedback_real; + case GL_OBJECT_TYPE_PROGRAMPIPELINE: + AST(mutex_lock(&ostate->shared->real_access_mutex) == 1); + return &ostate->shared->programpipeline_real; default: return NULL; } @@ -588,6 +662,7 @@ _unlock_gl_object_hash_real(GL_Object_State *ostate, GL_Object_Type type) case GL_OBJECT_TYPE_RENDERBUFFER: case GL_OBJECT_TYPE_PROGRAM: case GL_OBJECT_TYPE_SAMPLER: + case GL_OBJECT_TYPE_PROGRAMPIPELINE: AST(mutex_unlock(&ostate->shared->real_access_mutex) == 1); break; default: @@ -772,12 +847,14 @@ fastpath_sostate_init(GL_Shared_Object_State *sostate) HASH_INIT(sostate->renderbuffer); HASH_INIT(sostate->program); HASH_INIT(sostate->sampler); + HASH_INIT(sostate->programpipeline); HASH_INIT(sostate->texture_real); HASH_INIT(sostate->buffer_real); HASH_INIT(sostate->renderbuffer_real); HASH_INIT(sostate->program_real); HASH_INIT(sostate->sampler_real); + HASH_INIT(sostate->programpipeline_real); } #undef HASH_INIT @@ -890,12 +967,15 @@ fastpath_sostate_deinit(GL_Shared_Object_State *sostate) HASH_DEINIT(sostate->renderbuffer, 1); HASH_DEINIT(sostate->program, 1); HASH_DEINIT(sostate->sampler, 1); + HASH_DEINIT(sostate->programpipeline, 1); HASH_DEINIT(sostate->texture_real, 0); HASH_DEINIT(sostate->buffer_real, 0); HASH_DEINIT(sostate->renderbuffer_real, 0); HASH_DEINIT(sostate->program_real, 0); HASH_DEINIT(sostate->sampler_real, 0); + + HASH_DEINIT(sostate->programpipeline_real, 0); } #undef HASH_DEINIT @@ -1610,6 +1690,10 @@ fastpath_make_context_current(GLGlueContext *oldctx, GLGlueContext *newctx) } STATE_COMPARE(gl_element_array_buffer_binding[0]) { + STATE_COMPARE(gl_vertex_array_binding[0]) + { + CHECK_GL_ERROR(_orig_fastpath_glBindVertexArray(newctx->gl_vertex_array_binding[0])) + } CHECK_GL_ERROR(_orig_fastpath_glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, newctx->gl_element_array_buffer_binding[0])) } @@ -2137,10 +2221,6 @@ fastpath_make_context_current(GLGlueContext *oldctx, GLGlueContext *newctx) CHECK_GL_ERROR(_orig_fastpath_glDrawBuffers(drawBuffSize, newctx->gl_draw_buffers)) } - STATE_COMPARE(gl_vertex_array_binding[0]) - { - CHECK_GL_ERROR(_orig_fastpath_glBindVertexArray(newctx->gl_vertex_array_binding[0])) - } if (oldctx->gl_transform_feedback_active[0] == GL_TRUE && oldctx->gl_transform_feedback_paused[0] == GL_FALSE) { diff --git a/src/modules/fastpath/coregl_fastpath.h b/src/modules/fastpath/coregl_fastpath.h index dbc902b..6fa2622 100644 --- a/src/modules/fastpath/coregl_fastpath.h +++ b/src/modules/fastpath/coregl_fastpath.h @@ -127,6 +127,7 @@ typedef struct #define GL_OBJECT_TYPE_VERTEXARRAY 0x6000000 #define GL_OBJECT_TYPE_SAMPLER 0x7000000 #define GL_OBJECT_TYPE_TRANSFORMFEEDBACK 0x8000000 +#define GL_OBJECT_TYPE_PROGRAMPIPELINE 0x9000000 #define GL_OBJECT_TYPE_UNKNOWN 0xFFFFFFF typedef struct _GL_Object @@ -167,12 +168,15 @@ typedef struct _GL_Shared_Object_State GL_Object_Hash_Base renderbuffer; GL_Object_Hash_Base program; GL_Object_Hash_Base sampler; + GL_Object_Hash_Base programpipeline; GL_Object_Hash_Base texture_real; GL_Object_Hash_Base buffer_real; GL_Object_Hash_Base renderbuffer_real; GL_Object_Hash_Base program_real; GL_Object_Hash_Base sampler_real; + + GL_Object_Hash_Base programpipeline_real; } GL_Shared_Object_State; typedef struct _GL_Object_State @@ -331,6 +335,8 @@ typedef struct _GLGlueContext #define _MISC_FLAG3_BIT_gl_vertex_array_binding FLAG_BIT_2 #define _MISC_FLAG3_BIT_gl_transform_feedback_binding FLAG_BIT_3 #define _MISC_FLAG3_BIT_gl_transform_feedback FLAG_BIT_4 +#define _MISC_FLAG3_BIT_gl_draw_range_elements FLAG_BIT_5 +#define _MISC_FLAG3_BIT_gl_program_pipeline_binding FLAG_BIT_6 unsigned char _vattrib_flag; #define _VATTRIB_FLAG_BIT_gl_vertex_attrib_value FLAG_BIT_0 diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 433ecb4..172045e 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -8,6 +8,7 @@ #include #include +#include #define CURR_STATE_COMPARE(curr_state, state ) \ if ((current_ctx->curr_state[0]) != (state)) @@ -382,7 +383,7 @@ fastpath_glGetString(GLenum name) IF_GL_SUCCESS(ret = (const char *)_orig_fastpath_glGetString(name)) { double GLver = _get_gl_version(); - if (GLver > 3.0) + if (GLver > 3.1) { COREGL_WRN("\E[40;31;1mFastpath can't support %s (Fixed to %s)\E[0m\n", ret, string_gles30); ret = string_gles30; @@ -4051,6 +4052,7 @@ _modify_get_value(GLenum pname, GLvoid *ptr, GLenum get_type, GLboolean is64) case GL_VERTEX_ARRAY_BINDING: case GL_SAMPLER_BINDING: case GL_TRANSFORM_FEEDBACK_BINDING: + case GL_PROGRAM_PIPELINE_BINDING: { GLint real_obj_id = _COREGL_INT_INIT_VALUE; GLuint glue_obj_id = _COREGL_INT_INIT_VALUE; @@ -4092,6 +4094,8 @@ _modify_get_value(GLenum pname, GLvoid *ptr, GLenum get_type, GLboolean is64) case GL_TRANSFORM_FEEDBACK_BINDING: obj_type = GL_OBJECT_TYPE_TRANSFORMFEEDBACK; break; + case GL_PROGRAM_PIPELINE_BINDING: + obj_type = GL_OBJECT_TYPE_PROGRAMPIPELINE; } AST(obj_type != GL_OBJECT_TYPE_UNKNOWN); AST(GET_GLUE_OBJ(obj_type, real_obj_id, &glue_obj_id) == 1); @@ -5855,3 +5859,1493 @@ finish: } +/* GLES3.1 API */ +GLuint +fastpath_glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings) +{ + GLuint ret = 0; + GLuint real_obj = 0; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + AST(current_ctx->ostate.shared != NULL); + + real_obj = _orig_fastpath_glCreateShaderProgramv(type, count, strings); + if (real_obj != 0) + { + ret = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAM, real_obj); + + Program_object_attached_tag *poat = NULL; + poat = (Program_object_attached_tag *)calloc(1, sizeof(Program_object_attached_tag)); + AST(poat != NULL); + + poat->is_deleting = 0; + poat->shader_count = 0; + + fastpath_ostate_set_object_tag(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAM, ret, poat); + } + _attach_program_object(¤t_ctx->ostate, real_obj); + + goto finish; + + finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +void +fastpath_glGenProgramPipelines( GLsizei n, GLuint *pipelines) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0 || pipelines == NULL) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + + IF_GL_SUCCESS(_orig_fastpath_glGenProgramPipelines(n, objid_array)) + { + for (i = 0; i < n; i++) + { + pipelines[i] = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAMPIPELINE, objid_array[i]); + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBindProgramPipeline( GLuint pipeline) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + if (current_ctx->gl_program_pipeline_binding[0] != real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindProgramPipeline(real_obj)) + { + current_ctx->_misc_flag3 |= _MISC_FLAG3_BIT_gl_program_pipeline_binding; + current_ctx->gl_program_pipeline_binding[0] = real_obj; + } + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (params == NULL || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + switch (pname) + { + case GL_ACTIVE_PROGRAM: + case GL_VERTEX_SHADER: + case GL_FRAGMENT_SHADER: + case GL_COMPUTE_SHADER: + case GL_INFO_LOG_LENGTH: + case GL_VALIDATE_STATUS: + _orig_fastpath_glGetProgramPipelineiv(real_obj, pname, params); + break; + default: + _set_gl_error(GL_INVALID_ENUM); + break; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDeleteProgramPipelines(GLsizei n, GLuint const *pipelines) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0 || pipelines == NULL) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + if (n == 0) + goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + { + int real_n = 0; + + for (i = 0; i < n; i++) + { + int real_objid = _COREGL_INT_INIT_VALUE; + if (pipelines[i] == 0) continue; + + real_objid = fastpath_ostate_get_object(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAMPIPELINE, pipelines[i]); + if (real_objid == 0) continue; + + AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_PROGRAMPIPELINE, pipelines[i]) == 1); + objid_array[real_n++] = real_objid; + } + + IF_GL_SUCCESS(_orig_fastpath_glDeleteProgramPipelines(real_n, objid_array)) + { + for (i = 0; i < real_n; i++) + { + General_Trace_List *current = NULL; + current = current_ctx->ostate.shared->using_gctxs; + + while (current != NULL) + { + GLGlueContext *cur_gctx = (GLGlueContext *)current->value; + + if (cur_gctx->gl_program_pipeline_binding[0] == objid_array[i]) + cur_gctx->gl_program_pipeline_binding[0] = 0; + + current = current->next; + } + } + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +GLboolean +fastpath_glIsProgramPipeline( GLuint pipeline) +{ + GLboolean ret = GL_FALSE; + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_obj) != 1) + { + ret = GL_FALSE; + goto finish; + } + + ret = _orig_fastpath_glIsProgramPipeline(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +void +fastpath_glValidateProgramPipeline(GLuint pipeline) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glValidateProgramPipeline(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (NULL == infoLog || bufSize < 0 || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAMPIPELINE, pipeline, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glGetProgramPipelineInfoLog(real_obj, bufSize, length, infoLog); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (num_groups_x > GL_MAX_COMPUTE_WORK_GROUP_COUNT || + num_groups_y > GL_MAX_COMPUTE_WORK_GROUP_COUNT || + num_groups_z > GL_MAX_COMPUTE_WORK_GROUP_COUNT) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + if (num_groups_x == 0 || num_groups_y == 0 || num_groups_z == 0) + { + goto finish; + } + + _orig_fastpath_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDispatchComputeIndirect( GLintptr indirect) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (indirect < 0 || (indirect % sizeof(GLuint)) != 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glDispatchComputeIndirect(indirect); + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (params == NULL || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glGetProgramInterfaceiv(real_obj, programInterface, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +GLuint +fastpath_glGetProgramResourceIndex( GLuint program, GLenum programInterface, const char * name) +{ + GLuint real_obj; + GLuint ret = GL_INVALID_INDEX; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (name == NULL || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + ret = _orig_fastpath_glGetProgramResourceIndex(real_obj, programInterface, name); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +void +fastpath_glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((NULL == name && 0 != bufSize) || 0 > bufSize || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glGetProgramResourceName(real_obj, programInterface, index, bufSize, length, name); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetProgramResourceiv( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (0 > bufSize || 0 >= propCount || NULL == props || ((NULL == params && 0 < bufSize)) || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glGetProgramResourceiv(real_obj, programInterface, index, propCount, props, bufSize, length, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +GLint +fastpath_glGetProgramResourceLocation(GLuint program, GLenum programInterface, GLchar const *name) +{ + GLuint real_obj; + GLuint ret = -1; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (name == NULL || GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + ret = _orig_fastpath_glGetProgramResourceLocation(real_obj, programInterface, name); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +void +fastpath_glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glUseProgramStages(pipeline, stages, real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glActiveShaderProgram(GLuint pipeline, GLuint program) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glActiveShaderProgram(pipeline, real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1iv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2iv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3iv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4iv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + + +void +fastpath_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1fv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2fv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3fv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4fv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix2fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix3fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix4fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform1i(GLuint program, GLint location, GLint x) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1i(real_obj, location, x); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2i(real_obj, location, x, y); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3i(real_obj, location, x, y, z); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4i(real_obj, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform1f(GLuint program, GLint location, GLfloat x) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1f(real_obj, location, x); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2f(real_obj, location, x, y); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3f(real_obj, location, x, y, z); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4f(real_obj, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniform1ui(GLuint program, GLint location, GLuint x) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1ui(real_obj, location, x); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2ui(real_obj, location, x, y); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3ui(real_obj, location, x, y, z); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4ui(real_obj, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform1uiv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform2uiv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform3uiv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniform4uiv(real_obj, location, count, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix2x3fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix3x2fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix4x2fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix2x4fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix3x4fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_PROGRAM, program, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glProgramUniformMatrix4x3fv(real_obj, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glBindImageTexture(unit, texture, level, layered, layer, access, format); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetBooleani_v (GLenum target, GLuint index, GLboolean *data) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + IF_GL_SUCCESS(_orig_fastpath_glGetBooleani_v(target, index, data)) + { + _modify_get_value(target, data, GL_BOOL, GL_FALSE); + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glMemoryBarrier (GLbitfield barriers) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glMemoryBarrier(barriers); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glMemoryBarrierByRegion (GLbitfield barriers) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glMemoryBarrierByRegion(barriers); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glTexStorage2DMultisample (target, samples, internalformat, width, height, fixedsamplelocations); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glGetMultisamplefv (pname, index, val); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glSampleMaski (GLuint maskNumber, GLbitfield mask) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glSampleMaski(maskNumber, mask); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glGetTexLevelParameteriv (target, level, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glGetTexLevelParameterfv (target, level, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glBindVertexBuffer(bindingindex, buffer, offset, stride); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + +} + +void +fastpath_glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glVertexAttribFormat (attribindex, size, type, normalized, relativeoffset); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glVertexAttribIFormat (attribindex, size, type, relativeoffset); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glVertexAttribBinding (attribindex, bindingindex); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glVertexBindingDivisor(GLuint bindingindex, GLuint divisor) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glVertexBindingDivisor (bindingindex, divisor); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} diff --git a/src/modules/fastpath/coregl_fastpath_state.h b/src/modules/fastpath/coregl_fastpath_state.h index c56a410..7126023 100644 --- a/src/modules/fastpath/coregl_fastpath_state.h +++ b/src/modules/fastpath/coregl_fastpath_state.h @@ -18,7 +18,7 @@ #define SET_N(n, inc, stmt) \ { \ int i; \ - for (i = 0; i < n; i++) \ + for (i = 0; i < (int)n; i++) \ { \ stmt \ value += inc; \ @@ -198,7 +198,7 @@ GLUE_STATE(GLint, gl_scissor_box, 4, 4, GLUE_STATE(GLuint, gl_vertex_array_buf_id, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, SET_1(0)), SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, _sym_glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_BUFFER_BINDING, (GLint *)value);)) -GLUE_STATE(GLboolean, gl_vertex_array_enabled, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, +GLUE_STATE(GLint, gl_vertex_array_enabled, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, SET_1(GL_FALSE)), SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, _sym_glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_ENABLED, (GLint *)value);)) GLUE_STATE(GLint, gl_vertex_array_size, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, @@ -210,10 +210,10 @@ GLUE_STATE(GLsizei, gl_vertex_array_stride, INITIAL_CTX->gl_num_vertex_attribs[0 GLUE_STATE(GLenum, gl_vertex_array_type, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, SET_1(GL_FLOAT)), SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, _sym_glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_TYPE, (GLint *)value);)) -GLUE_STATE(GLboolean, gl_vertex_array_normalized, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, +GLUE_STATE(GLint, gl_vertex_array_normalized, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, SET_1(GL_FALSE)), SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, _sym_glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_NORMALIZED, (GLint *)value);)) -GLUE_STATE(GLboolean, gl_vertex_array_integer, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, +GLUE_STATE(GLint, gl_vertex_array_integer, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, SET_1(GL_FALSE)), SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 1, _sym_glGetVertexAttribiv(i, GL_VERTEX_ATTRIB_ARRAY_INTEGER, (GLint *)value);)) GLUE_STATE(GLuint, gl_vertex_array_divisor, INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, @@ -229,10 +229,10 @@ GLUE_STATE(GLfloat, gl_vertex_attrib_value, 4 * INITIAL_CTX->gl_num_vertex_attri _COREGL_START_API(COREGL_GLAPI_3) GLUE_STATE(GLint, gl_vertex_attrib_value_integer, 4 * INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, SET_4(0, 0, 0, GET_INT_FROM_FLOAT(1.0f))), - SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, _sym_glGetVertexAttribIiv(i, GL_CURRENT_VERTEX_ATTRIB, (GLint *)value);)) + SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, SET_4(0, 0, 0, GET_INT_FROM_FLOAT(1.0f)))) GLUE_STATE(GLuint, gl_vertex_attrib_value_unsigned_integer, 4 * INITIAL_CTX->gl_num_vertex_attribs[0], MAX_VERTEX_ATTRIBS, SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, SET_4(0, 0, 0, GET_UINT_FROM_FLOAT(1.0f))), - SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, _sym_glGetVertexAttribIuiv(i, GL_CURRENT_VERTEX_ATTRIB, (GLuint *)value);)) + SET_N(INITIAL_CTX->gl_num_vertex_attribs[0], 4, SET_4(0, 0, 0, GET_INT_FROM_FLOAT(1.0f)))) // MISC FLAG 3 GLUE_STATE(GLenum, gl_read_buffer, 1, 1, SET_1(GL_BACK), _sym_glGetIntegerv(GL_READ_BUFFER, (GLint *)value);) @@ -240,6 +240,7 @@ GLUE_STATE(GLenum, gl_draw_buffers, INITIAL_CTX->gl_num_draw_buffers[0], 16, SET_1(GL_BACK); value++; SET_N(INITIAL_CTX->gl_num_draw_buffers[0] - 1, 1, SET_1(GL_NONE)), _state_get_draw_buffers(value);) GLUE_STATE(GLuint, gl_vertex_array_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_VERTEX_ARRAY_BINDING, (GLint *)value);) +GLUE_STATE(GLuint, gl_program_pipeline_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_PROGRAM_PIPELINE_BINDING, (GLint *)value);) GLUE_STATE(GLuint, gl_transform_feedback_binding, 1, 1, SET_1(0), _sym_glGetIntegerv(GL_TRANSFORM_FEEDBACK_BINDING, (GLint *)value);) GLUE_STATE(GLboolean, gl_transform_feedback_active, 1, 1, SET_1(0), _sym_glGetBooleanv(GL_TRANSFORM_FEEDBACK_ACTIVE, (GLboolean *)value);) GLUE_STATE(GLboolean, gl_transform_feedback_paused, 1, 1, SET_1(0), _sym_glGetBooleanv(GL_TRANSFORM_FEEDBACK_PAUSED, (GLboolean *)value);) diff --git a/src/modules/tracepath/coregl_tracepath.h b/src/modules/tracepath/coregl_tracepath.h index e40a666..4acedf4 100644 --- a/src/modules/tracepath/coregl_tracepath.h +++ b/src/modules/tracepath/coregl_tracepath.h @@ -127,9 +127,8 @@ extern void deinit_modules_tstate_tracepath(GLThreadState *tstate extern void tracepath_apply_overrides(); -extern void tracepath_apply_overrides_egl(); -extern void tracepath_apply_overrides_gl(); - +extern void tracepath_apply_overrides_egl(int enable); +extern void tracepath_apply_overrides_gl(int enable); extern void tracepath_dump_context_states(int force_output); extern void *tracepath_api_trace_begin(const char *name, void *hint, int trace_total_time); diff --git a/src/modules/tracepath/coregl_tracepath_egl.c b/src/modules/tracepath/coregl_tracepath_egl.c index 6bf7743..98a8bf6 100644 --- a/src/modules/tracepath/coregl_tracepath_egl.c +++ b/src/modules/tracepath/coregl_tracepath_egl.c @@ -1085,3 +1085,48 @@ finish: return ret; } +EGLBoolean +tracepath_eglBindWaylandDisplayWL(EGLDisplay dpy, void* display) +{ + EGLBoolean ret = EGL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_eglBindWaylandDisplayWL(dpy, display); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +EGLBoolean +tracepath_eglUnbindWaylandDisplayWL(EGLDisplay dpy, void* display) +{ + EGLBoolean ret = EGL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_eglUnbindWaylandDisplayWL(dpy, display); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + + +EGLBoolean +tracepath_eglQueryWaylandBufferWL(EGLDisplay dpy, void* buffer, EGLint attribute, EGLint *value) +{ + EGLBoolean ret = EGL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_eglQueryWaylandBufferWL(dpy, buffer, attribute, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} \ No newline at end of file diff --git a/src/modules/tracepath/coregl_tracepath_gl.c b/src/modules/tracepath/coregl_tracepath_gl.c index d4d263d..8b9b0c8 100644 --- a/src/modules/tracepath/coregl_tracepath_gl.c +++ b/src/modules/tracepath/coregl_tracepath_gl.c @@ -4500,3 +4500,828 @@ finish: return ret; } +/* GLES3.1 API */ +void +tracepath_glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLuint +tracepath_glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings) +{ + GLboolean ret = GL_FALSE; + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glCreateShaderProgramv(type, count, strings); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void +tracepath_glGenProgramPipelines( GLsizei n, GLuint *pipelines) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenProgramPipelines(n, pipelines); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBindProgramPipeline( GLuint pipeline) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBindProgramPipeline(pipeline); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetProgramPipelineiv(pipeline, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDeleteProgramPipelines(GLsizei n, GLuint const *pipelines) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDeleteProgramPipelines(n, pipelines); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLboolean +tracepath_glIsProgramPipeline( GLuint pipeline) +{ + GLboolean ret = GL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glIsProgramPipeline(pipeline); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void +tracepath_glValidateProgramPipeline(GLuint pipeline) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glValidateProgramPipeline(pipeline); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDispatchComputeIndirect( GLintptr indirect) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDispatchComputeIndirect(indirect); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDrawArraysIndirect(GLenum mode, GLvoid const *indirect) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDrawArraysIndirect(mode, indirect); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDrawElementsIndirect(GLenum mode, GLenum type, GLvoid const *indirect) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDrawElementsIndirect(mode, type, indirect); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glFramebufferParameteri(GLenum target, GLenum pname, GLint param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFramebufferParameteri(target, pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetFramebufferParameteriv( GLenum target, GLenum pname, GLint * params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetFramebufferParameteriv(target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetProgramInterfaceiv(program, programInterface, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLuint +tracepath_glGetProgramResourceIndex( GLuint program, GLenum programInterface, const char * name) +{ + GLuint ret = GL_INVALID_INDEX; + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glGetProgramResourceIndex(program, programInterface, name); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void +tracepath_glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + + _orig_tracepath_glGetProgramResourceName(program, programInterface, index, bufSize, length, name); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetProgramResourceiv( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + + _orig_tracepath_glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLint +tracepath_glGetProgramResourceLocation(GLuint program, GLenum programInterface, GLchar const *name) +{ + GLuint ret = -1; + _COREGL_TRACEPATH_FUNC_BEGIN(); + + ret = _orig_tracepath_glGetProgramResourceLocation(program, programInterface, name); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void +tracepath_glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glUseProgramStages(pipeline, stages, program); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glActiveShaderProgram(GLuint pipeline, GLuint program) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glActiveShaderProgram(pipeline, program); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1iv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2iv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3iv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4iv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1fv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2fv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3fv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4fv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix2fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix3fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix4fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1i(GLuint program, GLint location, GLint x) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1i(program, location, x); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2i(program, location, x, y); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3i(program, location, x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4i(program, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1f(GLuint program, GLint location, GLfloat x) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1f(program, location, x); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2f(program, location, x, y); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3f(program, location, x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4f(program, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1ui(GLuint program, GLint location, GLuint x) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1ui(program, location, x); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2ui(program, location, x, y); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3ui(program, location, x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4ui(program, location, x, y, z, w); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform1uiv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform2uiv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform3uiv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniform4uiv(program, location, count, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix2x3fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix3x2fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix4x2fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix2x4fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix3x4fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glProgramUniformMatrix4x3fv(program, location, count, transpose, value); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBindImageTexture(GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + + _orig_tracepath_glBindImageTexture(unit, texture, level, layered, layer, access, format); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetBooleani_v (GLenum target, GLuint index, GLboolean *data) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetBooleani_v (target, index, data); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMemoryBarrier (GLbitfield barriers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMemoryBarrier (barriers); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glMemoryBarrierByRegion (GLbitfield barriers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMemoryBarrierByRegion (barriers); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexStorage2DMultisample (target, samples, internalformat, width, height, fixedsamplelocations); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetMultisamplefv (pname, index, val); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glSampleMaski (GLuint maskNumber, GLbitfield mask) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glSampleMaski (maskNumber, mask); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetTexLevelParameteriv (target, level, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetTexLevelParameterfv (target, level, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBindVertexBuffer (bindingindex, buffer, offset, stride); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void tracepath_glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glVertexAttribFormat (attribindex, size, type, normalized, relativeoffset); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glVertexAttribIFormat (attribindex, size, type, relativeoffset); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glVertexAttribBinding (attribindex, bindingindex); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glVertexBindingDivisor (bindingindex, divisor); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} \ No newline at end of file diff --git a/src/wraps/coregl_gl.c b/src/wraps/coregl_gl.c index ba7eda9..365601a 100644 --- a/src/wraps/coregl_gl.c +++ b/src/wraps/coregl_gl.c @@ -1536,3 +1536,405 @@ glGetInternalformativ(GLenum target, GLenum internalformat, GLenum pname, GLsize ovr_glGetInternalformativ(target, internalformat, pname, bufSize, params); } +/* GLES3.1 API */ +GLuint +glCreateShaderProgramv(GLenum type, GLsizei count, const GLchar *const*strings) +{ + return ovr_glCreateShaderProgramv(type, count, strings); +} + +void +glGenProgramPipelines( GLsizei n, GLuint *pipelines) +{ + ovr_glGenProgramPipelines(n, pipelines); +} + +void +glBindProgramPipeline( GLuint pipeline) +{ + ovr_glBindProgramPipeline(pipeline); +} + +void +glGetProgramPipelineiv(GLuint pipeline, GLenum pname, GLint *params) +{ + ovr_glGetProgramPipelineiv(pipeline, pname, params); +} + +void +glDeleteProgramPipelines(GLsizei n, GLuint const *pipelines) +{ + ovr_glDeleteProgramPipelines(n, pipelines); +} + +GLboolean +glIsProgramPipeline( GLuint pipeline) +{ + return ovr_glIsProgramPipeline(pipeline); +} + +void +glValidateProgramPipeline(GLuint pipeline) +{ + ovr_glValidateProgramPipeline(pipeline); +} + +void +glGetProgramPipelineInfoLog(GLuint pipeline, GLsizei bufSize, GLsizei *length, GLchar *infoLog) +{ + ovr_glGetProgramPipelineInfoLog(pipeline, bufSize, length, infoLog); +} + +void +glDispatchCompute(GLuint num_groups_x, GLuint num_groups_y, GLuint num_groups_z) +{ + ovr_glDispatchCompute(num_groups_x, num_groups_y, num_groups_z); +} + +void +glDispatchComputeIndirect( GLintptr indirect) +{ + ovr_glDispatchComputeIndirect(indirect); +} + +void +glDrawArraysIndirect(GLenum mode, GLvoid const *indirect) +{ + ovr_glDrawArraysIndirect(mode, indirect); +} + +void +glDrawElementsIndirect(GLenum mode, GLenum type, GLvoid const *indirect) +{ + ovr_glDrawElementsIndirect(mode, type, indirect); +} + +void +glFramebufferParameteri(GLenum target, GLenum pname, GLint param) +{ + ovr_glFramebufferParameteri(target, pname, param); +} + +void +glGetFramebufferParameteriv( GLenum target, GLenum pname, GLint * params) +{ + ovr_glGetFramebufferParameteriv(target, pname, params); +} + +void +glGetProgramInterfaceiv(GLuint program, GLenum programInterface, GLenum pname, GLint * params) +{ + ovr_glGetProgramInterfaceiv(program, programInterface, pname, params); +} + +GLuint +glGetProgramResourceIndex( GLuint program, GLenum programInterface, const char * name) +{ + return ovr_glGetProgramResourceIndex(program, programInterface, name); +} + +void +glGetProgramResourceName(GLuint program, GLenum programInterface, GLuint index, GLsizei bufSize, GLsizei *length, GLchar *name) +{ + ovr_glGetProgramResourceName(program, programInterface, index, bufSize, length, name); +} + +void +glGetProgramResourceiv( GLuint program, GLenum programInterface, GLuint index, GLsizei propCount, const GLenum * props, GLsizei bufSize, GLsizei * length, GLint * params) +{ + ovr_glGetProgramResourceiv(program, programInterface, index, propCount, props, bufSize, length, params); +} + +GLint +glGetProgramResourceLocation(GLuint program, GLenum programInterface, GLchar const *name) +{ + return ovr_glGetProgramResourceLocation(program, programInterface, name); +} + +void +glUseProgramStages(GLuint pipeline, GLbitfield stages, GLuint program) +{ + ovr_glUseProgramStages(pipeline, stages, program); +} + +void +glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform1iv(program, location, count, value); +} + +void +glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform2iv(program, location, count, value); +} + +void +glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform3iv(program, location, count, value); +} + +void +glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) +{ + ovr_glProgramUniform4iv(program, location, count, value); +} + +void +glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform1fv(program, location, count, value); +} + +void +glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform2fv(program, location, count, value); +} + +void +glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform3fv(program, location, count, value); +} + +void +glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) +{ + ovr_glProgramUniform4fv(program, location, count, value); +} + +void +glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4fv(program, location, count, transpose, value); +} + +void +glProgramUniform1i(GLuint program, GLint location, GLint x) +{ + ovr_glProgramUniform1i(program, location, x); +} + +void +glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) +{ + ovr_glProgramUniform2i(program, location, x, y); +} + +void +glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) +{ + ovr_glProgramUniform3i(program, location, x, y, z); +} + +void +glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) +{ + ovr_glProgramUniform4i(program, location, x, y, z, w); +} + +void +glProgramUniform1f(GLuint program, GLint location, GLfloat x) +{ + ovr_glProgramUniform1f(program, location, x); +} + +void +glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) +{ + ovr_glProgramUniform2f(program, location, x, y); +} + +void +glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) +{ + ovr_glProgramUniform3f(program, location, x, y, z); +} + +void +glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) +{ + ovr_glProgramUniform4f(program, location, x, y, z, w); +} + +void +glProgramUniform1ui(GLuint program, GLint location, GLuint x) +{ + ovr_glProgramUniform1ui(program, location, x); +} + +void +glProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y) +{ + ovr_glProgramUniform2ui(program, location, x, y); +} + +void +glProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z) +{ + ovr_glProgramUniform3ui(program, location, x, y, z); +} + +void +glProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) +{ + ovr_glProgramUniform4ui(program, location, x, y, z, w); +} + +void +glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform1uiv(program, location, count, value); +} + +void +glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform2uiv(program, location, count, value); +} + +void +glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform3uiv(program, location, count, value); +} + +void +glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) +{ + ovr_glProgramUniform4uiv(program, location, count, value); +} + +void +glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2x3fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3x2fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4x3fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix3x4fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix2x4fv(program, location, count, transpose, value); +} + +void +glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) +{ + ovr_glProgramUniformMatrix4x2fv(program, location, count, transpose, value); +} + +void +glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) +{ + ovr_glBindImageTexture (unit, texture, level, layered, layer, access, format); +} + +void +glGetBooleani_v (GLenum target, GLuint index, GLboolean *data) +{ + ovr_glGetBooleani_v (target, index, data); +} + +void +glMemoryBarrier (GLbitfield barriers) +{ + ovr_glMemoryBarrier (barriers); +} + +void +glMemoryBarrierByRegion (GLbitfield barriers) +{ + ovr_glMemoryBarrierByRegion (barriers); +} + +void +glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) +{ + ovr_glTexStorage2DMultisample (target, samples, internalformat, width, height, fixedsamplelocations); +} + +void +glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val) +{ + ovr_glGetMultisamplefv (pname, index, val); +} + +void +glSampleMaski (GLuint maskNumber, GLbitfield mask) +{ + ovr_glSampleMaski (maskNumber, mask); +} + +void +glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params) +{ + ovr_glGetTexLevelParameteriv (target, level, pname, params); +} + +void +glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params) +{ + ovr_glGetTexLevelParameterfv (target, level, pname, params); +} + +void +glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) +{ + ovr_glBindVertexBuffer (bindingindex, buffer, offset, stride); +} + +void +glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) +{ + ovr_glVertexAttribFormat (attribindex, size, type, normalized, relativeoffset); +} + +void +glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) +{ + ovr_glVertexAttribIFormat (attribindex, size, type, relativeoffset); +} + +void +glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) +{ + ovr_glVertexAttribBinding (attribindex, bindingindex); +} + +void +glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) +{ + ovr_glVertexBindingDivisor (bindingindex, divisor); +} -- 2.7.4 From bfef8696b6200121b41e7cbfc51fc4643b3af0eb Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Wed, 25 Nov 2015 00:19:56 +0900 Subject: [PATCH 06/16] Add egl.pc Remove unused file Fix description on package config file Change-Id: I1cda3fcd47c89726676c2c37d94a766521f14cd4 --- CMakeLists.txt | 4 ---- COREGL.pc.in | 13 ------------- pkgconfig/egl.pc | 11 +++++++++++ pkgconfig/gles11.pc | 2 +- pkgconfig/gles20.pc | 2 +- pkgconfig/glesv1.pc | 2 +- pkgconfig/glesv1_cm.pc | 2 +- pkgconfig/glesv2.pc | 2 +- 8 files changed, 16 insertions(+), 22 deletions(-) delete mode 100644 COREGL.pc.in create mode 100644 pkgconfig/egl.pc diff --git a/CMakeLists.txt b/CMakeLists.txt index b4f61c8..4d4c75b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -114,14 +114,10 @@ SET_TARGET_PROPERTIES(${GLES2} PROPERTIES VERSION ${GLES2_VERSION}) #SET_TARGET_PROPERTIES(${COREGL} PROPERTIES COMPILE_FLAGS ${EXTRA_CFLAGS_common}) TARGET_LINK_LIBRARIES(${GLES2} ${pkg_common_LDFLAGS} ${dlog_LIBRARIES} "-ldl -g -O2 -fvisibility=hidden -Wall -std=c99 -lpthread") -CONFIGURE_FILE(${COREGL}.pc.in ${COREGL}.pc @ONLY) - INSTALL(TARGETS ${COREGL} DESTINATION lib COMPONENT RuntimeLibraries) INSTALL(TARGETS ${EGL} DESTINATION lib COMPONENT RuntimeLibraries) INSTALL(TARGETS ${GLES2} DESTINATION lib COMPONENT RuntimeLibraries) -INSTALL(FILES ${CMAKE_CURRENT_BINARY_DIR}/${COREGL}.pc DESTINATION lib/pkgconfig) - #FOREACH(hfile ${HEADERS_common}) # INSTALL(FILES ${CMAKE_CURRENT_SOURCE_DIR}/include/${hfile} DESTINATION include/coregl) #ENDFOREACH(hfile) diff --git a/COREGL.pc.in b/COREGL.pc.in deleted file mode 100644 index ca32f1b..0000000 --- a/COREGL.pc.in +++ /dev/null @@ -1,13 +0,0 @@ -# Package Information for pkg-config - -prefix=@PREFIX@ -exec_prefix=@EXEC_PREFIX@ -libdir=@LIBDIR@ -includedir=@INCLUDEDIR@ - -Name: coregl -Description: SAMSUNG Linux platform application library -Version: @VERSION@ -Requires: x11 dlog -Libs: -L${libdir} -lcoregl -Cflags: -I${includedir} -I${includedir}/coregl diff --git a/pkgconfig/egl.pc b/pkgconfig/egl.pc new file mode 100644 index 0000000..855639f --- /dev/null +++ b/pkgconfig/egl.pc @@ -0,0 +1,11 @@ +prefix=/usr +exec_prefix=${prefix} +libdir=/usr/lib +includedir=/usr/include + +Name: egl +Description: CoreGL EGL library +Version: 0.1 +Requires: +Libs: -L${libdir} -lEGL +Cflags: -I${includedir} diff --git a/pkgconfig/gles11.pc b/pkgconfig/gles11.pc index 9306e86..1ddec10 100644 --- a/pkgconfig/gles11.pc +++ b/pkgconfig/gles11.pc @@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: gles11 -Description: OpenGL-ES 1.1 Library for ARM Mali 400MP +Description: CoreGL OpenGL-ES 1.1 Library Version: 0.1 Requires: Libs: -L${libdir} -lGLESv1_CM -lEGL diff --git a/pkgconfig/gles20.pc b/pkgconfig/gles20.pc index 2b99820..d1d7c14 100644 --- a/pkgconfig/gles20.pc +++ b/pkgconfig/gles20.pc @@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: gles20 -Description: OpenGL-ES 2.0 Library for ARM Mali 400MP +Description: CoreGL OpenGL-ES 2.0 Library Version: 0.1 Requires: Libs: -L${libdir} -lGLESv2 -lEGL diff --git a/pkgconfig/glesv1.pc b/pkgconfig/glesv1.pc index da7cf0e..e09cefd 100644 --- a/pkgconfig/glesv1.pc +++ b/pkgconfig/glesv1.pc @@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: glesv1 -Description: OpenGL-ES 1.1 Library for ARM Mali 400MP +Description: CoreGL OpenGL-ES 1.1 Library Version: 0.1 Requires: Libs: -L${libdir} -lGLESv1_CM -lEGL diff --git a/pkgconfig/glesv1_cm.pc b/pkgconfig/glesv1_cm.pc index 153fd3b..54d77f2 100644 --- a/pkgconfig/glesv1_cm.pc +++ b/pkgconfig/glesv1_cm.pc @@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: glesv1_cm -Description: OpenGL-ES 1.1 Library for ARM Mali 400MP +Description: CoreGL OpenGL-ES 1.1 Library Version: 0.1 Requires: Libs: -L${libdir} -lGLESv1_CM -lEGL diff --git a/pkgconfig/glesv2.pc b/pkgconfig/glesv2.pc index a73e902..7e3cbaa 100644 --- a/pkgconfig/glesv2.pc +++ b/pkgconfig/glesv2.pc @@ -4,7 +4,7 @@ libdir=${exec_prefix}/lib includedir=${prefix}/include Name: glesv2 -Description: OpenGL-ES 2.0 Library for ARM Mali 400MP +Description: CoreGL OpenGL-ES 2.0 Library Version: 0.1 Requires: Libs: -L${libdir} -lGLESv2 -lEGL -- 2.7.4 From 73a17439b2daf80270acb8275b5699e235492b26 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 7 Dec 2015 13:28:53 +0900 Subject: [PATCH 07/16] Add ix86 and x86_64 to Build Architecture. Change-Id: I2d47b050ffca66c021afa8bd46908e618231330c --- CMakeLists.txt | 2 ++ packaging/coregl.spec | 1 - 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index 4d4c75b..6c1b233 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -17,6 +17,8 @@ SET(BUILD_ARCH "$ENV{RPM_ARCH}") IF(${BUILD_ARCH} MATCHES "aarch64") SET(LIBDIR "/usr/lib64") +ELSEIF(${BUILD_ARCH} MATCHES "x86_64") +SET(LIBDIR "/usr/lib64") ELSE(${BUILD_ARCH} MATCHES "aarch64") SET(LIBDIR "/usr/lib") ENDIF(${BUILD_ARCH} MATCHES "aarch64") diff --git a/packaging/coregl.spec b/packaging/coregl.spec index 1e2957c..2bd548e 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -4,7 +4,6 @@ Name: coregl Summary: CoreGL FastPath Optimization Version: 0.1.10 Release: 02 -ExclusiveArch: %arm aarch64 Group: Graphics License: Apache 2.0 URL: http://www.tizen.org -- 2.7.4 From 13cd81887dd6152fa5390f10440c05dd3f845a95 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 7 Dec 2015 15:30:09 +0900 Subject: [PATCH 08/16] Add devel package requires. libwayland-egl libgbm-devel Change-Id: Ib50c214f4f2e91d3bb8285c7b494b3bd06d11f27 --- packaging/coregl.spec | 2 ++ 1 file changed, 2 insertions(+) diff --git a/packaging/coregl.spec b/packaging/coregl.spec index 2bd548e..0604938 100644 --- a/packaging/coregl.spec +++ b/packaging/coregl.spec @@ -27,6 +27,8 @@ Supported versions: Summary: Development files for EGL 1.4 and OpenGL ES 1.1 and 2.0 Group: Graphics Requires: %{name} = %{version}-%{release} +Requires: libgbm-devel +Requires: libwayland-egl %description devel This package contains the development libraries and header files needed by -- 2.7.4 From 86f4ff2b048c9edc4cbecc5f2298cdf1a97cd626 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 7 Dec 2015 15:52:29 +0900 Subject: [PATCH 09/16] Fix egl package config version match to mesa egl version. Change-Id: Ida942be9ace41c9893dadd5d88af3b6a7211e0df --- pkgconfig/egl.pc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgconfig/egl.pc b/pkgconfig/egl.pc index 855639f..cb03cd6 100644 --- a/pkgconfig/egl.pc +++ b/pkgconfig/egl.pc @@ -5,7 +5,7 @@ includedir=/usr/include Name: egl Description: CoreGL EGL library -Version: 0.1 +Version: 10.3.0 Requires: Libs: -L${libdir} -lEGL Cflags: -I${includedir} -- 2.7.4 From af04a32d08541164a385753498e563b3e7fa13a8 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 14 Dec 2015 14:36:16 +0900 Subject: [PATCH 10/16] Add wayland specs to eglext.h Change-Id: I1d997f51b299d53e6b0444877953c6fc3794abb1 --- include_KHR/EGL/eglext.h | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/include_KHR/EGL/eglext.h b/include_KHR/EGL/eglext.h index 860d9fb..027b2ed 100644 --- a/include_KHR/EGL/eglext.h +++ b/include_KHR/EGL/eglext.h @@ -798,7 +798,7 @@ EGLAPI EGLuint64NV EGLAPIENTRY eglGetSystemTimeNV (void); #endif /* EGL_TIZEN_image_native_surface */ /******************************************************************************/ -/* 20140709-sw815.ha: SEC proprietary specs */ +/* SEC proprietary specs */ #ifndef EGL_SEC_client_pixmap #define EGL_SEC_client_pixmap 1 #define EGL_CLINET_MEM_PIXMAP_SEC 0x3200 /* eglCreateClientPixmapFromClientBufferSEC buftype */ @@ -839,6 +839,44 @@ EGLAPI EGLBoolean EGLAPIENTRY eglGetImageAttribSEC (EGLDisplay dpy, EGLImageKHR #endif /*EGL_ANDROID_PIXMAP_image /******************************************************************************/ +/******************************************************************************/ +/* WAYLAND specs */ +#ifndef EGL_WL_bind_wayland_display +#define EGL_WL_bind_wayland_display 1 + +#define EGL_WAYLAND_BUFFER_WL 0x31D5 /* eglCreateImageKHR target */ +#define EGL_WAYLAND_PLANE_WL 0x31D6 /* eglCreateImageKHR target */ + +#define EGL_WAYLAND_Y_INVERTED_WL 0x31DB /* eglQueryWaylandBufferWL attribute */ + +#define EGL_TEXTURE_Y_U_V_WL 0x31D7 +#define EGL_TEXTURE_Y_UV_WL 0x31D8 +#define EGL_TEXTURE_Y_XUXV_WL 0x31D9 + +struct wl_display; +struct wl_resource; +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI EGLBoolean EGLAPIENTRY eglBindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglUnbindWaylandDisplayWL(EGLDisplay dpy, struct wl_display *display); +EGLAPI EGLBoolean EGLAPIENTRY eglQueryWaylandBufferWL(EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); +#endif +typedef EGLBoolean (EGLAPIENTRYP PFNEGLBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLUNBINDWAYLANDDISPLAYWL) (EGLDisplay dpy, struct wl_display *display); +typedef EGLBoolean (EGLAPIENTRYP PFNEGLQUERYWAYLANDBUFFERWL) (EGLDisplay dpy, struct wl_resource *buffer, EGLint attribute, EGLint *value); + +#endif + +#ifndef EGL_WL_create_wayland_buffer_from_image +#define EGL_WL_create_wayland_buffer_from_image 1 + +#ifdef EGL_EGLEXT_PROTOTYPES +EGLAPI struct wl_buffer * EGLAPIENTRY eglCreateWaylandBufferFromImageWL(EGLDisplay dpy, EGLImageKHR image); +#endif +typedef struct wl_buffer * (EGLAPIENTRYP PFNEGLCREATEWAYLANDBUFFERFROMIMAGEWL) (EGLDisplay dpy, EGLImageKHR image); + +#endif +/******************************************************************************/ + #ifdef __cplusplus } #endif -- 2.7.4 From 50c6136ac4336c383cafd3a8fff5916a92c0f288 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Thu, 24 Dec 2015 12:57:15 +0900 Subject: [PATCH 11/16] Add error checking code for initialize of real EGL. Change-Id: Id635f0e87c5d5d6309b3ca10dd7df7c82bb82e69 --- src/coregl_export_egl.c | 170 ++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 136 insertions(+), 34 deletions(-) diff --git a/src/coregl_export_egl.c b/src/coregl_export_egl.c index da04740..b8ae001 100644 --- a/src/coregl_export_egl.c +++ b/src/coregl_export_egl.c @@ -8,8 +8,10 @@ Mutex init_export_mutex = MUTEX_INITIALIZER; mutex_lock(&init_export_mutex); \ if (export_initialized == 0) \ { \ - coregl_initialize(); \ - export_initialized = 1; \ + if (coregl_initialize() != 0) \ + { \ + export_initialized = 1; \ + } \ } \ mutex_unlock(&init_export_mutex); \ } @@ -18,49 +20,70 @@ EGLint coregl_api_eglGetError(void) { INIT_EXPORT(); - return ovr_eglGetError(); + if (!export_initialized) + return EGL_NOT_INITIALIZED; + else + return ovr_eglGetError(); } EGLDisplay coregl_api_eglGetDisplay(EGLNativeDisplayType display_id) { INIT_EXPORT(); - return ovr_eglGetDisplay(display_id); + if (!export_initialized) + return NULL; + else + return ovr_eglGetDisplay(display_id); } EGLBoolean coregl_api_eglInitialize(EGLDisplay dpy, EGLint* major, EGLint* minor) { INIT_EXPORT(); - return ovr_eglInitialize(dpy, major, minor); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglInitialize(dpy, major, minor); } EGLBoolean coregl_api_eglTerminate(EGLDisplay dpy) { INIT_EXPORT(); - return ovr_eglTerminate(dpy); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglTerminate(dpy); } EGLBoolean coregl_api_eglGetConfigs(EGLDisplay dpy, EGLConfig *configs, EGLint config_size, EGLint *num_config) { INIT_EXPORT(); - return ovr_eglGetConfigs(dpy, configs, config_size, num_config); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglGetConfigs(dpy, configs, config_size, num_config); } EGLBoolean coregl_api_eglChooseConfig(EGLDisplay dpy, const EGLint* attrib_list, EGLConfig* configs, EGLint config_size, EGLint* num_config) { INIT_EXPORT(); - return ovr_eglChooseConfig(dpy, attrib_list, configs, config_size, num_config); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglChooseConfig(dpy, attrib_list, configs, config_size, num_config); } EGLBoolean coregl_api_eglGetConfigAttrib(EGLDisplay dpy, EGLConfig config, EGLint attribute, EGLint *value) { INIT_EXPORT(); - return ovr_eglGetConfigAttrib(dpy, config, attribute, value); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglGetConfigAttrib(dpy, config, attribute, value); } @@ -68,146 +91,208 @@ EGLSurface coregl_api_eglCreateWindowSurface(EGLDisplay dpy, EGLConfig config, EGLNativeWindowType win, const EGLint* attrib_list) { INIT_EXPORT(); - return ovr_eglCreateWindowSurface(dpy, config, win, attrib_list); + if (!export_initialized) + return EGL_NO_SURFACE; + else + return ovr_eglCreateWindowSurface(dpy, config, win, attrib_list); } EGLSurface coregl_api_eglCreatePbufferSurface(EGLDisplay dpy, EGLConfig config, const EGLint *attrib_list) { INIT_EXPORT(); - return ovr_eglCreatePbufferSurface(dpy, config, attrib_list); + if (!export_initialized) + return EGL_NO_SURFACE; + else + return ovr_eglCreatePbufferSurface(dpy, config, attrib_list); } EGLSurface coregl_api_eglCreatePixmapSurface(EGLDisplay dpy, EGLConfig config, EGLNativePixmapType pixmap, const EGLint* attrib_list) { INIT_EXPORT(); - return ovr_eglCreatePixmapSurface(dpy, config, pixmap, attrib_list); + if (!export_initialized) + return EGL_NO_SURFACE; + else + return ovr_eglCreatePixmapSurface(dpy, config, pixmap, attrib_list); } EGLBoolean coregl_api_eglDestroySurface(EGLDisplay dpy, EGLSurface surface) { INIT_EXPORT(); - return ovr_eglDestroySurface(dpy, surface); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglDestroySurface(dpy, surface); } EGLBoolean coregl_api_eglQuerySurface(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint *value) { INIT_EXPORT(); - return ovr_eglQuerySurface(dpy, surface, attribute, value); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglQuerySurface(dpy, surface, attribute, value); } EGLBoolean coregl_api_eglBindAPI(EGLenum api) { INIT_EXPORT(); - return ovr_eglBindAPI(api); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglBindAPI(api); } EGLenum coregl_api_eglQueryAPI(void) { INIT_EXPORT(); - return ovr_eglQueryAPI(); + if (!export_initialized) + return EGL_NONE; + else + return ovr_eglQueryAPI(); } EGLBoolean coregl_api_eglWaitClient(void) { INIT_EXPORT(); - return ovr_eglWaitClient(); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglWaitClient(); } EGLBoolean coregl_api_eglReleaseThread(void) { INIT_EXPORT(); - return ovr_eglReleaseThread(); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglReleaseThread(); } EGLSurface coregl_api_eglCreatePbufferFromClientBuffer(EGLDisplay dpy, EGLenum buftype, EGLClientBuffer buffer, EGLConfig config, const EGLint *attrib_list) { INIT_EXPORT(); - return ovr_eglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list); + if (!export_initialized) + return EGL_NO_SURFACE; + else + return ovr_eglCreatePbufferFromClientBuffer(dpy, buftype, buffer, config, attrib_list); } EGLBoolean coregl_api_eglSurfaceAttrib(EGLDisplay dpy, EGLSurface surface, EGLint attribute, EGLint value) { INIT_EXPORT(); - return ovr_eglSurfaceAttrib(dpy, surface, attribute, value); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglSurfaceAttrib(dpy, surface, attribute, value); } EGLBoolean coregl_api_eglBindTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) { INIT_EXPORT(); - return ovr_eglBindTexImage(dpy, surface, buffer); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglBindTexImage(dpy, surface, buffer); } EGLBoolean coregl_api_eglReleaseTexImage(EGLDisplay dpy, EGLSurface surface, EGLint buffer) { INIT_EXPORT(); - return ovr_eglReleaseTexImage(dpy, surface, buffer); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglReleaseTexImage(dpy, surface, buffer); } EGLBoolean coregl_api_eglSwapInterval(EGLDisplay dpy, EGLint interval) { INIT_EXPORT(); - return ovr_eglSwapInterval(dpy, interval); + if (!export_initialized) + EGL_FALSE; + else + return ovr_eglSwapInterval(dpy, interval); } EGLContext coregl_api_eglCreateContext(EGLDisplay dpy, EGLConfig config, EGLContext share_context, const EGLint* attrib_list) { INIT_EXPORT(); - return ovr_eglCreateContext(dpy, config, share_context, attrib_list); + if (!export_initialized) + return EGL_NO_CONTEXT; + else + return ovr_eglCreateContext(dpy, config, share_context, attrib_list); } EGLBoolean coregl_api_eglDestroyContext(EGLDisplay dpy, EGLContext ctx) { INIT_EXPORT(); - return ovr_eglDestroyContext(dpy, ctx); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglDestroyContext(dpy, ctx); } EGLBoolean coregl_api_eglMakeCurrent(EGLDisplay dpy, EGLSurface draw, EGLSurface read, EGLContext ctx) { INIT_EXPORT(); - return ovr_eglMakeCurrent(dpy, draw, read, ctx); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglMakeCurrent(dpy, draw, read, ctx); } EGLContext coregl_api_eglGetCurrentContext(void) { INIT_EXPORT(); - return ovr_eglGetCurrentContext(); + if (!export_initialized) + return EGL_NO_CONTEXT; + else + return ovr_eglGetCurrentContext(); } EGLSurface coregl_api_eglGetCurrentSurface(EGLint readdraw) { INIT_EXPORT(); - return ovr_eglGetCurrentSurface(readdraw); + if (!export_initialized) + return EGL_NO_SURFACE; + else + return ovr_eglGetCurrentSurface(readdraw); } EGLDisplay coregl_api_eglGetCurrentDisplay(void) { INIT_EXPORT(); - return ovr_eglGetCurrentDisplay(); + if (!export_initialized) + return EGL_NO_DISPLAY; + else + return ovr_eglGetCurrentDisplay(); } EGLBoolean coregl_api_eglQueryContext(EGLDisplay dpy, EGLContext ctx, EGLint attribute, EGLint *value) { INIT_EXPORT(); + if (!export_initialized) + return EGL_FALSE; return ovr_eglQueryContext(dpy, ctx, attribute, value); } @@ -215,41 +300,58 @@ EGLBoolean coregl_api_eglWaitGL(void) { INIT_EXPORT(); - return ovr_eglWaitGL(); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglWaitGL(); } EGLBoolean coregl_api_eglWaitNative(EGLint engine) { INIT_EXPORT(); - return ovr_eglWaitNative(engine); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglWaitNative(engine); } EGLBoolean coregl_api_eglSwapBuffers(EGLDisplay dpy, EGLSurface surface) { INIT_EXPORT(); - return ovr_eglSwapBuffers(dpy, surface); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglSwapBuffers(dpy, surface); } EGLBoolean coregl_api_eglCopyBuffers(EGLDisplay dpy, EGLSurface surface, EGLNativePixmapType target) { INIT_EXPORT(); - return ovr_eglCopyBuffers(dpy, surface, target); + if (!export_initialized) + return EGL_FALSE; + else + return ovr_eglCopyBuffers(dpy, surface, target); } _eng_fn coregl_api_eglGetProcAddress(const char* procname) { INIT_EXPORT(); - return ovr_eglGetProcAddress(procname); + if (!export_initialized) + return NULL; + else + return ovr_eglGetProcAddress(procname); } const char * coregl_api_eglQueryString(EGLDisplay dpy, EGLint name) { INIT_EXPORT(); + if (!export_initialized) + return NULL; return ovr_eglQueryString(dpy, name); } -- 2.7.4 From 19ba76af2ebc858a1373845f7c60d8253776a87a Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Mon, 4 Jan 2016 23:02:12 +0900 Subject: [PATCH 12/16] Fix package-config file's library directory for 64bit architecture. Change-Id: If8c4f3e65d5b8567982af573843fdc7f3e7862a9 --- CMakeLists.txt | 13 +++++++++++++ pkgconfig/{egl.pc => egl.pc.in} | 4 ++-- pkgconfig/{gles11.pc => gles11.pc.in} | 2 +- pkgconfig/{gles20.pc => gles20.pc.in} | 2 +- pkgconfig/{glesv1.pc => glesv1.pc.in} | 2 +- pkgconfig/{glesv1_cm.pc => glesv1_cm.pc.in} | 2 +- pkgconfig/{glesv2.pc => glesv2.pc.in} | 2 +- 7 files changed, 20 insertions(+), 7 deletions(-) rename pkgconfig/{egl.pc => egl.pc.in} (72%) rename pkgconfig/{gles11.pc => gles11.pc.in} (88%) rename pkgconfig/{gles20.pc => gles20.pc.in} (87%) rename pkgconfig/{glesv1.pc => glesv1.pc.in} (87%) rename pkgconfig/{glesv1_cm.pc => glesv1_cm.pc.in} (87%) rename pkgconfig/{glesv2.pc => glesv2.pc.in} (87%) diff --git a/CMakeLists.txt b/CMakeLists.txt index 6c1b233..9670c96 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -16,13 +16,26 @@ SET(GLES2_VERSION "${GLES2_VERSION_MAJOR}.${GLES2_VERSION_MINOR}") SET(BUILD_ARCH "$ENV{RPM_ARCH}") IF(${BUILD_ARCH} MATCHES "aarch64") +SET(LIB "lib64") SET(LIBDIR "/usr/lib64") ELSEIF(${BUILD_ARCH} MATCHES "x86_64") +SET(LIB "lib64") SET(LIBDIR "/usr/lib64") ELSE(${BUILD_ARCH} MATCHES "aarch64") +SET(LIB "lib") SET(LIBDIR "/usr/lib") ENDIF(${BUILD_ARCH} MATCHES "aarch64") +################################################################# +# Build Package Config File +# ------------------------------ +CONFIGURE_FILE(pkgconfig/egl.pc.in pkgconfig/egl.pc @ONLY) +CONFIGURE_FILE(pkgconfig/gles11.pc.in pkgconfig/gles11.pc @ONLY) +CONFIGURE_FILE(pkgconfig/gles20.pc.in pkgconfig/gles20.pc @ONLY) +CONFIGURE_FILE(pkgconfig/glesv1_cm.pc.in pkgconfig/glesv1_cm.pc @ONLY) +CONFIGURE_FILE(pkgconfig/glesv1.pc.in pkgconfig/glesv1.pc @ONLY) +CONFIGURE_FILE(pkgconfig/glesv2.pc.in pkgconfig/glesv2.pc @ONLY) + INCLUDE_DIRECTORIES(${CMAKE_SOURCE_DIR}/include_KHR) ADD_DEFINITIONS("-DPREFIX=\"${PREFIX}\"") diff --git a/pkgconfig/egl.pc b/pkgconfig/egl.pc.in similarity index 72% rename from pkgconfig/egl.pc rename to pkgconfig/egl.pc.in index cb03cd6..d1c6369 100644 --- a/pkgconfig/egl.pc +++ b/pkgconfig/egl.pc.in @@ -1,7 +1,7 @@ prefix=/usr exec_prefix=${prefix} -libdir=/usr/lib -includedir=/usr/include +libdir=${exec_prefix}/@LIB@ +includedir=${prefix}/include Name: egl Description: CoreGL EGL library diff --git a/pkgconfig/gles11.pc b/pkgconfig/gles11.pc.in similarity index 88% rename from pkgconfig/gles11.pc rename to pkgconfig/gles11.pc.in index 1ddec10..842e471 100644 --- a/pkgconfig/gles11.pc +++ b/pkgconfig/gles11.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir={exec_prefix}/@LIB@ includedir=${prefix}/include Name: gles11 diff --git a/pkgconfig/gles20.pc b/pkgconfig/gles20.pc.in similarity index 87% rename from pkgconfig/gles20.pc rename to pkgconfig/gles20.pc.in index d1d7c14..4bd595b 100644 --- a/pkgconfig/gles20.pc +++ b/pkgconfig/gles20.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=${exec_prefix}/@LIB@ includedir=${prefix}/include Name: gles20 diff --git a/pkgconfig/glesv1.pc b/pkgconfig/glesv1.pc.in similarity index 87% rename from pkgconfig/glesv1.pc rename to pkgconfig/glesv1.pc.in index e09cefd..2be4671 100644 --- a/pkgconfig/glesv1.pc +++ b/pkgconfig/glesv1.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=${exec_prefix}/@LIB@ includedir=${prefix}/include Name: glesv1 diff --git a/pkgconfig/glesv1_cm.pc b/pkgconfig/glesv1_cm.pc.in similarity index 87% rename from pkgconfig/glesv1_cm.pc rename to pkgconfig/glesv1_cm.pc.in index 54d77f2..0beafaf 100644 --- a/pkgconfig/glesv1_cm.pc +++ b/pkgconfig/glesv1_cm.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=${exec_prefix}/@LIB@ includedir=${prefix}/include Name: glesv1_cm diff --git a/pkgconfig/glesv2.pc b/pkgconfig/glesv2.pc.in similarity index 87% rename from pkgconfig/glesv2.pc rename to pkgconfig/glesv2.pc.in index 7e3cbaa..8273d13 100644 --- a/pkgconfig/glesv2.pc +++ b/pkgconfig/glesv2.pc.in @@ -1,6 +1,6 @@ prefix=/usr exec_prefix=${prefix} -libdir=${exec_prefix}/lib +libdir=${exec_prefix}/@LIB@ includedir=${prefix}/include Name: glesv2 -- 2.7.4 From e10b3590be99bad4a58637e0b3c2e7fdf22ce620 Mon Sep 17 00:00:00 2001 From: "xing.huang" Date: Thu, 26 Nov 2015 15:02:29 +0800 Subject: [PATCH 13/16] 1.add fastpath APIs for OpenGLES_DDK 2.open macro to support GL_OES_EGL_image_external and GL_EXT_disjoint_timer_query 3.add support for the api which not needed by fastpath mode 4.egl extension call API through eglGetProcAddress Change-Id: I0c8084f21c7d3d840ef98d95b71842408ab89a2a --- include_KHR/GLES/glext.h | 2 + include_KHR/GLES2/gl2ext.h | 8 + src/coregl_export_gl.c | 29 +- src/headers/gl.h | 2 + src/headers/sym_gl.h | 160 +++- src/modules/fastpath/coregl_fastpath.c | 61 +- src/modules/fastpath/coregl_fastpath_gl.c | 1375 +++++++++++++++++++++++++++ src/modules/tracepath/coregl_tracepath.c | 17 +- src/modules/tracepath/coregl_tracepath_gl.c | 1342 +++++++++++++++++++++++++- src/wraps/coregl_gl.c | 47 + 10 files changed, 3003 insertions(+), 40 deletions(-) diff --git a/include_KHR/GLES/glext.h b/include_KHR/GLES/glext.h index 0373451..6d6f375 100644 --- a/include_KHR/GLES/glext.h +++ b/include_KHR/GLES/glext.h @@ -688,6 +688,7 @@ GL_API void GL_APIENTRY glLoadMatrixxOES (const GLfixed *m); GL_API void GL_APIENTRY glMaterialxOES (GLenum face, GLenum pname, GLfixed param); GL_API void GL_APIENTRY glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params); GL_API void GL_APIENTRY glMultMatrixxOES (const GLfixed *m); +GL_API void GL_APIENTRY glMultiTexCoord4bOES (GLenum target, GLbyte s, GLbyte t, GLbyte r, GLbyte q); GL_API void GL_APIENTRY glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q); GL_API void GL_APIENTRY glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz); GL_API void GL_APIENTRY glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar); @@ -743,6 +744,7 @@ typedef void (GL_APIENTRYP PFNGLTEXENVXVOESPROC) (GLenum target, GLenum pname, c typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXOESPROC) (GLenum target, GLenum pname, GLfixed param); typedef void (GL_APIENTRYP PFNGLTEXPARAMETERXVOESPROC) (GLenum target, GLenum pname, const GLfixed *params); typedef void (GL_APIENTRYP PFNGLTRANSLATEXOESPROC) (GLfixed x, GLfixed y, GLfixed z); +typedef void (GL_APIENTRYP PFNGLMULTITEXCOORD4BOESPROC) (GLenum target, GLbyte s, GLbyte t, GLbyte r, GLbyte q); #endif /* GL_OES_framebuffer_object */ diff --git a/include_KHR/GLES2/gl2ext.h b/include_KHR/GLES2/gl2ext.h index e004151..bcd0a8f 100644 --- a/include_KHR/GLES2/gl2ext.h +++ b/include_KHR/GLES2/gl2ext.h @@ -140,7 +140,13 @@ typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELKHRPROC) (GLenum identifier, GLuin typedef void (GL_APIENTRYP PFNGLOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei length, const GLchar *label); typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELKHRPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); typedef void (GL_APIENTRYP PFNGLGETPOINTERVKHRPROC) (GLenum pname, void **params); +typedef void (GL_APIENTRYP PFNGLGETOBJECTLABELPROC) (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +typedef void (GL_APIENTRYP PFNGLGETOBJECTPTRLABELPROC) (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); #ifdef GL_GLEXT_PROTOTYPES +GL_APICALL void GL_APIENTRY glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label); +GL_APICALL void GL_APIENTRY glPopDebugGroup (void); +GL_APICALL void GL_APIENTRY glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message); GL_APICALL void GL_APIENTRY glDebugMessageControlKHR (GLenum source, GLenum type, GLenum severity, GLsizei count, const GLuint *ids, GLboolean enabled); GL_APICALL void GL_APIENTRY glDebugMessageInsertKHR (GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, const GLchar *buf); GL_APICALL void GL_APIENTRY glDebugMessageCallbackKHR (GLDEBUGPROCKHR callback, const void *userParam); @@ -152,6 +158,8 @@ GL_APICALL void GL_APIENTRY glGetObjectLabelKHR (GLenum identifier, GLuint name, GL_APICALL void GL_APIENTRY glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label); GL_APICALL void GL_APIENTRY glGetObjectPtrLabelKHR (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); GL_APICALL void GL_APIENTRY glGetPointervKHR (GLenum pname, void **params); +GL_APICALL void GL_APIENTRY glGetObjectLabel (GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label); +GL_APICALL void GL_APIENTRY glGetObjectPtrLabel (const void *ptr, GLsizei bufSize, GLsizei *length, GLchar *label); #endif #endif /* GL_KHR_debug */ diff --git a/src/coregl_export_gl.c b/src/coregl_export_gl.c index 6f84da3..c4c8dd7 100644 --- a/src/coregl_export_gl.c +++ b/src/coregl_export_gl.c @@ -1610,18 +1610,21 @@ coregl_api_glProgramUniform1iv(GLuint program, GLint location, GLsizei count, co ovr_glProgramUniform1iv(program, location, count, value); } + void coregl_api_glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) { ovr_glProgramUniform2iv(program, location, count, value); } + void coregl_api_glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) { ovr_glProgramUniform3iv(program, location, count, value); } + void coregl_api_glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) { @@ -1634,18 +1637,21 @@ coregl_api_glProgramUniform1fv(GLuint program, GLint location, GLsizei count, co ovr_glProgramUniform1fv(program, location, count, value); } + void coregl_api_glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { ovr_glProgramUniform2fv(program, location, count, value); } + void coregl_api_glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { ovr_glProgramUniform3fv(program, location, count, value); } + void coregl_api_glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { @@ -1658,12 +1664,14 @@ coregl_api_glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei cou ovr_glProgramUniformMatrix2fv(program, location, count, transpose, value); } + void coregl_api_glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { ovr_glProgramUniformMatrix3fv(program, location, count, transpose, value); } + void coregl_api_glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { @@ -1676,42 +1684,49 @@ coregl_api_glProgramUniform1i(GLuint program, GLint location, GLint x) ovr_glProgramUniform1i(program, location, x); } + void coregl_api_glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) { ovr_glProgramUniform2i(program, location, x, y); } + void coregl_api_glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) { ovr_glProgramUniform3i(program, location, x, y, z); } + void coregl_api_glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) { ovr_glProgramUniform4i(program, location, x, y, z, w); } + void coregl_api_glProgramUniform1f(GLuint program, GLint location, GLfloat x) { ovr_glProgramUniform1f(program, location, x); } + void coregl_api_glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) { ovr_glProgramUniform2f(program, location, x, y); } + void coregl_api_glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) { ovr_glProgramUniform3f(program, location, x, y, z); } + void coregl_api_glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { @@ -1748,18 +1763,21 @@ coregl_api_glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, c ovr_glProgramUniform1uiv(program, location, count, value); } + void coregl_api_glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) { ovr_glProgramUniform2uiv(program, location, count, value); } + void coregl_api_glProgramUniform3uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) { ovr_glProgramUniform3uiv(program, location, count, value); } + void coregl_api_glProgramUniform4uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) { @@ -1884,4 +1902,13 @@ void coregl_api_glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) { ovr_glVertexBindingDivisor (bindingindex, divisor); -} \ No newline at end of file +} + +void +coregl_api_glGetPointerv(GLenum pname, GLvoid **params) +{ + ovr_glGetPointerv(pname, params); +} + + + diff --git a/src/headers/gl.h b/src/headers/gl.h index f995e08..ef2defa 100644 --- a/src/headers/gl.h +++ b/src/headers/gl.h @@ -25,7 +25,9 @@ typedef khronos_float_t GLclampf; typedef khronos_int32_t GLfixed; typedef khronos_intptr_t GLintptr; typedef khronos_ssize_t GLsizeiptr; +typedef khronos_int32_t GLclampx; +typedef void (GL_APIENTRY *GLDEBUGPROCKHR)(GLenum source,GLenum type,GLuint id,GLenum severity,GLsizei length,const GLchar *message,const void *userParam); /* OpenGL ES 3.0 */ typedef unsigned short GLhalf; diff --git a/src/headers/sym_gl.h b/src/headers/sym_gl.h index cac9801..2df8795 100644 --- a/src/headers/sym_gl.h +++ b/src/headers/sym_gl.h @@ -179,7 +179,99 @@ _COREGL_SYMBOL(void, glVertexAttrib4f, (GLuint index, GLfloat x, GLfloat y, GLfl _COREGL_SYMBOL(void, glVertexAttrib4fv, (GLuint index, const GLfloat* values)) _COREGL_SYMBOL(void, glVertexAttribPointer, (GLuint index, GLint size, GLenum type, GLboolean normalized, GLsizei stride, const void* pointer)) _COREGL_SYMBOL(void, glViewport, (GLint x, GLint y, GLsizei width, GLsizei height)) - +_COREGL_SYMBOL(void, glGetPointerv,(GLenum pname, GLvoid **params)) + +_COREGL_EXT_SYMBOL(void, glBindFramebufferOES, (GLenum target, GLuint framebuffer)) +_COREGL_EXT_SYMBOL(void, glBindRenderbufferOES, (GLenum target, GLuint renderbuffer)) +_COREGL_EXT_SYMBOL(void, glDeleteFramebuffersOES, (GLsizei n, const GLuint* framebuffers)) +_COREGL_EXT_SYMBOL(void, glDeleteRenderbuffersOES, (GLsizei n, const GLuint* renderbuffers)) +_COREGL_EXT_SYMBOL(void, glDepthRangefOES, (GLclampf zNear, GLclampf zFar)) +_COREGL_EXT_SYMBOL(void, glDepthRangexOES, (GLclampx zNear, GLclampx zFar)) +_COREGL_EXT_SYMBOL(void, glFramebufferRenderbufferOES, (GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)) +_COREGL_EXT_SYMBOL(void, glFramebufferTexture2DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)) +_COREGL_EXT_SYMBOL(void, glGenFramebuffersOES, (GLsizei n, GLuint* framebuffers)) +_COREGL_EXT_SYMBOL(void, glGenRenderbuffersOES, (GLsizei n, GLuint* renderbuffers)) +_COREGL_EXT_SYMBOL(void, glGetFramebufferAttachmentParameterivOES, (GLenum target, GLenum attachment, GLenum pname, GLint* params)) +_COREGL_EXT_SYMBOL(void, glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) +_COREGL_EXT_SYMBOL(GLboolean, glIsFramebufferOES, (GLuint framebuffer)) +_COREGL_EXT_SYMBOL(GLboolean, glIsRenderbufferOES, (GLuint renderbuffer)) +_COREGL_EXT_SYMBOL(void, glAlphaFuncxOES,(GLenum func, GLclampx ref)) +_COREGL_EXT_SYMBOL(void, glBlendBarrierKHR, (void)) +_COREGL_EXT_SYMBOL(void, glBlendEquationOES, (GLenum mode)) +_COREGL_EXT_SYMBOL(void, glBlendEquationSeparateOES, (GLenum modeRGB, GLenum modeAlpha)) +_COREGL_EXT_SYMBOL(void, glBlendFuncSeparateOES, (GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha)) +_COREGL_EXT_SYMBOL(GLenum, glCheckFramebufferStatusOES, (GLenum target)) +_COREGL_EXT_SYMBOL(void, glClearColorxOES,(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha)) +_COREGL_EXT_SYMBOL(void, glClearDepthfOES,(GLclampf depth)) +_COREGL_EXT_SYMBOL(void, glClearDepthxOES,(GLclampx depth)) +_COREGL_EXT_SYMBOL(void, glClipPlanefOES,(GLenum plane, GLfloat const *equation)) +_COREGL_EXT_SYMBOL(void, glClipPlanexOES,(GLenum plane, GLfixed const *equation)) +_COREGL_EXT_SYMBOL(void, glColor4xOES,(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha)) +_COREGL_EXT_SYMBOL(void, glFogxOES,(GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glFogxvOES,(GLenum pname, GLfixed const *params)) +_COREGL_EXT_SYMBOL(void, glFrustumxOES,(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)) +_COREGL_EXT_SYMBOL(void, glFrustumfOES,(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)) +_COREGL_EXT_SYMBOL(void, glGenerateMipmapOES,(GLenum target)) +_COREGL_EXT_SYMBOL(void,glGetClipPlanefOES,(GLenum pname, GLfloat eqn[4])) +_COREGL_EXT_SYMBOL(void,glGetClipPlanexOES,(GLenum pname, GLfixed eqn[4])) +_COREGL_EXT_SYMBOL(GLuint,glGetDebugMessageLog,(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog)) +_COREGL_EXT_SYMBOL(void,glGetObjectLabel,(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)) +_COREGL_EXT_SYMBOL(void,glGetObjectPtrLabel,(void const *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)) +_COREGL_EXT_SYMBOL(void,glGetPointervKHR,(GLenum pname, GLvoid **params)) +_COREGL_EXT_SYMBOL(void, glDebugMessageCallback,(GLDEBUGPROCKHR callback, void const *userParam)) +_COREGL_EXT_SYMBOL(void, glDebugMessageControl,(GLenum source, GLenum type, GLenum severity, GLsizei count, GLuint const *ids, GLboolean enabled)) +_COREGL_EXT_SYMBOL(void, glDebugMessageInsert,(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, GLchar const *buf)) +_COREGL_EXT_SYMBOL(void, glDebugMessageCallbackKHR,(GLDEBUGPROCKHR callback, void const *userParam)) +_COREGL_EXT_SYMBOL(void, glDebugMessageControlKHR,(GLenum source, GLenum type, GLenum severity, GLsizei count, GLuint const *ids, GLboolean enabled)) +_COREGL_EXT_SYMBOL(void, glDebugMessageInsertKHR,(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, GLchar const *buf)) +_COREGL_EXT_SYMBOL(GLuint,glGetDebugMessageLogKHR,(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog)) +_COREGL_EXT_SYMBOL(void,glGetObjectLabelKHR,(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label)) +_COREGL_EXT_SYMBOL(void,glGetObjectPtrLabelKHR,(void const *ptr, GLsizei bufSize, GLsizei *length, GLchar *label)) +_COREGL_EXT_SYMBOL(void, glObjectLabelKHR, (GLenum identifier, GLuint name, GLsizei length, const GLchar *label)) +_COREGL_EXT_SYMBOL(void, glObjectPtrLabelKHR, (const void *ptr, GLsizei length, const GLchar *label)) +_COREGL_EXT_SYMBOL(void, glPopDebugGroupKHR, (void)) +_COREGL_EXT_SYMBOL(void, glPushDebugGroupKHR, (GLenum source, GLuint id, GLsizei length, const GLchar *message)) +_COREGL_EXT_SYMBOL(void,glGetFixedvOES,(GLenum pname, GLfixed *params)) +_COREGL_EXT_SYMBOL(void,glGetLightxvOES,(GLenum light, GLenum pname, GLfixed *params)) +_COREGL_EXT_SYMBOL(void,glGetMaterialxvOES,(GLenum face, GLenum pname, GLfixed *params)) +_COREGL_EXT_SYMBOL(void,glGetRenderbufferParameterivOES,(GLenum target, GLenum pname, GLint *params)) +_COREGL_EXT_SYMBOL(void,glGetTexEnvxvOES,(GLenum env, GLenum pname, GLfixed *params)) +_COREGL_EXT_SYMBOL(void,glGetTexParameterxvOES,(GLenum target, GLenum pname, GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glLightModelxOES, (GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glLightModelxvOES, (GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glLightxOES, (GLenum light, GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glLightxvOES, (GLenum light, GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glLineWidthxOES, (GLfixed width)) +_COREGL_EXT_SYMBOL(void, glLoadMatrixxOES, (const GLfixed *m)) +_COREGL_EXT_SYMBOL(void, glMaterialxOES, (GLenum face, GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glMaterialxvOES, (GLenum face, GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glMultMatrixxOES, (const GLfixed *m)) +_COREGL_EXT_SYMBOL(void, glMultiTexCoord4bOES, (GLenum target, GLbyte s, GLbyte t, GLbyte r, GLbyte q)) +_COREGL_EXT_SYMBOL(void, glMultiTexCoord4xOES, (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q)) +_COREGL_EXT_SYMBOL(void, glNormal3xOES, (GLfixed nx, GLfixed ny, GLfixed nz)) +_COREGL_EXT_SYMBOL(void, glObjectLabel, (GLenum identifier, GLuint name, GLsizei length, const GLchar *label)) +_COREGL_EXT_SYMBOL(void, glObjectPtrLabel, (const void *ptr, GLsizei length, const GLchar *label)) +_COREGL_EXT_SYMBOL(void, glOrthofOES, (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar)) +_COREGL_EXT_SYMBOL(void, glOrthoxOES, (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar)) +_COREGL_EXT_SYMBOL(void, glPointParameterxOES, (GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glPointParameterxvOES, (GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glPointSizexOES, (GLfixed size)) +_COREGL_EXT_SYMBOL(void, glPolygonOffsetxOES, (GLfixed factor, GLfixed units)) +_COREGL_EXT_SYMBOL(void, glPopDebugGroup, (void)) +_COREGL_EXT_SYMBOL(void, glPushDebugGroup, (GLenum source, GLuint id, GLsizei length, const GLchar *message)) +_COREGL_EXT_SYMBOL(void, glQueryCounterEXT, (GLuint id, GLenum target)) +_COREGL_EXT_SYMBOL(void, glRenderbufferStorageOES, (GLenum target, GLenum internalformat, GLsizei width, GLsizei height)) +_COREGL_EXT_SYMBOL(void, glRotatexOES, (GLfixed angle, GLfixed x, GLfixed y, GLfixed z)) +_COREGL_EXT_SYMBOL(void, glSampleCoveragexOES, (GLclampx value, GLboolean invert)) +_COREGL_EXT_SYMBOL(void, glScalexOES, (GLfixed x, GLfixed y, GLfixed z)) +_COREGL_EXT_SYMBOL(void, glTexEnvxOES, (GLenum target, GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glTexEnvxvOES, (GLenum target, GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glTexParameterxOES, (GLenum target, GLenum pname, GLfixed param)) +_COREGL_EXT_SYMBOL(void, glTexParameterxvOES, (GLenum target, GLenum pname, const GLfixed *params)) +_COREGL_EXT_SYMBOL(void, glTexStorage2DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height)) +_COREGL_EXT_SYMBOL(void, glTexStorage3DEXT, (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth)) +_COREGL_EXT_SYMBOL(void, glTexStorage3DMultisampleOES, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations)) +_COREGL_EXT_SYMBOL(void, glTranslatexOES, (GLfixed x, GLfixed y, GLfixed z)) /* OpenGL ES 3.0 */ _COREGL_START_API(COREGL_GLAPI_3) _COREGL_SYMBOL(void, glReadBuffer, (GLenum mode)) @@ -365,7 +457,9 @@ _COREGL_END_API(COREGL_GLAPI_31) _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_EGL_image", 1.1, -1) _COREGL_EXT_SYMBOL(void, glEGLImageTargetTexture2DOES, (GLenum target, GLeglImageOES image)) _COREGL_EXT_SYMBOL(void, glEGLImageTargetRenderbufferStorageOES, (GLenum target, GLeglImageOES image)) -//_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_EGL_image_external", 1.1, -1) +_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_EGL_image_external", 1.1, -1) +_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_surfaceless_context", 1.1, -1) +_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_fixed_point", 1.1, -1) _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_get_program_binary", 2.0, -1) _COREGL_EXT_SYMBOL(void, glGetProgramBinaryOES, (GLuint program, GLsizei bufSize, GLsizei* length, GLenum* binaryFormat, GLvoid* binary)) @@ -408,6 +502,20 @@ _COREGL_EXT_SYMBOL(void, glProgramUniformMatrix4fvEXT, (GLuint program, GLint lo _COREGL_EXT_SYMBOL(void, glValidateProgramPipelineEXT, (GLuint pipeline)) _COREGL_EXT_SYMBOL(void, glGetProgramPipelineInfoLogEXT, (GLuint pipeline, GLsizei bufSize, GLsizei *length, char *infoLog)) +_COREGL_EXT_SYMBOL(void, glGetQueryObjecti64vEXT,(GLuint id, GLenum pname, GLint64 *params)) +_COREGL_EXT_SYMBOL(void, glGetQueryObjectivEXT,(GLuint id, GLenum pname, GLint *params)) +_COREGL_EXT_SYMBOL(void, glGetQueryObjectui64vEXT,(GLuint id, GLenum pname, GLuint64 *params)) +_COREGL_EXT_SYMBOL(void, glGetQueryObjectuivEXT, (GLuint id, GLenum pname, GLuint* params)) +_COREGL_EXT_SYMBOL(void, glGetQueryivEXT, (GLenum target, GLenum pname, GLint* params)) +_COREGL_EXT_SYMBOL(void, glBeginQueryEXT, (GLenum target, GLuint id)) +_COREGL_EXT_SYMBOL(void, glDeleteQueriesEXT, (GLsizei n, const GLuint* ids)) +_COREGL_EXT_SYMBOL(void, glGenQueriesEXT, (GLsizei n, GLuint* ids)) +_COREGL_EXT_SYMBOL(GLboolean, glIsQueryEXT, (GLuint id)) +_COREGL_EXT_SYMBOL(void, glEndQueryEXT, (GLenum target)) +_COREGL_EXT_SYMBOL(void, glBindVertexArrayOES,(GLuint array)) +_COREGL_EXT_SYMBOL(void, glDeleteVertexArraysOES,(GLsizei n, GLuint const *arrays)) +_COREGL_EXT_SYMBOL(GLboolean, glIsVertexArrayOES,(GLuint array)) +_COREGL_EXT_SYMBOL(void, glGenVertexArraysOES,(GLsizei n, GLuint *arrays)) _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_EXT_multisampled_render_to_texture", 2.0, -1) _COREGL_EXT_SYMBOL(void, glRenderbufferStorageMultisampleEXT, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) _COREGL_EXT_SYMBOL(void, glFramebufferTexture2DMultisampleEXT, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLsizei samples)) @@ -416,25 +524,25 @@ _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_EXT_discard_framebuffer", 1.0, -1) _COREGL_EXT_SYMBOL(void, glDiscardFramebufferEXT, (GLenum target, GLsizei numAttachments, const GLenum* attachments)) _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_texture_3D", 2.0, -1) -_COREGL_EXT_SYMBOL(void, glTexImage3DOES, (GLenum target, GLint level, GLint internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid* pixels)) +_COREGL_EXT_SYMBOL(void, glTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void* pixels)) _COREGL_EXT_SYMBOL(void, glTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLsizei width, GLsizei height, GLsizei depth, GLenum format, GLenum type, const GLvoid* pixels)) _COREGL_EXT_SYMBOL(void, glCopyTexSubImage3DOES, (GLenum target, GLint level, GLint xoffset, GLint yoffset, GLint zoffset, GLint x, GLint y, GLsizei width, GLsizei height)) _COREGL_EXT_SYMBOL(void, glCompressedTexImage3DOES, (GLenum target, GLint level, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLsizei imageSize, const GLvoid* data)) _COREGL_EXT_SYMBOL(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)) -_COREGL_EXT_SYMBOL(void, glFramebufferTexture3DOES, (GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level, GLint zoffset)) + _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_mapbuffer", 1.1, -1) _COREGL_EXT_SYMBOL(void, glGetBufferPointervOES, (GLenum target, GLenum pname, GLvoid** params)) -_COREGL_EXT_SYMBOL(void *, glMapBufferOES, (GLenum target, GLenum access)) +_COREGL_EXT_SYMBOL(void*, glMapBufferOES, (GLenum target, GLenum access)) _COREGL_EXT_SYMBOL(GLboolean, glUnmapBufferOES, (GLenum target)) - +/* _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_ANGLE_framebuffer_blit", 1.1, -1) _COREGL_EXT_SYMBOL(void, glBlitFramebufferANGLE, (GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter)) _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_ANGLE_framebuffer_multisample", 1.1, -1) _COREGL_EXT_SYMBOL(void, glRenderbufferStorageMultisampleANGLE, (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height)) - +*/ /* Fastpath Verified extensions */ @@ -534,6 +642,8 @@ _COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_QCOM_tiled_rendering", 1.0, -1) _COREGL_EXT_SYMBOL_FASTPATH_PASS(glStartTilingQCOM) _COREGL_EXT_SYMBOL_FASTPATH_PASS(glEndTilingQCOM) +_COREGL_EXT_SYMBOL_FASTPATH_PASS(glGetTexLevelParameterfv) +_COREGL_EXT_SYMBOL_FASTPATH_PASS(glGetTexLevelParameteriv) /* Fastpath Blocked extensions */ @@ -547,24 +657,24 @@ _COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetnUniformivEXT) _COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glLabelObjectEXT) _COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetObjectLabelEXT) -//_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_EXT_disjoint_timer_query", 2.0, -1) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGenQueriesEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glDeleteQueriesEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glIsQueryEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glBeginQueryEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glEndQueryEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glQueryCounterEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryivEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectivEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectuivEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjecti64vEXT) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectui64vEXT) - -//_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_vertex_array_object", 1.1, -1) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glBindVertexArrayOES) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glDeleteVertexArraysOES) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGenVertexArraysOES) -_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glIsVertexArrayOES) +_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_EXT_disjoint_timer_query", 2.0, -1) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGenQueriesEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glDeleteQueriesEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glIsQueryEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glBeginQueryEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glEndQueryEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glQueryCounterEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryivEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectivEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectuivEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjecti64vEXT) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGetQueryObjectui64vEXT) + +_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_OES_vertex_array_object", 1.1, -1) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glBindVertexArrayOES) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glDeleteVertexArraysOES) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glGenVertexArraysOES) +//_COREGL_EXT_SYMBOL_FASTPATH_BLOCK(glIsVertexArrayOES) //_COREGL_FASTPATH_SUPPORTED_EXTENSION("GL_QCOM_alpha_test", 2.0, -1) diff --git a/src/modules/fastpath/coregl_fastpath.c b/src/modules/fastpath/coregl_fastpath.c index b9842c9..0c61c31 100644 --- a/src/modules/fastpath/coregl_fastpath.c +++ b/src/modules/fastpath/coregl_fastpath.c @@ -417,15 +417,51 @@ fastpath_apply_overrides_gl(int enable) COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix2fvEXT); COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix3fvEXT); COREGL_OVERRIDE(fastpath_, glProgramUniformMatrix4fvEXT); - COREGL_OVERRIDE(fastpath_, glProgramParameteriEXT); - COREGL_OVERRIDE(fastpath_, glProgramParameteriEXT); - COREGL_OVERRIDE(fastpath_, glProgramParameteriEXT); - COREGL_OVERRIDE(fastpath_, glProgramParameteriEXT); - COREGL_OVERRIDE(fastpath_, glProgramParameteriEXT); COREGL_OVERRIDE(fastpath_, glFramebufferTexture2DMultisampleEXT); COREGL_OVERRIDE(fastpath_, glFramebufferTexture3DOES); + COREGL_OVERRIDE(fastpath_, glBindFramebufferOES); + COREGL_OVERRIDE(fastpath_, glBindRenderbufferOES); + COREGL_OVERRIDE(fastpath_, glClearBufferfi); + COREGL_OVERRIDE(fastpath_, glClearBufferfv); + COREGL_OVERRIDE(fastpath_, glClearBufferiv); + COREGL_OVERRIDE(fastpath_, glClearBufferuiv); + COREGL_OVERRIDE(fastpath_, glDeleteFramebuffersOES); + COREGL_OVERRIDE(fastpath_, glDeleteRenderbuffersOES); + COREGL_OVERRIDE(fastpath_, glDepthRangefOES); + COREGL_OVERRIDE(fastpath_, glDepthRangexOES); + COREGL_OVERRIDE(fastpath_, glFramebufferParameteri); + COREGL_OVERRIDE(fastpath_, glGetFramebufferParameteriv); + COREGL_OVERRIDE(fastpath_, glFramebufferRenderbufferOES); + COREGL_OVERRIDE(fastpath_, glFramebufferTexture2DOES); + COREGL_OVERRIDE(fastpath_, glGenFramebuffersOES); + COREGL_OVERRIDE(fastpath_, glGenRenderbuffersOES); + COREGL_OVERRIDE(fastpath_, glGetFramebufferAttachmentParameterivOES); + COREGL_OVERRIDE(fastpath_, glGetQueryObjecti64vEXT); + COREGL_OVERRIDE(fastpath_, glGetQueryObjectivEXT); + COREGL_OVERRIDE(fastpath_, glGetQueryObjectui64vEXT); + COREGL_OVERRIDE(fastpath_, glGetQueryObjectuivEXT); + COREGL_OVERRIDE(fastpath_, glGetQueryivEXT); + COREGL_OVERRIDE(fastpath_, glBeginQueryEXT); + COREGL_OVERRIDE(fastpath_, glDeleteQueriesEXT); + COREGL_OVERRIDE(fastpath_, glGenQueriesEXT); + COREGL_OVERRIDE(fastpath_, glIsFramebufferOES); + COREGL_OVERRIDE(fastpath_, glIsQueryEXT); + COREGL_OVERRIDE(fastpath_, glIsRenderbufferOES); + COREGL_OVERRIDE(fastpath_, glBlendEquationOES); + COREGL_OVERRIDE(fastpath_, glBlendEquationSeparateOES); + COREGL_OVERRIDE(fastpath_, glBlendFuncSeparateOES); + COREGL_OVERRIDE(fastpath_, glPolygonOffsetxOES); + COREGL_OVERRIDE(fastpath_, glLineWidthxOES); + COREGL_OVERRIDE(fastpath_, glSampleCoveragexOES); + COREGL_OVERRIDE(fastpath_, glQueryCounterEXT); + COREGL_OVERRIDE(fastpath_, glBindVertexArrayOES); + COREGL_OVERRIDE(fastpath_, glDeleteVertexArraysOES); + COREGL_OVERRIDE(fastpath_, glGenVertexArraysOES); + COREGL_OVERRIDE(fastpath_, glIsVertexArrayOES); + COREGL_OVERRIDE(fastpath_, glClearDepthfOES ); + COREGL_OVERRIDE(fastpath_, glClearDepthxOES ); /* Start overriding GLES 3.0 */ if(driver_gl_version >= COREGL_GLAPI_3) { COREGL_OVERRIDE(fastpath_, glReadBuffer); @@ -1701,18 +1737,27 @@ fastpath_make_context_current(GLGlueContext *oldctx, GLGlueContext *newctx) { STATE_COMPARE(gl_framebuffer_binding_read[0]) { - CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_READ_FRAMEBUFFER, newctx->gl_framebuffer_binding_read[0])) + if(driver_gl_version >=2) + CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_READ_FRAMEBUFFER, newctx->gl_framebuffer_binding_read[0])) + else + CHECK_GL_ERROR(_orig_fastpath_glBindFramebufferOES(GL_READ_FRAMEBUFFER, newctx->gl_framebuffer_binding_read[0])) } STATE_COMPARE(gl_framebuffer_binding_draw[0]) { - CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, newctx->gl_framebuffer_binding_draw[0])) + if(driver_gl_version >=2) + CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_DRAW_FRAMEBUFFER, newctx->gl_framebuffer_binding_draw[0])) + else + CHECK_GL_ERROR(_orig_fastpath_glBindFramebufferOES(GL_DRAW_FRAMEBUFFER, newctx->gl_framebuffer_binding_draw[0])) } } else { STATE_COMPARE(gl_framebuffer_binding[0]) { - CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_FRAMEBUFFER, newctx->gl_framebuffer_binding[0])) + if(driver_gl_version >=2) + CHECK_GL_ERROR(_orig_fastpath_glBindFramebuffer(GL_FRAMEBUFFER, newctx->gl_framebuffer_binding[0])) + else + CHECK_GL_ERROR(_orig_fastpath_glBindFramebufferOES(GL_FRAMEBUFFER, newctx->gl_framebuffer_binding[0])) } } STATE_COMPARE(gl_renderbuffer_binding[0]) diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 172045e..0fe6928 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -7349,3 +7349,1378 @@ fastpath_glVertexBindingDivisor(GLuint bindingindex, GLuint divisor) finish: _COREGL_FASTPATH_FUNC_END(); } +void +fastpath_glBindFramebufferOES(GLenum target, GLuint framebuffer) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_FRAMEBUFFER, framebuffer, &real_obj) != 1) + { + _set_gl_error(GL_OUT_OF_MEMORY); + goto finish; + } + + if (target == GL_FRAMEBUFFER) + { + if (current_ctx->gl_framebuffer_binding_read_used == 1) + { + CURR_STATE_COMPARE(gl_framebuffer_binding_read, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindFramebufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_read); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_framebuffer_binding_read; + current_ctx->gl_framebuffer_binding_read[0] = real_obj; + } + } + CURR_STATE_COMPARE(gl_framebuffer_binding_draw, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindFramebufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_draw); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_framebuffer_binding_draw; + current_ctx->gl_framebuffer_binding_draw[0] = real_obj; + } + } + } + else + { + CURR_STATE_COMPARE(gl_framebuffer_binding, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindFramebufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_framebuffer_binding; + current_ctx->gl_framebuffer_binding[0] = real_obj; + } + } + } + } + else if (target == GL_READ_FRAMEBUFFER && current_ctx->gl_framebuffer_binding_read_used) + { + CURR_STATE_COMPARE(gl_framebuffer_binding_read, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindFramebufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_read); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_framebuffer_binding_read; + current_ctx->gl_framebuffer_binding_read[0] = real_obj; + } + } + } + else if (target == GL_DRAW_FRAMEBUFFER && current_ctx->gl_framebuffer_binding_draw_used) + { + CURR_STATE_COMPARE(gl_framebuffer_binding_draw, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindFramebufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_draw); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_framebuffer_binding_draw; + current_ctx->gl_framebuffer_binding_draw[0] = real_obj; + } + } + } + else + { + _set_gl_error(GL_INVALID_ENUM); + goto finish; + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, renderbuffer, &real_obj) != 1) + { + _set_gl_error(GL_OUT_OF_MEMORY); + goto finish; + } + + if (target == GL_RENDERBUFFER) + { + CURR_STATE_COMPARE(gl_renderbuffer_binding, real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindRenderbufferOES(target, real_obj)) + { + if (real_obj == 0) + current_ctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_renderbuffer_binding); + else + current_ctx->_bind_flag1 |= _BIND_FLAG1_BIT_gl_renderbuffer_binding; + current_ctx->gl_renderbuffer_binding[0] = real_obj; + } + } + } + else + { + _set_gl_error(GL_INVALID_ENUM); + goto finish; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glClearBufferfi(GLenum buffer, GLint drawbuffer, GLfloat depth, GLint stencil) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) + { + goto finish; + } + + _orig_fastpath_glClearBufferfi(real_obj, drawbuffer, depth, stencil); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glClearBufferfv(GLenum buffer, GLint drawbuffer, GLfloat const *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) + { + goto finish; + } + + _orig_fastpath_glClearBufferfv(buffer, drawbuffer, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glClearBufferiv(GLenum buffer, GLint drawbuffer, GLint const *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) + { + goto finish; + } + + _orig_fastpath_glClearBufferiv(buffer, drawbuffer, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glClearBufferuiv(GLenum buffer, GLint drawbuffer, GLuint const *value) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_BUFFER, buffer, &real_obj) != 1) + { + goto finish; + } + + _orig_fastpath_glClearBufferuiv(buffer, drawbuffer, value); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (framebuffers == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + { + int real_n = 0; + + for (i = 0; i < n; i++) + { + int real_objid = _COREGL_INT_INIT_VALUE; + if (framebuffers[i] == 0) continue; + + real_objid = fastpath_ostate_get_object(¤t_ctx->ostate, GL_OBJECT_TYPE_FRAMEBUFFER, framebuffers[i]); + if (real_objid == 0) continue; + + AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_FRAMEBUFFER, framebuffers[i]) == 1); + objid_array[real_n++] = real_objid; + } + + IF_GL_SUCCESS(_orig_fastpath_glDeleteFramebuffersOES(real_n, objid_array)) + { + for (i = 0; i < real_n; i++) + { + General_Trace_List *current = NULL; + current = current_ctx->ostate.shared->using_gctxs; + + while (current != NULL) + { + GLGlueContext *cur_gctx = (GLGlueContext *)current->value; + + if (cur_gctx->gl_framebuffer_binding[0] == objid_array[i]) + { + cur_gctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding); + cur_gctx->gl_framebuffer_binding[0] = 0; + } + if (cur_gctx->gl_framebuffer_binding_read[0] == objid_array[i]) + { + cur_gctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_read); + cur_gctx->gl_framebuffer_binding_read[0] = 0; + } + if (cur_gctx->gl_framebuffer_binding_draw[0] == objid_array[i]) + { + cur_gctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_framebuffer_binding_draw); + cur_gctx->gl_framebuffer_binding_draw[0] = 0; + } + + current = current->next; + } + } + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (renderbuffers == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + { + int real_n = 0; + + for (i = 0; i < n; i++) + { + int real_objid = _COREGL_INT_INIT_VALUE; + if (renderbuffers[i] == 0) continue; + + real_objid = fastpath_ostate_get_object(¤t_ctx->ostate, GL_OBJECT_TYPE_RENDERBUFFER, renderbuffers[i]); + if (real_objid == 0) continue; + + AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_RENDERBUFFER, renderbuffers[i]) == 1); + objid_array[real_n++] = real_objid; + } + + IF_GL_SUCCESS(_orig_fastpath_glDeleteRenderbuffersOES(real_n, objid_array)) + { + for (i = 0; i < real_n; i++) + { + General_Trace_List *current = NULL; + current = current_ctx->ostate.shared->using_gctxs; + + while (current != NULL) + { + GLGlueContext *cur_gctx = (GLGlueContext *)current->value; + + if (cur_gctx->gl_renderbuffer_binding[0] == objid_array[i]) + { + cur_gctx->_bind_flag1 &= (~_BIND_FLAG1_BIT_gl_renderbuffer_binding); + cur_gctx->gl_renderbuffer_binding[0] = 0; + } + + current = current->next; + } + } + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDepthRangefOES(GLclampf zNear, GLclampf zFar) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_depth_range[0] != zNear) || + (current_ctx->gl_depth_range[1] != zFar)) + { + IF_GL_SUCCESS(_orig_fastpath_glDepthRangefOES(zNear, zFar)) + { + current_ctx->_clear_flag2 |= _CLEAR_FLAG2_BIT_gl_depth_range; + current_ctx->gl_depth_range[0] = zNear; + current_ctx->gl_depth_range[1] = zFar; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDepthRangexOES(GLclampx zNear, GLclampx zFar) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_depth_range[0] != zNear) || + (current_ctx->gl_depth_range[1] != zFar)) + { + IF_GL_SUCCESS(_orig_fastpath_glDepthRangexOES(zNear, zFar)) + { + current_ctx->_clear_flag2 |= _CLEAR_FLAG2_BIT_gl_depth_range; + current_ctx->gl_depth_range[0] = zNear; + current_ctx->gl_depth_range[1] = zFar; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glFramebufferParameteri(GLenum target, GLenum pname, GLint param) +{ + GLint real_obj = 0, fa_type = 0; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + switch (pname) + { + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + param = 0; + _orig_fastpath_glFramebufferParameteri(target, pname, real_obj); + _orig_fastpath_glFramebufferParameteri(target, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, fa_type); + switch (fa_type) + { + case GL_TEXTURE: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_TEXTURE, real_obj, (GLuint *)¶m) != 1) + { + param = 0; + goto finish; + } + break; + case GL_RENDERBUFFER: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, real_obj, (GLuint *)¶m) != 1) + { + param = 0; + goto finish; + } + break; + } + break; + default: + _orig_fastpath_glFramebufferParameteri(target, pname, param); + break; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetFramebufferParameteriv(GLenum target, GLenum pname, GLint *params) +{ + GLint real_obj = 0, fa_type = 0;; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + switch (pname) + { + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + params[0] = 0; + _orig_fastpath_glGetFramebufferParameteriv(target, pname, &real_obj); + _orig_fastpath_glGetFramebufferParameteriv(target, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &fa_type); + switch (fa_type) + { + case GL_TEXTURE: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_TEXTURE, real_obj, (GLuint *)params) != 1) + { + params[0] = 0; + goto finish; + } + break; + case GL_RENDERBUFFER: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, real_obj, (GLuint *)params) != 1) + { + params[0] = 0; + goto finish; + } + break; + } + break; + default: + _orig_fastpath_glGetFramebufferParameteriv(target, pname, params); + break; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, renderbuffer, &real_obj) != 1) + { + _set_gl_error(GL_OUT_OF_MEMORY); + goto finish; + } + + _orig_fastpath_glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_TEXTURE, texture, &real_obj) != 1) + { + _set_gl_error(GL_OUT_OF_MEMORY); + goto finish; + } + + _orig_fastpath_glFramebufferTexture2DOES(target, attachment, textarget, real_obj, level); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (framebuffers == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + + IF_GL_SUCCESS(_orig_fastpath_glGenFramebuffersOES(n, objid_array)) + { + for (i = 0; i < n; i++) + { + framebuffers[i] = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_FRAMEBUFFER, objid_array[i]); + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (renderbuffers == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + + IF_GL_SUCCESS(_orig_fastpath_glGenRenderbuffersOES(n, objid_array)) + { + for (i = 0; i < n; i++) + { + renderbuffers[i] = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_RENDERBUFFER, objid_array[i]); + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint *params) +{ + GLint real_obj, fa_type; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + switch (pname) + { + case GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME: + params[0] = 0; + _orig_fastpath_glGetFramebufferAttachmentParameterivOES(target, attachment, pname, &real_obj); + _orig_fastpath_glGetFramebufferAttachmentParameterivOES(target, attachment, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &fa_type); + switch (fa_type) + { + case GL_TEXTURE: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_TEXTURE, real_obj, (GLuint *)params) != 1) + { + params[0] = 0; + goto finish; + } + break; + case GL_RENDERBUFFER: + if (GET_GLUE_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, real_obj, (GLuint *)params) != 1) + { + params[0] = 0; + goto finish; + } + break; + } + break; + default: + _orig_fastpath_glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params); + break; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glGetQueryObjecti64vEXT(real_obj, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glGetQueryObjectivEXT(real_obj, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glGetQueryObjectui64vEXT(real_obj, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glGetQueryObjectuivEXT(real_obj, pname, params); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGetQueryivEXT(GLenum target, GLenum pname, GLint* params) +{ + GLuint glue_obj_id = _COREGL_INT_INIT_VALUE; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + _orig_fastpath_glGetQueryivEXT(target, pname, params); + + switch (pname) + { + case GL_CURRENT_QUERY: + if (params[0] != 0) + { + AST(GET_GLUE_OBJ(GL_OBJECT_TYPE_QUERY, params[0], &glue_obj_id) == 1); + params[0] = glue_obj_id; + } + break; + } + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBeginQueryEXT(GLenum target, GLuint id) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + // TODO : Begin - Context Switch + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glBeginQueryEXT(target, real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glDeleteQueriesEXT(GLsizei n, const GLuint* ids) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (ids == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + { + int real_n = 0; + + for (i = 0; i < n; i++) + { + int real_objid = _COREGL_INT_INIT_VALUE; + if (ids[i] == 0) continue; + + real_objid = fastpath_ostate_get_object(¤t_ctx->ostate, GL_OBJECT_TYPE_QUERY, ids[i]); + if (real_objid == 0) continue; + + AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_QUERY, ids[i]) == 1); + objid_array[real_n++] = real_objid; + } + + _orig_fastpath_glDeleteQueriesEXT(real_n, objid_array); + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGenQueriesEXT(GLsizei n, GLuint* ids) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (ids == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + + IF_GL_SUCCESS(_orig_fastpath_glGenQueriesEXT(n, objid_array)) + { + for (i = 0; i < n; i++) + { + ids[i] = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_QUERY, objid_array[i]); + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +GLboolean +fastpath_glIsFramebufferOES(GLuint framebuffer) +{ + GLboolean ret = GL_FALSE; + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_FRAMEBUFFER, framebuffer, &real_obj) != 1) + { + ret = GL_FALSE; + goto finish; + } + + ret = _orig_fastpath_glIsFramebufferOES(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +GLboolean +fastpath_glIsQueryEXT(GLuint id) +{ + GLboolean ret = GL_FALSE; + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + ret = GL_FALSE; + goto finish; + } + + ret = _orig_fastpath_glIsQueryEXT(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +GLboolean +fastpath_glIsRenderbufferOES(GLuint renderbuffer) +{ + GLboolean ret = GL_FALSE; + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_RENDERBUFFER, renderbuffer, &real_obj) != 1) + { + ret = GL_FALSE; + goto finish; + } + + ret = _orig_fastpath_glIsRenderbufferOES(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + +void +fastpath_glBlendEquationOES(GLenum mode) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + IF_GL_SUCCESS(_orig_fastpath_glBlendEquationOES(mode)) + { + current_ctx->_blend_flag |= + _BLEND_FLAG_BIT_gl_blend_equation_rgb | + _BLEND_FLAG_BIT_gl_blend_equation_alpha; + + _orig_fastpath_glGetIntegerv(GL_BLEND_EQUATION_RGB, (GLint*) & (current_ctx->gl_blend_equation_rgb)); + _orig_fastpath_glGetIntegerv(GL_BLEND_EQUATION_ALPHA, (GLint*) & (current_ctx->gl_blend_equation_alpha)); + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_blend_equation_rgb[0] != modeRGB) || + (current_ctx->gl_blend_equation_alpha[0] != modeAlpha)) + { + IF_GL_SUCCESS(_orig_fastpath_glBlendEquationSeparateOES(modeRGB, modeAlpha)) + { + current_ctx->_blend_flag |= + _BLEND_FLAG_BIT_gl_blend_equation_rgb | + _BLEND_FLAG_BIT_gl_blend_equation_alpha; + + current_ctx->gl_blend_equation_rgb[0] = modeRGB; + current_ctx->gl_blend_equation_alpha[0] = modeAlpha; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_blend_src_rgb[0] != srcRGB) || + (current_ctx->gl_blend_dst_rgb[0] != dstRGB) || + (current_ctx->gl_blend_src_alpha[0] != srcAlpha) || + (current_ctx->gl_blend_dst_alpha[0] != dstAlpha)) + { + IF_GL_SUCCESS(_orig_fastpath_glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha)) + { + current_ctx->_blend_flag |= + _BLEND_FLAG_BIT_gl_blend_src_rgb | + _BLEND_FLAG_BIT_gl_blend_src_alpha | + _BLEND_FLAG_BIT_gl_blend_dst_rgb | + _BLEND_FLAG_BIT_gl_blend_dst_alpha; + + current_ctx->gl_blend_src_rgb[0] = srcRGB; + current_ctx->gl_blend_dst_rgb[0] = dstRGB; + current_ctx->gl_blend_src_alpha[0] = srcAlpha; + current_ctx->gl_blend_dst_alpha[0] = dstAlpha; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glPolygonOffsetxOES(GLfixed factor, GLfixed units) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_polygon_offset_factor[0] != factor) || + (current_ctx->gl_polygon_offset_units[0] != units)) + { + IF_GL_SUCCESS(_orig_fastpath_glPolygonOffsetxOES(factor, units)) + { + current_ctx->_misc_flag1 |= + _MISC_FLAG1_BIT_gl_polygon_offset_factor | + _MISC_FLAG1_BIT_gl_polygon_offset_units; + + current_ctx->gl_polygon_offset_factor[0] = factor; + current_ctx->gl_polygon_offset_units[0] = units; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glLineWidthxOES(GLfixed width) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + CURR_STATE_COMPARE(gl_line_width, width) + { + IF_GL_SUCCESS(_orig_fastpath_glLineWidthxOES(width)) + { + current_ctx->_misc_flag1 |= _MISC_FLAG1_BIT_gl_line_width; + current_ctx->gl_line_width[0] = width; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glSampleCoveragexOES(GLclampx value, GLboolean invert) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if ((current_ctx->gl_sample_coverage_value[0] != value) || + (current_ctx->gl_sample_coverage_invert[0] != invert)) + { + IF_GL_SUCCESS(_orig_fastpath_glSampleCoveragexOES(value, invert)) + { + current_ctx->_misc_flag1 |= + _MISC_FLAG1_BIT_gl_sample_coverage_value | + _MISC_FLAG1_BIT_gl_sample_coverage_invert; + + current_ctx->gl_sample_coverage_value[0] = value; + current_ctx->gl_sample_coverage_invert[0] = invert; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glQueryCounterEXT(GLuint id, GLenum target) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_QUERY, id, &real_obj) != 1) + { + // TODO : Begin - Context Switch + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + + _orig_fastpath_glQueryCounterEXT(real_obj,target); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glGenVertexArraysOES(GLsizei n, GLuint* arrays) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (arrays == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + + IF_GL_SUCCESS(_orig_fastpath_glGenVertexArraysOES(n, objid_array)) + { + for (i = 0; i < n; i++) + { + arrays[i] = fastpath_ostate_create_object(¤t_ctx->ostate, GL_OBJECT_TYPE_VERTEXARRAY, objid_array[i]); + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + + +void +fastpath_glBindVertexArrayOES(GLuint array) +{ + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_VERTEXARRAY, array, &real_obj) != 1) + { + _set_gl_error(GL_INVALID_OPERATION); + goto finish; + } + if (current_ctx->gl_vertex_array_binding[0] != real_obj) + { + IF_GL_SUCCESS(_orig_fastpath_glBindVertexArrayOES(real_obj)) + { + current_ctx->_misc_flag3 |= _MISC_FLAG3_BIT_gl_vertex_array_binding; + current_ctx->gl_vertex_array_binding[0] = real_obj; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + + +GLboolean +fastpath_glIsVertexArrayOES(GLuint array) +{ + GLboolean ret = GL_FALSE; + GLuint real_obj; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (GET_REAL_OBJ(GL_OBJECT_TYPE_VERTEXARRAY, array, &real_obj) != 1) + { + ret = GL_FALSE; + goto finish; + } + + ret = _orig_fastpath_glIsVertexArrayOES(real_obj); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); + return ret; +} + + +void +fastpath_glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays) +{ + int i; + GLuint *objid_array = NULL; + + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + if (n < 0) + { + _set_gl_error(GL_INVALID_VALUE); + goto finish; + } + if (n == 0) goto finish; + if (arrays == NULL) goto finish; + + AST(current_ctx->ostate.shared != NULL); + + objid_array = (GLuint *)calloc(1, sizeof(GLuint) * n); + { + int real_n = 0; + + for (i = 0; i < n; i++) + { + int real_objid = _COREGL_INT_INIT_VALUE; + if (arrays[i] == 0) continue; + + real_objid = fastpath_ostate_get_object(¤t_ctx->ostate, GL_OBJECT_TYPE_VERTEXARRAY, arrays[i]); + if (real_objid == 0) continue; + + AST(fastpath_ostate_remove_object(¤t_ctx->ostate, GL_OBJECT_TYPE_VERTEXARRAY, arrays[i]) == 1); + objid_array[real_n++] = real_objid; + } + + IF_GL_SUCCESS(_orig_fastpath_glDeleteVertexArraysOES(real_n, objid_array)) + { + for (i = 0; i < real_n; i++) + { + General_Trace_List *current = NULL; + current = current_ctx->ostate.shared->using_gctxs; + + while (current != NULL) + { + GLGlueContext *cur_gctx = (GLGlueContext *)current->value; + + if (cur_gctx->gl_vertex_array_binding[0] == objid_array[i]) + cur_gctx->gl_vertex_array_binding[0] = 0; + + current = current->next; + } + } + } + } + + goto finish; + +finish: + if (objid_array != NULL) + { + free(objid_array); + objid_array = NULL; + } + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glClearDepthfOES(GLclampf depth) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + CURR_STATE_COMPARE(gl_depth_clear_value, depth) + { + IF_GL_SUCCESS(_orig_fastpath_glClearDepthfOES(depth)) + { + current_ctx->_clear_flag2 |= _CLEAR_FLAG2_BIT_gl_depth_clear_value; + current_ctx->gl_depth_clear_value[0] = depth; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glClearDepthxOES(GLclampx depth) +{ + DEFINE_FASTPAH_GL_FUNC(); + _COREGL_FASTPATH_FUNC_BEGIN(); + INIT_FASTPATH_GL_FUNC(); + + CURR_STATE_COMPARE(gl_depth_clear_value, depth) + { + IF_GL_SUCCESS(_orig_fastpath_glClearDepthxOES(depth)) + { + current_ctx->_clear_flag2 |= _CLEAR_FLAG2_BIT_gl_depth_clear_value; + current_ctx->gl_depth_clear_value[0] = depth; + } + } + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} diff --git a/src/modules/tracepath/coregl_tracepath.c b/src/modules/tracepath/coregl_tracepath.c index 6b2125e..563088b 100644 --- a/src/modules/tracepath/coregl_tracepath.c +++ b/src/modules/tracepath/coregl_tracepath.c @@ -1184,6 +1184,7 @@ _dump_surface(int force_output, int type, const char *position, Surface_Data *sd png_struct *png = NULL; png_info *info = NULL; png_byte **rows = NULL; + GLenum ret_value = _COREGL_INT_INIT_VALUE; if (!png_lib_handle) { @@ -1308,7 +1309,11 @@ _dump_surface(int force_output, int type, const char *position, Surface_Data *sd _orig_tracepath_glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldfb); _orig_tracepath_glBindFramebuffer(GL_FRAMEBUFFER, sdata->fbo); - if (_orig_tracepath_glCheckFramebufferStatus(GL_FRAMEBUFFER) == GL_FRAMEBUFFER_COMPLETE) + if(driver_gl_version >=2) + ret_value = _orig_tracepath_glCheckFramebufferStatus(GL_FRAMEBUFFER); + else + ret_value = _orig_tracepath_glCheckFramebufferStatusOES(GL_FRAMEBUFFER); + if (ret_value == GL_FRAMEBUFFER_COMPLETE) { _orig_tracepath_glBindFramebuffer(GL_FRAMEBUFFER, oldfb); width = sdata->tex_w; @@ -1348,10 +1353,16 @@ _dump_surface(int force_output, int type, const char *position, Surface_Data *sd _orig_tracepath_glBindFramebuffer(GL_FRAMEBUFFER, sdata->fbo); int atttype = _COREGL_INT_INIT_VALUE; - _orig_tracepath_glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &atttype); + if(driver_gl_version >=2) + _orig_tracepath_glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &atttype); + else + _orig_tracepath_glGetFramebufferAttachmentParameterivOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE, &atttype); AST(atttype != sdata->tex); int attname = _COREGL_INT_INIT_VALUE; - _orig_tracepath_glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &attname); + if(driver_gl_version >=2) + _orig_tracepath_glGetFramebufferAttachmentParameteriv(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &attname); + else + _orig_tracepath_glGetFramebufferAttachmentParameterivOES(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME, &attname); switch (atttype) { case GL_TEXTURE: diff --git a/src/modules/tracepath/coregl_tracepath_gl.c b/src/modules/tracepath/coregl_tracepath_gl.c index 8b9b0c8..cffb3c2 100644 --- a/src/modules/tracepath/coregl_tracepath_gl.c +++ b/src/modules/tracepath/coregl_tracepath_gl.c @@ -2370,7 +2370,7 @@ finish: } void -tracepath_glTexImage3DOES(GLenum target, GLint level, GLint GLinternalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const GLvoid *pixels) +tracepath_glTexImage3DOES(GLenum target, GLint level, GLenum GLinternalFormat, GLsizei width, GLsizei height, GLsizei depth, GLint border, GLenum format, GLenum type, const void *pixels) { _COREGL_TRACEPATH_FUNC_BEGIN(); _orig_tracepath_glTexImage3DOES(target, level, GLinternalFormat, width, height, depth, border, format, type, pixels); @@ -4350,7 +4350,7 @@ tracepath_glFramebufferTexture3DOES(GLenum target, GLenum attachment, GLenum tex finish: _COREGL_TRACEPATH_FUNC_END(); } - +/* void tracepath_glBlitFramebufferANGLE(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, GLint dstX0, GLint dstY0, GLint dstX1, GLint dstY1, GLbitfield mask, GLenum filter) { @@ -4454,6 +4454,7 @@ finish: } #endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO } +*/ void @@ -5324,4 +5325,1339 @@ void tracepath_glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) finish: _COREGL_TRACEPATH_FUNC_END(); -} \ No newline at end of file +} +void +tracepath_glBindFramebufferOES(GLenum target, GLuint framebuffer) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + if (unlikely(trace_surface_flag == 1)) + { + GLint oldfb; + _orig_tracepath_glGetIntegerv(GL_FRAMEBUFFER_BINDING, &oldfb); + if (oldfb != 0) + { + _COREGL_TRACE_SURFACE(0, 2, "GLBINDFBO"); + } + + tracepath_fbdump_update(0); + } +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + _orig_tracepath_glBindFramebufferOES(target, framebuffer); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + if (unlikely(trace_surface_flag == 1)) + { + tracepath_fbdump_update(1); + } +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBindRenderbufferOES(GLenum target, GLuint renderbuffer) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBindRenderbufferOES(target, renderbuffer); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDeleteFramebuffersOES(GLsizei n, const GLuint* framebuffers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(0); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + _orig_tracepath_glDeleteFramebuffersOES(n, framebuffers); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(1); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDeleteRenderbuffersOES(GLsizei n, const GLuint* renderbuffers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(0); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + _orig_tracepath_glDeleteRenderbuffersOES(n, renderbuffers); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(1); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO + if (trace_mem_flag == 1) + { + MY_MODULE_TSTATE *tstate = NULL; + + GET_MY_TSTATE(tstate, get_current_thread_state()); + AST(tstate != NULL); + if (tstate->ctx != NULL) + { + for (int i = 0; i < n; i++) + { + if (renderbuffers[i] == 0) continue; + _remove_glbuf_object(tstate->ctx->sostate->glbuf_rb, renderbuffers[i], "Renderbuffer"); + } + } + } +#endif // COREGL_TRACEPATH_TRACE_MEMUSE_INFO +} + +void +tracepath_glDepthRangefOES(GLclampf zNear, GLclampf zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDepthRangefOES(zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDepthRangexOES(GLclampx zNear, GLclampx zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDepthRangexOES(zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glFramebufferRenderbufferOES(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(0); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + _orig_tracepath_glFramebufferRenderbufferOES(target, attachment, renderbuffertarget, renderbuffer); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(1); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glFramebufferTexture2DOES(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(0); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + _orig_tracepath_glFramebufferTexture2DOES(target, attachment, textarget, texture, level); + +#ifdef COREGL_TRACEPATH_TRACE_SURFACE_INFO + tracepath_fbdump_update(1); +#endif // COREGL_TRACEPATH_TRACE_SURFACE_INFO + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGenFramebuffersOES(GLsizei n, GLuint* framebuffers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenFramebuffersOES(n, framebuffers); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGenRenderbuffersOES(GLsizei n, GLuint* renderbuffers) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenRenderbuffersOES(n, renderbuffers); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +#ifdef COREGL_TRACEPATH_TRACE_MEMUSE_INFO + if (trace_mem_flag == 1) + { + MY_MODULE_TSTATE *tstate = NULL; + + GET_MY_TSTATE(tstate, get_current_thread_state()); + AST(tstate != NULL); + if (tstate->ctx != NULL) + { + for (int i = 0; i < n; i++) + { + if (renderbuffers[i] == 0) continue; + _add_glbuf_object(tstate->ctx->sostate->glbuf_rb, renderbuffers[i], "Renderbuffer", 0, 0, 0, "Unknown"); + } + } + } +#endif // COREGL_TRACEPATH_TRACE_MEMUSE_INFO +} + +void +tracepath_glGetFramebufferAttachmentParameterivOES(GLenum target, GLenum attachment, GLenum pname, GLint* params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetFramebufferAttachmentParameterivOES(target, attachment, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetQueryObjecti64vEXT(GLuint id, GLenum pname, GLint64 *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetQueryObjecti64vEXT(id, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetQueryObjectivEXT(GLuint id, GLenum pname, GLint *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetQueryObjectivEXT(id, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetQueryObjectui64vEXT(GLuint id, GLenum pname, GLuint64 *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetQueryObjectui64vEXT(id, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetQueryObjectuivEXT(GLuint id, GLenum pname, GLuint* params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetQueryObjectuivEXT(id, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetQueryivEXT(GLenum target, GLenum pname, GLint* params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetQueryivEXT(target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBeginQueryEXT(GLenum target, GLuint id) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBeginQueryEXT(target, id); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void +tracepath_glDeleteQueriesEXT(GLsizei n, const GLuint* ids) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDeleteQueriesEXT(n, ids); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGenQueriesEXT(GLsizei n, GLuint* ids) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenQueriesEXT(n, ids); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLboolean +tracepath_glIsFramebufferOES(GLuint framebuffer) +{ + GLboolean ret = GL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glIsFramebufferOES(framebuffer); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +GLboolean +tracepath_glIsQueryEXT(GLuint id) +{ + GLboolean ret = GL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glIsQueryEXT(id); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +GLboolean +tracepath_glIsRenderbufferOES(GLuint renderbuffer) +{ + GLboolean ret; + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glIsRenderbufferOES(renderbuffer); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void +tracepath_glEndQueryEXT(GLenum target) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glEndQueryEXT(target); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glAlphaFuncxOES(GLenum func, GLclampx ref) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glAlphaFuncxOES(func, ref); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glBlendBarrierKHR() +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBlendBarrierKHR(); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glBlendEquationOES(GLenum mode) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBlendEquationOES(mode); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glBlendEquationSeparateOES(GLenum modeRGB, GLenum modeAlpha) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBlendEquationSeparateOES(modeRGB, modeAlpha); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glBlendFuncSeparateOES(GLenum srcRGB, GLenum dstRGB, GLenum srcAlpha, GLenum dstAlpha) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBlendFuncSeparateOES(srcRGB, dstRGB, srcAlpha, dstAlpha); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLenum tracepath_glCheckFramebufferStatusOES(GLenum target) +{ + GLenum ret = _COREGL_INT_INIT_VALUE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glCheckFramebufferStatusOES(target); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + + +void tracepath_glClearColorxOES(GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glClearColorxOES(red, green, blue, alpha); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glClearDepthfOES(GLclampf depth) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glClearDepthfOES(depth); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glClearDepthxOES(GLclampx depth) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glClearDepthxOES(depth); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glClipPlanefOES(GLenum plane, GLfloat const *equation) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glClipPlanefOES(plane, equation); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void tracepath_glClipPlanexOES(GLenum plane, GLfixed const *equation) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glClipPlanexOES(plane, equation); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glColor4xOES(GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glColor4xOES(red, green, blue, alpha); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glDebugMessageCallback(GLDEBUGPROCKHR callback, void const *userParam) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageCallback(callback, userParam); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glDebugMessageInsert(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, GLchar const *buf) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageInsert(source, type, id, severity, length, buf); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glDebugMessageControl(GLenum source, GLenum type, GLenum severity, GLsizei count, GLuint const *ids, GLboolean enabled) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageControl(source, type, severity, count, ids, enabled); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glFogxOES(GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFogxOES(pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glFogxvOES(GLenum pname, GLfixed const *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFogxvOES(pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glFrustumxOES(GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFrustumxOES(left, right, bottom, top, zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glFrustumfOES(GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFrustumfOES(left, right, bottom, top, zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGenerateMipmapOES(GLenum target) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenerateMipmapOES(target); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetClipPlanefOES(GLenum pname, GLfloat eqn[4]) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetClipPlanefOES(pname, eqn); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetClipPlanexOES(GLenum pname, GLfixed eqn[4]) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetClipPlanexOES(pname, eqn); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLuint tracepath_glGetDebugMessageLog(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog) +{ + GLuint ret = GL_INVALID_INDEX; + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glGetDebugMessageLog(count, bufsize, sources, types, ids, severities, lengths, messageLog); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void tracepath_glGetFixedvOES(GLenum pname, GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetFixedvOES(pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetLightxvOES(GLenum light, GLenum pname, GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetLightxvOES(light, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetMaterialxvOES(GLenum face, GLenum pname, GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetMaterialxvOES(face, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetObjectLabel(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetObjectLabel(identifier, name, bufSize, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetObjectPtrLabel(void const *ptr, GLsizei bufSize, GLsizei *length, GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetObjectPtrLabel(ptr, bufSize, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetPointervKHR(GLenum pname, GLvoid **params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetPointervKHR(pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetRenderbufferParameterivOES(GLenum target, GLenum pname, GLint *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetRenderbufferParameterivOES(target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetTexEnvxvOES(GLenum env, GLenum pname, GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetTexEnvxvOES(env, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetTexParameterxvOES(GLenum target, GLenum pname, GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetTexParameterxvOES(target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void +tracepath_glLightModelxOES (GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLightModelxOES (pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void +tracepath_glLightModelxvOES (GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLightModelxvOES (pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void +tracepath_glLightxOES (GLenum light, GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLightxOES (light, pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void +tracepath_glLightxvOES (GLenum light, GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLightxvOES (light, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glLineWidthxOES (GLfixed width) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLineWidthxOES (width); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glLoadMatrixxOES (const GLfixed *m) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glLoadMatrixxOES (m); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMaterialxOES (GLenum face, GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMaterialxOES (face, pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMaterialxvOES (GLenum face, GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMaterialxvOES (face, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMultMatrixxOES (const GLfixed *m) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMultMatrixxOES (m); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMultiTexCoord4bOES (GLenum target, GLbyte s, GLbyte t, GLbyte r, GLbyte q) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMultiTexCoord4bOES (target, s, t, r, q); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glMultiTexCoord4xOES (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glMultiTexCoord4xOES (target, s, t, r, q); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glNormal3xOES (GLfixed nx, GLfixed ny, GLfixed nz) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glNormal3xOES (nx, ny, nz); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glObjectLabel (GLenum identifier, GLuint name, GLsizei length, const GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glObjectLabel (identifier, name, length, label); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glObjectPtrLabel (const void *ptr, GLsizei length, const GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glObjectPtrLabel (ptr, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glOrthofOES (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glOrthofOES (left, right, bottom, top, zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glOrthoxOES (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glOrthoxOES (left, right, bottom, top, zNear, zFar); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPointParameterxOES (GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPointParameterxOES (pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPointParameterxvOES (GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPointParameterxvOES (pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPointSizexOES (GLfixed size) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPointSizexOES (size); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPolygonOffsetxOES (GLfixed factor, GLfixed units) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPolygonOffsetxOES (factor, units); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPopDebugGroup (void) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPopDebugGroup (); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPushDebugGroup (GLenum source, GLuint id, GLsizei length, const GLchar *message) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPushDebugGroup (source, id, length, message); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glQueryCounterEXT (GLuint id, GLenum target) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glQueryCounterEXT (id, target); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glRenderbufferStorageOES (GLenum target, GLenum internalformat, GLsizei width, GLsizei height) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glRenderbufferStorageOES (target, internalformat, width, height); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glRotatexOES (GLfixed angle, GLfixed x, GLfixed y, GLfixed z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glRotatexOES (angle, x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glSampleCoveragexOES (GLclampx value, GLboolean invert) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glSampleCoveragexOES (value, invert); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glScalexOES (GLfixed x, GLfixed y, GLfixed z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glScalexOES (x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexEnvxOES (GLenum target, GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexEnvxOES (target, pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexEnvxvOES (GLenum target, GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexEnvxvOES (target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexParameterxOES (GLenum target, GLenum pname, GLfixed param) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexParameterxOES (target, pname, param); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexParameterxvOES (GLenum target, GLenum pname, const GLfixed *params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexParameterxvOES (target, pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexStorage2DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexStorage2DEXT (target, levels, internalformat, width, height); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexStorage3DEXT (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexStorage3DEXT (target, levels, internalformat, width, height, depth); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTexStorage3DMultisampleOES (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth, GLboolean fixedsamplelocations) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTexStorage3DMultisampleOES (target, samples, internalformat, width, height, depth, fixedsamplelocations); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glTranslatexOES (GLfixed x, GLfixed y, GLfixed z) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glTranslatexOES (x, y, z); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glBindVertexArrayOES(GLuint array) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glBindVertexArrayOES(array); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glDeleteVertexArraysOES(GLsizei n, const GLuint* arrays) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDeleteVertexArraysOES(n, arrays); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGenVertexArraysOES(GLsizei n, GLuint* arrays) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGenVertexArraysOES(n, arrays); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLboolean +tracepath_glIsVertexArrayOES(GLuint array) +{ + GLboolean ret = GL_FALSE; + + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glIsVertexArrayOES(array); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void tracepath_glDebugMessageCallbackKHR(GLDEBUGPROCKHR callback, void const *userParam) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageCallbackKHR(callback, userParam); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + + +void tracepath_glDebugMessageControlKHR(GLenum source, GLenum type, GLenum severity, GLsizei count, GLuint const *ids, GLboolean enabled) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageControlKHR(source, type, severity, count, ids, enabled); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glDebugMessageInsertKHR(GLenum source, GLenum type, GLuint id, GLenum severity, GLsizei length, GLchar const *buf) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glDebugMessageInsertKHR(source, type, id, severity, length, buf); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +GLuint tracepath_glGetDebugMessageLogKHR(GLuint count, GLsizei bufsize, GLenum *sources, GLenum *types, GLuint *ids, GLenum *severities, GLsizei *lengths, GLchar *messageLog) +{ + GLuint ret = GL_INVALID_INDEX; + _COREGL_TRACEPATH_FUNC_BEGIN(); + ret = _orig_tracepath_glGetDebugMessageLogKHR(count, bufsize, sources, types, ids, severities, lengths, messageLog); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); + return ret; +} + +void tracepath_glGetObjectLabelKHR(GLenum identifier, GLuint name, GLsizei bufSize, GLsizei *length, GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetObjectLabelKHR(identifier, name, bufSize, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void tracepath_glGetObjectPtrLabelKHR(void const *ptr, GLsizei bufSize, GLsizei *length, GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetObjectPtrLabelKHR(ptr, bufSize, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glGetPointerv(GLenum pname, GLvoid **params) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glGetPointerv(pname, params); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glObjectLabelKHR (GLenum identifier, GLuint name, GLsizei length, const GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glObjectLabelKHR (identifier, name, length, label); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glObjectPtrLabelKHR (const void *ptr, GLsizei length, const GLchar *label) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glObjectPtrLabelKHR (ptr, length, label); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPopDebugGroupKHR (void) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPopDebugGroupKHR (); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glPushDebugGroupKHR (GLenum source, GLuint id, GLsizei length, const GLchar *message) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glPushDebugGroupKHR (source, id, length, message); + + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + diff --git a/src/wraps/coregl_gl.c b/src/wraps/coregl_gl.c index 365601a..957fa56 100644 --- a/src/wraps/coregl_gl.c +++ b/src/wraps/coregl_gl.c @@ -1663,42 +1663,50 @@ glProgramUniform1iv(GLuint program, GLint location, GLsizei count, const GLint * ovr_glProgramUniform1iv(program, location, count, value); } + void glProgramUniform2iv(GLuint program, GLint location, GLsizei count, const GLint *value) { ovr_glProgramUniform2iv(program, location, count, value); } + void glProgramUniform3iv(GLuint program, GLint location, GLsizei count, const GLint *value) { ovr_glProgramUniform3iv(program, location, count, value); } + void glProgramUniform4iv(GLuint program, GLint location, GLsizei count, const GLint *value) { ovr_glProgramUniform4iv(program, location, count, value); } + + void glProgramUniform1fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { ovr_glProgramUniform1fv(program, location, count, value); } + void glProgramUniform2fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { ovr_glProgramUniform2fv(program, location, count, value); } + void glProgramUniform3fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { ovr_glProgramUniform3fv(program, location, count, value); } + void glProgramUniform4fv(GLuint program, GLint location, GLsizei count, const GLfloat *value) { @@ -1711,12 +1719,14 @@ glProgramUniformMatrix2fv(GLuint program, GLint location, GLsizei count, GLboole ovr_glProgramUniformMatrix2fv(program, location, count, transpose, value); } + void glProgramUniformMatrix3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { ovr_glProgramUniformMatrix3fv(program, location, count, transpose, value); } + void glProgramUniformMatrix4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { @@ -1729,42 +1739,49 @@ glProgramUniform1i(GLuint program, GLint location, GLint x) ovr_glProgramUniform1i(program, location, x); } + void glProgramUniform2i(GLuint program, GLint location, GLint x, GLint y) { ovr_glProgramUniform2i(program, location, x, y); } + void glProgramUniform3i(GLuint program, GLint location, GLint x, GLint y, GLint z) { ovr_glProgramUniform3i(program, location, x, y, z); } + void glProgramUniform4i(GLuint program, GLint location, GLint x, GLint y, GLint z, GLint w) { ovr_glProgramUniform4i(program, location, x, y, z, w); } + void glProgramUniform1f(GLuint program, GLint location, GLfloat x) { ovr_glProgramUniform1f(program, location, x); } + void glProgramUniform2f(GLuint program, GLint location, GLfloat x, GLfloat y) { ovr_glProgramUniform2f(program, location, x, y); } + void glProgramUniform3f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z) { ovr_glProgramUniform3f(program, location, x, y, z); } + void glProgramUniform4f(GLuint program, GLint location, GLfloat x, GLfloat y, GLfloat z, GLfloat w) { @@ -1777,18 +1794,21 @@ glProgramUniform1ui(GLuint program, GLint location, GLuint x) ovr_glProgramUniform1ui(program, location, x); } + void glProgramUniform2ui(GLuint program, GLint location, GLuint x, GLuint y) { ovr_glProgramUniform2ui(program, location, x, y); } + void glProgramUniform3ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z) { ovr_glProgramUniform3ui(program, location, x, y, z); } + void glProgramUniform4ui(GLuint program, GLint location, GLuint x, GLuint y, GLuint z, GLuint w) { @@ -1801,6 +1821,7 @@ glProgramUniform1uiv(GLuint program, GLint location, GLsizei count, const GLuint ovr_glProgramUniform1uiv(program, location, count, value); } + void glProgramUniform2uiv(GLuint program, GLint location, GLsizei count, const GLuint *value) { @@ -1825,12 +1846,14 @@ glProgramUniformMatrix2x3fv(GLuint program, GLint location, GLsizei count, GLboo ovr_glProgramUniformMatrix2x3fv(program, location, count, transpose, value); } + void glProgramUniformMatrix3x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { ovr_glProgramUniformMatrix3x2fv(program, location, count, transpose, value); } + void glProgramUniformMatrix4x3fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { @@ -1843,98 +1866,122 @@ glProgramUniformMatrix3x4fv(GLuint program, GLint location, GLsizei count, GLboo ovr_glProgramUniformMatrix3x4fv(program, location, count, transpose, value); } + void glProgramUniformMatrix2x4fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { ovr_glProgramUniformMatrix2x4fv(program, location, count, transpose, value); } + void glProgramUniformMatrix4x2fv(GLuint program, GLint location, GLsizei count, GLboolean transpose, const GLfloat *value) { ovr_glProgramUniformMatrix4x2fv(program, location, count, transpose, value); } + void glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format) { ovr_glBindImageTexture (unit, texture, level, layered, layer, access, format); } + void glGetBooleani_v (GLenum target, GLuint index, GLboolean *data) { ovr_glGetBooleani_v (target, index, data); } + void glMemoryBarrier (GLbitfield barriers) { ovr_glMemoryBarrier (barriers); } + void glMemoryBarrierByRegion (GLbitfield barriers) { ovr_glMemoryBarrierByRegion (barriers); } + void glTexStorage2DMultisample (GLenum target, GLsizei samples, GLenum internalformat, GLsizei width, GLsizei height, GLboolean fixedsamplelocations) { ovr_glTexStorage2DMultisample (target, samples, internalformat, width, height, fixedsamplelocations); } + void glGetMultisamplefv (GLenum pname, GLuint index, GLfloat *val) { ovr_glGetMultisamplefv (pname, index, val); } + void glSampleMaski (GLuint maskNumber, GLbitfield mask) { ovr_glSampleMaski (maskNumber, mask); } + void glGetTexLevelParameteriv (GLenum target, GLint level, GLenum pname, GLint *params) { ovr_glGetTexLevelParameteriv (target, level, pname, params); } + void glGetTexLevelParameterfv (GLenum target, GLint level, GLenum pname, GLfloat *params) { ovr_glGetTexLevelParameterfv (target, level, pname, params); } + void glBindVertexBuffer (GLuint bindingindex, GLuint buffer, GLintptr offset, GLsizei stride) { ovr_glBindVertexBuffer (bindingindex, buffer, offset, stride); } + void glVertexAttribFormat (GLuint attribindex, GLint size, GLenum type, GLboolean normalized, GLuint relativeoffset) { ovr_glVertexAttribFormat (attribindex, size, type, normalized, relativeoffset); } + void glVertexAttribIFormat (GLuint attribindex, GLint size, GLenum type, GLuint relativeoffset) { ovr_glVertexAttribIFormat (attribindex, size, type, relativeoffset); } + void glVertexAttribBinding (GLuint attribindex, GLuint bindingindex) { ovr_glVertexAttribBinding (attribindex, bindingindex); } + void glVertexBindingDivisor (GLuint bindingindex, GLuint divisor) { ovr_glVertexBindingDivisor (bindingindex, divisor); } + +void +glGetPointerv(GLenum pname, GLvoid **params) +{ + ovr_glGetPointerv(pname, params); +} + + -- 2.7.4 From 7a77f354316fc6a7c7d6f34b4fa1702a158861fd Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Fri, 22 Jan 2016 12:49:43 +0900 Subject: [PATCH 14/16] Fix memory bug and prevent potential leak. Change-Id: Iadeb173177b09b21fb3674b1ed726e1da7b3d994 --- src/modules/fastpath/coregl_fastpath.c | 21 ++++++++++++++++----- src/modules/fastpath/coregl_fastpath_gl.c | 22 ++++++++++++++++------ 2 files changed, 32 insertions(+), 11 deletions(-) diff --git a/src/modules/fastpath/coregl_fastpath.c b/src/modules/fastpath/coregl_fastpath.c index 0c61c31..85cc12a 100644 --- a/src/modules/fastpath/coregl_fastpath.c +++ b/src/modules/fastpath/coregl_fastpath.c @@ -1107,23 +1107,35 @@ fastpath_ostate_create_object(GL_Object_State *ostate, GL_Object_Type type, GLui { GL_Object *newobj = (GL_Object *)calloc(1, sizeof(GL_Object)); - AST(newobj != NULL); + if (newobj == NULL) + goto finish; newobj->id = (int)type + newid; newobj->real_id = real_name; newobj->ref_count = 1; - ret = newobj->id; + GL_Object_Hash *newobj_hash = (GL_Object_Hash *)calloc(1, sizeof(GL_Object_Hash)); - AST(newobj_hash != NULL); + if (newobj_hash == NULL) + { + free(newobj); + goto finish; + } newobj_hash->item = newobj; newobj_hash->hash_key = newid; _add_hash(hash_base, newobj_hash); GL_Object_Hash *newobj_hash_real = (GL_Object_Hash *)calloc(1, sizeof(GL_Object_Hash)); - AST(newobj_hash_real != NULL); + if (newobj_hash_real == NULL) + { + free(newobj); + free(newobj_hash); + goto finish; + } newobj_hash_real->item = newobj; newobj_hash_real->hash_key = real_name; _add_hash(hash_base_real, newobj_hash_real); + + ret = newobj->id; } _ostate_hash_check(hash_base); @@ -1212,7 +1224,6 @@ finish: return ret; } - /* Check if the context's state contains object of a given type */ GLuint fastpath_ostate_has_object_type(GL_Object_State *ostate, GL_Object_Type type) diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 0fe6928..887dcec 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -137,15 +137,21 @@ _create_program_object(GL_Object_State *ostate, int is_program, GLenum shader_ty if (real_obj != 0) { ret = fastpath_ostate_create_object(ostate, GL_OBJECT_TYPE_PROGRAM, real_obj); - Program_object_attached_tag *poat = NULL; - poat = (Program_object_attached_tag *)calloc(1, sizeof(Program_object_attached_tag)); - AST(poat != NULL); - poat->is_deleting = 0; - poat->shader_count = 0; + if (ret != _COREGL_INT_INIT_VALUE) + { + poat = (Program_object_attached_tag *)calloc(1, sizeof(Program_object_attached_tag)); + if (poat == NULL) + { + AST(poat != NULL); + fastpath_ostate_remove_object(ostate, GL_OBJECT_TYPE_PROGRAM, ret); + } + poat->is_deleting = 0; + poat->shader_count = 0; - fastpath_ostate_set_object_tag(ostate, GL_OBJECT_TYPE_PROGRAM, ret, poat); + fastpath_ostate_set_object_tag(ostate, GL_OBJECT_TYPE_PROGRAM, ret, poat); + } } return ret; @@ -203,7 +209,11 @@ _detach_program_object(GL_Object_State *ostate, GLuint real_object, int is_progr if (poat->is_deleting == 0) { poat->is_deleting = 1; + /* Ref count increased when glCreateProgram/initial attach */ fastpath_ostate_remove_object(ostate, GL_OBJECT_TYPE_PROGRAM, object); + /* Ref count increased when glCreateProgram/create object */ + /* So, we have to call the under function twice.*/ + fastpath_ostate_remove_object(ostate, GL_OBJECT_TYPE_PROGRAM, object); } } else -- 2.7.4 From 7473d37a365f9ab07d9ea72272f22fd8766e8816 Mon Sep 17 00:00:00 2001 From: "Mun, Gwan-gyeong" Date: Wed, 27 Jan 2016 16:53:52 +0900 Subject: [PATCH 15/16] Add EGL_PLATFORM_TBM_EXT specs to eglext.h Change-Id: I392a04f3f85263161885305f28bb36fccb801a34 --- include_KHR/EGL/eglext.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include_KHR/EGL/eglext.h b/include_KHR/EGL/eglext.h index 027b2ed..6ee20e3 100644 --- a/include_KHR/EGL/eglext.h +++ b/include_KHR/EGL/eglext.h @@ -567,6 +567,11 @@ EGLAPI EGLSurface EGLAPIENTRY eglCreatePlatformPixmapSurfaceEXT (EGLDisplay dpy, #define EGL_PLATFORM_WAYLAND_EXT 0x31D8 #endif /* EGL_EXT_platform_wayland */ +#ifndef EGL_EXT_platform_tbm +#define EGL_EXT_platform_tbm 1 +#define EGL_PLATFORM_TBM_EXT 0x31D9 +#endif /* EGL_EXT_platform_tbm */ + #ifndef EGL_EXT_platform_x11 #define EGL_EXT_platform_x11 1 #define EGL_PLATFORM_X11_EXT 0x31D5 -- 2.7.4 From 481a5c97710cc9c9c05df0b8f63c1e56636eb43b Mon Sep 17 00:00:00 2001 From: "joonbum.ko" Date: Fri, 12 Feb 2016 16:17:58 +0900 Subject: [PATCH 16/16] Add glActiveShaderProgram wrapper function. Change-Id: Ib1b31665c153d75f91d49dd2a8ae06dcf1d1201e --- src/wraps/coregl_gl.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wraps/coregl_gl.c b/src/wraps/coregl_gl.c index 957fa56..8fffdc7 100644 --- a/src/wraps/coregl_gl.c +++ b/src/wraps/coregl_gl.c @@ -840,6 +840,12 @@ glUniformMatrix4fv(GLint location, GLsizei count, GLboolean transpose, const GLf } void +glActiveShaderProgram(GLuint pipeline, GLuint program) +{ + ovr_glActiveShaderProgram(pipeline, program); +} + +void glUseProgram(GLuint program) { ovr_glUseProgram(program); -- 2.7.4