summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/mach64
diff options
context:
space:
mode:
authorBrian Paul <brianp@vmware.com>2009-09-30 20:28:45 -0600
committerBrian Paul <brianp@vmware.com>2009-09-30 20:28:45 -0600
commit1f7c914ad0beea8a29c1a171c7cd1a12f2efe0fa (patch)
tree1126fbf352c0f86b86afda83a7a0ca58e6243723 /src/mesa/drivers/dri/mach64
parente2e7bd6c1f979179e6840cf0e8db72fc72751650 (diff)
mesa: replace gl_texture_format with gl_format
Now gl_texture_image::TexFormat is a simple MESA_FORMAT_x enum. ctx->Driver.ChooseTexture format also returns a MESA_FORMAT_x. gl_texture_format will go away next.
Diffstat (limited to 'src/mesa/drivers/dri/mach64')
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_tex.c34
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texmem.c4
-rw-r--r--src/mesa/drivers/dri/mach64/mach64_texstate.c4
3 files changed, 21 insertions, 21 deletions
diff --git a/src/mesa/drivers/dri/mach64/mach64_tex.c b/src/mesa/drivers/dri/mach64/mach64_tex.c
index 225d23179e..02433e5dd8 100644
--- a/src/mesa/drivers/dri/mach64/mach64_tex.c
+++ b/src/mesa/drivers/dri/mach64/mach64_tex.c
@@ -138,7 +138,7 @@ mach64AllocTexObj( struct gl_texture_object *texObj )
/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
+static gl_format
mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -167,15 +167,15 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGBA2:
case GL_COMPRESSED_RGBA:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
else
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case GL_RGB5_A1:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
else
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
case GL_RGBA8:
case GL_RGB10_A2:
@@ -183,9 +183,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGBA16:
case GL_RGBA4:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
else
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case 3:
case GL_RGB:
@@ -198,9 +198,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB16:
case GL_COMPRESSED_RGB:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888;
+ return MESA_FORMAT_ARGB8888;
else
- return &_mesa_texformat_rgb565;
+ return MESA_FORMAT_RGB565;
case 1:
case GL_LUMINANCE:
@@ -210,9 +210,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_LUMINANCE16:
case GL_COMPRESSED_LUMINANCE:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888; /* inefficient but accurate */
+ return MESA_FORMAT_ARGB8888; /* inefficient but accurate */
else
- return &_mesa_texformat_argb1555;
+ return MESA_FORMAT_ARGB1555;
case GL_INTENSITY4:
case GL_INTENSITY:
@@ -221,9 +221,9 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_INTENSITY16:
case GL_COMPRESSED_INTENSITY:
if (mmesa->mach64Screen->cpp == 4)
- return &_mesa_texformat_argb8888; /* inefficient but accurate */
+ return MESA_FORMAT_ARGB8888; /* inefficient but accurate */
else
- return &_mesa_texformat_argb4444;
+ return MESA_FORMAT_ARGB4444;
case GL_COLOR_INDEX:
case GL_COLOR_INDEX1_EXT:
@@ -232,18 +232,18 @@ mach64ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
case GL_COLOR_INDEX8_EXT:
case GL_COLOR_INDEX12_EXT:
case GL_COLOR_INDEX16_EXT:
- return &_mesa_texformat_ci8;
+ return MESA_FORMAT_CI8;
case GL_YCBCR_MESA:
if (type == GL_UNSIGNED_SHORT_8_8_APPLE ||
type == GL_UNSIGNED_BYTE)
- return &_mesa_texformat_ycbcr;
+ return MESA_FORMAT_YCBCR;
else
- return &_mesa_texformat_ycbcr_rev;
+ return MESA_FORMAT_YCBCR_REV;
default:
_mesa_problem( ctx, "unexpected format in %s", __FUNCTION__ );
- return NULL;
+ return MESA_FORMAT_NONE;
}
}
diff --git a/src/mesa/drivers/dri/mach64/mach64_texmem.c b/src/mesa/drivers/dri/mach64/mach64_texmem.c
index 843b231051..e83aeae3e1 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texmem.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texmem.c
@@ -86,7 +86,7 @@ static void mach64UploadAGPSubImage( mach64ContextPtr mmesa,
if ( !image )
return;
- texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat);
+ texelBytes = _mesa_get_format_bytes(image->TexFormat);
switch ( texelBytes ) {
case 1: texelsPerDword = 4; break;
@@ -153,7 +153,7 @@ static void mach64UploadLocalSubImage( mach64ContextPtr mmesa,
if ( !image )
return;
- texelBytes = _mesa_get_format_bytes(image->TexFormat->MesaFormat);
+ texelBytes = _mesa_get_format_bytes(image->TexFormat);
switch ( texelBytes ) {
case 1: texelsPerDword = 4; break;
diff --git a/src/mesa/drivers/dri/mach64/mach64_texstate.c b/src/mesa/drivers/dri/mach64/mach64_texstate.c
index ff03b0c40a..c333355324 100644
--- a/src/mesa/drivers/dri/mach64/mach64_texstate.c
+++ b/src/mesa/drivers/dri/mach64/mach64_texstate.c
@@ -55,7 +55,7 @@ static void mach64SetTexImages( mach64ContextPtr mmesa,
if ( MACH64_DEBUG & DEBUG_VERBOSE_API )
fprintf( stderr, "%s( %p )\n", __FUNCTION__, tObj );
- switch (baseImage->TexFormat->MesaFormat) {
+ switch (baseImage->TexFormat) {
case MESA_FORMAT_ARGB8888:
t->textureFormat = MACH64_DATATYPE_ARGB8888;
break;
@@ -89,7 +89,7 @@ static void mach64SetTexImages( mach64ContextPtr mmesa,
totalSize = ( baseImage->Height *
baseImage->Width *
- _mesa_get_format_bytes(baseImage->TexFormat->MesaFormat) );
+ _mesa_get_format_bytes(baseImage->TexFormat) );
totalSize = (totalSize + 31) & ~31;