diff options
author | Brian Paul <[email protected]> | 2011-12-24 08:54:26 -0700 |
---|---|---|
committer | Brian Paul <[email protected]> | 2011-12-24 08:54:26 -0700 |
commit | fc41473b9f7d1171a2921a825807889b8fcbcaaf (patch) | |
tree | 436f32a8177ad21b34660d14023312a8a02380bd /src/mesa/swrast | |
parent | c4b5f0cadb18bad22b4c28424723a09832209c6f (diff) |
mesa: remove gl_renderbufer::PutMonoRow() and PutMonoValues()
The former was only used for clearing buffers. The later wasn't used
anywhere! Remove them and all implementations of those functions.
Reviewed-by: Eric Anholt <[email protected]>
Diffstat (limited to 'src/mesa/swrast')
-rw-r--r-- | src/mesa/swrast/s_depthstencil.c | 243 | ||||
-rw-r--r-- | src/mesa/swrast/s_renderbuffer.c | 408 | ||||
-rw-r--r-- | src/mesa/swrast/s_spantemp.h | 55 | ||||
-rw-r--r-- | src/mesa/swrast/s_texrender.c | 117 |
4 files changed, 1 insertions, 822 deletions
diff --git a/src/mesa/swrast/s_depthstencil.c b/src/mesa/swrast/s_depthstencil.c index dc768e21699..e2558c4859a 100644 --- a/src/mesa/swrast/s_depthstencil.c +++ b/src/mesa/swrast/s_depthstencil.c @@ -207,59 +207,6 @@ put_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count, } } -static void -put_mono_row_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(z24rb->DataType == GL_UNSIGNED_INT); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (dst) { - /* direct access */ - GLuint i; - if (dsrb->Format == MESA_FORMAT_Z24_S8) { - const GLuint shiftedVal = *((GLuint *) value) << 8; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = shiftedVal | (dst[i] & 0xff); - } - } - } - else { - const GLuint shiftedVal = *((GLuint *) value); - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = shiftedVal | (dst[i] & 0xff000000); - } - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - if (dsrb->Format == MESA_FORMAT_Z24_S8) { - const GLuint shiftedVal = *((GLuint *) value) << 8; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); - } - } - } - else { - const GLuint shiftedVal = *((GLuint *) value); - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff000000); - } - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} static void put_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint count, @@ -314,35 +261,6 @@ put_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, GLuint cou } } -static void -put_mono_values_z24(struct gl_context *ctx, struct gl_renderbuffer *z24rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z24rb->Wrapped; - GLuint temp[MAX_WIDTH], i; - /* get, modify, put */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - if (dsrb->Format == MESA_FORMAT_Z24_S8) { - const GLuint shiftedVal = *((GLuint *) value) << 8; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff); - } - } - } - else { - const GLuint shiftedVal = *((GLuint *) value); - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = shiftedVal | (temp[i] & 0xff000000); - } - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); -} - /** * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like @@ -386,9 +304,7 @@ new_z24_renderbuffer_wrapper(struct gl_context *ctx, z24rb->GetValues = get_values_z24; z24rb->PutRow = put_row_z24; z24rb->PutRowRGB = NULL; - z24rb->PutMonoRow = put_mono_row_z24; z24rb->PutValues = put_values_z24; - z24rb->PutMonoValues = put_mono_values_z24; return z24rb; } @@ -467,39 +383,6 @@ put_row_z32f(struct gl_context *ctx, struct gl_renderbuffer *z32frb, GLuint coun } } -static void -put_mono_row_z32f(struct gl_context *ctx, struct gl_renderbuffer *z32frb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z32frb->Wrapped; - GLfloat *dst = (GLfloat *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(z32frb->DataType == GL_FLOAT); - ASSERT(dsrb->DataType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); - ASSERT(dsrb->Format == MESA_FORMAT_Z32_FLOAT_X24S8); - if (dst) { - /* direct access */ - GLuint i; - const GLfloat val = *(GLfloat*)value; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i*2] = val; - } - } - } - else { - /* get, modify, put */ - GLfloat temp[MAX_WIDTH*2]; - GLuint i; - const GLfloat val = *(GLfloat *)value; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i*2] = val; - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} static void put_values_z32f(struct gl_context *ctx, struct gl_renderbuffer *z32frb, GLuint count, @@ -535,28 +418,6 @@ put_values_z32f(struct gl_context *ctx, struct gl_renderbuffer *z32frb, GLuint c } } -static void -put_mono_values_z32f(struct gl_context *ctx, struct gl_renderbuffer *z32frb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = z32frb->Wrapped; - GLfloat temp[MAX_WIDTH*2]; - GLuint i; - const GLfloat val = *(GLfloat *)value; - ASSERT(z32frb->DataType == GL_FLOAT); - ASSERT(dsrb->DataType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); - ASSERT(dsrb->Format == MESA_FORMAT_Z32_FLOAT_X24S8); - /* get, modify, put */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i*2] = val; - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); -} - /** * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like @@ -597,9 +458,7 @@ new_z32f_renderbuffer_wrapper(struct gl_context *ctx, z32frb->GetValues = get_values_z32f; z32frb->PutRow = put_row_z32f; z32frb->PutRowRGB = NULL; - z32frb->PutMonoRow = put_mono_row_z32f; z32frb->PutValues = put_values_z32f; - z32frb->PutMonoValues = put_mono_values_z32f; return z32frb; } @@ -739,71 +598,6 @@ put_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count, } } -static void -put_mono_row_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - const GLubyte val = *((GLubyte *) value); - GLuint *dst = (GLuint *) dsrb->GetPointer(ctx, dsrb, x, y); - ASSERT(s8rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(dsrb->DataType == GL_UNSIGNED_INT_24_8_EXT || - dsrb->DataType == GL_FLOAT_32_UNSIGNED_INT_24_8_REV); - if (dst) { - /* direct access */ - GLuint i; - if (dsrb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i*2+1] = val; - } - } - } - else if (dsrb->Format == MESA_FORMAT_Z24_S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff00) | val; - } - } - } - else { - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i] = (dst[i] & 0xffffff) | (val << 24); - } - } - } - } - else { - /* get, modify, put */ - GLuint temp[MAX_WIDTH*2], i; - dsrb->GetRow(ctx, dsrb, count, x, y, temp); - if (dsrb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i*2+1] = val; - } - } - } - else if (dsrb->Format == MESA_FORMAT_Z24_S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | val; - } - } - } - else { - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff) | (val << 24); - } - } - } - dsrb->PutRow(ctx, dsrb, count, x, y, temp, mask); - } -} static void put_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count, @@ -874,41 +668,6 @@ put_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count } } -static void -put_mono_values_s8(struct gl_context *ctx, struct gl_renderbuffer *s8rb, GLuint count, - const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct gl_renderbuffer *dsrb = s8rb->Wrapped; - GLuint temp[MAX_WIDTH*2], i; - const GLubyte val = *((GLubyte *) value); - /* get, modify, put */ - dsrb->GetValues(ctx, dsrb, count, x, y, temp); - if (dsrb->Format == MESA_FORMAT_Z32_FLOAT_X24S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i*2+1] = val; - } - } - } - else if (dsrb->Format == MESA_FORMAT_Z24_S8) { - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff00) | val; - } - } - } - else { - assert(dsrb->Format == MESA_FORMAT_S8_Z24); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - temp[i] = (temp[i] & 0xffffff) | (val << 24); - } - } - } - dsrb->PutValues(ctx, dsrb, count, x, y, temp, mask); -} - /** * Wrap the given GL_DEPTH_STENCIL renderbuffer so that it acts like @@ -951,9 +710,7 @@ new_s8_renderbuffer_wrapper(struct gl_context *ctx, struct gl_renderbuffer *dsrb s8rb->GetValues = get_values_s8; s8rb->PutRow = put_row_s8; s8rb->PutRowRGB = NULL; - s8rb->PutMonoRow = put_mono_row_s8; s8rb->PutValues = put_values_s8; - s8rb->PutMonoValues = put_mono_values_s8; return s8rb; } diff --git a/src/mesa/swrast/s_renderbuffer.c b/src/mesa/swrast/s_renderbuffer.c index bb7cdebfe8c..881f3e6337b 100644 --- a/src/mesa/swrast/s_renderbuffer.c +++ b/src/mesa/swrast/s_renderbuffer.c @@ -158,31 +158,6 @@ put_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb, } } -static void -put_mono_row_generic(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *value, const GLubyte *mask) -{ - void *row = rb->GetPointer(ctx, rb, x, y); - int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat); - unsigned int i; - - if (mask) { - for (i = 0; i < count; i++) { - char *dst = (char *) row + i * format_bytes; - if (mask[i]) { - memcpy(dst, value, format_bytes); - } - } - } - else { - for (i = 0; i < count; i++) { - char *dst = (char *) row + i * format_bytes; - memcpy(dst, value, format_bytes); - } - } -} - static void put_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb, @@ -203,22 +178,6 @@ put_values_generic(struct gl_context *ctx, struct gl_renderbuffer *rb, } -static void -put_mono_values_generic(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - int format_bytes = _mesa_get_format_bytes(rb->Format) / sizeof(GLfloat); - unsigned int i; - - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - void *dst = rb->GetPointer(ctx, rb, x[i], y[i]); - memcpy(dst, value, format_bytes); - } - } -} /********************************************************************** * Functions for buffers of 1 X GLubyte values. @@ -261,30 +220,6 @@ put_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, static void -put_mono_row_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLubyte val = *((const GLubyte *) value); - GLubyte *dst = (GLubyte *) rb->Data + y * rb->RowStride + x; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void put_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -301,23 +236,6 @@ put_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint coun } -static void -put_mono_values_ubyte(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLubyte val = *((const GLubyte *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = (GLubyte *) rb->Data + y[i] * rb->RowStride + x[i]; - *dst = val; - } - } -} - - /********************************************************************** * Functions for buffers of 1 X GLushort values. * Typically depth/Z. @@ -359,30 +277,6 @@ put_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, static void -put_mono_row_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLushort val = *((const GLushort *) value); - GLushort *dst = (GLushort *) rb->Data + y * rb->RowStride + x; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void put_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -399,32 +293,6 @@ put_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint cou } -static void -put_mono_values_ushort(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLushort val = *((const GLushort *) value); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i]; - *dst = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - GLushort *dst = (GLushort *) rb->Data + y[i] * rb->RowStride + x[i]; - *dst = val; - } - } -} - - /********************************************************************** * Functions for buffers of 1 X GLuint values. * Typically depth/Z or color index. @@ -468,31 +336,6 @@ put_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, static void -put_mono_row_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLuint val = *((const GLuint *) value); - GLuint *dst = (GLuint *) rb->Data + y * rb->RowStride + x; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } -} - - -static void put_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -510,24 +353,6 @@ put_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count } -static void -put_mono_values_uint(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - const GLint x[], const GLint y[], const void *value, - const GLubyte *mask) -{ - const GLuint val = *((const GLuint *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_INT || - rb->DataType == GL_UNSIGNED_INT_24_8_EXT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + y[i] * rb->RowStride + x[i]; - *dst = val; - } - } -} - - /********************************************************************** * Functions for buffers of 3 X GLubyte (or GLbyte) values. * Typically color buffers. @@ -626,34 +451,6 @@ put_row_rgb_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co static void -put_mono_row_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - /* note: incoming value is RGB+A! */ - const GLubyte val0 = ((const GLubyte *) value)[0]; - const GLubyte val1 = ((const GLubyte *) value)[1]; - const GLubyte val2 = ((const GLubyte *) value)[2]; - GLubyte *dst = (GLubyte *) rb->Data + 3 * (y * rb->RowStride + x); - ASSERT(rb->Format == MESA_FORMAT_RGB888); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - if (!mask && val0 == val1 && val1 == val2) { - /* optimized case */ - memset(dst, val0, 3 * count); - } - else { - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 3 + 0] = val0; - dst[i * 3 + 1] = val1; - dst[i * 3 + 2] = val2; - } - } - } -} - - -static void put_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -674,30 +471,6 @@ put_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint cou } -static void -put_mono_values_ubyte3(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - /* note: incoming value is RGB+A! */ - const GLubyte val0 = ((const GLubyte *) value)[0]; - const GLubyte val1 = ((const GLubyte *) value)[1]; - const GLubyte val2 = ((const GLubyte *) value)[2]; - GLuint i; - ASSERT(rb->Format == MESA_FORMAT_RGB888); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLubyte *dst = ((GLubyte *) rb->Data) + - 3 * (y[i] * rb->RowStride + x[i]); - dst[0] = val0; - dst[1] = val1; - dst[2] = val2; - } - } -} - - /********************************************************************** * Functions for buffers of 4 X GLubyte (or GLbyte) values. * Typically color buffers. @@ -767,40 +540,6 @@ put_row_rgb_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co static void -put_mono_row_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint val = *((const GLuint *) value); - GLuint *dst = (GLuint *) rb->Data + (y * rb->RowStride + x); - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->Format == MESA_FORMAT_RGBA8888 || - rb->Format == MESA_FORMAT_RGBA8888_REV); - if (!mask && val == 0) { - /* common case */ - memset(dst, 0, count * 4 * sizeof(GLubyte)); - } - else { - /* general case */ - if (mask) { - GLuint i; - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = val; - } - } - } - else { - GLuint i; - for (i = 0; i < count; i++) { - dst[i] = val; - } - } - } -} - - -static void put_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -820,26 +559,6 @@ put_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint cou } -static void -put_mono_values_ubyte4(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - /* treat 4*GLubyte as 1*GLuint */ - const GLuint val = *((const GLuint *) value); - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_BYTE); - ASSERT(rb->Format == MESA_FORMAT_RGBA8888 || - rb->Format == MESA_FORMAT_RGBA8888_REV); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLuint *dst = (GLuint *) rb->Data + (y[i] * rb->RowStride + x[i]); - *dst = val; - } - } -} - - /********************************************************************** * Functions for buffers of 4 X GLushort (or GLshort) values. * Typically accum buffer. @@ -910,34 +629,6 @@ put_row_rgb_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint c static void -put_mono_row_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - const GLushort val0 = ((const GLushort *) value)[0]; - const GLushort val1 = ((const GLushort *) value)[1]; - const GLushort val2 = ((const GLushort *) value)[2]; - const GLushort val3 = ((const GLushort *) value)[3]; - GLushort *dst = (GLushort *) rb->Data + 4 * (y * rb->RowStride + x); - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - if (!mask && val0 == 0 && val1 == 0 && val2 == 0 && val3 == 0) { - /* common case for clearing accum buffer */ - memset(dst, 0, count * 4 * sizeof(GLushort)); - } - else { - GLuint i; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - dst[i * 4 + 0] = val0; - dst[i * 4 + 1] = val1; - dst[i * 4 + 2] = val2; - dst[i * 4 + 3] = val3; - } - } - } -} - - -static void put_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -958,29 +649,6 @@ put_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co } -static void -put_mono_values_ushort4(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const GLushort val0 = ((const GLushort *) value)[0]; - const GLushort val1 = ((const GLushort *) value)[1]; - const GLushort val2 = ((const GLushort *) value)[2]; - const GLushort val3 = ((const GLushort *) value)[3]; - GLuint i; - ASSERT(rb->DataType == GL_UNSIGNED_SHORT || rb->DataType == GL_SHORT); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - GLushort *dst = ((GLushort *) rb->Data) + - 4 * (y[i] * rb->RowStride + x[i]); - dst[0] = val0; - dst[1] = val1; - dst[2] = val2; - dst[3] = val3; - } - } -} - /********************************************************************** * Functions for MESA_FORMAT_R8. */ @@ -1241,29 +909,6 @@ put_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb, } static void -put_mono_row_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *value, const GLubyte *mask) -{ - float *dst = rb->GetPointer(ctx, rb, x, y); - const float *src = value; - unsigned int i; - - if (mask) { - for (i = 0; i < count; i++) { - if (mask[i]) { - dst[i] = src[ACOMP]; - } - } - } - else { - for (i = 0; i < count; i++) { - dst[i] = src[ACOMP]; - } - } -} - -static void put_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -1280,23 +925,6 @@ put_values_a_float32(struct gl_context *ctx, struct gl_renderbuffer *rb, } } -static void -put_mono_values_a_float32(struct gl_context *ctx, - struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - const float *src = value; - unsigned int i; - - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - float *dst = rb->GetPointer(ctx, rb, x[i], y[i]); - *dst = src[ACOMP]; - } - } -} - /********************************************************************** * Functions for MESA_FORMAT_R_FLOAT32. */ @@ -1391,9 +1019,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_ubyte3; rb->PutRow = put_row_ubyte3; rb->PutRowRGB = put_row_rgb_ubyte3; - rb->PutMonoRow = put_mono_row_ubyte3; rb->PutValues = put_values_ubyte3; - rb->PutMonoValues = put_mono_values_ubyte3; break; case MESA_FORMAT_RGBA8888: @@ -1402,9 +1028,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_ubyte4; rb->PutRow = put_row_ubyte4; rb->PutRowRGB = put_row_rgb_ubyte4; - rb->PutMonoRow = put_mono_row_ubyte4; rb->PutValues = put_values_ubyte4; - rb->PutMonoValues = put_mono_values_ubyte4; break; case MESA_FORMAT_R8: @@ -1413,9 +1037,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetRow = get_row_r8; rb->PutRow = put_row_generic; rb->PutRowRGB = put_row_generic; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_GR88: @@ -1424,9 +1046,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetRow = get_row_rg88; rb->PutRow = put_row_generic; rb->PutRowRGB = put_row_generic; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_R16: @@ -1435,9 +1055,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetRow = get_row_r16; rb->PutRow = put_row_generic; rb->PutRowRGB = put_row_generic; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_RG1616: @@ -1446,9 +1064,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetRow = get_row_rg1616; rb->PutRow = put_row_generic; rb->PutRowRGB = put_row_generic; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_SIGNED_RGBA_16: @@ -1456,9 +1072,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_ushort4; rb->PutRow = put_row_ushort4; rb->PutRowRGB = put_row_rgb_ushort4; - rb->PutMonoRow = put_mono_row_ushort4; rb->PutValues = put_values_ushort4; - rb->PutMonoValues = put_mono_values_ushort4; break; case MESA_FORMAT_S8: @@ -1466,9 +1080,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_ubyte; rb->PutRow = put_row_ubyte; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ubyte; rb->PutValues = put_values_ubyte; - rb->PutMonoValues = put_mono_values_ubyte; break; case MESA_FORMAT_Z16: @@ -1476,9 +1088,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_ushort; rb->PutRow = put_row_ushort; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_ushort; rb->PutValues = put_values_ushort; - rb->PutMonoValues = put_mono_values_ushort; break; case MESA_FORMAT_Z32: @@ -1488,9 +1098,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_uint; rb->PutRow = put_row_uint; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; break; case MESA_FORMAT_Z24_S8: @@ -1499,9 +1107,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_uint; rb->PutRow = put_row_uint; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_uint; rb->PutValues = put_values_uint; - rb->PutMonoValues = put_mono_values_uint; break; case MESA_FORMAT_RGBA_FLOAT32: @@ -1509,9 +1115,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_generic; rb->PutRow = put_row_generic; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_INTENSITY_FLOAT32: @@ -1519,9 +1123,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_i_float32; rb->PutRow = put_row_generic; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_LUMINANCE_FLOAT32: @@ -1529,9 +1131,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_l_float32; rb->PutRow = put_row_generic; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_ALPHA_FLOAT32: @@ -1539,9 +1139,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_a_float32; rb->PutRow = put_row_a_float32; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_a_float32; rb->PutValues = put_values_a_float32; - rb->PutMonoValues = put_mono_values_a_float32; break; case MESA_FORMAT_RG_FLOAT32: @@ -1549,9 +1147,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_rg_float32; rb->PutRow = put_row_generic; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; case MESA_FORMAT_R_FLOAT32: @@ -1559,9 +1155,7 @@ _swrast_set_renderbuffer_accessors(struct gl_renderbuffer *rb) rb->GetValues = get_values_r_float32; rb->PutRow = put_row_generic; rb->PutRowRGB = NULL; - rb->PutMonoRow = put_mono_row_generic; rb->PutValues = put_values_generic; - rb->PutMonoValues = put_mono_values_generic; break; default: @@ -1651,9 +1245,7 @@ soft_renderbuffer_storage(struct gl_context *ctx, struct gl_renderbuffer *rb, ASSERT(rb->GetRow); ASSERT(rb->GetValues); ASSERT(rb->PutRow); - ASSERT(rb->PutMonoRow); ASSERT(rb->PutValues); - ASSERT(rb->PutMonoValues); /* free old buffer storage */ if (rb->Data) { diff --git a/src/mesa/swrast/s_spantemp.h b/src/mesa/swrast/s_spantemp.h index 517c2eb3fbe..ff26856679c 100644 --- a/src/mesa/swrast/s_spantemp.h +++ b/src/mesa/swrast/s_spantemp.h @@ -25,8 +25,7 @@ /* * Templates for the span/pixel-array write/read functions called via - * the gl_renderbuffer's GetRow, GetValues, PutRow, PutMonoRow, PutValues - * and PutMonoValues functions. + * the gl_renderbuffer's GetRow, GetValues, PutRow, and PutValues. * * Define the following macros before including this file: * NAME(BASE) to generate the function name (i.e. add prefix or suffix) @@ -144,36 +143,6 @@ NAME(put_row_rgb)( struct gl_context *ctx, struct gl_renderbuffer *rb, static void -NAME(put_mono_row)( struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, GLint x, GLint y, - const void *value, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE *src = (const RB_TYPE *) value; - GLuint i; - INIT_PIXEL_PTR(pixel, x, y); - if (mask) { - for (i = 0; i < count; i++) { - if (mask[i]) { - STORE_PIXEL(pixel, x + i, y, src); - } - INC_PIXEL_PTR(pixel); - } - } - else { - for (i = 0; i < count; i++) { - STORE_PIXEL(pixel, x + i, y, src); - INC_PIXEL_PTR(pixel); - } - } - (void) rb; - (void) ctx; -} - - -static void NAME(put_values)( struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte mask[] ) @@ -195,28 +164,6 @@ NAME(put_values)( struct gl_context *ctx, struct gl_renderbuffer *rb, } -static void -NAME(put_mono_values)( struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte mask[] ) -{ -#ifdef SPAN_VARS - SPAN_VARS -#endif - const RB_TYPE *src = (const RB_TYPE *) value; - GLuint i; - ASSERT(mask); - for (i = 0; i < count; i++) { - if (mask[i]) { - INIT_PIXEL_PTR(pixel, x[i], y[i]); - STORE_PIXEL(pixel, x[i], y[i], src); - } - } - (void) rb; - (void) ctx; -} - - #undef NAME #undef RB_TYPE #undef RB_COMPONENTS diff --git a/src/mesa/swrast/s_texrender.c b/src/mesa/swrast/s_texrender.c index 3734ce6d527..08ceb4dbf15 100644 --- a/src/mesa/swrast/s_texrender.c +++ b/src/mesa/swrast/s_texrender.c @@ -298,64 +298,6 @@ texture_put_row_rgb(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint c static void -texture_put_mono_row(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, - GLint x, GLint y, const void *value, const GLubyte *mask) -{ - struct texture_renderbuffer *trb = texture_renderbuffer(rb); - const GLint z = trb->Zoffset; - GLuint i; - - y += trb->Yoffset; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) value; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, rgba); - } - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort zValue = *((const GLushort *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint zValue = *((const GLuint *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &flt); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x + i, y, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_row"); - } -} - - -static void texture_put_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint count, const GLint x[], const GLint y[], const void *values, const GLubyte *mask) @@ -414,63 +356,6 @@ texture_put_values(struct gl_context *ctx, struct gl_renderbuffer *rb, GLuint co static void -texture_put_mono_values(struct gl_context *ctx, struct gl_renderbuffer *rb, - GLuint count, const GLint x[], const GLint y[], - const void *value, const GLubyte *mask) -{ - struct texture_renderbuffer *trb = texture_renderbuffer(rb); - const GLint z = trb->Zoffset; - GLuint i; - - if (rb->DataType == CHAN_TYPE) { - const GLchan *rgba = (const GLchan *) value; - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, rgba); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT) { - const GLuint zValue = *((const GLuint *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_SHORT) { - const GLushort zValue = *((const GLushort *) value); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &zValue); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_24_8_EXT) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue >> 8) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); - } - } - } - else if (rb->DataType == GL_UNSIGNED_INT_8_24_REV_MESA) { - const GLuint zValue = *((const GLuint *) value); - const GLfloat flt = (GLfloat) ((zValue & 0xffffff) * (1.0 / 0xffffff)); - for (i = 0; i < count; i++) { - if (!mask || mask[i]) { - trb->Store(trb->TexImage, x[i], y[i] + trb->Yoffset, z, &flt); - } - } - } - else { - _mesa_problem(ctx, "invalid rb->DataType in texture_put_mono_values"); - } -} - - -static void store_nop(struct swrast_texture_image *texImage, GLint col, GLint row, GLint img, const void *texel) @@ -515,9 +400,7 @@ wrap_texture(struct gl_context *ctx, struct gl_renderbuffer_attachment *att) trb->Base.GetValues = texture_get_values; trb->Base.PutRow = texture_put_row; trb->Base.PutRowRGB = texture_put_row_rgb; - trb->Base.PutMonoRow = texture_put_mono_row; trb->Base.PutValues = texture_put_values; - trb->Base.PutMonoValues = texture_put_mono_values; /* update attachment point */ _mesa_reference_renderbuffer(&att->Renderbuffer, &(trb->Base)); |