diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-06 15:20:14 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-01-06 15:20:14 +0000 |
commit | 9051f43fa3c8d011921ac6ff75b763280f26d98f (patch) | |
tree | 8871c41a4158d759c0ba6d94931190174682cbc9 /src/sna/gen4_vertex.c | |
parent | 4af910e8be92e0ca241ce1e93e322c712dcbe340 (diff) |
sna/gen4+: Handle solids passed to the general texcoord emitter
The general texcoord emitter does handle solids (for the case of a
transformed mask) and so we need to be careful to setup the
VERTEX_ELEMENTS accordingly.
Fixes regression from
commit 2559cfcc4cbc1d0d84b048565cad3bfee61df8da
Author: Chris Wilson <chris@chris-wilson.co.uk>
Date: Wed Jan 2 10:22:14 2013 +0000
sna/gen4+: Specialise linear vertex emissio
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/gen4_vertex.c')
-rw-r--r-- | src/sna/gen4_vertex.c | 30 |
1 files changed, 27 insertions, 3 deletions
diff --git a/src/sna/gen4_vertex.c b/src/sna/gen4_vertex.c index f8becce3..98914531 100644 --- a/src/sna/gen4_vertex.c +++ b/src/sna/gen4_vertex.c @@ -780,6 +780,7 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp) tmp->floats_per_vertex = 5; vb = 2 << 2 | 2; } else { + DBG(("%s: projective source, identity mask\n", __FUNCTION__)); tmp->prim_emit = emit_primitive_mask; tmp->floats_per_vertex = 6; vb = 2 << 2 | 3; @@ -787,9 +788,29 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp) } else { tmp->prim_emit = emit_primitive_mask; tmp->floats_per_vertex = 1; - tmp->floats_per_vertex += 2 + !tmp->mask.is_affine; - tmp->floats_per_vertex += 2 + !tmp->src.is_affine; - vb = (2 + !tmp->src.is_affine) | (2 + !tmp->mask.is_affine) << 2; + vb = 0; + if (tmp->mask.is_solid) { + tmp->floats_per_vertex += 1; + vb |= 1 << 2; + } else if (tmp->mask.is_affine) { + tmp->floats_per_vertex += 2; + vb |= 2 << 2; + }else { + tmp->floats_per_vertex += 3; + vb |= 3 << 2; + } + if (tmp->src.is_solid) { + tmp->floats_per_vertex += 1; + vb |= 1; + } else if (tmp->src.is_affine) { + tmp->floats_per_vertex += 2; + vb |= 2 ; + }else { + tmp->floats_per_vertex += 3; + vb |= 3; + } + DBG(("%s: general mask: floats-per-vertex=%d, vb=%x\n", + __FUNCTION__,tmp->floats_per_vertex, vb)); } } else { if (tmp->src.is_solid) { @@ -800,6 +821,7 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp) tmp->floats_per_vertex = 2; vb = 1; } else if (tmp->src.is_linear) { + DBG(("%s: linear, no mask\n", __FUNCTION__)); tmp->prim_emit = emit_primitive_linear; tmp->floats_per_vertex = 2; vb = 1; @@ -821,6 +843,8 @@ unsigned gen4_choose_composite_emitter(struct sna_composite_op *tmp) tmp->floats_per_vertex = 3; vb = 2; } else { + DBG(("%s: projective src, no mask\n", __FUNCTION__)); + assert(!tmp->src.is_solid); tmp->prim_emit = emit_primitive; tmp->floats_per_vertex = 4; vb = 3; |