radeon/r200/r300: set the texture depth correctly for DRI2
authorDave Airlie <airlied@redhat.com>
Tue, 24 Mar 2009 01:19:09 +0000 (11:19 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 24 Mar 2009 01:19:09 +0000 (11:19 +1000)
src/mesa/drivers/dri/r200/r200_context.c
src/mesa/drivers/dri/r300/r300_context.c
src/mesa/drivers/dri/radeon/radeon_common_context.c
src/mesa/drivers/dri/radeon/radeon_context.c

index 6fd0575898f011ab0d30a1dc37f401c95cd8d0f6..d3898d0900d111a1b4d55adce0048b93a8939651 100644 (file)
@@ -338,12 +338,6 @@ GLboolean r200CreateContext( const __GLcontextModes *glVisual,
      return GL_FALSE;
    }
 
-   rmesa->radeon.texture_depth = driQueryOptioni (&rmesa->radeon.optionCache,
-                                          "texture_depth");
-   if (rmesa->radeon.texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
-      rmesa->radeon.texture_depth = ( screen->cpp == 4 ) ?
-        DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
    rmesa->radeon.swtcl.RenderIndex = ~0;
    rmesa->radeon.hw.all_dirty = 1;
 
index c6bd69ed1467ba08e040c9b34ae31b3eacae12e5..87ec68a2cd88f15870ddfa18429b63d0cb12f909 100644 (file)
@@ -328,12 +328,6 @@ GLboolean r300CreateContext(const __GLcontextModes * glVisual,
        }
 
        /* Init r300 context data */
-       r300->radeon.texture_depth = driQueryOptioni(&r300->radeon.optionCache,
-                                             "texture_depth");
-       if (r300->radeon.texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
-               r300->radeon.texture_depth = (screen->cpp == 4) ?
-                   DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
        /* Set the maximum texture size small enough that we can guarentee that
         * all texture units can bind a maximal texture and have them both in
         * texturable memory at once.
index f335eb0313e2672003f7f913aac745fad1e8780f..5b23473ab375e845db9f420f74f6652acc5e45be 100644 (file)
@@ -163,6 +163,12 @@ GLboolean radeonInitContext(radeonContextPtr radeon,
                        "IRQ's not enabled, falling back to %s: %d %d\n",
                        radeon->do_usleeps ? "usleeps" : "busy waits",
                        fthrottle_mode, radeon->radeonScreen->irq);
+       
+        radeon->texture_depth = driQueryOptioni (&radeon->optionCache,
+                                               "texture_depth");
+        if (radeon->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
+                radeon->texture_depth = ( glVisual->rgbBits > 16 ) ?
+               DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
 
        return GL_TRUE;
 }
index ac945ecc4d37d0ab5b7c130c32f944faa847ed40..cad2c3e0c1fba7a31a830665ce92ac8562490ab4 100644 (file)
@@ -261,12 +261,6 @@ radeonCreateContext( const __GLcontextModes *glVisual,
      return GL_FALSE;
    }
 
-   rmesa->radeon.texture_depth = driQueryOptioni (&rmesa->radeon.optionCache,
-                                          "texture_depth");
-   if (rmesa->radeon.texture_depth == DRI_CONF_TEXTURE_DEPTH_FB)
-      rmesa->radeon.texture_depth = ( screen->cpp == 4 ) ?
-        DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16;
-
    rmesa->radeon.swtcl.RenderIndex = ~0;
    rmesa->radeon.hw.all_dirty = GL_TRUE;