/* This basically bins and then flushes any outstanding full-screen * clears. * * TODO: fast path for fullscreen clears and no triangles. */ static boolean execute_clears( struct lp_setup_context *setup ) { LP_DBG(DEBUG_SETUP, "%s\n", __FUNCTION__); return begin_binning( setup ); }
static void set_scene_state( struct lp_setup_context *setup, enum setup_state new_state, const char *reason) { unsigned old_state = setup->state; if (old_state == new_state) return; if (LP_DEBUG & DEBUG_SCENE) { debug_printf("%s old %s new %s%s%s\n", __FUNCTION__, states[old_state], states[new_state], (new_state == SETUP_FLUSHED) ? ": " : "", (new_state == SETUP_FLUSHED) ? reason : ""); if (new_state == SETUP_FLUSHED && setup->scene) lp_debug_draw_bins_by_cmd_length(setup->scene); } /* wait for a free/empty scene */ if (old_state == SETUP_FLUSHED) lp_setup_get_empty_scene(setup); switch (new_state) { case SETUP_CLEARED: break; case SETUP_ACTIVE: begin_binning( setup ); break; case SETUP_FLUSHED: if (old_state == SETUP_CLEARED) execute_clears( setup ); lp_setup_rasterize_scene( setup ); assert(setup->scene == NULL); break; default: assert(0 && "invalid setup state mode"); } setup->state = new_state; }