summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Whitwell <keith@tungstengraphics.com>2005-02-11 12:55:58 +0000
committerKeith Whitwell <keith@tungstengraphics.com>2005-02-11 12:55:58 +0000
commit5dda8203f3fdba5958e98d1317e6e791fc46094b (patch)
treef443016af24048fe370abe52ec477539787c7622
parent40d70a66ed13f6e10d2b825928c0377fdcf95e83 (diff)
Change viaChooseTexFormat to match applications format/types more
closely, and to give viaScreen->bitsPerPixel less of a say in which texture format is chosen.
-rw-r--r--src/mesa/drivers/dri/unichrome/via_tex.c19
1 files changed, 12 insertions, 7 deletions
diff --git a/src/mesa/drivers/dri/unichrome/via_tex.c b/src/mesa/drivers/dri/unichrome/via_tex.c
index 9ef19cb9d8..94cdf61acc 100644
--- a/src/mesa/drivers/dri/unichrome/via_tex.c
+++ b/src/mesa/drivers/dri/unichrome/via_tex.c
@@ -62,7 +62,8 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGBA:
case GL_COMPRESSED_RGBA:
if ( format == GL_BGRA ) {
- if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) {
+ if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_BYTE ) {
return &_mesa_texformat_argb8888;
}
else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) {
@@ -72,6 +73,11 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
return &_mesa_texformat_argb1555;
}
}
+ else if ( type == GL_UNSIGNED_BYTE ||
+ type == GL_UNSIGNED_INT_8_8_8_8_REV ||
+ type == GL_UNSIGNED_INT_8_8_8_8 ) {
+ return &_mesa_texformat_argb8888;
+ }
return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
case 3:
@@ -80,13 +86,16 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) {
return &_mesa_texformat_rgb565;
}
+ else if ( type == GL_UNSIGNED_BYTE ) {
+ return &_mesa_texformat_argb8888;
+ }
return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
case GL_RGBA8:
case GL_RGB10_A2:
case GL_RGBA12:
case GL_RGBA16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb4444;
+ return &_mesa_texformat_argb8888;
case GL_RGBA4:
case GL_RGBA2:
@@ -99,7 +108,7 @@ viaChooseTexFormat( GLcontext *ctx, GLint internalFormat,
case GL_RGB10:
case GL_RGB12:
case GL_RGB16:
- return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_rgb565;
+ return &_mesa_texformat_argb8888;
case GL_RGB5:
case GL_RGB4:
@@ -332,16 +341,12 @@ static GLboolean viaSwapInTexObject( struct via_context *vmesa,
static GLboolean viaIsTexMemLow( struct via_context *vmesa,
GLuint heap )
{
-#if 1
struct via_tex_buffer *buf = via_alloc_texture(vmesa, 512 * 1024, heap );
if (!buf)
return GL_TRUE;
via_free_texture(vmesa, buf);
return GL_FALSE;
-#else
- return GL_TRUE;
-#endif
}