-/* $Id: mtypes.h,v 1.87 2002/09/21 17:34:56 brianp Exp $ */
+/* $Id: mtypes.h,v 1.88 2002/09/23 16:37:13 brianp Exp $ */
/*
* Mesa 3-D graphics library
GLuint Width; /* = 2^WidthLog2 + 2*Border */
GLuint Height; /* = 2^HeightLog2 + 2*Border */
GLuint Depth; /* = 2^DepthLog2 + 2*Border */
+ GLuint RowStride; /* == Width unless IsClientData and padded */
GLuint Width2; /* = Width - 2*Border */
GLuint Height2; /* = Height - 2*Border */
GLuint Depth2; /* = Depth - 2*Border */
-/* $Id: texformat.h,v 1.10 2002/09/21 16:51:25 brianp Exp $ */
+/* $Id: texformat.h,v 1.11 2002/09/23 16:37:14 brianp Exp $ */
/*
* Mesa 3-D graphics library
extern const struct gl_texture_format _mesa_texformat_l8;
extern const struct gl_texture_format _mesa_texformat_i8;
extern const struct gl_texture_format _mesa_texformat_ci8;
-extern const struct gl_texture_format _meas_texformat_ycbcr;
-extern const struct gl_texture_format _meas_texformat_ycbcr_rev;
+extern const struct gl_texture_format _mesa_texformat_ycbcr;
+extern const struct gl_texture_format _mesa_texformat_ycbcr_rev;
/* The null format:
*/
-/* $Id: texformat_tmp.h,v 1.7 2002/09/21 16:51:25 brianp Exp $ */
+/* $Id: texformat_tmp.h,v 1.8 2002/09/23 16:37:14 brianp Exp $ */
/*
* Mesa 3-D graphics library
#elif DIM == 2
#define CHAN_SRC( t, i, j, k, sz ) \
- ((GLchan *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
+ ((GLchan *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define UBYTE_SRC( t, i, j, k, sz ) \
- ((GLubyte *)(t)->Data + ((t)->Width * (j) + (i)) * (sz))
+ ((GLubyte *)(t)->Data + ((t)->RowStride * (j) + (i)) * (sz))
#define USHORT_SRC( t, i, j, k ) \
- ((GLushort *)(t)->Data + ((t)->Width * (j) + (i)))
+ ((GLushort *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define FLOAT_SRC( t, i, j, k ) \
- ((GLfloat *)(t)->Data + ((t)->Width * (j) + (i)))
+ ((GLfloat *)(t)->Data + ((t)->RowStride * (j) + (i)))
#define FETCH(x) fetch_2d_texel_##x
#define CHAN_SRC( t, i, j, k, sz ) \
(GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz)
+ (t)->RowStride + (i)) * (sz)
#define UBYTE_SRC( t, i, j, k, sz ) \
((GLubyte *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)) * (sz))
+ (t)->RowStride + (i)) * (sz))
#define USHORT_SRC( t, i, j, k ) \
((GLushort *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
+ (t)->RowStride + (i)))
#define FLOAT_SRC( t, i, j, k ) \
((GLfloat *)(t)->Data + (((t)->Height * (k) + (j)) * \
- (t)->Width + (i)))
+ (t)->RowStride + (i)))
#define FETCH(x) fetch_3d_texel_##x
-/* $Id: teximage.c,v 1.115 2002/09/21 16:51:25 brianp Exp $ */
+/* $Id: teximage.c,v 1.116 2002/09/23 16:37:14 brianp Exp $ */
/*
* Mesa 3-D graphics library
_mesa_printf(ctx, "%02x%02x%02x ", data[0], data[1], data[2]);
else if (c==4)
_mesa_printf(ctx, "%02x%02x%02x%02x ", data[0], data[1], data[2], data[3]);
- data += c;
+ data += (img->RowStride - img->Width) * c;
}
_mesa_printf(ctx, "\n");
}
img->Width = 0;
img->Height = 0;
img->Depth = 0;
+ img->RowStride = 0;
img->Width2 = 0;
img->Height2 = 0;
img->Depth2 = 0;
img->Width = width;
img->Height = height;
img->Depth = depth;
+ img->RowStride = width;
img->WidthLog2 = logbase2(width - 2 * border);
if (height == 1) /* 1-D texture */
img->HeightLog2 = 0;
}
else if (format == GL_YCBCR_MESA) {
/* No pixel transfer */
- MEMCPY(dest, (const GLushort *) texImage->Data + row * width,
+ const GLint rowstride = texImage->RowStride;
+ MEMCPY(dest,
+ (const GLushort *) texImage->Data + row * rowstride,
width * sizeof(GLushort));
/* check for byte swapping */
if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR
-/* $Id: s_texture.c,v 1.66 2002/09/21 16:51:26 brianp Exp $ */
+/* $Id: s_texture.c,v 1.67 2002/09/23 16:37:15 brianp Exp $ */
/*
* Mesa 3-D graphics library
* Optimized 2-D texture sampling:
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
- * No border
+ * No border,
+ * RowStride == Width,
* Format = GL_RGB
*/
static void
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
* No border
+ * RowStride == Width,
* Format = GL_RGBA
*/
static void
const GLboolean repeatNoBorder = (tObj->WrapS == GL_REPEAT)
&& (tObj->WrapT == GL_REPEAT)
- && (tImg->Border == 0)
+ && (tImg->Border == 0 && (tImg->Width == tImg->RowStride))
&& (tImg->Format != GL_COLOR_INDEX);
ASSERT(lambda != NULL);
-/* $Id: s_triangle.c,v 1.61 2002/08/07 00:45:07 brianp Exp $ */
+/* $Id: s_triangle.c,v 1.62 2002/09/23 16:37:15 brianp Exp $ */
/*
* Mesa 3-D graphics library
&& texObj2D->WrapS==GL_REPEAT
&& texObj2D->WrapT==GL_REPEAT
&& texImg->Border==0
+ && texImg->Width == texImg->RowStride
&& (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR