mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 11:18:08 +02:00
llvmpipe: minor refactoring of bin rasterization code
This commit is contained in:
parent
bfa1a766d6
commit
7d042ac2a2
1 changed files with 28 additions and 16 deletions
|
|
@ -170,13 +170,35 @@ 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,
|
||||||
|
int x, int y)
|
||||||
|
{
|
||||||
|
struct cmd_block *block;
|
||||||
|
unsigned k;
|
||||||
|
|
||||||
|
lp_rast_start_tile( rast, x, y );
|
||||||
|
|
||||||
|
/* simply execute each of the commands in the block list */
|
||||||
|
for (block = commands->head; block; block = block->next) {
|
||||||
|
for (k = 0; k < block->count; k++) {
|
||||||
|
block->cmd[k]( rast, block->arg[k] );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
lp_rast_end_tile( rast );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/** Rasterize all tile's bins */
|
||||||
static void
|
static void
|
||||||
rasterize_bins( struct setup_context *setup,
|
rasterize_bins( struct setup_context *setup,
|
||||||
boolean write_depth )
|
boolean write_depth )
|
||||||
{
|
{
|
||||||
struct lp_rasterizer *rast = setup->rast;
|
struct lp_rasterizer *rast = setup->rast;
|
||||||
struct cmd_block *block;
|
unsigned i, j;
|
||||||
unsigned i,j,k;
|
|
||||||
|
|
||||||
SETUP_DEBUG("%s\n", __FUNCTION__);
|
SETUP_DEBUG("%s\n", __FUNCTION__);
|
||||||
|
|
||||||
|
|
@ -188,22 +210,12 @@ rasterize_bins( struct setup_context *setup,
|
||||||
setup->fb.width,
|
setup->fb.width,
|
||||||
setup->fb.height );
|
setup->fb.height );
|
||||||
|
|
||||||
|
/* loop over tile bins, rasterize each */
|
||||||
|
|
||||||
for (i = 0; i < setup->tiles_x; i++) {
|
for (i = 0; i < setup->tiles_x; i++) {
|
||||||
for (j = 0; j < setup->tiles_y; j++) {
|
for (j = 0; j < setup->tiles_y; j++) {
|
||||||
|
rasterize_bin( rast, &setup->tile[i][j],
|
||||||
lp_rast_start_tile( rast,
|
i * TILE_SIZE,
|
||||||
i * TILE_SIZE,
|
j * TILE_SIZE );
|
||||||
j * TILE_SIZE );
|
|
||||||
|
|
||||||
for (block = setup->tile[i][j].head; block; block = block->next) {
|
|
||||||
for (k = 0; k < block->count; k++) {
|
|
||||||
block->cmd[k]( rast, block->arg[k] );
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
lp_rast_end_tile( rast );
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue