diff options
author | Alan Hourihane <[email protected]> | 2003-12-05 22:12:07 +0000 |
---|---|---|
committer | Alan Hourihane <[email protected]> | 2003-12-05 22:12:07 +0000 |
commit | d907a75498360fb96ec2314bb0abb105be74d500 (patch) | |
tree | a896c857622089b046bae51c1729733184b1f72e /src/mesa/drivers/dri/r200 | |
parent | e4b5ff8e773eb376e0b370df3d61c5b9bb02ea64 (diff) |
xmlconfig fixes
Diffstat (limited to 'src/mesa/drivers/dri/r200')
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_context.h | 2 | ||||
-rw-r--r-- | src/mesa/drivers/dri/r200/r200_tex.c | 49 |
2 files changed, 34 insertions, 17 deletions
diff --git a/src/mesa/drivers/dri/r200/r200_context.h b/src/mesa/drivers/dri/r200/r200_context.h index 7421db97e6c..ebb1b8c215f 100644 --- a/src/mesa/drivers/dri/r200/r200_context.h +++ b/src/mesa/drivers/dri/r200/r200_context.h @@ -778,7 +778,7 @@ struct r200_context { unsigned nr_heaps; driTexHeap * texture_heaps[ R200_NR_TEX_HEAPS ]; driTextureObject swapped; - GLboolean default32BitTextures; + int texture_depth; /* Rasterization and vertex state: diff --git a/src/mesa/drivers/dri/r200/r200_tex.c b/src/mesa/drivers/dri/r200/r200_tex.c index f19f877cab5..256fc8dac80 100644 --- a/src/mesa/drivers/dri/r200/r200_tex.c +++ b/src/mesa/drivers/dri/r200/r200_tex.c @@ -51,6 +51,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "r200_swtcl.h" #include "r200_tex.h" +#include "xmlpool.h" + /** @@ -296,38 +298,53 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { r200ContextPtr rmesa = R200_CONTEXT(ctx); - const GLboolean do32bpt = rmesa->default32BitTextures; + const GLboolean do32bpt = + ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_32 ); + const GLboolean force16bpt = + ( rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FORCE_16 ); + (void) format; switch ( internalFormat ) { case 4: case GL_RGBA: case GL_COMPRESSED_RGBA: - if ( format == GL_BGRA ) { - if ( type == GL_UNSIGNED_INT_8_8_8_8_REV ) { - return &_mesa_texformat_argb8888; - } - else if ( type == GL_UNSIGNED_SHORT_4_4_4_4_REV ) { - return &_mesa_texformat_argb4444; - } - else if ( type == GL_UNSIGNED_SHORT_1_5_5_5_REV ) { - return &_mesa_texformat_argb1555; - } + switch ( type ) { + case GL_UNSIGNED_INT_10_10_10_2: + case GL_UNSIGNED_INT_2_10_10_10_REV: + return do32bpt ? &_mesa_texformat_argb8888 : &_mesa_texformat_argb1555; + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + return &_mesa_texformat_argb4444; + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + return &_mesa_texformat_argb1555; + default: + return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444; } - return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444; case 3: case GL_RGB: case GL_COMPRESSED_RGB: - if ( format == GL_RGB && type == GL_UNSIGNED_SHORT_5_6_5 ) { + switch ( type ) { + case GL_UNSIGNED_SHORT_4_4_4_4: + case GL_UNSIGNED_SHORT_4_4_4_4_REV: + return &_mesa_texformat_argb4444; + case GL_UNSIGNED_SHORT_5_5_5_1: + case GL_UNSIGNED_SHORT_1_5_5_5_REV: + return &_mesa_texformat_argb1555; + case GL_UNSIGNED_SHORT_5_6_5: + case GL_UNSIGNED_SHORT_5_6_5_REV: return &_mesa_texformat_rgb565; + default: + return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565; } - return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565; case GL_RGBA8: case GL_RGB10_A2: case GL_RGBA12: case GL_RGBA16: - return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444; + return !force16bpt ? + &_mesa_texformat_rgba8888 : &_mesa_texformat_argb4444; case GL_RGBA4: case GL_RGBA2: @@ -340,7 +357,7 @@ r200ChooseTextureFormat( GLcontext *ctx, GLint internalFormat, case GL_RGB10: case GL_RGB12: case GL_RGB16: - return do32bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565; + return !force16bpt ? &_mesa_texformat_rgba8888 : &_mesa_texformat_rgb565; case GL_RGB5: case GL_RGB4: |