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 2559cfcc4c
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>
This commit is contained in:
parent
4af910e8be
commit
9051f43fa3
|
|
@ -44,6 +44,7 @@ gen4_channel_init_solid(struct sna *sna,
|
|||
channel->repeat = RepeatNormal;
|
||||
channel->is_affine = true;
|
||||
channel->is_solid = true;
|
||||
channel->is_opaque = (color >> 24) == 0xff;
|
||||
channel->transform = NULL;
|
||||
channel->width = 1;
|
||||
channel->height = 1;
|
||||
|
|
@ -57,7 +58,6 @@ gen4_channel_init_solid(struct sna *sna,
|
|||
return channel->bo != NULL;
|
||||
}
|
||||
|
||||
|
||||
bool
|
||||
gen4_channel_init_linear(struct sna *sna,
|
||||
PicturePtr picture,
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue