aboutsummaryrefslogtreecommitdiffstats
path: root/src/mesa/drivers/glide/fxdd.c
diff options
context:
space:
mode:
authorDaniel Borca <[email protected]>2004-01-13 08:47:44 +0000
committerDaniel Borca <[email protected]>2004-01-13 08:47:44 +0000
commit09a4fcb59272afdf460032916b008e610d2d7eca (patch)
treebc082d6325072edbe884c619ecde07985a033ec0 /src/mesa/drivers/glide/fxdd.c
parentb005b8258d4c8ee5c99e4942575c20b8621f0435 (diff)
added support for textures bigger than HW can support (SW rescaling)
Diffstat (limited to 'src/mesa/drivers/glide/fxdd.c')
-rw-r--r--src/mesa/drivers/glide/fxdd.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/mesa/drivers/glide/fxdd.c b/src/mesa/drivers/glide/fxdd.c
index 0d0de38e02f..d7d347abae6 100644
--- a/src/mesa/drivers/glide/fxdd.c
+++ b/src/mesa/drivers/glide/fxdd.c
@@ -797,6 +797,7 @@ fxDDReadPixels565 (GLcontext * ctx,
GrLfbInfo_t info;
BEGIN_BOARD_LOCK();
+ info.size = sizeof(info);
if (grLfbLock(GR_LFB_READ_ONLY,
fxMesa->currentFB,
GR_LFBWRITEMODE_ANY,
@@ -909,6 +910,7 @@ fxDDReadPixels555 (GLcontext * ctx,
GrLfbInfo_t info;
BEGIN_BOARD_LOCK();
+ info.size = sizeof(info);
if (grLfbLock(GR_LFB_READ_ONLY,
fxMesa->currentFB,
GR_LFBWRITEMODE_ANY,
@@ -1021,6 +1023,7 @@ fxDDReadPixels8888 (GLcontext * ctx,
GrLfbInfo_t info;
BEGIN_BOARD_LOCK();
+ info.size = sizeof(info);
if (grLfbLock(GR_LFB_READ_ONLY,
fxMesa->currentFB,
GR_LFBWRITEMODE_ANY,
@@ -1338,17 +1341,25 @@ fxDDInitFxMesaContext(fxMesaContext fxMesa)
fxMesa->textureAlign = FX_grGetInteger(GR_TEXTURE_ALIGN);
/* [koolsmoky] */
{
+ char *env;
int textureLevels = 0;
int textureSize = FX_grGetInteger(GR_MAX_TEXTURE_SIZE);
do {
textureLevels++;
} while ((textureSize >>= 0x1) & 0x7ff);
+ fxMesa->textureMaxLod = textureLevels - 1;
ctx->Const.MaxTextureLevels = textureLevels;
+ if ((env = getenv("MESA_FX_MAXLOD")) != NULL) {
+ int maxLevels = atoi(env) + 1;
+ if ((maxLevels <= MAX_TEXTURE_LEVELS) && (maxLevels > textureLevels)) {
+ ctx->Const.MaxTextureLevels = maxLevels;
+ }
+ }
}
- ctx->Const.MaxTextureCoordUnits = fxMesa->haveTwoTMUs ? 2 : 1;
+ ctx->Const.MaxTextureCoordUnits =
ctx->Const.MaxTextureImageUnits = fxMesa->haveTwoTMUs ? 2 : 1;
ctx->Const.MaxTextureUnits = MAX2(ctx->Const.MaxTextureImageUnits, ctx->Const.MaxTextureCoordUnits);
-
+
fxMesa->new_state = _NEW_ALL;
if (!fxMesa->haveHwStencil) {
/* don't touch stencil if there is none */