diff options
author | Keith Whitwell <[email protected]> | 2009-10-08 17:52:35 +0100 |
---|---|---|
committer | Keith Whitwell <[email protected]> | 2009-10-08 17:53:12 +0100 |
commit | 1caa26202c3bcc41ea5829b646128088e14d5dfd (patch) | |
tree | 04e7b808a06e3033138b59ec33ed03a164442da4 /src/gallium/drivers/llvmpipe/lp_setup_context.h | |
parent | d0c918b87a9fb0e86d6b3efedf3ef505e04c527f (diff) |
llvmpipe: start cleaning up
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_setup_context.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_setup_context.h | 26 |
1 files changed, 17 insertions, 9 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_setup_context.h b/src/gallium/drivers/llvmpipe/lp_setup_context.h index eeee7159d93..19d163df8e5 100644 --- a/src/gallium/drivers/llvmpipe/lp_setup_context.h +++ b/src/gallium/drivers/llvmpipe/lp_setup_context.h @@ -28,23 +28,25 @@ #ifndef LP_SETUP_CONTEXT_H #define LP_SETUP_CONTEXT_H +#include "lp_setup.h" +#include "lp_rast.h" #define CMD_BLOCK_MAX 128 #define DATA_BLOCK_SIZE (16 * 1024 - sizeof(unsigned) - sizeof(void *)) /* switch to a non-pointer value for this: */ -typedef void (*lp_rast_cmd)( struct lp_rast *, const union lp_rast_cmd_arg * ); +typedef void (*lp_rast_cmd)( struct lp_rasterizer *, const union lp_rast_cmd_arg * ); struct cmd_block { - union lp_rast_arg *arg[CMD_BLOCK_MAX]; lp_rast_cmd cmd[CMD_BLOCK_MAX]; + const union lp_rast_cmd_arg *arg[CMD_BLOCK_MAX]; unsigned count; struct cmd_block *next; }; struct data_block { - ubyte data[DATA_BLOCK_SZ]; + ubyte data[DATA_BLOCK_SIZE]; unsigned used; struct data_block *next; }; @@ -68,10 +70,12 @@ struct data_block_list { struct setup_context { + struct lp_rasterizer *rast; + /* When there are multiple threads, will want to double-buffer the * bin arrays: */ - struct cmd_block_list bin[MAXHEIGHT / TILESIZE][MAXWIDTH / TILESIZE]; + struct cmd_block_list tile[MAXHEIGHT / TILESIZE][MAXWIDTH / TILESIZE]; struct data_block_list data; unsigned tiles_x; @@ -110,9 +114,12 @@ struct setup_context { void (*triangle)( struct setup_context *, const float (*v0)[4], const float (*v1)[4], - const float (*v1)[4]); + const float (*v2)[4]); }; +void lp_setup_new_data_block( struct data_block_list *list ); +void lp_setup_new_cmd_block( struct cmd_block_list *list ); + static INLINE void *get_data( struct data_block_list *list, unsigned size) { @@ -123,7 +130,7 @@ static INLINE void *get_data( struct data_block_list *list, { struct data_block *tail = list->tail; - char *data = tail->data + tail->used; + ubyte *data = tail->data + tail->used; tail->used += size; return data; } @@ -132,11 +139,11 @@ static INLINE void *get_data( struct data_block_list *list, /* Add a command to a given bin. */ static INLINE void bin_cmd( struct cmd_block_list *list, - bin_cmd cmd, + lp_rast_cmd cmd, const union lp_rast_cmd_arg *arg ) { - if (list->tail.count == CMD_BLOCK_MAX) { - lp_setup_new_cmd_block( list ) + if (list->tail->count == CMD_BLOCK_MAX) { + lp_setup_new_cmd_block( list ); } { @@ -150,3 +157,4 @@ static INLINE void bin_cmd( struct cmd_block_list *list, +#endif |