/** * Called by setup module when it has something for us to render. */ void lp_rast_queue_scene( struct lp_rasterizer *rast, struct lp_scene *scene) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); if (rast->num_threads == 0) { /* no threading */ lp_rast_begin( rast, scene ); rasterize_scene( &rast->tasks[0], scene ); lp_rast_end( rast ); rast->curr_scene = NULL; } else { /* threaded rendering! */ unsigned i; lp_scene_enqueue( rast->full_scenes, scene ); /* signal the threads that there's work to do */ for (i = 0; i < rast->num_threads; i++) { pipe_semaphore_signal(&rast->tasks[i].work_ready); } } LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__); }
/** * Called by setup module when it has something for us to render. */ void lp_rast_queue_scene( struct lp_rasterizer *rast, struct lp_scene *scene) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); if (rast->num_threads == 0) { /* no threading */ unsigned fpstate = util_fpstate_get(); /* Make sure that denorms are treated like zeros. This is * the behavior required by D3D10. OpenGL doesn't care. */ util_fpstate_set_denorms_to_zero(fpstate); lp_rast_begin( rast, scene ); rasterize_scene( &rast->tasks[0], scene ); lp_rast_end( rast ); util_fpstate_set(fpstate); rast->curr_scene = NULL; } else { /* threaded rendering! */ unsigned i; lp_scene_enqueue( rast->full_scenes, scene ); /* signal the threads that there's work to do */ for (i = 0; i < rast->num_threads; i++) { pipe_semaphore_signal(&rast->tasks[i].work_ready); } } LP_DBG(DEBUG_SETUP, "%s done \n", __FUNCTION__); }