diff options
author | Dave Airlie <airlied@redhat.com> | 2009-03-20 10:52:17 +1000 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-03-20 10:52:17 +1000 |
commit | 407e8ae5b167b0193e1e5b1266a5d61ed836dfb5 (patch) | |
tree | 2d9d05a5c3122f41a13aa8bd9ae921c1176e6b0d /src/mesa/state_tracker/st_context.c | |
parent | bdaa0341caffc353fd26bbd91865c2d86eed11c1 (diff) | |
parent | 114bb54324f22cb53bcd14607234d0acd74d37bd (diff) |
Merge remote branch 'main/master' into radeon-rewrite
Conflicts:
src/mesa/drivers/dri/r300/r300_cmdbuf.c
src/mesa/drivers/dri/r300/r300_state.c
src/mesa/drivers/dri/r300/r300_swtcl.c
src/mesa/drivers/dri/r300/radeon_ioctl.c
src/mesa/drivers/dri/radeon/radeon_screen.c
Diffstat (limited to 'src/mesa/state_tracker/st_context.c')
-rw-r--r-- | src/mesa/state_tracker/st_context.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/mesa/state_tracker/st_context.c b/src/mesa/state_tracker/st_context.c index e584a6ceea..b27274725f 100644 --- a/src/mesa/state_tracker/st_context.c +++ b/src/mesa/state_tracker/st_context.c @@ -31,6 +31,7 @@ #include "main/matrix.h" #include "main/buffers.h" #include "main/scissor.h" +#include "main/viewport.h" #include "vbo/vbo.h" #include "shader/shader_api.h" #include "glapi/glapi.h" @@ -59,13 +60,13 @@ #include "st_cb_texture.h" #include "st_cb_flush.h" #include "st_cb_strings.h" +#include "st_cb_viewport.h" #include "st_atom.h" #include "st_draw.h" #include "st_extensions.h" #include "st_gen_mipmap.h" #include "st_program.h" #include "pipe/p_context.h" -#include "pipe/p_inlines.h" #include "draw/draw_context.h" #include "cso_cache/cso_cache.h" #include "cso_cache/cso_context.h" @@ -105,7 +106,7 @@ static struct st_context * st_create_context_priv( GLcontext *ctx, struct pipe_context *pipe ) { uint i; - struct st_context *st = CALLOC_STRUCT( st_context ); + struct st_context *st = ST_CALLOC_STRUCT( st_context ); ctx->st = st; @@ -208,7 +209,7 @@ static void st_destroy_context_priv( struct st_context *st ) for (i = 0; i < Elements(st->state.constants); i++) { if (st->state.constants[i].buffer) { - pipe_buffer_reference(st->pipe->screen, &st->state.constants[i].buffer, NULL); + pipe_buffer_reference(&st->state.constants[i].buffer, NULL); } } @@ -217,7 +218,7 @@ static void st_destroy_context_priv( struct st_context *st ) st->default_texture = NULL; } - free( st ); + _mesa_free( st ); } @@ -245,7 +246,7 @@ void st_destroy_context( struct st_context *st ) pipe->destroy( pipe ); - free(ctx); + _mesa_free(ctx); } @@ -253,6 +254,11 @@ void st_make_current(struct st_context *st, struct st_framebuffer *draw, struct st_framebuffer *read) { + /* Call this periodically to detect when the user has begun using + * GL rendering from multiple threads. + */ + _glapi_check_multithread(); + if (st) { GLboolean firstTime = st->ctx->FirstTimeCurrent; _mesa_make_current(st->ctx, &draw->Base, &read->Base); @@ -320,6 +326,7 @@ void st_init_driver_functions(struct dd_function_table *functions) st_init_texture_functions(functions); st_init_flush_functions(functions); st_init_string_functions(functions); + st_init_viewport_functions(functions); functions->UpdateState = st_invalidate_state; } |