summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_atifragshader.c5
-rw-r--r--src/mesa/swrast/s_buffers.c5
-rw-r--r--src/mesa/swrast/s_context.c4
-rw-r--r--src/mesa/swrast/s_copypix.c4
-rw-r--r--src/mesa/swrast/s_depth.c4
-rw-r--r--src/mesa/swrast/s_drawpix.c16
-rw-r--r--src/mesa/swrast/s_linetemp.h7
-rw-r--r--src/mesa/swrast/s_pointtemp.h6
-rw-r--r--src/mesa/swrast/s_readpix.c23
-rw-r--r--src/mesa/swrast/s_stencil.c12
-rw-r--r--src/mesa/swrast/s_texfilter.c4
-rw-r--r--src/mesa/swrast/s_zoom.c12
12 files changed, 59 insertions, 43 deletions
diff --git a/src/mesa/swrast/s_atifragshader.c b/src/mesa/swrast/s_atifragshader.c
index 1ac6528a91..947054faa3 100644
--- a/src/mesa/swrast/s_atifragshader.c
+++ b/src/mesa/swrast/s_atifragshader.c
@@ -326,7 +326,8 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
struct atifs_instruction *inst;
struct atifs_setupinst *texinst;
GLint optype;
- GLint i, j, pass;
+ GLuint i;
+ GLint j, pass;
GLint dstreg;
GLfloat src[2][3][4];
GLfloat zeros[4] = { 0.0, 0.0, 0.0, 0.0 };
@@ -349,7 +350,7 @@ execute_shader(GLcontext *ctx, const struct ati_fragment_shader *shader,
/* setup the source registers for color and alpha ops */
for (optype = 0; optype < 2; optype++) {
- for (i = 0; i < inst->ArgCount[optype]; i++) {
+ for (i = 0; i < inst->ArgCount[optype]; i++) {
GLint index = inst->SrcReg[optype][i].Index;
if (index >= GL_REG_0_ATI && index <= GL_REG_5_ATI)
diff --git a/src/mesa/swrast/s_buffers.c b/src/mesa/swrast/s_buffers.c
index 284ea2b517..35f2dd6490 100644
--- a/src/mesa/swrast/s_buffers.c
+++ b/src/mesa/swrast/s_buffers.c
@@ -80,7 +80,10 @@ clear_rgba_buffer_with_masking(GLcontext *ctx, struct gl_renderbuffer *rb)
else {
ASSERT(span.array->ChanType == GL_FLOAT);
for (i = 0; i < width; i++) {
- COPY_4V(span.array->rgba[i], ctx->Color.ClearColor);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][0], ctx->Color.ClearColor[0]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][1], ctx->Color.ClearColor[1]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][2], ctx->Color.ClearColor[2]);
+ CLAMPED_FLOAT_TO_CHAN(span.array->rgba[i][3], ctx->Color.ClearColor[3]);
}
}
diff --git a/src/mesa/swrast/s_context.c b/src/mesa/swrast/s_context.c
index d8a5520f6b..5e174f81d5 100644
--- a/src/mesa/swrast/s_context.c
+++ b/src/mesa/swrast/s_context.c
@@ -395,7 +395,7 @@ _swrast_validate_texture_images(GLcontext *ctx)
GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face;
for (face = 0; face < numFaces; face++) {
- GLuint lvl;
+ GLint lvl;
for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
struct gl_texture_image *texImg = texObj->Image[face][lvl];
if (texImg && !texImg->Data) {
@@ -433,7 +433,7 @@ _swrast_eject_texture_images(GLcontext *ctx)
GLuint numFaces = (texObj->Target == GL_TEXTURE_CUBE_MAP) ? 6 : 1;
GLuint face;
for (face = 0; face < numFaces; face++) {
- GLuint lvl;
+ GLint lvl;
for (lvl = texObj->BaseLevel; lvl <= texObj->_MaxLevel; lvl++) {
struct gl_texture_image *texImg = texObj->Image[face][lvl];
if (texImg && texImg->Data) {
diff --git a/src/mesa/swrast/s_copypix.c b/src/mesa/swrast/s_copypix.c
index a9bc6433de..afab7c4d37 100644
--- a/src/mesa/swrast/s_copypix.c
+++ b/src/mesa/swrast/s_copypix.c
@@ -860,8 +860,8 @@ fast_copy_pixels(GLcontext *ctx,
}
/* clipping not supported */
- if (srcX < 0 || srcX + width > srcFb->Width ||
- srcY < 0 || srcY + height > srcFb->Height ||
+ if (srcX < 0 || srcX + width > (GLint) srcFb->Width ||
+ srcY < 0 || srcY + height > (GLint) srcFb->Height ||
dstX < dstFb->_Xmin || dstX + width > dstFb->_Xmax ||
dstY < dstFb->_Ymin || dstY + height > dstFb->_Ymax) {
return GL_FALSE;
diff --git a/src/mesa/swrast/s_depth.c b/src/mesa/swrast/s_depth.c
index cb584b5de8..408174c990 100644
--- a/src/mesa/swrast/s_depth.c
+++ b/src/mesa/swrast/s_depth.c
@@ -1289,7 +1289,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
GLint dx = -x;
GLint i;
for (i = 0; i < dx; i++)
- depth[i] = 0.0;
+ depth[i] = 0;
x = 0;
n -= dx;
depth += dx;
@@ -1298,7 +1298,7 @@ _swrast_read_depth_span_uint( GLcontext *ctx, struct gl_renderbuffer *rb,
GLint dx = x + n - (GLint) rb->Width;
GLint i;
for (i = 0; i < dx; i++)
- depth[n - i - 1] = 0.0;
+ depth[n - i - 1] = 0;
n -= dx;
}
if (n <= 0) {
diff --git a/src/mesa/swrast/s_drawpix.c b/src/mesa/swrast/s_drawpix.c
index dd2b57c7d3..595fd5c5cd 100644
--- a/src/mesa/swrast/s_drawpix.c
+++ b/src/mesa/swrast/s_drawpix.c
@@ -110,8 +110,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
*/
if (format == GL_RGBA && type == rbType) {
- const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
const GLint srcStride = _mesa_image_row_stride(&unpack, width,
format, type);
if (simpleZoom) {
@@ -139,8 +140,9 @@ fast_draw_rgba_pixels(GLcontext *ctx, GLint x, GLint y,
}
if (format == GL_RGB && type == rbType) {
- const GLubyte *src = _mesa_image_address2d(&unpack, pixels, width,
- height, format, type, 0, 0);
+ const GLubyte *src
+ = (const GLubyte *) _mesa_image_address2d(&unpack, pixels, width,
+ height, format, type, 0, 0);
const GLint srcStride = _mesa_image_row_stride(&unpack, width,
format, type);
if (simpleZoom) {
@@ -640,8 +642,10 @@ draw_rgba_pixels( GLcontext *ctx, GLint x, GLint y,
/* if the span is wider than MAX_WIDTH we have to do it in chunks */
while (skipPixels < width) {
const GLint spanWidth = MIN2(width - skipPixels, MAX_WIDTH);
- const GLubyte *source = _mesa_image_address2d(unpack, pixels,
- width, height, format, type, 0, skipPixels);
+ const GLubyte *source
+ = (const GLubyte *) _mesa_image_address2d(unpack, pixels,
+ width, height, format,
+ type, 0, skipPixels);
GLint row;
for (row = 0; row < height; row++) {
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index d2f37bf391..7b66291eb5 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -82,14 +82,15 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
GLint numPixels;
GLint xstep, ystep;
#if defined(DEPTH_TYPE)
- const GLint depthBits = ctx->Visual.depthBits;
+ const GLint depthBits = ctx->DrawBuffer->Visual.depthBits;
const GLint fixedToDepthShift = depthBits <= 16 ? FIXED_SHIFT : 0;
struct gl_renderbuffer *zrb = ctx->DrawBuffer->Attachment[BUFFER_DEPTH].Renderbuffer;
#define FixedToDepth(F) ((F) >> fixedToDepthShift)
GLint zPtrXstep, zPtrYstep;
DEPTH_TYPE *zPtr;
#elif defined(INTERP_Z)
- const GLint depthBits = ctx->Visual.depthBits;
+ const GLint depthBits = ctx->DrawBuffer->Visual.depthBits;
+/*ctx->Visual.depthBits;*/
#endif
#ifdef PIXEL_ADDRESS
PIXEL_TYPE *pixelPtr;
@@ -272,7 +273,7 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
}
else {
/* don't use fixed point */
- span.z = (GLint) vert0->win[2];
+ span.z = (GLuint) vert0->win[2];
span.zStep = (GLint) ((vert1->win[2] - vert0->win[2]) / numPixels);
}
}
diff --git a/src/mesa/swrast/s_pointtemp.h b/src/mesa/swrast/s_pointtemp.h
index eca0b9d38d..cc6f999b91 100644
--- a/src/mesa/swrast/s_pointtemp.h
+++ b/src/mesa/swrast/s_pointtemp.h
@@ -1,8 +1,8 @@
/*
* Mesa 3-D graphics library
- * Version: 6.5.2
+ * Version: 6.5.3
*
- * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
+ * Copyright (C) 1999-2007 Brian Paul All Rights Reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -195,7 +195,7 @@ NAME ( GLcontext *ctx, const SWvertex *vert )
{{
GLint x, y;
const GLfloat radius = 0.5F * size;
- const GLint z = (GLint) (vert->win[2] + 0.5F);
+ const GLuint z = (GLuint) (vert->win[2] + 0.5F);
GLuint count;
#if FLAGS & SMOOTH
const GLfloat rmin = radius - 0.7071F; /* 0.7071 = sqrt(2)/2 */
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index 75134ab462..a7b25a4633 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -94,8 +94,8 @@ read_depth_pixels( GLcontext *ctx,
/* clipping should have been done already */
ASSERT(x >= 0);
ASSERT(y >= 0);
- ASSERT(x + width <= rb->Width);
- ASSERT(y + height <= rb->Height);
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
/* width should never be > MAX_WIDTH since we did clipping earlier */
ASSERT(width <= MAX_WIDTH);
@@ -210,8 +210,8 @@ fast_read_rgba_pixels( GLcontext *ctx,
ASSERT(rb->_BaseFormat == GL_RGBA || rb->_BaseFormat == GL_RGB);
/* clipping should have already been done */
- ASSERT(x + width <= rb->Width);
- ASSERT(y + height <= rb->Height);
+ ASSERT(x + width <= (GLint) rb->Width);
+ ASSERT(y + height <= (GLint) rb->Height);
/* check for things we can't handle here */
if (transferOps ||
@@ -223,8 +223,9 @@ fast_read_rgba_pixels( GLcontext *ctx,
if (format == GL_RGBA && rb->DataType == type) {
const GLint dstStride = _mesa_image_row_stride(packing, width,
format, type);
- GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
GLint row;
ASSERT(rb->GetRow);
for (row = 0; row < height; row++) {
@@ -239,8 +240,9 @@ fast_read_rgba_pixels( GLcontext *ctx,
type == GL_UNSIGNED_BYTE) {
const GLint dstStride = _mesa_image_row_stride(packing, width,
format, type);
- GLubyte *dest = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dest
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
GLint row;
ASSERT(rb->GetRow);
for (row = 0; row < height; row++) {
@@ -396,8 +398,9 @@ read_rgba_pixels( GLcontext *ctx,
= _mesa_image_row_stride(packing, width, format, type);
GLfloat (*rgba)[4] = swrast->SpanArrays->attribs[FRAG_ATTRIB_COL0];
GLint row;
- GLubyte *dst = _mesa_image_address2d(packing, pixels, width, height,
- format, type, 0, 0);
+ GLubyte *dst
+ = (GLubyte *) _mesa_image_address2d(packing, pixels, width, height,
+ format, type, 0, 0);
for (row = 0; row < height; row++, y++) {
diff --git a/src/mesa/swrast/s_stencil.c b/src/mesa/swrast/s_stencil.c
index dbab6b3c20..a8aa1d4b6d 100644
--- a/src/mesa/swrast/s_stencil.c
+++ b/src/mesa/swrast/s_stencil.c
@@ -1062,7 +1062,8 @@ void
_swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
GLint n, GLint x, GLint y, GLstencil stencil[])
{
- if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) {
+ if (y < 0 || y >= (GLint) rb->Height ||
+ x + n <= 0 || x >= (GLint) rb->Width) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1073,7 +1074,7 @@ _swrast_read_stencil_span(GLcontext *ctx, struct gl_renderbuffer *rb,
n -= dx;
stencil += dx;
}
- if (x + n > rb->Width) {
+ if (x + n > (GLint) rb->Width) {
GLint dx = x + n - rb->Width;
n -= dx;
}
@@ -1103,7 +1104,8 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
const GLuint stencilMax = (1 << fb->Visual.stencilBits) - 1;
const GLuint stencilMask = ctx->Stencil.WriteMask[0];
- if (y < 0 || y >= rb->Height || x + n <= 0 || x >= rb->Width) {
+ if (y < 0 || y >= (GLint) rb->Height ||
+ x + n <= 0 || x >= (GLint) rb->Width) {
/* span is completely outside framebuffer */
return; /* undefined values OK */
}
@@ -1113,7 +1115,7 @@ _swrast_write_stencil_span(GLcontext *ctx, GLint n, GLint x, GLint y,
n -= dx;
stencil += dx;
}
- if (x + n > rb->Width) {
+ if (x + n > (GLint) rb->Width) {
GLint dx = x + n - rb->Width;
n -= dx;
}
@@ -1191,7 +1193,7 @@ _swrast_clear_stencil_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
}
else {
/* no bit masking */
- if (width == rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
+ if (width == (GLint) rb->Width && rb->DataType == GL_UNSIGNED_BYTE) {
/* optimized case */
/* Note: bottom-to-top raster assumed! */
GLubyte *stencil = (GLubyte *) rb->GetPointer(ctx, rb, x, y);
diff --git a/src/mesa/swrast/s_texfilter.c b/src/mesa/swrast/s_texfilter.c
index f55e23422d..b2c5574d95 100644
--- a/src/mesa/swrast/s_texfilter.c
+++ b/src/mesa/swrast/s_texfilter.c
@@ -1196,7 +1196,9 @@ sample_linear_2d( GLcontext *ctx,
GLuint i;
struct gl_texture_image *image = tObj->Image[0][tObj->BaseLevel];
(void) lambda;
- if (tObj->WrapS == GL_REPEAT && tObj->WrapT == GL_REPEAT) {
+ if (tObj->WrapS == GL_REPEAT &&
+ tObj->WrapT == GL_REPEAT &&
+ image->_IsPowerOfTwo) {
for (i=0;i<n;i++) {
sample_2d_linear_repeat(ctx, tObj, image, texcoords[i], rgba[i]);
}
diff --git a/src/mesa/swrast/s_zoom.c b/src/mesa/swrast/s_zoom.c
index a4e8d9a36f..9bec0bb1a1 100644
--- a/src/mesa/swrast/s_zoom.c
+++ b/src/mesa/swrast/s_zoom.c
@@ -210,7 +210,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
COPY_4UBV(zoomed.array->color.sz1.rgba[i], rgba[j]);
}
}
@@ -220,7 +220,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
COPY_4V(zoomed.array->color.sz2.rgba[i], rgba[j]);
}
}
@@ -242,7 +242,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->color.sz1.rgba[i][0] = rgb[j][0];
zoomed.array->color.sz1.rgba[i][1] = rgb[j][1];
zoomed.array->color.sz1.rgba[i][2] = rgb[j][2];
@@ -255,7 +255,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->color.sz2.rgba[i][0] = rgb[j][0];
zoomed.array->color.sz2.rgba[i][1] = rgb[j][1];
zoomed.array->color.sz2.rgba[i][2] = rgb[j][2];
@@ -282,7 +282,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->index[i] = indexes[j];
}
}
@@ -292,7 +292,7 @@ zoom_span( GLcontext *ctx, GLint imgX, GLint imgY, const SWspan *span,
for (i = 0; i < zoomedWidth; i++) {
GLint j = unzoom_x(ctx->Pixel.ZoomX, imgX, x0 + i) - span->x;
ASSERT(j >= 0);
- ASSERT(j < span->end);
+ ASSERT(j < (GLint) span->end);
zoomed.array->z[i] = zValues[j];
}
/* Now, fall into either the RGB or COLOR_INDEX path below */