allow >10 mipmap levels (patch by Benno Schulenberg) (bug 3130)
This commit is contained in:
@@ -88,6 +88,11 @@ DRI_CONF_SECTION_BEGIN \
|
||||
DRI_CONF_DESC(nl,"Beeldkwaliteit") \
|
||||
DRI_CONF_DESC(fr,"Qualité d'image")
|
||||
|
||||
#define DRI_CONF_EXCESS_MIPMAP(def) \
|
||||
DRI_CONF_OPT_BEGIN(excess_mipmap,bool,def) \
|
||||
DRI_CONF_DESC(en,"Enable extra mipmap level") \
|
||||
DRI_CONF_OPT_END
|
||||
|
||||
#define DRI_CONF_TEXTURE_DEPTH_FB 0
|
||||
#define DRI_CONF_TEXTURE_DEPTH_32 1
|
||||
#define DRI_CONF_TEXTURE_DEPTH_16 2
|
||||
|
||||
@@ -481,7 +481,7 @@ viaCreateContext(const __GLcontextModes *visual,
|
||||
/* Parse configuration files.
|
||||
*/
|
||||
driParseConfigFiles (&vmesa->optionCache, &viaScreen->optionCache,
|
||||
sPriv->myNum, "via");
|
||||
sPriv->myNum, "unichrome");
|
||||
|
||||
/* pick back buffer */
|
||||
vmesa->hasBack = visual->doubleBufferMode;
|
||||
@@ -558,7 +558,11 @@ viaCreateContext(const __GLcontextModes *visual,
|
||||
|
||||
ctx = vmesa->glCtx;
|
||||
|
||||
ctx->Const.MaxTextureLevels = 11;
|
||||
if (driQueryOptionb(&vmesa->optionCache, "excess_mipmap"))
|
||||
ctx->Const.MaxTextureLevels = 11;
|
||||
else
|
||||
ctx->Const.MaxTextureLevels = 10;
|
||||
|
||||
ctx->Const.MaxTextureUnits = 2;
|
||||
ctx->Const.MaxTextureImageUnits = ctx->Const.MaxTextureUnits;
|
||||
ctx->Const.MaxTextureCoordUnits = ctx->Const.MaxTextureUnits;
|
||||
@@ -656,20 +660,14 @@ viaCreateContext(const __GLcontextModes *visual,
|
||||
VIA_DEBUG = driParseDebugString( getenv( "VIA_DEBUG" ),
|
||||
debug_control );
|
||||
|
||||
if (getenv("VIA_NO_RAST"))
|
||||
if (getenv("VIA_NO_RAST") ||
|
||||
driQueryOptionb(&vmesa->optionCache, "no_rast"))
|
||||
FALLBACK(vmesa, VIA_FALLBACK_USER_DISABLE, 1);
|
||||
|
||||
/* I don't understand why this isn't working:
|
||||
*/
|
||||
vmesa->vblank_flags =
|
||||
vmesa->viaScreen->irqEnabled ?
|
||||
driGetDefaultVBlankFlags(&vmesa->optionCache) : VBLANK_FLAG_NO_IRQ;
|
||||
|
||||
/* Hack this up in its place:
|
||||
*/
|
||||
vmesa->vblank_flags = (getenv("VIA_VSYNC") ?
|
||||
VBLANK_FLAG_SYNC : VBLANK_FLAG_NO_IRQ);
|
||||
|
||||
if (getenv("VIA_PAGEFLIP"))
|
||||
vmesa->allowPageFlip = 1;
|
||||
|
||||
@@ -727,7 +725,9 @@ viaDestroyContext(__DRIcontextPrivate *driContextPriv)
|
||||
assert (is_empty_list(&vmesa->tex_image_list[VIA_MEM_SYSTEM]));
|
||||
assert (is_empty_list(&vmesa->freed_tex_buffers));
|
||||
|
||||
FREE(vmesa);
|
||||
driDestroyOptionCache(&vmesa->optionCache);
|
||||
|
||||
FREE(vmesa);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -46,16 +46,16 @@
|
||||
#include "GL/internal/dri_interface.h"
|
||||
#include "drirenderbuffer.h"
|
||||
|
||||
/* Radeon configuration
|
||||
*/
|
||||
#include "xmlpool.h"
|
||||
|
||||
const char __driConfigOptions[] =
|
||||
DRI_CONF_BEGIN
|
||||
DRI_CONF_SECTION_PERFORMANCE
|
||||
DRI_CONF_FTHROTTLE_MODE(DRI_CONF_FTHROTTLE_IRQS)
|
||||
DRI_CONF_VBLANK_MODE(DRI_CONF_VBLANK_DEF_INTERVAL_0)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_SECTION_QUALITY
|
||||
DRI_CONF_EXCESS_MIPMAP(false)
|
||||
DRI_CONF_SECTION_END
|
||||
DRI_CONF_SECTION_DEBUG
|
||||
DRI_CONF_NO_RAST(false)
|
||||
DRI_CONF_SECTION_END
|
||||
@@ -131,7 +131,6 @@ viaInitDriver(__DRIscreenPrivate *sPriv)
|
||||
viaScreen->fbOffset = 0;
|
||||
viaScreen->fbSize = gDRIPriv->fbSize;
|
||||
viaScreen->irqEnabled = gDRIPriv->irqEnabled;
|
||||
viaScreen->irqEnabled = 1;
|
||||
|
||||
if (VIA_DEBUG & DEBUG_DRI) {
|
||||
fprintf(stderr, "deviceID = %08x\n", viaScreen->deviceID);
|
||||
@@ -201,6 +200,8 @@ viaDestroyScreen(__DRIscreenPrivate *sPriv)
|
||||
|
||||
via_free_empty_buffers(viaScreen->bufs);
|
||||
|
||||
driDestroyOptionInfo(&viaScreen->optionCache);
|
||||
|
||||
FREE(viaScreen);
|
||||
sPriv->private = NULL;
|
||||
}
|
||||
|
||||
@@ -513,11 +513,11 @@ static GLboolean viaSetTexImages(GLcontext *ctx,
|
||||
|
||||
numLevels = lastLevel - firstLevel + 1;
|
||||
|
||||
/* The hardware only supports 10 mipmap levels. Ignore higher levels.
|
||||
/* The hardware supports only 10 mipmap levels; ignore higher levels.
|
||||
*/
|
||||
if (numLevels > 10) {
|
||||
lastLevel -= numLevels - 10;
|
||||
numLevels = 10;
|
||||
if ((numLevels > 10) && (ctx->Const.MaxTextureLevels > 10)) {
|
||||
lastLevel -= numLevels - 10;
|
||||
numLevels = 10;
|
||||
}
|
||||
|
||||
/* save these values, check if they effect the residency of the
|
||||
|
||||
Reference in New Issue
Block a user