sna: Use single precision for computing the texcoord scale factor

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-09-12 11:54:02 +01:00
parent c2e19987c3
commit f2a617dcc5
7 changed files with 28 additions and 28 deletions

View File

@ -2019,8 +2019,8 @@ gen2_render_copy_setup_source(struct sna *sna,
channel->repeat = RepeatNone;
channel->width = pixmap->drawable.width;
channel->height = pixmap->drawable.height;
channel->scale[0] = 1./pixmap->drawable.width;
channel->scale[1] = 1./pixmap->drawable.height;
channel->scale[0] = 1.f/pixmap->drawable.width;
channel->scale[1] = 1.f/pixmap->drawable.height;
channel->offset[0] = 0;
channel->offset[1] = 0;
channel->pict_format = sna_format_for_depth(pixmap->drawable.depth);

View File

@ -3233,8 +3233,8 @@ gen3_render_copy_setup_source(struct sna *sna,
channel->repeat = gen3_texture_repeat(RepeatNone);
channel->width = pixmap->drawable.width;
channel->height = pixmap->drawable.height;
channel->scale[0] = 1./pixmap->drawable.width;
channel->scale[1] = 1./pixmap->drawable.height;
channel->scale[0] = 1.f/pixmap->drawable.width;
channel->scale[1] = 1.f/pixmap->drawable.height;
channel->offset[0] = 0;
channel->offset[1] = 0;
gen3_composite_channel_set_format(channel,

View File

@ -2224,8 +2224,8 @@ gen4_render_copy_boxes(struct sna *sna, uint8_t alu,
gen4_copy_bind_surfaces(sna, &tmp);
gen4_align_vertex(sna, &tmp);
tmp.src.scale[0] = 1. / src->drawable.width;
tmp.src.scale[1] = 1. / src->drawable.height;
tmp.src.scale[0] = 1.f/src->drawable.width;
tmp.src.scale[1] = 1.f/src->drawable.height;
do {
gen4_render_copy_one(sna, &tmp,
box->x1 + src_dx, box->y1 + src_dy,
@ -2303,8 +2303,8 @@ gen4_render_copy(struct sna *sna, uint8_t alu,
gen4_get_card_format_for_depth(src->drawable.depth),
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
op->base.src.scale[0] = 1./src->drawable.width;
op->base.src.scale[1] = 1./src->drawable.height;
op->base.src.scale[0] = 1.f/src->drawable.width;
op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;

View File

@ -2163,8 +2163,8 @@ gen5_render_copy_boxes(struct sna *sna, uint8_t alu,
gen5_copy_bind_surfaces(sna, &tmp);
gen5_align_vertex(sna, &tmp);
tmp.src.scale[0] = 1. / src->drawable.width;
tmp.src.scale[1] = 1. / src->drawable.height;
tmp.src.scale[0] = 1.f/src->drawable.width;
tmp.src.scale[1] = 1.f/src->drawable.height;
do {
int n_this_time = gen5_get_rectangles(sna, &tmp, n);
if (n_this_time == 0) {
@ -2277,8 +2277,8 @@ gen5_render_copy(struct sna *sna, uint8_t alu,
gen5_get_card_format_for_depth(src->drawable.depth),
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
op->base.src.scale[0] = 1./src->drawable.width;
op->base.src.scale[1] = 1./src->drawable.height;
op->base.src.scale[0] = 1.f/src->drawable.width;
op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;

View File

@ -2498,8 +2498,8 @@ gen6_render_copy(struct sna *sna, uint8_t alu,
gen6_get_card_format_for_depth(src->drawable.depth),
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
op->base.src.scale[0] = 1./src->drawable.width;
op->base.src.scale[1] = 1./src->drawable.height;
op->base.src.scale[0] = 1.f/src->drawable.width;
op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;

View File

@ -2633,8 +2633,8 @@ gen7_render_copy(struct sna *sna, uint8_t alu,
gen7_get_card_format_for_depth(src->drawable.depth),
op->base.src.width = src->drawable.width;
op->base.src.height = src->drawable.height;
op->base.src.scale[0] = 1./src->drawable.width;
op->base.src.scale[1] = 1./src->drawable.height;
op->base.src.scale[0] = 1.f/src->drawable.width;
op->base.src.scale[1] = 1.f/src->drawable.height;
op->base.src.filter = SAMPLER_FILTER_NEAREST;
op->base.src.repeat = SAMPLER_EXTEND_NONE;

View File

@ -319,8 +319,8 @@ static struct kgem_bo *upload(struct sna *sna,
if (bo) {
channel->offset[0] -= box->x1;
channel->offset[1] -= box->y1;
channel->scale[0] = 1./w;
channel->scale[1] = 1./h;
channel->scale[0] = 1.f/w;
channel->scale[1] = 1.f/h;
channel->width = w;
channel->height = h;
}
@ -387,8 +387,8 @@ sna_render_pixmap_bo(struct sna *sna,
channel->height = pixmap->drawable.height;
channel->width = pixmap->drawable.width;
channel->scale[0] = 1. / pixmap->drawable.width;
channel->scale[1] = 1. / pixmap->drawable.height;
channel->scale[0] = 1.f / pixmap->drawable.width;
channel->scale[1] = 1.f / pixmap->drawable.height;
channel->offset[0] = x - dst_x;
channel->offset[1] = y - dst_y;
@ -648,8 +648,8 @@ static int sna_render_picture_downsample(struct sna *sna,
channel->offset[0] = x - dst_x;
channel->offset[1] = y - dst_y;
channel->scale[0] = 1./w;
channel->scale[1] = 1./h;
channel->scale[0] = 1.f/w;
channel->scale[1] = 1.f/h;
channel->width = w / 2;
channel->height = h / 2;
channel->bo = bo;
@ -824,8 +824,8 @@ sna_render_picture_extract(struct sna *sna,
channel->offset[0] = x - dst_x;
channel->offset[1] = y - dst_y;
channel->scale[0] = 1./w;
channel->scale[1] = 1./h;
channel->scale[0] = 1.f/w;
channel->scale[1] = 1.f/h;
channel->width = w;
channel->height = h;
channel->bo = bo;
@ -941,8 +941,8 @@ sna_render_picture_fixup(struct sna *sna,
channel->repeat = RepeatNone;
channel->is_affine = TRUE;
channel->scale[0] = 1./w;
channel->scale[1] = 1./h;
channel->scale[0] = 1.f/w;
channel->scale[1] = 1.f/h;
channel->offset[0] = -dst_x;
channel->offset[1] = -dst_y;
channel->transform = NULL;
@ -1061,8 +1061,8 @@ sna_render_picture_convert(struct sna *sna,
channel->width = w;
channel->height = h;
channel->scale[0] = 1. / w;
channel->scale[1] = 1. / h;
channel->scale[0] = 1.f/w;
channel->scale[1] = 1.f/h;
channel->offset[0] = x - dst_x - box.x1;
channel->offset[1] = y - dst_y - box.y1;