summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2008-08-14 10:40:03 +0200
committerMichel Dänzer <[email protected]>2008-08-14 10:40:03 +0200
commit57acb0fad9e6299eb2e1e2c06d043b2a418e3732 (patch)
tree542895ae1b34b5259af3bbf8d3955ab4c271bd8e /src
parent505606349e5154c67d1a857d7125048669a594c3 (diff)
r300: Fix 3D texture support.
Diffstat (limited to 'src')
-rw-r--r--src/mesa/drivers/dri/r300/r300_reg.h4
-rw-r--r--src/mesa/drivers/dri/r300/r300_texstate.c7
2 files changed, 8 insertions, 3 deletions
diff --git a/src/mesa/drivers/dri/r300/r300_reg.h b/src/mesa/drivers/dri/r300/r300_reg.h
index 562cd6afdb2..778db96cc1f 100644
--- a/src/mesa/drivers/dri/r300/r300_reg.h
+++ b/src/mesa/drivers/dri/r300/r300_reg.h
@@ -1458,8 +1458,8 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
# define R300_TX_FORMAT_X32 0x1e
/* 0x16 - some 16 bit green format.. ?? */
-# define R300_TX_FORMAT_UNK25 (1 << 25) /* no swizzle */
-# define R300_TX_FORMAT_CUBIC_MAP (1 << 26)
+# define R300_TX_FORMAT_3D (1 << 25)
+# define R300_TX_FORMAT_CUBIC_MAP (2 << 25)
/* gap */
/* Floating point formats */
diff --git a/src/mesa/drivers/dri/r300/r300_texstate.c b/src/mesa/drivers/dri/r300/r300_texstate.c
index bdd20b18e44..d19832f8618 100644
--- a/src/mesa/drivers/dri/r300/r300_texstate.c
+++ b/src/mesa/drivers/dri/r300/r300_texstate.c
@@ -392,6 +392,9 @@ static void r300SetTexImages(r300ContextPtr rmesa,
compute_tex_image_offset(tObj, face, i, &curOffset);
}
} else {
+ if (tObj->Target == GL_TEXTURE_3D)
+ t->format |= R300_TX_FORMAT_3D;
+
for (i = 0; i < numLevels; i++)
compute_tex_image_offset(tObj, 0, i, &curOffset);
}
@@ -405,7 +408,9 @@ static void r300SetTexImages(r300ContextPtr rmesa,
(((tObj->Image[0][t->base.firstLevel]->Width -
1) << R300_TX_WIDTHMASK_SHIFT)
| ((tObj->Image[0][t->base.firstLevel]->Height - 1) <<
- R300_TX_HEIGHTMASK_SHIFT))
+ R300_TX_HEIGHTMASK_SHIFT)
+ | ((tObj->Image[0][t->base.firstLevel]->DepthLog2) <<
+ R300_TX_DEPTHMASK_SHIFT))
| ((numLevels - 1) << R300_TX_MAX_MIP_LEVEL_SHIFT);
t->pitch = 0;