diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-28 17:14:52 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-28 19:15:53 +0000 |
commit | 3fdc9923447538ed65bf9ffa189d7290ce804730 (patch) | |
tree | 9c4fde9fa2076995c317e36cd813342440e8bd7d /src/sna | |
parent | fdd6d222bc92b3e385f5d62f5e03dfd86f290e45 (diff) |
sna/gen4+: Trim an extraneous coordinate from solid span emission
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/gen4_vertex.c | 22 | ||||
-rw-r--r-- | src/sna/gen4_vertex.h | 7 |
2 files changed, 15 insertions, 14 deletions
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index 576e3f31..b41476c9 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -751,24 +751,23 @@ emit_spans_solid(struct sna *sna, float f; } dst; - assert(op->base.floats_per_rect == 12); - assert((sna->render.vertex_used % 4) == 0); + assert(op->base.floats_per_rect == 9); + assert((sna->render.vertex_used % 3) == 0); v = sna->render.vertices + sna->render.vertex_used; - sna->render.vertex_used += 3*4; + sna->render.vertex_used += 3*3; dst.p.x = box->x2; dst.p.y = box->y2; v[0] = dst.f; dst.p.x = box->x1; - v[4] = dst.f; + v[3] = dst.f; dst.p.y = box->y1; - v[8] = dst.f; + v[6] = dst.f; - v[9] = v[5] = 0.; - v[10] = v[6] = v[1] = v[2] = 1.; - v[3] = v[7] = v[11] = opacity; + v[7] = v[4] = v[1] = .5; + v[8] = v[5] = v[2] = opacity; } fastcall static void @@ -905,8 +904,10 @@ void gen4_choose_spans_emitter(struct sna_composite_spans_op *tmp) tmp->prim_emit = emit_composite_spans_primitive; if (tmp->base.src.is_solid) { tmp->prim_emit = emit_spans_solid; + tmp->base.floats_per_vertex = 3; } else if (tmp->base.src.transform == NULL) { tmp->prim_emit = emit_spans_identity; + tmp->base.floats_per_vertex = 4; } else if (tmp->base.is_affine) { if (!sna_affine_transform_is_rotation(tmp->base.src.transform)) { tmp->base.src.scale[0] /= tmp->base.src.transform->matrix[2][2]; @@ -914,7 +915,8 @@ void gen4_choose_spans_emitter(struct sna_composite_spans_op *tmp) tmp->prim_emit = emit_spans_simple; } else tmp->prim_emit = emit_spans_affine; - } - tmp->base.floats_per_vertex = 4 + !tmp->base.is_affine; + tmp->base.floats_per_vertex = 4; + } else + tmp->base.floats_per_vertex = 5; tmp->base.floats_per_rect = 3 * tmp->base.floats_per_vertex; } diff --git a/src/sna/gen4_vertex.h b/src/sna/gen4_vertex.h index 418bdef1..1d94ab46 100644 --- a/src/sna/gen4_vertex.h +++ b/src/sna/gen4_vertex.h @@ -26,10 +26,9 @@ gen4_choose_composite_vertex_buffer(const struct sna_composite_op *op) inline inline static uint32_t gen4_choose_spans_vertex_buffer(const struct sna_composite_op *op) { - DBG(("%s: id=%x (%d, 1)\n", __FUNCTION__, - 1 << 2 | (2+!op->src.is_affine), - 2 + !op->src.is_affine)); - return 1 << 2 | (2+!op->src.is_affine); + int id = op->src.is_solid ? 1 : 2 + !op->src.is_affine; + DBG(("%s: id=%x (%d, 1)\n", __FUNCTION__, 1 << 2 | id, id)); + return 1 << 2 | id; } void gen4_choose_composite_emitter(struct sna_composite_op *tmp); |