*/
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;
/** 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;
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);
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);
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.
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 */
/* 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 );
}