diff options
author | Felix Kuehling <[email protected]> | 2004-12-15 17:45:23 +0000 |
---|---|---|
committer | Felix Kuehling <[email protected]> | 2004-12-15 17:45:23 +0000 |
commit | 58f5b91b1bd3d329f98969c7d6c8434107b3ec6d (patch) | |
tree | 1e6e2e2de88161d4cc88c0a714277767b455bfb7 /src/mesa/drivers/dri/savage/savage_xmesa.c | |
parent | 489ccef3982267b0d35c8548921f58d553c25a3a (diff) |
Added configuration support to the Savage driver. Three options are
supported so far.
Diffstat (limited to 'src/mesa/drivers/dri/savage/savage_xmesa.c')
-rw-r--r-- | src/mesa/drivers/dri/savage/savage_xmesa.c | 38 |
1 files changed, 37 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/savage/savage_xmesa.c b/src/mesa/drivers/dri/savage/savage_xmesa.c index c8eb69160f8..5bbc7c5ba1a 100644 --- a/src/mesa/drivers/dri/savage/savage_xmesa.c +++ b/src/mesa/drivers/dri/savage/savage_xmesa.c @@ -57,6 +57,22 @@ #include "savagedma.h" +#include "xmlpool.h" + +/* Configuration + */ +const char __driConfigOptions[] = +DRI_CONF_BEGIN + DRI_CONF_SECTION_QUALITY + DRI_CONF_TEXTURE_DEPTH(DRI_CONF_TEXTURE_DEPTH_FB) + DRI_CONF_COLOR_REDUCTION(DRI_CONF_COLOR_REDUCTION_DITHER) + DRI_CONF_SECTION_END + DRI_CONF_SECTION_PERFORMANCE + DRI_CONF_MAX_TEXTURE_UNITS(2,1,2) + DRI_CONF_SECTION_END +DRI_CONF_END; +static const GLuint __driNConfigOptions = 3; + #ifdef USE_NEW_INTERFACE static PFNGLXCREATECONTEXTMODES create_context_modes = NULL; #endif /* USE_NEW_INTERFACE */ @@ -202,6 +218,10 @@ savageInitDriver(__DRIscreenPrivate *sPriv) return GL_FALSE; } + /* parse information in __driConfigOptions */ + driParseOptionInfo (&savageScreen->optionCache, + __driConfigOptions, __driNConfigOptions); + #if 0 savageDDFastPathInit(); savageDDTrifuncInit(); @@ -217,7 +237,9 @@ savageDestroyScreen(__DRIscreenPrivate *sPriv) { savageScreenPrivate *savageScreen = (savageScreenPrivate *)sPriv->private; - + /* free all option information */ + driDestroyOptionInfo (&savageScreen->optionCache); + Xfree(savageScreen); sPriv->private = NULL; } @@ -287,10 +309,24 @@ savageCreateContext( const __GLcontextModes *mesaVis, } driContextPriv->driverPrivate = imesa; + /* Parse configuration files */ + driParseConfigFiles (&imesa->optionCache, &savageScreen->optionCache, + sPriv->myNum, "savage"); + + imesa->texture_depth = driQueryOptioni (&imesa->optionCache, + "texture_depth"); + if (imesa->texture_depth == DRI_CONF_TEXTURE_DEPTH_FB) + imesa->texture_depth = ( savageScreen->cpp == 4 ) ? + DRI_CONF_TEXTURE_DEPTH_32 : DRI_CONF_TEXTURE_DEPTH_16; + if (savageScreen->chipset >= S3_SAVAGE4) ctx->Const.MaxTextureUnits = 2; else ctx->Const.MaxTextureUnits = 1; + if (driQueryOptioni(&imesa->optionCache, "texture_units") < + ctx->Const.MaxTextureUnits) + ctx->Const.MaxTextureUnits = + driQueryOptioni(&imesa->optionCache, "texture_units"); ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits; ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits; |