Lines Matching refs:rast

65 lp_rast_begin( struct lp_rasterizer *rast,  in lp_rast_begin()  argument
68 rast->curr_scene = scene; in lp_rast_begin()
78 lp_rast_end( struct lp_rasterizer *rast ) in lp_rast_end() argument
80 lp_scene_end_rasterization( rast->curr_scene ); in lp_rast_end()
82 rast->curr_scene = NULL; in lp_rast_end()
682 if (!task->rast->no_rast && !scene->discard) { in rasterize_scene()
723 lp_rast_queue_scene( struct lp_rasterizer *rast, in lp_rast_queue_scene() argument
728 if (rast->num_threads == 0) { in lp_rast_queue_scene()
737 lp_rast_begin( rast, scene ); in lp_rast_queue_scene()
739 rasterize_scene( &rast->tasks[0], scene ); in lp_rast_queue_scene()
741 lp_rast_end( rast ); in lp_rast_queue_scene()
745 rast->curr_scene = NULL; in lp_rast_queue_scene()
751 lp_scene_enqueue( rast->full_scenes, scene ); in lp_rast_queue_scene()
754 for (i = 0; i < rast->num_threads; i++) { in lp_rast_queue_scene()
755 pipe_semaphore_signal(&rast->tasks[i].work_ready); in lp_rast_queue_scene()
764 lp_rast_finish( struct lp_rasterizer *rast ) in lp_rast_finish() argument
766 if (rast->num_threads == 0) { in lp_rast_finish()
773 for (i = 0; i < rast->num_threads; i++) { in lp_rast_finish()
774 pipe_semaphore_wait(&rast->tasks[i].work_done); in lp_rast_finish()
791 struct lp_rasterizer *rast = task->rast; in thread_function() local
811 if (rast->exit_flag) in thread_function()
819 lp_rast_begin( rast, in thread_function()
820 lp_scene_dequeue( rast->full_scenes, TRUE ) ); in thread_function()
826 util_barrier_wait( &rast->barrier ); in thread_function()
833 rast->curr_scene); in thread_function()
836 util_barrier_wait( &rast->barrier ); in thread_function()
841 lp_rast_end( rast ); in thread_function()
863 create_rast_threads(struct lp_rasterizer *rast) in create_rast_threads() argument
868 for (i = 0; i < rast->num_threads; i++) { in create_rast_threads()
869 pipe_semaphore_init(&rast->tasks[i].work_ready, 0); in create_rast_threads()
870 pipe_semaphore_init(&rast->tasks[i].work_done, 0); in create_rast_threads()
871 rast->threads[i] = u_thread_create(thread_function, in create_rast_threads()
872 (void *) &rast->tasks[i]); in create_rast_threads()
886 struct lp_rasterizer *rast; in lp_rast_create() local
889 rast = CALLOC_STRUCT(lp_rasterizer); in lp_rast_create()
890 if (!rast) { in lp_rast_create()
894 rast->full_scenes = lp_scene_queue_create(); in lp_rast_create()
895 if (!rast->full_scenes) { in lp_rast_create()
900 struct lp_rasterizer_task *task = &rast->tasks[i]; in lp_rast_create()
901 task->rast = rast; in lp_rast_create()
910 rast->num_threads = num_threads; in lp_rast_create()
912 rast->no_rast = debug_get_bool_option("LP_NO_RAST", FALSE); in lp_rast_create()
914 create_rast_threads(rast); in lp_rast_create()
917 if (rast->num_threads > 0) { in lp_rast_create()
918 util_barrier_init( &rast->barrier, rast->num_threads ); in lp_rast_create()
923 return rast; in lp_rast_create()
926 for (i = 0; i < MAX2(1, rast->num_threads); i++) { in lp_rast_create()
927 if (rast->tasks[i].thread_data.cache) { in lp_rast_create()
928 align_free(rast->tasks[i].thread_data.cache); in lp_rast_create()
932 lp_scene_queue_destroy(rast->full_scenes); in lp_rast_create()
934 FREE(rast); in lp_rast_create()
942 void lp_rast_destroy( struct lp_rasterizer *rast ) in lp_rast_destroy() argument
950 rast->exit_flag = TRUE; in lp_rast_destroy()
951 for (i = 0; i < rast->num_threads; i++) { in lp_rast_destroy()
952 pipe_semaphore_signal(&rast->tasks[i].work_ready); in lp_rast_destroy()
958 for (i = 0; i < rast->num_threads; i++) { in lp_rast_destroy()
960 pipe_semaphore_wait(&rast->tasks[i].work_done); in lp_rast_destroy()
962 thrd_join(rast->threads[i], NULL); in lp_rast_destroy()
967 for (i = 0; i < rast->num_threads; i++) { in lp_rast_destroy()
968 pipe_semaphore_destroy(&rast->tasks[i].work_ready); in lp_rast_destroy()
969 pipe_semaphore_destroy(&rast->tasks[i].work_done); in lp_rast_destroy()
971 for (i = 0; i < MAX2(1, rast->num_threads); i++) { in lp_rast_destroy()
972 align_free(rast->tasks[i].thread_data.cache); in lp_rast_destroy()
976 if (rast->num_threads > 0) { in lp_rast_destroy()
977 util_barrier_destroy( &rast->barrier ); in lp_rast_destroy()
980 lp_scene_queue_destroy(rast->full_scenes); in lp_rast_destroy()
982 FREE(rast); in lp_rast_destroy()