From: Thomas Hellstrom Date: Tue, 28 Apr 2009 12:12:39 +0000 (+0200) Subject: st: Add an st_get_current() function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3d2bba0d10d59a9c2d6d09c5dc3fabe148d5e0d7;p=mesa.git st: Add an st_get_current() function. Signed-off-by: Thomas Hellstrom --- diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index b27274725fc..92a630eff97 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 030314372f9..290b8a974e6 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 );