Added support for GL_TEXTURE_EXTERNAL_OES target in CoreGL.
authormythri.venugopal <mythri.venugopal@samsung.com>
Thu, 19 Dec 2013 02:11:57 +0000 (11:11 +0900)
committermythri.venugopal <mythri.venugopal@samsung.com>
Thu, 19 Dec 2013 04:57:50 +0000 (13:57 +0900)
Removed extra whitespace.

src/headers/gl.h
src/modules/fastpath/coregl_fastpath.c
src/modules/fastpath/coregl_fastpath.h
src/modules/fastpath/coregl_fastpath_gl.c
src/modules/fastpath/coregl_fastpath_state.h

index 460f87e..3ceab22 100644 (file)
@@ -733,6 +733,7 @@ typedef struct __GLsync *GLsync;
 #define GL_TIMEOUT_IGNORED                               0xFFFFFFFFFFFFFFFFull
 #define GL_VERTEX_ATTRIB_ARRAY_DIVISOR                   0x88FE
 #define GL_ANY_SAMPLES_PASSED                            0x8C2F
+#define GL_TEXTURE_EXTERNAL_OES                          0x8D65
 #define GL_ANY_SAMPLES_PASSED_CONSERVATIVE               0x8D6A
 #define GL_SAMPLER_BINDING                               0x8919
 #define GL_RGB10_A2UI                                    0x906F
index 41af949..feb958d 100644 (file)
@@ -1849,6 +1849,11 @@ fastpath_make_context_current(GLGlueContext *oldctx, GLGlueContext *newctx)
                                CHECK_GL_ERROR(_orig_fastpath_glActiveTexture(GL_TEXTURE0 + i))
                                CHECK_GL_ERROR(_orig_fastpath_glBindTexture(GL_TEXTURE_CUBE_MAP, newctx->gl_tex_cube_state[i]))
                        }
+                       STATE_COMPARE(gl_tex_external_oes_state[i])
+                       {
+                               CHECK_GL_ERROR(_orig_fastpath_glActiveTexture(GL_TEXTURE0 + i))
+                               CHECK_GL_ERROR(_orig_fastpath_glBindTexture(GL_TEXTURE_EXTERNAL_OES, newctx->gl_tex_external_oes_state[i]))
+                       }
                }
 
                // Restore active texture
index 0e0684a..dbc902b 100644 (file)
@@ -269,6 +269,7 @@ typedef struct _GLGlueContext
 #define _TEX_FLAG1_BIT_gl_tex_3d_state           FLAG_BIT_3
 #define _TEX_FLAG1_BIT_gl_tex_2d_array_state     FLAG_BIT_4
 #define _TEX_FLAG1_BIT_gl_tex_cube_state         FLAG_BIT_5
+#define _TEX_FLAG1_BIT_gl_tex_external_oes_state FLAG_BIT_6
 
        unsigned char           _blend_flag;
 #define _BLEND_FLAG_BIT_gl_blend_color           FLAG_BIT_0
index 774214b..ca2ac85 100644 (file)
@@ -526,6 +526,9 @@ fastpath_glBindTexture(GLenum target, GLuint texture)
                case GL_TEXTURE_CUBE_MAP:
                        STATE_PROC(gl_tex_cube_state, _tex_flag1, _TEX_FLAG1_BIT);
                        break;
+               case GL_TEXTURE_EXTERNAL_OES:
+                       STATE_PROC(gl_tex_external_oes_state, _tex_flag1, _TEX_FLAG1_BIT);
+                       break;
                default:
                        _set_gl_error(GL_INVALID_ENUM);
                        break;
@@ -741,6 +744,8 @@ fastpath_glDeleteTextures(GLsizei n, const GLuint* textures)
                                                        cur_gctx->gl_tex_2d_array_state[j] = 0;
                                                if (cur_gctx->gl_tex_cube_state[j] == objid_array[i])
                                                        cur_gctx->gl_tex_cube_state[j] = 0;
+                                               if (cur_gctx->gl_tex_external_oes_state[j] == objid_array[i])
+                                                       cur_gctx->gl_tex_external_oes_state[j] = 0;
                                        }
 
                                        current = current->next;
@@ -4014,6 +4019,9 @@ fastpath_glEGLImageTargetTexture2DOES(GLenum target, GLeglImageOES image)
                case GL_TEXTURE_CUBE_MAP:
                        current_ctx->gl_tex_cube_state[tex_idx] = -1;
                        break;
+               case GL_TEXTURE_EXTERNAL_OES:
+                       current_ctx->gl_tex_external_oes_state[tex_idx] = -1;
+                       break;
                default:
                        _set_gl_error(GL_INVALID_ENUM);
                        goto finish;
index 76fda11..6f2080b 100644 (file)
@@ -114,6 +114,9 @@ GLUE_STATE(GLuint, gl_tex_2d_array_state, INITIAL_CTX->gl_num_tex_units[0], MAX_
 GLUE_STATE(GLuint, gl_tex_cube_state, INITIAL_CTX->gl_num_tex_units[0], MAX_TEXTURE_UNITS,
            SET_N(INITIAL_CTX->gl_num_tex_units[0], 1, SET_1(0)),
            _state_get_texture_states(GL_TEXTURE_BINDING_CUBE_MAP, (GLint *)value);)
+GLUE_STATE(GLuint, gl_tex_external_oes_state, INITIAL_CTX->gl_num_tex_units[0], MAX_TEXTURE_UNITS,
+           SET_N(INITIAL_CTX->gl_num_tex_units[0], 1, SET_1(0)),
+           _state_get_texture_states(GL_TEXTURE_EXTERNAL_OES, (GLint *)value);)
 
 GLUE_STATE(GLenum, gl_active_texture, 1, 1, SET_1(GL_TEXTURE0), _sym_glGetIntegerv(GL_ACTIVE_TEXTURE, (GLint *)value))
 GLUE_STATE(GLenum, gl_generate_mipmap_hint, 1, 1, SET_1(GL_DONT_CARE), _sym_glGetIntegerv(GL_GENERATE_MIPMAP_HINT, (GLint *)value))