r300: Fix 3D texture support.
authorMichel Dänzer <michel@tungstengraphics.com>
Thu, 14 Aug 2008 08:40:03 +0000 (10:40 +0200)
committerMichel Dänzer <michel@tungstengraphics.com>
Thu, 14 Aug 2008 08:40:03 +0000 (10:40 +0200)
src/mesa/drivers/dri/r300/r300_reg.h
src/mesa/drivers/dri/r300/r300_texstate.c

index 562cd6afdb27aea3be86ef0bf78a2de41a3af0db..778db96cc1fd184f6afd1653018f5a6cce23b5fd 100644 (file)
@@ -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 */
index bdd20b18e442622bd70a4fcc5346ce41047d1afa..d19832f86181eecf202a04310322b35188ce06f0 100644 (file)
@@ -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;