diff options
author | Roland Scheidegger <[email protected]> | 2010-07-13 19:58:58 +0200 |
---|---|---|
committer | Roland Scheidegger <[email protected]> | 2010-07-13 19:58:58 +0200 |
commit | edac740095fb2514b512034b334947f72648cd51 (patch) | |
tree | 48dc86b5bfd49bfdcc5343755c3f970eb5f6a847 /src/gallium/drivers/llvmpipe/lp_screen.c | |
parent | 962da13ba30d66bd8b9a28ba5f06c66ceec1ce92 (diff) |
llvmpipe: move rasterizer to screen instead of setup context
there's no point of having this per context, so move to screen
(and protect with a mutex).
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_screen.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_screen.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_screen.c b/src/gallium/drivers/llvmpipe/lp_screen.c index e151782ceac..f7f1635ef96 100644 --- a/src/gallium/drivers/llvmpipe/lp_screen.c +++ b/src/gallium/drivers/llvmpipe/lp_screen.c @@ -43,6 +43,7 @@ #include "lp_debug.h" #include "lp_public.h" #include "lp_limits.h" +#include "lp_rast.h" #include "state_tracker/sw_winsys.h" @@ -296,11 +297,16 @@ llvmpipe_destroy_screen( struct pipe_screen *_screen ) struct llvmpipe_screen *screen = llvmpipe_screen(_screen); struct sw_winsys *winsys = screen->winsys; + if (screen->rast) + lp_rast_destroy(screen->rast); + lp_jit_screen_cleanup(screen); if(winsys->destroy) winsys->destroy(winsys); + pipe_mutex_destroy(screen->rast_mutex); + FREE(screen); } @@ -357,6 +363,14 @@ llvmpipe_create_screen(struct sw_winsys *winsys) screen->num_threads = debug_get_num_option("LP_NUM_THREADS", screen->num_threads); screen->num_threads = MIN2(screen->num_threads, LP_MAX_THREADS); + screen->rast = lp_rast_create(screen->num_threads); + if (!screen->rast) { + lp_jit_screen_cleanup(screen); + FREE(screen); + return NULL; + } + pipe_mutex_init(screen->rast_mutex); + util_format_s3tc_init(); return &screen->base; |