diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-24 14:21:44 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-01-24 14:21:44 +0000 |
commit | 294180b3bf78f2c0ae2f1197e1c0819d99009356 (patch) | |
tree | 6351002fb067f2ce08243df75692ecd1d3c3c9b4 | |
parent | 4385724dc49dd090e0a5956e287f80b92ebd70e8 (diff) |
sna/gen3+: Allow for spill when aligning vertices
We need to flush the batch if we run out of space aligning our vertex
buffer - but the test must anticipate the space required for the new
alignment.
Reported-by: Arkadiusz Miskiewicz
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen3_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen4_vertex.c | 2 | ||||
-rw-r--r-- | src/sna/gen8_vertex.c | 2 |
3 files changed, 3 insertions, 3 deletions
diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 941b633f..5601f4c5 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -3137,7 +3137,7 @@ gen3_align_vertex(struct sna *sna, if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) { DBG(("%s: flushing vertex buffer: new index=%d, max=%d\n", __FUNCTION__, vertex_index, sna->render.vertex_size / op->floats_per_vertex)); - if (gen3_vertex_finish(sna) < op->floats_per_vertex) + if (gen3_vertex_finish(sna) < 2*op->floats_per_vertex) kgem_submit(&sna->kgem); vertex_index = (sna->render.vertex_used + op->floats_per_vertex - 1) / op->floats_per_vertex; diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index 38f4cf3b..4b3496cc 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -48,7 +48,7 @@ void gen4_vertex_align(struct sna *sna, const struct sna_composite_op *op) if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) { DBG(("%s: flushing vertex buffer: new index=%d, max=%d\n", __FUNCTION__, vertex_index, sna->render.vertex_size / op->floats_per_vertex)); - if (gen4_vertex_finish(sna) < op->floats_per_rect) { + if (gen4_vertex_finish(sna) < 2*op->floats_per_rect) { kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_RENDER); } diff --git a/src/sna/gen8_vertex.c b/src/sna/gen8_vertex.c index dfa4cce2..c66d8642 100644 --- a/src/sna/gen8_vertex.c +++ b/src/sna/gen8_vertex.c @@ -44,7 +44,7 @@ void gen8_vertex_align(struct sna *sna, const struct sna_composite_op *op) if ((int)sna->render.vertex_size - vertex_index * op->floats_per_vertex < 2*op->floats_per_rect) { DBG(("%s: flushing vertex buffer: new index=%d, max=%d\n", __FUNCTION__, vertex_index, sna->render.vertex_size / op->floats_per_vertex)); - if (gen8_vertex_finish(sna) < op->floats_per_rect) { + if (gen8_vertex_finish(sna) < 2*op->floats_per_rect) { kgem_submit(&sna->kgem); _kgem_set_mode(&sna->kgem, KGEM_RENDER); } |