summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/ilo/ilo_3d.c
diff options
context:
space:
mode:
authorChia-I Wu <[email protected]>2014-09-22 10:12:06 +0800
committerChia-I Wu <[email protected]>2014-09-22 10:36:27 +0800
commit17e7582465e2210f479350449b9598864728b4d0 (patch)
treea2a5afe0fb882b437c2c95e7c51f9e9bfbdaccc9 /src/gallium/drivers/ilo/ilo_3d.c
parent49b8fb937f76d49fb5d2ed0d2c99e947a389d686 (diff)
ilo: move size estimation check out of pipeline
It can be done outside of the pipeline. Let's move it.
Diffstat (limited to 'src/gallium/drivers/ilo/ilo_3d.c')
-rw-r--r--src/gallium/drivers/ilo/ilo_3d.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/gallium/drivers/ilo/ilo_3d.c b/src/gallium/drivers/ilo/ilo_3d.c
index 4be4ce4fc0d..066a4df6282 100644
--- a/src/gallium/drivers/ilo/ilo_3d.c
+++ b/src/gallium/drivers/ilo/ilo_3d.c
@@ -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);
+
+ /* sanity check size estimation */
+ assert(before_space - ilo_cp_space(hw3d->cp) <= max_len);
- return ilo_3d_pipeline_emit_draw(hw3d->pipeline, vec);
+ return success;
}
bool