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/radeon/radeon_tex.c | |
parent | e4b5ff8e773eb376e0b370df3d61c5b9bb02ea64 (diff) |
xmlconfig fixes
Diffstat (limited to 'src/mesa/drivers/dri/radeon/radeon_tex.c')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_tex.c | 49 |
1 files changed, 33 insertions, 16 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_tex.c b/src/mesa/drivers/dri/radeon/radeon_tex.c index e068202c5ee..269c0a4ebb6 100644 --- a/src/mesa/drivers/dri/radeon/radeon_tex.c +++ b/src/mesa/drivers/dri/radeon/radeon_tex.c @@ -50,6 +50,8 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include "radeon_swtcl.h" #include "radeon_tex.h" +#include "xmlpool.h" + /** @@ -262,38 +264,53 @@ radeonChooseTextureFormat( GLcontext *ctx, GLint internalFormat, GLenum format, GLenum type ) { radeonContextPtr rmesa = RADEON_CONTEXT(ctx); - const GLboolean do32bpt = ( rmesa->radeonScreen->cpp == 4 ); + 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: @@ -306,7 +323,7 @@ radeonChooseTextureFormat( 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: |