Mesa (master): gallium: Add st_context_iface::share to st_api.

Chia-I Wu olv at kemper.freedesktop.org
Thu Nov 18 03:57:31 UTC 2010


Module: Mesa
Branch: master
Commit: 4f38dcd97410d0a58be19cb5c6dfbee51a3b7561
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=4f38dcd97410d0a58be19cb5c6dfbee51a3b7561

Author: Chia-I Wu <olv at lunarg.com>
Date:   Thu Nov 11 00:09:09 2010 +0800

gallium: Add st_context_iface::share to st_api.

It will be used to implement wglShareLists.  Fill st_context_iface::copy
for glXCopyContext as well.

---

 src/gallium/include/state_tracker/st_api.h |    6 ++++++
 src/mesa/state_tracker/st_manager.c        |   23 ++++++++++++++++++++++-
 2 files changed, 28 insertions(+), 1 deletions(-)

diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index c73a53d..565a096 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -349,6 +349,12 @@ struct st_context_iface
                 struct st_context_iface *stsrci, unsigned mask);
 
    /**
+    * Used to implement wglShareLists.
+    */
+   boolean (*share)(struct st_context_iface *stctxi,
+                    struct st_context_iface *stsrci);
+
+   /**
     * Look up and return the info of a resource for EGLImage.
     *
     * This function is optional.
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index 35b59de..15e7b89 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -611,6 +611,26 @@ st_context_teximage(struct st_context_iface *stctxi, enum st_texture_type target
 }
 
 static void
+st_context_copy(struct st_context_iface *stctxi,
+                struct st_context_iface *stsrci, unsigned mask)
+{
+   struct st_context *st = (struct st_context *) stctxi;
+   struct st_context *src = (struct st_context *) stsrci;
+
+   _mesa_copy_context(src->ctx, st->ctx, mask);
+}
+
+static boolean
+st_context_share(struct st_context_iface *stctxi,
+                 struct st_context_iface *stsrci)
+{
+   struct st_context *st = (struct st_context *) stctxi;
+   struct st_context *src = (struct st_context *) stsrci;
+
+   return _mesa_share_state(st->ctx, src->ctx);
+}
+
+static void
 st_context_destroy(struct st_context_iface *stctxi)
 {
    struct st_context *st = (struct st_context *) stctxi;
@@ -677,7 +697,8 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
       st_context_notify_invalid_framebuffer;
    st->iface.flush = st_context_flush;
    st->iface.teximage = st_context_teximage;
-   st->iface.copy = NULL;
+   st->iface.copy = st_context_copy;
+   st->iface.share = st_context_share;
    st->iface.st_context_private = (void *) smapi;
 
    return &st->iface;




More information about the mesa-commit mailing list