diff options
author | Kristian Høgsberg <[email protected]> | 2010-02-11 17:42:30 -0500 |
---|---|---|
committer | Kristian Høgsberg <[email protected]> | 2010-02-24 13:38:56 -0500 |
commit | d1dc5b124e133379be5bb57b68733c09c0e04f71 (patch) | |
tree | a6e8c1c0ddad297a8996fcbeab53e90bd90da82c /src/mesa/main/teximage.c | |
parent | 07b07b4d723394c82f7ba915c1cba620b307013d (diff) |
core: Implement GL_OES_EGL_image entry points
Diffstat (limited to 'src/mesa/main/teximage.c')
-rw-r--r-- | src/mesa/main/teximage.c | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c index 00329c755d5..40ebff76c6e 100644 --- a/src/mesa/main/teximage.c +++ b/src/mesa/main/teximage.c @@ -2448,6 +2448,47 @@ _mesa_TexImage3DEXT( GLenum target, GLint level, GLenum internalFormat, } +#if FEATURE_OES_EGL_image +void GLAPIENTRY +_mesa_EGLImageTargetTexture2DOES (GLenum target, GLeglImageOES image) +{ + GET_CURRENT_CONTEXT(ctx); + ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx); + struct gl_texture_object *texObj; + struct gl_texture_image *texImage; + + if (target != GL_TEXTURE_2D) { + _mesa_error(ctx, GL_INVALID_ENUM, + "glEGLImageTargetTexture2D(target=%d)", target); + return; + } + + if (ctx->NewState & _MESA_NEW_TRANSFER_STATE) + _mesa_update_state(ctx); + + texObj = _mesa_get_current_tex_object(ctx, target); + _mesa_lock_texture(ctx, texObj); + + texImage = _mesa_get_tex_image(ctx, texObj, target, 0); + if (!texImage) { + _mesa_error(ctx, GL_OUT_OF_MEMORY, "glEGLImageTargetTexture2D"); + } else { + if (texImage->Data) + ctx->Driver.FreeTexImageData( ctx, texImage ); + + ASSERT(texImage->Data == NULL); + ctx->Driver.EGLImageTargetTexture2D(ctx, target, + texObj, texImage, image); + + /* state update */ + texObj->_Complete = GL_FALSE; + ctx->NewState |= _NEW_TEXTURE; + } + _mesa_unlock_texture(ctx, texObj); + +} +#endif + void GLAPIENTRY _mesa_TexSubImage1D( GLenum target, GLint level, |