diff options
author | Brian Paul <[email protected]> | 2009-12-04 10:41:38 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-04 10:41:42 -0700 |
commit | 9dca0100489c7a7c02af77da42a39dbe1560d7e2 (patch) | |
tree | 01305cc4c1257a13a9f31ccbacd9f5392f35a029 | |
parent | 1796ffd3bcf74a94c800717e77abaf9902c50b4d (diff) |
llvmpipe: struct cmd_bin
Just introducing a new structure to represent a per-tile bin.
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup.c | 11 | ||||
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_context.h | 19 |
2 files changed, 21 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup.c b/src/gallium/drivers/llvmpipe/lp_setup.c index 1f303d7705e..fc7f4f6778e 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup.c +++ b/src/gallium/drivers/llvmpipe/lp_setup.c @@ -111,7 +111,7 @@ static void reset_context( struct setup_context *setup ) */ for (i = 0; i < setup->tiles_x; i++) { for (j = 0; j < setup->tiles_y; j++) { - struct cmd_block_list *list = &setup->tile[i][j]; + struct cmd_block_list *list = &setup->tile[i][j].commands; struct cmd_block *block; struct cmd_block *tmp; @@ -173,9 +173,10 @@ static void bin_everywhere( struct setup_context *setup, /** Rasterize commands for a single bin */ static void rasterize_bin( struct lp_rasterizer *rast, - struct cmd_block_list *commands, + const struct cmd_bin *bin, int x, int y) { + const struct cmd_block_list *commands = &bin->commands; struct cmd_block *block; unsigned k; @@ -666,7 +667,7 @@ lp_setup_destroy( struct setup_context *setup ) for (i = 0; i < TILES_X; i++) for (j = 0; j < TILES_Y; j++) - FREE(setup->tile[i][j].head); + FREE(setup->tile[i][j].commands.head); FREE(setup->data.head); @@ -691,8 +692,8 @@ lp_setup_create( struct pipe_screen *screen ) for (i = 0; i < TILES_X; i++) for (j = 0; j < TILES_Y; j++) - setup->tile[i][j].head = - setup->tile[i][j].tail = CALLOC_STRUCT(cmd_block); + setup->tile[i][j].commands.head = + setup->tile[i][j].commands.tail = CALLOC_STRUCT(cmd_block); setup->data.head = setup->data.tail = CALLOC_STRUCT(data_block); diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h index b502f00eea4..1715048f760 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_context.h +++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h @@ -71,11 +71,20 @@ struct cmd_block_list { struct cmd_block *tail; }; +/** + * For each screen tile we have one of these bins. + */ +struct cmd_bin { + struct cmd_block_list commands; + struct lp_rast_state *curr_state; +}; + + struct data_block_list { struct data_block *head; struct data_block *tail; }; - + /** * Point/line/triangle setup context. @@ -87,12 +96,12 @@ struct setup_context { struct lp_rasterizer *rast; /** - * Per-bin data goes into the 'tile' cmd_block_lists. + * Per-bin data goes into the 'tile' bins. * Shared bin data goes into the 'data' buffer. * When there are multiple threads, will want to double-buffer the * bin arrays: */ - struct cmd_block_list tile[TILES_X][TILES_Y]; + struct cmd_bin tile[TILES_X][TILES_Y]; struct data_block_list data; /* size of framebuffer, in tiles */ @@ -212,10 +221,12 @@ static INLINE void *get_data_aligned( struct data_block_list *list, /* Add a command to a given bin. */ -static INLINE void bin_command( struct cmd_block_list *list, +static INLINE void bin_command( struct cmd_bin *bin, lp_rast_cmd cmd, union lp_rast_cmd_arg arg ) { + struct cmd_block_list *list = &bin->commands; + if (list->tail->count == CMD_BLOCK_MAX) { lp_setup_new_cmd_block( list ); } |