Mesa (master): st: Add an st_get_current() function.

Thomas Hellstrom thomash at kemper.freedesktop.org
Tue Apr 28 12:26:27 UTC 2009


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

Author: Thomas Hellstrom <thellstrom-at-vmware-dot-com>
Date:   Tue Apr 28 14:12:39 2009 +0200

st: Add an st_get_current() function.

Signed-off-by: Thomas Hellstrom <thellstrom-at-vmware-dot-com>

---

 src/mesa/state_tracker/st_context.c |    6 ++++++
 src/mesa/state_tracker/st_public.h  |    2 ++
 2 files changed, 8 insertions(+), 0 deletions(-)

diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c
index b272747..92a630e 100644
--- a/src/mesa/state_tracker/st_context.c
+++ b/src/mesa/state_tracker/st_context.c
@@ -279,6 +279,12 @@ void st_make_current(struct st_context *st,
    }
 }
 
+struct st_context *st_get_current(void)
+{
+   GET_CURRENT_CONTEXT(ctx);
+
+   return (ctx == NULL) ? NULL : ctx->st;
+}
 
 void st_copy_context_state(struct st_context *dst,
                            struct st_context *src,
diff --git a/src/mesa/state_tracker/st_public.h b/src/mesa/state_tracker/st_public.h
index 0303143..290b8a9 100644
--- a/src/mesa/state_tracker/st_public.h
+++ b/src/mesa/state_tracker/st_public.h
@@ -95,6 +95,8 @@ void st_make_current(struct st_context *st,
                      struct st_framebuffer *draw,
                      struct st_framebuffer *read);
 
+struct st_context *st_get_current(void);
+
 void st_flush( struct st_context *st, uint pipeFlushFlags,
                struct pipe_fence_handle **fence );
 void st_finish( struct st_context *st );




More information about the mesa-commit mailing list