summaryrefslogtreecommitdiff
path: root/src/mesa/pipe
diff options
context:
space:
mode:
authorBrian <brian@i915.localnet.net>2007-08-06 11:22:00 -0600
committerBrian <brian@i915.localnet.net>2007-08-06 11:22:00 -0600
commitd9605cdf7cbbd3c81c506d01eb8e88a11ccfc09b (patch)
tree3aeebfa5447ad4d794a5d92d567d12ff7907d76d /src/mesa/pipe
parent95794abec4bdc5cda9f2e7d139a70c3acf372fe3 (diff)
Checkpoint lifting of intel_mipmap_tree (intel_mipmap_tree -> pipe_mipmap_tree and move some code)
Diffstat (limited to 'src/mesa/pipe')
-rw-r--r--src/mesa/pipe/p_context.h8
-rw-r--r--src/mesa/pipe/p_state.h55
2 files changed, 63 insertions, 0 deletions
diff --git a/src/mesa/pipe/p_context.h b/src/mesa/pipe/p_context.h
index 76a2593567..db9429f8d3 100644
--- a/src/mesa/pipe/p_context.h
+++ b/src/mesa/pipe/p_context.h
@@ -207,6 +207,14 @@ struct pipe_context {
unsigned long offset,
unsigned long size,
void *data);
+
+ /*
+ * Texture functions
+ */
+ GLboolean (*mipmap_tree_layout)( struct pipe_context *pipe,
+ struct pipe_mipmap_tree *mt );
+
+
};
diff --git a/src/mesa/pipe/p_state.h b/src/mesa/pipe/p_state.h
index 518110d447..13b8813f4a 100644
--- a/src/mesa/pipe/p_state.h
+++ b/src/mesa/pipe/p_state.h
@@ -292,6 +292,61 @@ struct pipe_texture_object
};
+/**
+ * Describes the location of each texture image within a texture region.
+ */
+struct pipe_mipmap_level
+{
+ GLuint level_offset;
+ GLuint width;
+ GLuint height;
+ GLuint depth;
+ GLuint nr_images;
+
+ /* Explicitly store the offset of each image for each cube face or
+ * depth value. Pretty much have to accept that hardware formats
+ * are going to be so diverse that there is no unified way to
+ * compute the offsets of depth/cube images within a mipmap level,
+ * so have to store them as a lookup table:
+ */
+ GLuint *image_offset;
+};
+
+struct pipe_mipmap_tree
+{
+ /* Effectively the key:
+ */
+ GLenum target;
+ GLenum internal_format;
+
+ GLuint first_level;
+ GLuint last_level;
+
+ GLuint width0, height0, depth0; /**< Level zero image dimensions */
+ GLuint cpp;
+ GLboolean compressed;
+
+ /* Derived from the above:
+ */
+ GLuint pitch;
+ GLuint depth_pitch; /* per-image on i945? */
+ GLuint total_height;
+
+ /* Includes image offset tables:
+ */
+ struct pipe_mipmap_level level[MAX_TEXTURE_LEVELS];
+
+ /* The data is held here:
+ */
+ struct pipe_region *region;
+
+ /* These are also refcounted:
+ */
+ GLuint refcount;
+};
+
+
+
struct pipe_buffer_handle;
#define PIPE_BUFFER_FLAG_READ 0x1