/* Use actual texture offset */
+ fprintf(stderr,"pp_border_color=%08x pp_cubic_faces=%08x format=%08x size=%08x format_x=%08x\n",
+ t->pp_border_color, t->pp_cubic_faces, t->format, t->size, t->format_x);
+
SINGLE_TEXTURE_PIPELINE.texture_unit[0].offset=rmesa->radeon.radeonScreen->fbLocation+t->offset;
#if 0
SINGLE_TEXTURE_PIPELINE.texture_unit[0].format=t->format;
- SINGLE_TEXTURE_PIPELINE.texture_unit[0].size=t->size;
#endif
+ SINGLE_TEXTURE_PIPELINE.texture_unit[0].size=t->size;
SINGLE_TEXTURE_PIPELINE.texture_unit[0].filter=t->filter;
SINGLE_TEXTURE_PIPELINE.texture_unit[0].unknown1=t->pitch; /* Unknown 1 is pitch ! */
SINGLE_TEXTURE_PIPELINE.texture_unit[0].filter=t->filter;
_mesa_problem(NULL, "bad T wrap mode in %s", __FUNCTION__);
}
- #if 0 /* Which field is this ? */
- t->pp_txformat_x &= ~R200_CLAMP_Q_MASK;
+ t->format_x &= ~R200_CLAMP_Q_MASK;
switch (rwrap) {
case GL_REPEAT:
- t->pp_txformat_x |= R200_CLAMP_Q_WRAP;
+ t->format_x |= R200_CLAMP_Q_WRAP;
break;
case GL_CLAMP:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL;
+ t->format_x |= R200_CLAMP_Q_CLAMP_GL;
is_clamp = GL_TRUE;
break;
case GL_CLAMP_TO_EDGE:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_LAST;
+ t->format_x |= R200_CLAMP_Q_CLAMP_LAST;
break;
case GL_CLAMP_TO_BORDER:
- t->pp_txformat_x |= R200_CLAMP_Q_CLAMP_GL;
+ t->format_x |= R200_CLAMP_Q_CLAMP_GL;
is_clamp_to_border = GL_TRUE;
break;
case GL_MIRRORED_REPEAT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR;
+ t->format_x |= R200_CLAMP_Q_MIRROR;
break;
case GL_MIRROR_CLAMP_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
+ t->format_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
is_clamp = GL_TRUE;
break;
case GL_MIRROR_CLAMP_TO_EDGE_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_LAST;
+ t->format_x |= R200_CLAMP_Q_MIRROR_CLAMP_LAST;
break;
case GL_MIRROR_CLAMP_TO_BORDER_EXT:
- t->pp_txformat_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
+ t->format_x |= R200_CLAMP_Q_MIRROR_CLAMP_GL;
is_clamp_to_border = GL_TRUE;
break;
default:
_mesa_problem(NULL, "bad R wrap mode in %s", __FUNCTION__);
}
- #endif
if (is_clamp_to_border) {
t->filter |= R200_BORDER_MODE_D3D;
GLuint anisotropy = (t->filter & R200_MAX_ANISO_MASK);
t->filter &= ~(R200_MIN_FILTER_MASK | R200_MAG_FILTER_MASK);
- #if 0
- t->pp_txformat_x &= ~R200_VOLUME_FILTER_MASK;
- #endif
+ t->format_x &= ~R200_VOLUME_FILTER_MASK;
if (anisotropy == R200_MAX_ANISO_1_TO_1) {
switch (minf) {
switch (magf) {
case GL_NEAREST:
t->filter |= R200_MAG_FILTER_NEAREST;
- #if 0
- t->pp_txformat_x |= R200_VOLUME_FILTER_NEAREST;
- #endif
+ t->format_x |= R200_VOLUME_FILTER_NEAREST;
break;
case GL_LINEAR:
t->filter |= R200_MAG_FILTER_LINEAR;
- #if 0
- t->pp_txformat_x |= R200_VOLUME_FILTER_LINEAR;
- #endif
+ t->format_x |= R200_VOLUME_FILTER_LINEAR;
break;
}
}
static void r300SetTexBorderColor(r300TexObjPtr t, GLubyte c[4])
{
- #if 0
t->pp_border_color = radeonPackColor(4, c[0], c[1], c[2], c[3]);
- #endif
}
/**
driInitTextureFormats();
-#if 000
+#if 0
/* moved or obsolete code */
r300ContextPtr rmesa = R300_CONTEXT(ctx);
driInitTextureObjects(ctx, &rmesa->swapped,
//#include "r300_swtcl.h"
#include "r300_tex.h"
//#include "r300_tcl.h"
+#include "r300_reg.h"
#define R200_TXFORMAT_A8 R200_TXFORMAT_I8
#define R200_TXFORMAT_L8 R200_TXFORMAT_I8
t->format |= ((log2Width << R200_TXFORMAT_WIDTH_SHIFT) |
(log2Height << R200_TXFORMAT_HEIGHT_SHIFT));
- #if 0
t->format_x &= ~(R200_DEPTH_LOG2_MASK | R200_TEXCOORD_MASK);
if (tObj->Target == GL_TEXTURE_3D) {
t->format_x |= (log2Depth << R200_DEPTH_LOG2_SHIFT);
(log2Width << R200_FACE_WIDTH_4_SHIFT) |
(log2Height << R200_FACE_HEIGHT_4_SHIFT));
}
- #endif
- t->size = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << 0) |
- ((tObj->Image[0][t->base.firstLevel]->Height -
- 1) << 16));
+ t->size = (((tObj->Image[0][t->base.firstLevel]->Width - 1) << R300_TX_WIDTHMASK_SHIFT)
+ |((tObj->Image[0][t->base.firstLevel]->Height - 1) << R300_TX_HEIGHTMASK_SHIFT)
+ |((log2Width>log2Height)?log2Width:log2Height)<<R300_TX_SIZE_SHIFT);
/* Only need to round to nearest 32 for textures, but the blitter
* requires 64-byte aligned pitches, and we may/may not need the