summaryrefslogtreecommitdiff
path: root/src/mesa/swrast
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r--src/mesa/swrast/s_accum.c6
-rw-r--r--src/mesa/swrast/s_linetemp.h1
-rw-r--r--src/mesa/swrast/s_readpix.c18
3 files changed, 10 insertions, 15 deletions
diff --git a/src/mesa/swrast/s_accum.c b/src/mesa/swrast/s_accum.c
index 2dd9ca6348..854e106b7f 100644
--- a/src/mesa/swrast/s_accum.c
+++ b/src/mesa/swrast/s_accum.c
@@ -130,11 +130,7 @@ _swrast_clear_accum_buffer( GLcontext *ctx, struct gl_renderbuffer *rb )
SWcontext *swrast = SWRAST_CONTEXT(ctx);
GLuint x, y, width, height;
- if (ctx->Visual.accumRedBits == 0) {
- /* No accumulation buffer! Not an error. */
- return;
- }
-
+ /* No accumulation buffer! Not an error. */
if (!rb || !rb->Data)
return;
diff --git a/src/mesa/swrast/s_linetemp.h b/src/mesa/swrast/s_linetemp.h
index 182f962e1e..033431df23 100644
--- a/src/mesa/swrast/s_linetemp.h
+++ b/src/mesa/swrast/s_linetemp.h
@@ -84,7 +84,6 @@ NAME( GLcontext *ctx, const SWvertex *vert0, const SWvertex *vert1 )
DEPTH_TYPE *zPtr;
#elif defined(INTERP_Z)
const GLint depthBits = ctx->DrawBuffer->Visual.depthBits;
-/*ctx->Visual.depthBits;*/
#endif
#ifdef PIXEL_ADDRESS
PIXEL_TYPE *pixelPtr;
diff --git a/src/mesa/swrast/s_readpix.c b/src/mesa/swrast/s_readpix.c
index ecabac6921..368311e14d 100644
--- a/src/mesa/swrast/s_readpix.c
+++ b/src/mesa/swrast/s_readpix.c
@@ -253,21 +253,21 @@ fast_read_rgba_pixels( GLcontext *ctx,
/**
* When we're using a low-precision color buffer (like 16-bit 5/6/5)
* we have to adjust our color values a bit to pass conformance.
- * The problem is when a 5 or 6-bit color value is convert to an 8-bit
+ * The problem is when a 5 or 6-bit color value is converted to an 8-bit
* value and then a floating point value, the floating point values don't
* increment uniformly as the 5 or 6-bit value is incremented.
*
* This function adjusts floating point values to compensate.
*/
static void
-adjust_colors(GLcontext *ctx, GLuint n, GLfloat rgba[][4])
+adjust_colors(const struct gl_framebuffer *fb, GLuint n, GLfloat rgba[][4])
{
- const GLuint rShift = 8 - ctx->Visual.redBits;
- const GLuint gShift = 8 - ctx->Visual.greenBits;
- const GLuint bShift = 8 - ctx->Visual.blueBits;
- const GLfloat rScale = 1.0F / (GLfloat) ((1 << ctx->Visual.redBits ) - 1);
- const GLfloat gScale = 1.0F / (GLfloat) ((1 << ctx->Visual.greenBits) - 1);
- const GLfloat bScale = 1.0F / (GLfloat) ((1 << ctx->Visual.blueBits ) - 1);
+ const GLuint rShift = 8 - fb->Visual.redBits;
+ const GLuint gShift = 8 - fb->Visual.greenBits;
+ const GLuint bShift = 8 - fb->Visual.blueBits;
+ const GLfloat rScale = 1.0F / (GLfloat) ((1 << fb->Visual.redBits ) - 1);
+ const GLfloat gScale = 1.0F / (GLfloat) ((1 << fb->Visual.greenBits) - 1);
+ const GLfloat bScale = 1.0F / (GLfloat) ((1 << fb->Visual.blueBits ) - 1);
GLuint i;
for (i = 0; i < n; i++) {
GLint r, g, b;
@@ -390,7 +390,7 @@ read_rgba_pixels( GLcontext *ctx,
if (fb->Visual.redBits < 8 ||
fb->Visual.greenBits < 8 ||
fb->Visual.blueBits < 8) {
- adjust_colors(ctx, width, rgba);
+ adjust_colors(fb, width, rgba);
}
/* pack the row of RGBA pixels into user's buffer */