From 6a1b9bdc594400e07c85b97659874f0da1ed3895 Mon Sep 17 00:00:00 2001 From: Zhaowei Yuan Date: Sat, 7 Jan 2017 01:51:04 +0800 Subject: [PATCH] CoreGL: Add support for OVR extensions These OVR extensions include glFramebufferTextureMultiviewOVR, and glFramebufferTextureMultisampleMultiviewOVR Signed-off-by: Zhaowei Yuan Change-Id: I5b8509b30a40f719044f15f88599cae23ca666c2 --- src/headers/sym_gl2.h | 6 ++++ src/modules/fastpath/coregl_fastpath.c | 2 ++ src/modules/fastpath/coregl_fastpath_gl.c | 49 +++++++++++++++++++++++++++++ src/modules/tracepath/coregl_tracepath_gl.c | 27 ++++++++++++++++ 4 files changed, 84 insertions(+) diff --git a/src/headers/sym_gl2.h b/src/headers/sym_gl2.h index c47029d..be1d79a 100644 --- a/src/headers/sym_gl2.h +++ b/src/headers/sym_gl2.h @@ -886,6 +886,12 @@ _COREGL_EXT_SYMBOL(void, glCompressedTexSubImage3DOES, (GLenum target, GLsizei height, GLsizei depth, GLenum format, GLsizei imageSize, const GLvoid *data)) +_COREGL_EXT_SYMBOL(void, glFramebufferTextureMultiviewOVR, (GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews)) +_COREGL_EXT_SYMBOL(void, glFramebufferTextureMultisampleMultiviewOVR, (GLenum target, + GLenum attachment, GLuint texture, GLint level, GLsizei samples, + GLint baseViewIndex, GLsizei numViews)) + /* _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)) diff --git a/src/modules/fastpath/coregl_fastpath.c b/src/modules/fastpath/coregl_fastpath.c index cab9955..d33c157 100644 --- a/src/modules/fastpath/coregl_fastpath.c +++ b/src/modules/fastpath/coregl_fastpath.c @@ -549,6 +549,8 @@ fastpath_apply_overrides_gl(int enable) COREGL_OVERRIDE(fastpath_, glSamplerParameterIuivEXT); COREGL_OVERRIDE(fastpath_, glTexBufferRangeEXT); COREGL_OVERRIDE(fastpath_, glTexBufferEXT); + COREGL_OVERRIDE(fastpath_, glFramebufferTextureMultiviewOVR); + COREGL_OVERRIDE(fastpath_, glFramebufferTextureMultisampleMultiviewOVR); /* Start overriding GLES 3.0 */ if (driver_gl_version >= COREGL_GLAPI_3) { COREGL_OVERRIDE(fastpath_, glReadBuffer); diff --git a/src/modules/fastpath/coregl_fastpath_gl.c b/src/modules/fastpath/coregl_fastpath_gl.c index 9c9f6c2..6a1ac02 100644 --- a/src/modules/fastpath/coregl_fastpath_gl.c +++ b/src/modules/fastpath/coregl_fastpath_gl.c @@ -9096,3 +9096,52 @@ fastpath_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) finish: _COREGL_FASTPATH_FUNC_END(); } + +void +fastpath_glFramebufferTextureMultiviewOVR(GLenum target, GLenum attachment, GLuint texture, + GLint level, GLint baseViewIndex, GLsizei numViews) +{ + 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_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glFramebufferTextureMultiviewOVR(target, attachment, real_obj, + level, baseViewIndex, numViews); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} + +void +fastpath_glFramebufferTextureMultisampleMultiviewOVR (GLenum target, GLenum attachment, + GLuint texture, GLint level, GLsizei samples, + GLint baseViewIndex, GLsizei numViews) +{ + 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_INVALID_VALUE); + goto finish; + } + + _orig_fastpath_glFramebufferTextureMultisampleMultiviewOVR(target, attachment, real_obj, level, + samples, baseViewIndex, numViews); + + goto finish; + +finish: + _COREGL_FASTPATH_FUNC_END(); +} diff --git a/src/modules/tracepath/coregl_tracepath_gl.c b/src/modules/tracepath/coregl_tracepath_gl.c index 10f5b2f..53ef4dd 100644 --- a/src/modules/tracepath/coregl_tracepath_gl.c +++ b/src/modules/tracepath/coregl_tracepath_gl.c @@ -9173,3 +9173,30 @@ tracepath_glTexBufferEXT(GLenum target, GLenum internalformat, GLuint buffer) finish: _COREGL_TRACEPATH_FUNC_END(); } + +void +tracepath_glFramebufferTextureMultiviewOVR(GLenum target, GLenum attachment, + GLuint texture, GLint level, GLint baseViewIndex, GLsizei numViews) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFramebufferTextureMultiviewOVR(target, attachment, texture, level, + baseViewIndex, numViews); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} + +void +tracepath_glFramebufferTextureMultisampleMultiviewOVR(GLenum target, + GLenum attachment, GLuint texture, GLint level, GLsizei samples, + GLint baseViewIndex, GLsizei numViews) +{ + _COREGL_TRACEPATH_FUNC_BEGIN(); + _orig_tracepath_glFramebufferTextureMultisampleMultiviewOVR(target, attachment, texture, level, + samples, baseViewIndex, numViews); + goto finish; + +finish: + _COREGL_TRACEPATH_FUNC_END(); +} -- 2.7.4