diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-28 17:08:00 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-12-28 18:44:02 +0000 |
commit | 5d222d4d21e6e3af5316728e0da49a014e9fea21 (patch) | |
tree | e557feaa2ab2192ce90bf5b1ede19d73a73d6745 | |
parent | 4528f68eff33a5c2f9c1d884e9b3f7228053e0f4 (diff) |
sna/gen4+: Tidy emit_spans_solid()
gcc produced abysmal code for the inlined emission, so hand unroll it
for sanity.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen4_vertex.c | 31 |
1 files changed, 22 insertions, 9 deletions
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index a70c3c81..a5b9be75 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -757,17 +757,30 @@ emit_spans_solid(struct sna *sna, const BoxRec *box, float opacity) { - OUT_VERTEX(box->x2, box->y2); - OUT_VERTEX_F(1); OUT_VERTEX_F(1); - OUT_VERTEX_F(opacity); + float *v; + union { + struct sna_coordinate p; + float f; + } dst; - OUT_VERTEX(box->x1, box->y2); - OUT_VERTEX_F(0); OUT_VERTEX_F(1); - OUT_VERTEX_F(opacity); + assert(op->base.floats_per_rect == 12); + assert((sna->render.vertex_used % 4) == 0); + v = sna->render.vertices + sna->render.vertex_used; + sna->render.vertex_used += 3*4; - OUT_VERTEX(box->x1, box->y1); - OUT_VERTEX_F(0); OUT_VERTEX_F(0); - OUT_VERTEX_F(opacity); + dst.p.x = box->x2; + dst.p.y = box->y2; + v[0] = dst.f; + + dst.p.x = box->x1; + v[4] = dst.f; + + dst.p.y = box->y1; + v[8] = dst.f; + + v[9] = v[5] = 0.; + v[10] = v[6] = v[1] = v[2] = 1.; + v[3] = v[7] = v[11] = opacity; } fastcall static void |