summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r200
diff options
context:
space:
mode:
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r--src/mesa/drivers/dri/r200/r200_tex.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c
index 2a5603b4d5..6ce143dace 100644
--- a/src/mesa/drivers/dri/r200/r200_tex.c
+++ b/src/mesa/drivers/dri/r200/r200_tex.c
@@ -445,7 +445,6 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target,
{
r200ContextPtr rmesa = R200_CONTEXT(ctx);
- int texelBytes;
if (0)
fprintf(stderr, "intformat %s format %s type %s\n",
@@ -468,7 +467,6 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target,
case GL_RGBA:
if ( format == GL_BGRA && type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
texImage->TexFormat = &_mesa_texformat_argb8888;
- texelBytes = 4;
}
else
return 0;
@@ -477,7 +475,6 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target,
case GL_RGB:
if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
texImage->TexFormat = &_mesa_texformat_rgb565;
- texelBytes = 2;
}
else
return 0;
@@ -487,19 +484,16 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target,
if ( format == GL_YCBCR_MESA &&
type == GL_UNSIGNED_SHORT_8_8_REV_APPLE ) {
texImage->TexFormat = &_mesa_texformat_ycbcr_rev;
- texelBytes = 2;
}
else if ( format == GL_YCBCR_MESA &&
(type == GL_UNSIGNED_SHORT_8_8_APPLE ||
type == GL_UNSIGNED_BYTE)) {
texImage->TexFormat = &_mesa_texformat_ycbcr;
- texelBytes = 2;
}
else
return 0;
break;
-
-
+
default:
return 0;
}
@@ -538,7 +532,8 @@ r200ValidateClientStorage( GLcontext *ctx, GLenum target,
*/
texImage->Data = (void *)pixels;
texImage->IsClientData = GL_TRUE;
- texImage->RowStride = srcRowStride / texelBytes;
+ texImage->RowStride = srcRowStride / texImage->TexFormat->TexelBytes;
+
return 1;
}
}