summaryrefslogtreecommitdiffstats
path: root/src/mesa/state_tracker/st_manager.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2010-02-25 23:10:47 +0800
committerChia-I Wu <[email protected]>2010-04-04 21:58:32 +0800
commita1aa53b2a934ca026bb115aca18a46fd920f9e8d (patch)
tree8a2f4e62b29529d2e3a50d85346e3dd2d0e085e0 /src/mesa/state_tracker/st_manager.c
parent776dc53f62c46e235ff8ef2e1eec1a308a036987 (diff)
st/mesa: Implement GL_OES_EGL_image driver hooks.
Use st_manager::get_egl_image to look up GLeglImageOES and implement EGLImageTargetTexture2D and EGLImageTargetRenderbufferStorage.
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
-rw-r--r--src/mesa/state_tracker/st_manager.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index cac62e4a14c..696d8aa7922 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -721,6 +721,34 @@ st_manager_flush_frontbuffer(struct st_context *st)
}
/**
+ * Return the surface of an EGLImage.
+ */
+struct pipe_surface *
+st_manager_get_egl_image_surface(struct st_context *st,
+ void *eglimg, unsigned usage)
+{
+ struct st_manager *smapi =
+ (struct st_manager *) st->iface.st_context_private;
+ struct st_egl_image stimg;
+ struct pipe_surface *ps;
+
+ if (!smapi || !smapi->get_egl_image)
+ return NULL;
+
+ memset(&stimg, 0, sizeof(stimg));
+ stimg.stctxi = &st->iface;
+ stimg.egl_image = eglimg;
+ if (!smapi->get_egl_image(smapi, &stimg))
+ return NULL;
+
+ ps = smapi->screen->get_tex_surface(smapi->screen,
+ stimg.texture, stimg.face, stimg.level, stimg.zslice, usage);
+ pipe_texture_reference(&stimg.texture, NULL);
+
+ return ps;
+}
+
+/**
* Re-validate the framebuffers.
*/
void