From: Brian Paul Date: Fri, 16 Apr 2010 15:49:33 +0000 (-0600) Subject: llvmpipe: check for dirty context state in lp_setup_update_state() X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fae289fcd098027952c6b586292214ec586a2ec;p=mesa.git llvmpipe: check for dirty context state in lp_setup_update_state() This fixes problems with the draw module's aaline, aapoint and pstipple stages where we change some driver state after the call to the draw module's draw_arrays() function. --- diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 97a6b5422bd..ffbc7fc4ea0 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -37,6 +37,7 @@ #include "util/u_memory.h" #include "util/u_pack_color.h" #include "util/u_surface.h" +#include "lp_context.h" #include "lp_scene.h" #include "lp_scene_queue.h" #include "lp_texture.h" @@ -45,6 +46,7 @@ #include "lp_rast.h" #include "lp_setup_context.h" #include "lp_screen.h" +#include "lp_state.h" #include "state_tracker/sw_winsys.h" #include "draw/draw_context.h" @@ -598,6 +600,20 @@ lp_setup_update_state( struct lp_setup_context *setup ) assert(setup->fs.current.jit_function); + /* Some of the 'draw' pipeline stages may have changed some driver state. + * Make sure we've processed those state changes before anything else. + * + * XXX this is the only place where llvmpipe_context is used in the + * setup code. This may get refactored/changed... + */ + { + struct llvmpipe_context *lp = llvmpipe_context(scene->pipe); + if (lp->dirty) { + llvmpipe_update_derived(lp); + } + assert(lp->dirty == 0); + } + if(setup->dirty & LP_SETUP_NEW_BLEND_COLOR) { uint8_t *stored; unsigned i, j;