Mesa (radeon-rewrite): radeon/r200/r300: set the texture depth correctly for DRI2
Dave Airlie
airlied at kemper.freedesktop.org
Tue Mar 24 01:22:28 UTC 2009
Module: Mesa
Branch: radeon-rewrite
Commit: 0a725db10c1491539d48370df7207206538bf945
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=0a725db10c1491539d48370df7207206538bf945
Author: Dave Airlie <airlied at redhat.com>
Date: Tue Mar 24 11:19:09 2009 +1000
radeon/r200/r300: set the texture depth correctly for DRI2
---
src/mesa/drivers/dri/r200/r200_context.c | 6 ------
src/mesa/drivers/dri/r300/r300_context.c | 6 ------
.../drivers/dri/radeon/radeon_common_context.c | 6 ++++++
src/mesa/drivers/dri/radeon/radeon_context.c | 6 ------
4 files changed, 6 insertions(+), 18 deletions(-)
diff --git a/src/mesa/drivers/dri/r200/r200_context.c b/src/mesa/drivers/dri/r200/r200_context.c
index 6fd0575..d3898d0 100644
--- a/src/mesa/drivers/dri/r200/r200_context.c
+++ b/src/mesa/drivers/dri/r200/r200_context.c
@@ -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;
diff --git a/src/mesa/drivers/dri/r300/r300_context.c b/src/mesa/drivers/dri/r300/r300_context.c
index c6bd69e..87ec68a 100644
--- a/src/mesa/drivers/dri/r300/r300_context.c
+++ b/src/mesa/drivers/dri/r300/r300_context.c
@@ -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.
diff --git a/src/mesa/drivers/dri/radeon/radeon_common_context.c b/src/mesa/drivers/dri/radeon/radeon_common_context.c
index f335eb0..5b23473 100644
--- a/src/mesa/drivers/dri/radeon/radeon_common_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_common_context.c
@@ -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;
}
diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c
index ac945ec..cad2c3e 100644
--- a/src/mesa/drivers/dri/radeon/radeon_context.c
+++ b/src/mesa/drivers/dri/radeon/radeon_context.c
@@ -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;
More information about the mesa-commit
mailing list