summaryrefslogtreecommitdiffstats
path: root/src/mesa
diff options
context:
space:
mode:
authorBrian <[email protected]>2007-08-06 12:32:16 -0600
committerBrian <[email protected]>2007-08-06 12:32:16 -0600
commitbdd3ccf95982e4043f2b57b42fd5d63ff8de4b08 (patch)
tree9e3a53c03645b48a7da5e5eb6f85bc5bd39d7530 /src/mesa
parent24ddf1169dc2dc2438934957b0fd858042cef9cb (diff)
More code movement, removal of intel dependencies
Diffstat (limited to 'src/mesa')
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.c2
-rw-r--r--src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h6
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_layout.c23
-rw-r--r--src/mesa/drivers/dri/intel/intel_tex_layout.h4
4 files changed, 30 insertions, 5 deletions
diff --git a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.c b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.c
index 6a91ddbe5e5..1a9aa101157 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.c
+++ b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.c
@@ -32,7 +32,7 @@
#include "pipe/p_context.h"
-#define FILE_DEBUG_FLAG DEBUG_MIPTREE
+#define DBG if(0) printf
static GLenum
target_to_target(GLenum target)
diff --git a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h
index 59f1bfcab45..eafe47c0291 100644
--- a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h
+++ b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h
@@ -28,9 +28,11 @@
#ifndef INTEL_MIPMAP_TREE_H
#define INTEL_MIPMAP_TREE_H
-#include "intel_context.h"
-#include "main/glheader.h"
+#include "main/mtypes.h"
+
+struct pipe_context;
+struct pipe_mipmap_tree;
struct pipe_region;
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.c b/src/mesa/drivers/dri/intel/intel_tex_layout.c
index bedd835cbb9..61b8fb77c53 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.c
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.c
@@ -32,6 +32,7 @@
#include "macros.h"
#include "pipe/p_state.h"
+#include "intel_tex_layout.h"
#include "intel_mipmap_tree.h"
@@ -47,7 +48,7 @@ static int align(int value, int alignment)
static void
-mipmaptree_set_level_info(struct pipe_mipmap_tree *mt,
+intel_miptree_set_level_info(struct pipe_mipmap_tree *mt,
GLuint level,
GLuint nr_images,
GLuint x, GLuint y, GLuint w, GLuint h, GLuint d)
@@ -80,6 +81,24 @@ mipmaptree_set_level_info(struct pipe_mipmap_tree *mt,
static void
+intel_miptree_set_image_offset(struct pipe_mipmap_tree *mt,
+ GLuint level, GLuint img, GLuint x, GLuint y)
+{
+ if (img == 0 && level == 0)
+ assert(x == 0 && y == 0);
+
+ assert(img < mt->level[level].nr_images);
+
+ mt->level[level].image_offset[img] = (x + y * mt->pitch);
+
+ /*
+ DBG("%s level %d img %d pos %d,%d image_offset %x\n",
+ __FUNCTION__, level, img, x, y, mt->level[level].image_offset[img]);
+ */
+}
+
+
+static void
i945_miptree_layout_2d( struct pipe_mipmap_tree *mt )
{
GLint align_h = 2, align_w = 4;
@@ -113,7 +132,7 @@ i945_miptree_layout_2d( struct pipe_mipmap_tree *mt )
for ( level = mt->first_level ; level <= mt->last_level ; level++ ) {
GLuint img_height;
- mipmaptree_set_level_info(mt, level, 1, x, y, width, height, 1);
+ intel_miptree_set_level_info(mt, level, 1, x, y, width, height, 1);
if (mt->compressed)
img_height = MAX2(1, height/4);
diff --git a/src/mesa/drivers/dri/intel/intel_tex_layout.h b/src/mesa/drivers/dri/intel/intel_tex_layout.h
index cbd4b8e27ff..ed30e2ef768 100644
--- a/src/mesa/drivers/dri/intel/intel_tex_layout.h
+++ b/src/mesa/drivers/dri/intel/intel_tex_layout.h
@@ -33,6 +33,10 @@
#include "macros.h"
+struct pipe_context;
+struct pipe_mipmap_tree;
+
+
extern void i915_miptree_layout_2d( struct pipe_context *, struct pipe_mipmap_tree *mt );
extern void i945_miptree_layout_2d( struct pipe_context *, struct pipe_mipmap_tree *mt );