summaryrefslogtreecommitdiff
path: root/src/mesa/pipe/softpipe
diff options
context:
space:
mode:
authorJosé Fonseca <jrfonseca@tungstengraphics.com>2008-01-17 13:39:14 +0900
committerJosé Fonseca <jrfonseca@tungstengraphics.com>2008-01-17 13:39:14 +0900
commit271f9dac79a9247de9a57f4d248e404bf1652a13 (patch)
tree70e049d11449f2d41a7e27076995d86827e46be7 /src/mesa/pipe/softpipe
parentb016f0adba8278f3744d3aaa207a1b586d51756d (diff)
Back-port miscellaneous fixes from internal branch (mostly portability fixes).
These are changes that are in our internal branch, but somehow were skipped so far. It was done using visual comparison of the branches -- it is likely that changes are being carried on the wrong way
Diffstat (limited to 'src/mesa/pipe/softpipe')
-rw-r--r--src/mesa/pipe/softpipe/sp_prim_setup.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_fs.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_quad_stipple.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_surface.c1
-rw-r--r--src/mesa/pipe/softpipe/sp_texture.c2
-rw-r--r--src/mesa/pipe/softpipe/sp_tile_cache.c10
6 files changed, 11 insertions, 8 deletions
diff --git a/src/mesa/pipe/softpipe/sp_prim_setup.c b/src/mesa/pipe/softpipe/sp_prim_setup.c
index 7847027cae..89f8df945c 100644
--- a/src/mesa/pipe/softpipe/sp_prim_setup.c
+++ b/src/mesa/pipe/softpipe/sp_prim_setup.c
@@ -488,7 +488,7 @@ setup_fragcoord_coeff(struct setup_stage *setup)
if (setup->softpipe->rasterizer->origin_lower_left) {
/* y=0=bottom */
const int winHeight = setup->softpipe->framebuffer.cbufs[0]->height;
- setup->coef[0].a0[1] = winHeight - 1;
+ setup->coef[0].a0[1] = (float) (winHeight - 1);
setup->coef[0].dady[1] = -1.0;
}
else {
diff --git a/src/mesa/pipe/softpipe/sp_quad_fs.c b/src/mesa/pipe/softpipe/sp_quad_fs.c
index 921dfbaccb..0001c76a80 100644
--- a/src/mesa/pipe/softpipe/sp_quad_fs.c
+++ b/src/mesa/pipe/softpipe/sp_quad_fs.c
@@ -133,7 +133,7 @@ shade_quad(
machine->InterpCoefs = quad->coef;
/* Compute X, Y, Z, W vals for this quad */
- setup_pos_vector(quad->posCoef, quad->x0, quad->y0, &machine->QuadPos);
+ setup_pos_vector(quad->posCoef, (float) quad->x0, (float) quad->y0, &machine->QuadPos);
/* run shader */
#if defined(__i386__) || defined(__386__)
diff --git a/src/mesa/pipe/softpipe/sp_quad_stipple.c b/src/mesa/pipe/softpipe/sp_quad_stipple.c
index 0c42963dfe..8660432259 100644
--- a/src/mesa/pipe/softpipe/sp_quad_stipple.c
+++ b/src/mesa/pipe/softpipe/sp_quad_stipple.c
@@ -36,6 +36,7 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
stipple1 = softpipe->poly_stipple.stipple[y1 % 32];
#if 1
+ {
const int col0 = quad->x0 % 32;
if ((stipple0 & (bit31 >> col0)) == 0)
quad->mask &= ~MASK_TOP_LEFT;
@@ -48,6 +49,7 @@ stipple_quad(struct quad_stage *qs, struct quad_header *quad)
if ((stipple1 & (bit30 >> col0)) == 0)
quad->mask &= ~MASK_BOTTOM_RIGHT;
+ }
#else
/* We'd like to use this code, but we'd need to redefine
* MASK_TOP_LEFT to be (1 << 1) and MASK_TOP_RIGHT to be (1 << 0),
diff --git a/src/mesa/pipe/softpipe/sp_surface.c b/src/mesa/pipe/softpipe/sp_surface.c
index 6c080d5b5c..a580fb3e82 100644
--- a/src/mesa/pipe/softpipe/sp_surface.c
+++ b/src/mesa/pipe/softpipe/sp_surface.c
@@ -50,6 +50,7 @@ softpipe_get_tex_surface(struct pipe_context *pipe,
ps = pipe->winsys->surface_alloc(pipe->winsys);
if (ps) {
assert(ps->refcount);
+ assert(ps->winsys);
pipe->winsys->buffer_reference(pipe->winsys, &ps->buffer, spt->buffer);
ps->format = pt->format;
ps->cpp = pt->cpp;
diff --git a/src/mesa/pipe/softpipe/sp_texture.c b/src/mesa/pipe/softpipe/sp_texture.c
index e5e6bfe01b..532bcfcc51 100644
--- a/src/mesa/pipe/softpipe/sp_texture.c
+++ b/src/mesa/pipe/softpipe/sp_texture.c
@@ -126,7 +126,7 @@ softpipe_texture_release(struct pipe_context *pipe, struct pipe_texture **pt)
pipe->winsys->buffer_reference(pipe->winsys, &spt->buffer, NULL);
- free(spt);
+ FREE(spt);
}
*pt = NULL;
}
diff --git a/src/mesa/pipe/softpipe/sp_tile_cache.c b/src/mesa/pipe/softpipe/sp_tile_cache.c
index 6515ce668c..1974f77459 100644
--- a/src/mesa/pipe/softpipe/sp_tile_cache.c
+++ b/src/mesa/pipe/softpipe/sp_tile_cache.c
@@ -286,7 +286,7 @@ clear_tile(struct softpipe_cached_tile *tile,
else {
for (i = 0; i < TILE_SIZE; i++) {
for (j = 0; j < TILE_SIZE; j++) {
- tile->data.depth16[i][j] = clear_value;
+ tile->data.depth16[i][j] = (ushort) clear_value;
}
}
}
@@ -564,10 +564,10 @@ sp_tile_cache_clear(struct softpipe_tile_cache *tc, uint clearValue)
r = g = b = a = 0;
}
- tc->clear_color[0] = r / 255.0;
- tc->clear_color[1] = g / 255.0;
- tc->clear_color[2] = b / 255.0;
- tc->clear_color[3] = a / 255.0;
+ tc->clear_color[0] = r / 255.0f;
+ tc->clear_color[1] = g / 255.0f;
+ tc->clear_color[2] = b / 255.0f;
+ tc->clear_color[3] = a / 255.0f;
#if TILE_CLEAR_OPTIMIZATION
/* set flags to indicate all the tiles are cleared */