projects
/
mesa.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
b780888
)
merge gl_texture_image RowStride from DRI 4.0.4
author
Brian Paul
<brian.paul@tungstengraphics.com>
Mon, 23 Sep 2002 16:37:13 +0000
(16:37 +0000)
committer
Brian Paul
<brian.paul@tungstengraphics.com>
Mon, 23 Sep 2002 16:37:13 +0000
(16:37 +0000)
src/mesa/main/mtypes.h
patch
|
blob
|
history
src/mesa/main/texformat.h
patch
|
blob
|
history
src/mesa/main/texformat_tmp.h
patch
|
blob
|
history
src/mesa/main/teximage.c
patch
|
blob
|
history
src/mesa/swrast/s_texture.c
patch
|
blob
|
history
src/mesa/swrast/s_triangle.c
patch
|
blob
|
history
diff --git
a/src/mesa/main/mtypes.h
b/src/mesa/main/mtypes.h
index 3b94967e08ec0f01227340e080e0d4e06f5ea3cd..d3c6c6196d3d86fbcc0d3b63c10e9f1300081f16 100644
(file)
--- a/
src/mesa/main/mtypes.h
+++ b/
src/mesa/main/mtypes.h
@@
-1,4
+1,4
@@
-/* $Id: mtypes.h,v 1.8
7 2002/09/21 17:34:56
brianp Exp $ */
+/* $Id: mtypes.h,v 1.8
8 2002/09/23 16:37:13
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-839,6
+839,7
@@
struct gl_texture_image {
GLuint Width; /* = 2^WidthLog2 + 2*Border */
GLuint Height; /* = 2^HeightLog2 + 2*Border */
GLuint Depth; /* = 2^DepthLog2 + 2*Border */
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 */
GLuint Width2; /* = Width - 2*Border */
GLuint Height2; /* = Height - 2*Border */
GLuint Depth2; /* = Depth - 2*Border */
diff --git
a/src/mesa/main/texformat.h
b/src/mesa/main/texformat.h
index 802f4acefb5381f56c48981bc7c9ebfff8b737cf..d1e7544a420b33e6f734774f908546974df6379d 100644
(file)
--- a/
src/mesa/main/texformat.h
+++ b/
src/mesa/main/texformat.h
@@
-1,4
+1,4
@@
-/* $Id: texformat.h,v 1.1
0 2002/09/21 16:51:25
brianp Exp $ */
+/* $Id: texformat.h,v 1.1
1 2002/09/23 16:37:14
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-144,8
+144,8
@@
extern const struct gl_texture_format _mesa_texformat_a8;
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 _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 _me
as
_texformat_ycbcr;
-extern const struct gl_texture_format _me
as
_texformat_ycbcr_rev;
+extern const struct gl_texture_format _me
sa
_texformat_ycbcr;
+extern const struct gl_texture_format _me
sa
_texformat_ycbcr_rev;
/* The null format:
*/
/* The null format:
*/
diff --git
a/src/mesa/main/texformat_tmp.h
b/src/mesa/main/texformat_tmp.h
index 35f89d549365b443e5c2e45b9dd32d1647e58f88..f796928673f5cb1287d3dfadf2b5b791fee7108a 100644
(file)
--- a/
src/mesa/main/texformat_tmp.h
+++ b/
src/mesa/main/texformat_tmp.h
@@
-1,4
+1,4
@@
-/* $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
/*
* Mesa 3-D graphics library
@@
-43,13
+43,13
@@
#elif DIM == 2
#define CHAN_SRC( t, i, j, k, sz ) \
#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 ) \
#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 ) \
#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 ) \
#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 FETCH(x) fetch_2d_texel_##x
@@
-57,16
+57,16
@@
#define CHAN_SRC( t, i, j, k, sz ) \
(GLchan *)(t)->Data + (((t)->Height * (k) + (j)) * \
#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)) * \
#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)) * \
#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)) * \
#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
#define FETCH(x) fetch_3d_texel_##x
diff --git
a/src/mesa/main/teximage.c
b/src/mesa/main/teximage.c
index e62081be5bdf7a144c06839a6dc36b64dce98190..769f74eda7428c9f93918b2a0015dbfe8610c3cb 100644
(file)
--- a/
src/mesa/main/teximage.c
+++ b/
src/mesa/main/teximage.c
@@
-1,4
+1,4
@@
-/* $Id: teximage.c,v 1.11
5 2002/09/21 16:51:25
brianp Exp $ */
+/* $Id: teximage.c,v 1.11
6 2002/09/23 16:37:14
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-99,7
+99,7
@@
static void PrintTexture(GLcontext *ctx, const struct gl_texture_image *img)
_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]);
_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");
}
}
_mesa_printf(ctx, "\n");
}
@@
-611,6
+611,7
@@
clear_teximage_fields(struct gl_texture_image *img)
img->Width = 0;
img->Height = 0;
img->Depth = 0;
img->Width = 0;
img->Height = 0;
img->Depth = 0;
+ img->RowStride = 0;
img->Width2 = 0;
img->Height2 = 0;
img->Depth2 = 0;
img->Width2 = 0;
img->Height2 = 0;
img->Depth2 = 0;
@@
-642,6
+643,7
@@
_mesa_init_teximage_fields(GLcontext *ctx, GLenum target,
img->Width = width;
img->Height = height;
img->Depth = depth;
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;
img->WidthLog2 = logbase2(width - 2 * border);
if (height == 1) /* 1-D texture */
img->HeightLog2 = 0;
@@
-1413,7
+1415,9
@@
_mesa_GetTexImage( GLenum target, GLint level, GLenum format,
}
else if (format == GL_YCBCR_MESA) {
/* No pixel transfer */
}
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
width * sizeof(GLushort));
/* check for byte swapping */
if ((texImage->TexFormat->MesaFormat == MESA_FORMAT_YCBCR
diff --git
a/src/mesa/swrast/s_texture.c
b/src/mesa/swrast/s_texture.c
index fd2bf95b1788916ceaa80885b7997b1784e0e7a8..b8428c9a66a902cf155222d800227f244cc1c5cc 100644
(file)
--- a/
src/mesa/swrast/s_texture.c
+++ b/
src/mesa/swrast/s_texture.c
@@
-1,4
+1,4
@@
-/* $Id: s_texture.c,v 1.6
6 2002/09/21 16:51:26
brianp Exp $ */
+/* $Id: s_texture.c,v 1.6
7 2002/09/23 16:37:15
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-1119,7
+1119,8
@@
sample_linear_2d( GLcontext *ctx, GLuint texUnit,
* Optimized 2-D texture sampling:
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
* 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
* Format = GL_RGB
*/
static void
@@
-1158,6
+1159,7
@@
opt_sample_rgb_2d( GLcontext *ctx, GLuint texUnit,
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
* No border
* S and T wrap mode == GL_REPEAT
* GL_NEAREST min/mag filter
* No border
+ * RowStride == Width,
* Format = GL_RGBA
*/
static void
* Format = GL_RGBA
*/
static void
@@
-1205,7
+1207,7
@@
sample_lambda_2d( GLcontext *ctx, GLuint texUnit,
const GLboolean repeatNoBorder = (tObj->WrapS == GL_REPEAT)
&& (tObj->WrapT == GL_REPEAT)
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);
&& (tImg->Format != GL_COLOR_INDEX);
ASSERT(lambda != NULL);
diff --git
a/src/mesa/swrast/s_triangle.c
b/src/mesa/swrast/s_triangle.c
index 4e2c40625b43bfcf5fc1858f0eb24da885fe345d..a26f7319c5d27dd1cebdafd10d5458674467b80d 100644
(file)
--- a/
src/mesa/swrast/s_triangle.c
+++ b/
src/mesa/swrast/s_triangle.c
@@
-1,4
+1,4
@@
-/* $Id: s_triangle.c,v 1.6
1 2002/08/07 00:45:07
brianp Exp $ */
+/* $Id: s_triangle.c,v 1.6
2 2002/09/23 16:37:15
brianp Exp $ */
/*
* Mesa 3-D graphics library
/*
* Mesa 3-D graphics library
@@
-1136,6
+1136,7
@@
_swrast_choose_triangle( GLcontext *ctx )
&& texObj2D->WrapS==GL_REPEAT
&& texObj2D->WrapT==GL_REPEAT
&& texImg->Border==0
&& 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
&& (format == MESA_FORMAT_RGB || format == MESA_FORMAT_RGBA)
&& minFilter == magFilter
&& ctx->Light.Model.ColorControl == GL_SINGLE_COLOR