From e2f46344560f8f1193b311ad41883011e67eea00 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 3 Dec 2009 16:05:12 -0700 Subject: [PATCH] llvmpipe: checkpoint some initial state binning code --- src/gallium/drivers/llvmpipe/lp_rast.c | 2 ++ src/gallium/drivers/llvmpipe/lp_setup.c | 16 +++++++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/src/gallium/drivers/llvmpipe/lp_rast.c b/src/gallium/drivers/llvmpipe/lp_rast.c index 2d31977..d5fe6e9 100644 --- a/src/gallium/drivers/llvmpipe/lp_rast.c +++ b/src/gallium/drivers/llvmpipe/lp_rast.c @@ -235,6 +235,8 @@ void lp_rast_load_zstencil( struct lp_rasterizer *rast, void lp_rast_set_state( struct lp_rasterizer *rast, const union lp_rast_cmd_arg arg ) { + const struct lp_rast_state *state = arg.set_state; + RAST_DEBUG("%s\n", __FUNCTION__); /* XXX to do */ diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 142fec4..36bd0ad 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -594,14 +594,24 @@ lp_setup_update_shader_state( struct setup_context *setup ) memcmp(setup->fs.stored, &setup->fs.current, sizeof setup->fs.current) != 0) { - struct lp_rast_state *stored; - - stored = get_data(&setup->data, sizeof *stored); + /* The fs state that's been stored in the bins is different from + * the new, current state. So allocate a new lp_rast_state object + * and append it to the bin's setup data buffer. + */ + struct lp_rast_state *stored = + (struct lp_rast_state *) get_data(&setup->data, sizeof *stored); if(stored) { memcpy(stored, &setup->fs.current, sizeof setup->fs.current); setup->fs.stored = stored; + +#if 0 + /* put the state-set command into all bins */ + bin_everywhere( setup, + lp_rast_set_state, + *setup->fs.stored ); +#endif } } } -- 2.7.4