diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-06 08:02:09 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2011-06-06 08:12:33 +0100 |
commit | c76ec69660bf40de052159f60c16de8fd87341a8 (patch) | |
tree | 182e4cd4c6666f7f0085478ee9bd2a7943daa48c | |
parent | 91424d49373d8117e71441fa3221bd1801171692 (diff) |
sna/gen2: The inline primitive takes a length, not a vertex count
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen2_render.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 896f7308..1ee681a6 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -804,8 +804,8 @@ static void gen2_magic_ca_pass(struct sna *sna, memcpy(sna->kgem.batch + sna->kgem.nbatch, sna->kgem.batch + sna->render_state.gen2.vertex_offset, - (1 + 3*sna->render.vertex_index)*sizeof(uint32_t)); - sna->kgem.nbatch += 1 + 3*sna->render.vertex_index; + (1 + sna->render.vertex_index)*sizeof(uint32_t)); + sna->kgem.nbatch += 1 + sna->render.vertex_index; } static void gen2_vertex_flush(struct sna *sna) @@ -830,6 +830,8 @@ inline static int gen2_get_rectangles(struct sna *sna, struct gen2_render_state *state = &sna->render_state.gen2; int rem = batch_space(sna), size, need; + assert(op->floats_per_vertex); + need = 0; size = 3*op->floats_per_vertex; if (op->need_magic_ca_pass) @@ -851,7 +853,8 @@ inline static int gen2_get_rectangles(struct sna *sna, if (want * size > rem) want = rem / size; - sna->render.vertex_index += 3*want; + assert(want); + sna->render.vertex_index += 3*want*op->floats_per_vertex; return want; } |