Merge commit 'origin/gallium-0.1'
[mesa.git] / src / mesa / drivers / dri / r300 / r300_texstate.c
index bdd20b18e442622bd70a4fcc5346ce41047d1afa..e2329f04ec7ab241d23904cd233472b816a0b863 100644 (file)
@@ -35,14 +35,14 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  * \todo Enable R300 texture tiling code?
  */
 
-#include "glheader.h"
-#include "imports.h"
-#include "context.h"
-#include "macros.h"
-#include "texformat.h"
-#include "teximage.h"
-#include "texobj.h"
-#include "enums.h"
+#include "main/glheader.h"
+#include "main/imports.h"
+#include "main/context.h"
+#include "main/macros.h"
+#include "main/texformat.h"
+#include "main/teximage.h"
+#include "main/texobj.h"
+#include "main/enums.h"
 
 #include "r300_context.h"
 #include "r300_state.h"
@@ -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;