Give the user posibility to choose speed over correctness.
authorRune Petersen <rune@megahurts.dk>
Thu, 31 Aug 2006 15:15:29 +0000 (15:15 +0000)
committerRune Petersen <rune@megahurts.dk>
Thu, 31 Aug 2006 15:15:29 +0000 (15:15 +0000)
It does 2 things:
1) Allows you to disable S3TC, wine-games sometimes need S3TC enabled.
2) Disable fallbacks that usually have low impact.

src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/r300/r300_context.h
src/mesa/drivers/dri/radeon/radeon_screen.c

index c561b8eadb353f2ba69e8a18488aeca8d03a27b9..54eb081d055ed5239f27a1c6334e8e5d3ce1b02d 100644 (file)
@@ -331,7 +331,7 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
 
        driInitExtensions(ctx, card_extensions, GL_TRUE);
        
-       if (r300->radeon.glCtx->Mesa_DXTn) {
+       if (r300->radeon.glCtx->Mesa_DXTn && !driQueryOptionb (&r300->radeon.optionCache, "disable_s3tc")) {
          _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
          _mesa_enable_extension( ctx, "GL_S3_s3tc" );
        }
@@ -339,6 +339,8 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
          _mesa_enable_extension( ctx, "GL_EXT_texture_compression_s3tc" );
        }
 
+       r300->disable_lowimpact_fallback = driQueryOptionb(&r300->radeon.optionCache, "disable_lowimpact_fallback");
+
        radeonInitSpanFuncs(ctx);
        r300InitCmdBuf(r300);
        r300InitState(r300);
index 1acb6a6c9448b747ed6989a5023244c5525a3f47..17ce0d95bfe712927b60ee756a4e175991074010 100644 (file)
@@ -820,6 +820,7 @@ struct r300_context {
 
        GLboolean texmicrotile;
        GLboolean span_dlocking;
+       GLboolean disable_lowimpact_fallback;
 };
 
 struct r300_buffer_object {
index c58c0a57973e713d93c27dc4a814083906d30a50..140d848d9ae877167f140a11a3b719db3ade6160 100644 (file)
@@ -152,6 +152,17 @@ DRI_CONF_OPT_BEGIN_V(command_buffer_size,int,def, # min ":" # max ) \
         DRI_CONF_DESC(de,"Grösse des Befehlspuffers (in KB)") \
 DRI_CONF_OPT_END
 
+#define DRI_CONF_DISABLE_S3TC(def) \
+DRI_CONF_OPT_BEGIN(disable_s3tc,bool,def) \
+        DRI_CONF_DESC(en,"Disable S3TC compression") \
+DRI_CONF_OPT_END
+
+#define DRI_CONF_DISABLE_FALLBACK(def) \
+DRI_CONF_OPT_BEGIN(disable_lowimpact_fallback,bool,def) \
+        DRI_CONF_DESC(en,"Disable Low-impact fallback") \
+DRI_CONF_OPT_END
+
+
 const char __driConfigOptions[] =
 DRI_CONF_BEGIN
        DRI_CONF_SECTION_PERFORMANCE
@@ -161,12 +172,14 @@ DRI_CONF_BEGIN
                DRI_CONF_MAX_TEXTURE_IMAGE_UNITS(8, 2, 8)
                DRI_CONF_MAX_TEXTURE_COORD_UNITS(8, 2, 8)
                DRI_CONF_COMMAND_BUFFER_SIZE(8, 8, 32)
+               DRI_CONF_DISABLE_FALLBACK(false)
        DRI_CONF_SECTION_END
        DRI_CONF_SECTION_QUALITY
                DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB)
                DRI_CONF_DEF_MAX_ANISOTROPY(1.0, "1.0,2.0,4.0,8.0,16.0")
                DRI_CONF_NO_NEG_LOD_BIAS(false)
                 DRI_CONF_FORCE_S3TC_ENABLE(false)
+               DRI_CONF_DISABLE_S3TC(false)
                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)
@@ -175,7 +188,7 @@ DRI_CONF_BEGIN
                DRI_CONF_NO_RAST(false)
        DRI_CONF_SECTION_END
 DRI_CONF_END;
-static const GLuint __driNConfigOptions = 14;
+static const GLuint __driNConfigOptions = 16;
 
 #ifndef RADEON_DEBUG
 int RADEON_DEBUG = 0;