ilo: move size estimation check out of pipeline

It can be done outside of the pipeline.  Let's move it.
This commit is contained in:
Chia-I Wu 2014-09-22 10:12:06 +08:00
parent 49b8fb937f
commit 17e7582465
3 changed files with 10 additions and 10 deletions

View File

@ -357,7 +357,8 @@ static bool
draw_vbo(struct ilo_3d *hw3d, const struct ilo_state_vector *vec)
{
bool need_flush = false;
int max_len;
bool success;
int max_len, before_space;
ilo_3d_own_render_ring(hw3d);
@ -388,10 +389,17 @@ draw_vbo(struct ilo_3d *hw3d, const struct ilo_state_vector *vec)
assert(max_len <= ilo_cp_space(hw3d->cp));
}
/* space available before emission */
before_space = ilo_cp_space(hw3d->cp);
if (need_flush)
ilo_3d_pipeline_emit_flush(hw3d->pipeline);
success = ilo_3d_pipeline_emit_draw(hw3d->pipeline, vec);
return ilo_3d_pipeline_emit_draw(hw3d->pipeline, vec);
/* sanity check size estimation */
assert(before_space - ilo_cp_space(hw3d->cp) <= max_len);
return success;
}
bool

View File

@ -1361,9 +1361,6 @@ gen6_pipeline_prepare(const struct ilo_3d_pipeline *p,
session->pipe_dirty = vec->dirty;
session->reduced_prim = u_reduced_prim(vec->draw->mode);
/* available space before the session */
session->init_cp_space = ilo_cp_space(p->cp);
session->hw_ctx_changed =
(p->invalidate_flags & ILO_3D_PIPELINE_INVALIDATE_HW);
@ -1425,10 +1422,6 @@ gen6_pipeline_end(struct ilo_3d_pipeline *p,
const struct ilo_state_vector *vec,
struct gen6_pipeline_session *session)
{
/* sanity check size estimation */
assert(session->init_cp_space - ilo_cp_space(p->cp) <=
ilo_3d_pipeline_estimate_size(p, ILO_3D_PIPELINE_DRAW, vec));
p->state.reduced_prim = session->reduced_prim;
p->state.primitive_restart = vec->draw->primitive_restart;
}

View File

@ -38,7 +38,6 @@ struct gen6_pipeline_session {
uint32_t pipe_dirty;
int reduced_prim;
int init_cp_space;
bool hw_ctx_changed;
bool batch_bo_changed;