xmlconfig fixes

This commit is contained in:
Alan Hourihane
2003-12-05 22:12:07 +00:00
parent e4b5ff8e77
commit d907a75498
5 changed files with 78 additions and 39 deletions
+1 -1
View File
@@ -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:
+33 -16
View File
@@ -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:
+10 -5
View File
@@ -81,13 +81,16 @@ DRI_CONF_BEGIN
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_QUALITY
DRI_CONF_PREFERRED_BPT(0,"0,16,32")
DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER)
DRI_CONF_ROUND_MODE(DRI_CONF_ROUND_TRUNC)
DRI_CONF_DITHER_MODE(DRI_CONF_DITHER_XERRORDIFF)
DRI_CONF_SECTION_END
DRI_CONF_SECTION_DEBUG
DRI_CONF_NO_RAST(false)
DRI_CONF_SECTION_END
DRI_CONF_END;
const GLuint __driNConfigOptions = 5;
const GLuint __driNConfigOptions = 8;
/* Return the width and height of the given buffer.
*/
@@ -308,9 +311,11 @@ radeonCreateContext( const __GLcontextModes *glVisual,
driSetTextureSwapCounterLocation( rmesa->texture_heaps[i],
& rmesa->c_textureSwaps );
}
preferred_bpt = driQueryOptioni (&rmesa->optionCache, "preferred_bpt");
rmesa->default32BitTextures =
( ( preferred_bpt == 0 && screen->cpp == 4 ) || preferred_bpt == 32 );
rmesa->texture_depth = driQueryOptioni (&rmesa->optionCache,
"texture_depth");
if (rmesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
rmesa->texture_depth = ( screen->cpp == 4 ) ?
DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
rmesa->swtcl.RenderIndex = ~0;
rmesa->lost_context = 1;
+1 -1
View File
@@ -697,7 +697,7 @@ struct radeon_context {
unsigned nr_heaps;
driTexHeap * texture_heaps[ RADEON_NR_TEX_HEAPS ];
driTextureObject swapped;
GLboolean default32BitTextures;
int texture_depth;
/* Rasterization and vertex state:
+33 -16
View File
@@ -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: