From e7276b7fa597f7914f7e10a2e50dae36ae50e10b Mon Sep 17 00:00:00 2001 From: Roland Scheidegger Date: Fri, 3 Feb 2006 13:29:11 +0000 Subject: replace the texture level hack used in radeon/r200 to allow larger textures with different methods to calculate the announced maximum texture sizes. Default is still the same (that is, radeon/r200 default to not announce anything which might not fit, i830/i915 default to 1 texture must fit). Bug #5785. --- src/mesa/drivers/dri/radeon/radeon_context.c | 18 ++++++++---------- src/mesa/drivers/dri/radeon/radeon_screen.c | 4 ++-- 2 files changed, 10 insertions(+), 12 deletions(-) (limited to 'src/mesa/drivers/dri/radeon') diff --git a/src/mesa/drivers/dri/radeon/radeon_context.c b/src/mesa/drivers/dri/radeon/radeon_context.c index abfe56dd9c..e08358a8e5 100644 --- a/src/mesa/drivers/dri/radeon/radeon_context.c +++ b/src/mesa/drivers/dri/radeon/radeon_context.c @@ -327,8 +327,9 @@ radeonCreateContext( const __GLcontextModes *glVisual, rmesa->hw.all_dirty = GL_TRUE; /* 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. + * all texture units can bind a maximal texture and have all of them in + * texturable memory at once. Depending on the allow_large_textures driconf + * setting allow larger textures. */ ctx = rmesa->glCtx; @@ -337,23 +338,20 @@ radeonCreateContext( const __GLcontextModes *glVisual, ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; + i = driQueryOptioni( &rmesa->optionCache, "allow_large_textures"); + driCalculateMaxTextureLevels( rmesa->texture_heaps, rmesa->nr_heaps, & ctx->Const, 4, 11, /* max 2D texture size is 2048x2048 */ - 0, /* 3D textures unsupported. */ + 8, /* 256^3 */ 9, /* \todo: max cube texture size seems to be 512x512(x6) */ 11, /* max rect texture size is 2048x2048. */ 12, - GL_FALSE ); + GL_FALSE, + i ); - /* adjust max texture size a bit. Hack, but I really want to use larger textures - which will work just fine in 99.999999% of all cases, especially with texture compression... */ - if (driQueryOptionb( &rmesa->optionCache, "texture_level_hack" )) - { - if (ctx->Const.MaxTextureLevels < 12) ctx->Const.MaxTextureLevels += 1; - } ctx->Const.MaxTextureMaxAnisotropy = 16.0; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 2c8c667892..d7c6efd349 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -87,7 +87,7 @@ DRI_CONF_BEGIN 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_TEXTURE_LEVEL_HACK(false) + DRI_CONF_ALLOW_LARGE_TEXTURES(0) DRI_CONF_SECTION_END DRI_CONF_SECTION_DEBUG DRI_CONF_NO_RAST(false) @@ -114,7 +114,7 @@ DRI_CONF_BEGIN 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_TEXTURE_LEVEL_HACK(false) + DRI_CONF_ALLOW_LARGE_TEXTURES(0) DRI_CONF_TEXTURE_BLEND_QUALITY(1.0,"0.0:1.0") DRI_CONF_SECTION_END DRI_CONF_SECTION_DEBUG -- cgit v1.2.3