summaryrefslogtreecommitdiff
path: root/src/mesa/drivers/dri/r128
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/r128
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/r128')
-rw-r--r--src/mesa/drivers/dri/r128/r128_tex.c8
-rw-r--r--src/mesa/drivers/dri/r128/r128_texmem.c4
-rw-r--r--src/mesa/drivers/dri/r128/r128_texstate.c4
3 files changed, 8 insertions, 8 deletions
diff --git a/src/mesa/drivers/dri/r128/r128_tex.c b/src/mesa/drivers/dri/r128/r128_tex.c
index 0920270d7b..6acda445f7 100644
--- a/src/mesa/drivers/dri/r128/r128_tex.c
+++ b/src/mesa/drivers/dri/r128/r128_tex.c
@@ -178,7 +178,7 @@ static r128TexObjPtr r128AllocTexObj( struct gl_texture_object *texObj )
/* Called by the _mesa_store_teximage[123]d() functions. */
-static const struct gl_texture_format *
+static gl_format
r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
GLenum format, GLenum type )
{
@@ -282,13 +282,13 @@ r128ChooseTextureFormat( GLcontext *ctx, GLint internalFormat,
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/r128/r128_texmem.c b/src/mesa/drivers/dri/r128/r128_texmem.c
index c369e14bd5..84f8563b89 100644
--- a/src/mesa/drivers/dri/r128/r128_texmem.c
+++ b/src/mesa/drivers/dri/r128/r128_texmem.c
@@ -95,7 +95,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
if ( !image )
return;
- switch ( _mesa_get_format_bytes(image->TexFormat->MesaFormat) ) {
+ switch ( _mesa_get_format_bytes(image->TexFormat) ) {
case 1: texelsPerDword = 4; break;
case 2: texelsPerDword = 2; break;
case 4: texelsPerDword = 1; break;
@@ -216,7 +216,7 @@ static void uploadSubImage( r128ContextPtr rmesa, r128TexObjPtr t,
/* Copy the next chunck of the texture image into the blit buffer */
{
const GLuint texelBytes =
- _mesa_get_format_bytes(image->TexFormat->MesaFormat);
+ _mesa_get_format_bytes(image->TexFormat);
const GLubyte *src = (const GLubyte *) image->Data +
(y * image->Width + x) * texelBytes;
const GLuint bytes = width * height * texelBytes;
diff --git a/src/mesa/drivers/dri/r128/r128_texstate.c b/src/mesa/drivers/dri/r128/r128_texstate.c
index 9f4f9aea2d..2e71c25861 100644
--- a/src/mesa/drivers/dri/r128/r128_texstate.c
+++ b/src/mesa/drivers/dri/r128/r128_texstate.c
@@ -61,7 +61,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
if ( R128_DEBUG & DEBUG_VERBOSE_API )
fprintf( stderr, "%s( %p )\n", __FUNCTION__, (void *) tObj );
- switch (baseImage->TexFormat->MesaFormat) {
+ switch (baseImage->TexFormat) {
case MESA_FORMAT_ARGB8888:
case MESA_FORMAT_ARGB8888_REV:
t->textureFormat = R128_DATATYPE_ARGB8888;
@@ -123,7 +123,7 @@ static void r128SetTexImages( r128ContextPtr rmesa,
totalSize += (tObj->Image[0][i]->Height *
tObj->Image[0][i]->Width *
- _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat->MesaFormat));
+ _mesa_get_format_bytes(tObj->Image[0][i]->TexFormat));
/* Offsets must be 32-byte aligned for host data blits and tiling */
totalSize = (totalSize + 31) & ~31;