Lines Matching refs:task
92 lp_rast_tile_begin(struct lp_rasterizer_task *task, in lp_rast_tile_begin() argument
97 struct lp_scene *scene = task->scene; in lp_rast_tile_begin()
101 task->bin = bin; in lp_rast_tile_begin()
102 task->x = x * TILE_SIZE; in lp_rast_tile_begin()
103 task->y = y * TILE_SIZE; in lp_rast_tile_begin()
104 task->width = TILE_SIZE + x * TILE_SIZE > task->scene->fb.width ? in lp_rast_tile_begin()
105 task->scene->fb.width - x * TILE_SIZE : TILE_SIZE; in lp_rast_tile_begin()
106 task->height = TILE_SIZE + y * TILE_SIZE > task->scene->fb.height ? in lp_rast_tile_begin()
107 task->scene->fb.height - y * TILE_SIZE : TILE_SIZE; in lp_rast_tile_begin()
109 task->thread_data.vis_counter = 0; in lp_rast_tile_begin()
110 task->ps_invocations = 0; in lp_rast_tile_begin()
112 for (i = 0; i < task->scene->fb.nr_cbufs; i++) { in lp_rast_tile_begin()
113 if (task->scene->fb.cbufs[i]) { in lp_rast_tile_begin()
114 task->color_tiles[i] = scene->cbufs[i].map + in lp_rast_tile_begin()
115 scene->cbufs[i].stride * task->y + in lp_rast_tile_begin()
116 scene->cbufs[i].format_bytes * task->x; in lp_rast_tile_begin()
119 if (task->scene->fb.zsbuf) { in lp_rast_tile_begin()
120 task->depth_tile = scene->zsbuf.map + in lp_rast_tile_begin()
121 scene->zsbuf.stride * task->y + in lp_rast_tile_begin()
122 scene->zsbuf.format_bytes * task->x; in lp_rast_tile_begin()
133 lp_rast_clear_color(struct lp_rasterizer_task *task, in lp_rast_clear_color() argument
136 const struct lp_scene *scene = task->scene; in lp_rast_clear_color()
160 task->x, in lp_rast_clear_color()
161 task->y, in lp_rast_clear_color()
163 task->width, in lp_rast_clear_color()
164 task->height, in lp_rast_clear_color()
179 lp_rast_clear_zstencil(struct lp_rasterizer_task *task, in lp_rast_clear_zstencil() argument
182 const struct lp_scene *scene = task->scene; in lp_rast_clear_zstencil()
187 const unsigned height = task->height; in lp_rast_clear_zstencil()
188 const unsigned width = task->width; in lp_rast_clear_zstencil()
203 uint8_t *dst_layer = task->depth_tile; in lp_rast_clear_zstencil()
295 lp_rast_shade_tile(struct lp_rasterizer_task *task, in lp_rast_shade_tile() argument
298 const struct lp_scene *scene = task->scene; in lp_rast_shade_tile()
302 const unsigned tile_x = task->x, tile_y = task->y; in lp_rast_shade_tile()
312 state = task->state; in lp_rast_shade_tile()
320 for (y = 0; y < task->height; y += 4){ in lp_rast_shade_tile()
321 for (x = 0; x < task->width; x += 4) { in lp_rast_shade_tile()
332 color[i] = lp_rast_get_color_block_pointer(task, i, tile_x + x, in lp_rast_shade_tile()
343 depth = lp_rast_get_depth_block_pointer(task, tile_x + x, in lp_rast_shade_tile()
349 task->thread_data.raster_state.viewport_index = inputs->viewport_index; in lp_rast_shade_tile()
352 BEGIN_JIT_CALL(state, task); in lp_rast_shade_tile()
362 &task->thread_data, in lp_rast_shade_tile()
377 lp_rast_shade_tile_opaque(struct lp_rasterizer_task *task, in lp_rast_shade_tile_opaque() argument
382 assert(task->state); in lp_rast_shade_tile_opaque()
383 if (!task->state) { in lp_rast_shade_tile_opaque()
387 lp_rast_shade_tile(task, arg); in lp_rast_shade_tile_opaque()
398 lp_rast_shade_quads_mask(struct lp_rasterizer_task *task, in lp_rast_shade_quads_mask() argument
403 const struct lp_rast_state *state = task->state; in lp_rast_shade_quads_mask()
405 const struct lp_scene *scene = task->scene; in lp_rast_shade_quads_mask()
427 color[i] = lp_rast_get_color_block_pointer(task, i, x, y, in lp_rast_shade_quads_mask()
439 depth = lp_rast_get_depth_block_pointer(task, x, y, inputs->layer); in lp_rast_shade_quads_mask()
448 if ((x % TILE_SIZE) < task->width && (y % TILE_SIZE) < task->height) { in lp_rast_shade_quads_mask()
451 task->ps_invocations += 1 * variant->ps_inv_multiplier; in lp_rast_shade_quads_mask()
454 task->thread_data.raster_state.viewport_index = inputs->viewport_index; in lp_rast_shade_quads_mask()
457 BEGIN_JIT_CALL(state, task); in lp_rast_shade_quads_mask()
467 &task->thread_data, in lp_rast_shade_quads_mask()
482 lp_rast_begin_query(struct lp_rasterizer_task *task, in lp_rast_begin_query() argument
491 pq->start[task->thread_index] = task->thread_data.vis_counter; in lp_rast_begin_query()
494 pq->start[task->thread_index] = task->ps_invocations; in lp_rast_begin_query()
509 lp_rast_end_query(struct lp_rasterizer_task *task, in lp_rast_end_query() argument
518 pq->end[task->thread_index] += in lp_rast_end_query()
519 task->thread_data.vis_counter - pq->start[task->thread_index]; in lp_rast_end_query()
520 pq->start[task->thread_index] = 0; in lp_rast_end_query()
523 pq->end[task->thread_index] = os_time_get_nano(); in lp_rast_end_query()
526 pq->end[task->thread_index] += in lp_rast_end_query()
527 task->ps_invocations - pq->start[task->thread_index]; in lp_rast_end_query()
528 pq->start[task->thread_index] = 0; in lp_rast_end_query()
538 lp_rast_set_state(struct lp_rasterizer_task *task, in lp_rast_set_state() argument
541 task->state = arg.state; in lp_rast_set_state()
550 lp_rast_tile_end(struct lp_rasterizer_task *task) in lp_rast_tile_end() argument
554 for (i = 0; i < task->scene->num_active_queries; ++i) { in lp_rast_tile_end()
555 lp_rast_end_query(task, lp_rast_arg_query(task->scene->active_queries[i])); in lp_rast_tile_end()
559 memset(task->color_tiles, 0, sizeof(task->color_tiles)); in lp_rast_tile_end()
560 task->depth_tile = NULL; in lp_rast_tile_end()
562 task->bin = NULL; in lp_rast_tile_end()
600 do_rasterize_bin(struct lp_rasterizer_task *task, in do_rasterize_bin() argument
612 dispatch[block->cmd[k]]( task, block->arg[k] ); in do_rasterize_bin()
626 rasterize_bin(struct lp_rasterizer_task *task, in rasterize_bin() argument
629 lp_rast_tile_begin( task, bin, x, y ); in rasterize_bin()
631 do_rasterize_bin(task, bin, x, y); in rasterize_bin()
633 lp_rast_tile_end(task); in rasterize_bin()
666 rasterize_scene(struct lp_rasterizer_task *task, in rasterize_scene() argument
669 task->scene = scene; in rasterize_scene()
674 memset(task->thread_data.cache->cache_tags, 0, in rasterize_scene()
675 sizeof(task->thread_data.cache->cache_tags)); in rasterize_scene()
677 task->thread_data.cache->cache_access_total = 0; in rasterize_scene()
678 task->thread_data.cache->cache_access_miss = 0; in rasterize_scene()
682 if (!task->rast->no_rast && !scene->discard) { in rasterize_scene()
691 rasterize_bin(task, bin, i, j); in rasterize_scene()
700 total = task->thread_data.cache->cache_access_total; in rasterize_scene()
701 miss = task->thread_data.cache->cache_access_miss; in rasterize_scene()
704 task->thread_index, (long long unsigned)total, in rasterize_scene()
715 task->scene = NULL; in rasterize_scene()
790 struct lp_rasterizer_task *task = (struct lp_rasterizer_task *) init_data; in thread_function() local
791 struct lp_rasterizer *rast = task->rast; in thread_function()
796 util_snprintf(thread_name, sizeof thread_name, "llvmpipe-%u", task->thread_index); in thread_function()
808 debug_printf("thread %d waiting for work\n", task->thread_index); in thread_function()
809 pipe_semaphore_wait(&task->work_ready); in thread_function()
814 if (task->thread_index == 0) { in thread_function()
830 debug_printf("thread %d doing work\n", task->thread_index); in thread_function()
832 rasterize_scene(task, in thread_function()
840 if (task->thread_index == 0) { in thread_function()
846 debug_printf("thread %d done working\n", task->thread_index); in thread_function()
848 pipe_semaphore_signal(&task->work_done); in thread_function()
852 pipe_semaphore_signal(&task->work_done); in thread_function()
900 struct lp_rasterizer_task *task = &rast->tasks[i]; in lp_rast_create() local
901 task->rast = rast; in lp_rast_create()
902 task->thread_index = i; in lp_rast_create()
903 task->thread_data.cache = align_malloc(sizeof(struct lp_build_format_cache), in lp_rast_create()
905 if (!task->thread_data.cache) { in lp_rast_create()