diff options
author | Brian Paul <[email protected]> | 2009-12-04 15:59:25 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2009-12-04 15:59:25 -0700 |
commit | 8a23105fa016ec4368f407ca64e7763f110da4e5 (patch) | |
tree | 33f40653b67ab101fec1224f1c5397b0b55da2c7 /src/gallium/drivers/llvmpipe/lp_bin.h | |
parent | 2c8d5c66ce2ddc0b7182e4844690736fc4c47212 (diff) |
llvmpipe: still more bin code reorganization
Move tiles_x,y fields from setup state into bin state.
Move more bin-adding commands into lp_bin.[ch].
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_bin.h')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_bin.h | 32 |
1 files changed, 31 insertions, 1 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_bin.h b/src/gallium/drivers/llvmpipe/lp_bin.h index 4d12b932745..fcbb975ad64 100644 --- a/src/gallium/drivers/llvmpipe/lp_bin.h +++ b/src/gallium/drivers/llvmpipe/lp_bin.h @@ -104,16 +104,26 @@ struct data_block_list { struct lp_bins { struct cmd_bin tile[TILES_X][TILES_Y]; struct data_block_list data; + + /** + * Number of active tiles in each dimension. + * This basically the framebuffer size divided by tile size + */ + unsigned tiles_x, tiles_y; }; void lp_init_bins(struct lp_bins *bins); -void lp_reset_bins(struct lp_bins *bins, unsigned tiles_x, unsigned tiles_y); +void lp_reset_bins(struct lp_bins *bins ); void lp_free_bin_data(struct lp_bins *bins); +void +lp_bin_set_num_bins( struct lp_bins *bins, + unsigned tiles_x, unsigned tiles_y ); + void lp_bin_new_data_block( struct data_block_list *list ); void lp_bin_new_cmd_block( struct cmd_block_list *list ); @@ -209,4 +219,24 @@ lp_bin_command( struct lp_bins *bins, } +/* Add a command to all active bins. + */ +static INLINE void +lp_bin_everywhere( struct lp_bins *bins, + lp_rast_cmd cmd, + const union lp_rast_cmd_arg arg ) +{ + unsigned i, j; + for (i = 0; i < bins->tiles_x; i++) + for (j = 0; j < bins->tiles_y; j++) + lp_bin_command( bins, i, j, cmd, arg ); +} + + +void +lp_bin_state_command( struct lp_bins *bins, + lp_rast_cmd cmd, + const union lp_rast_cmd_arg arg ); + + #endif /* LP_BIN_H */ |