diff options
author | Brian <brian@i915.localnet.net> | 2007-08-06 11:22:00 -0600 |
---|---|---|
committer | Brian <brian@i915.localnet.net> | 2007-08-06 11:22:00 -0600 |
commit | d9605cdf7cbbd3c81c506d01eb8e88a11ccfc09b (patch) | |
tree | 3aeebfa5447ad4d794a5d92d567d12ff7907d76d /src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h | |
parent | 95794abec4bdc5cda9f2e7d139a70c3acf372fe3 (diff) |
Checkpoint lifting of intel_mipmap_tree (intel_mipmap_tree -> pipe_mipmap_tree and move some code)
Diffstat (limited to 'src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h')
-rw-r--r-- | src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h | 114 |
1 files changed, 16 insertions, 98 deletions
diff --git a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h index 09b2e362fc..94fb21372c 100644 --- a/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h +++ b/src/mesa/drivers/dri/i915pipe/intel_mipmap_tree.h @@ -34,89 +34,7 @@ struct pipe_region; -/* A layer on top of the pipe_regions code which adds: - * - * - Code to size and layout a region to hold a set of mipmaps. - * - Query to determine if a new image fits in an existing tree. - * - More refcounting - * - maybe able to remove refcounting from pipe_region? - * - ? - * - * The fixed mipmap layout of intel hardware where one offset - * specifies the position of all images in a mipmap hierachy - * complicates the implementation of GL texture image commands, - * compared to hardware where each image is specified with an - * independent offset. - * - * In an ideal world, each texture object would be associated with a - * single bufmgr buffer or 2d pipe_region, and all the images within - * the texture object would slot into the tree as they arrive. The - * reality can be a little messier, as images can arrive from the user - * with sizes that don't fit in the existing tree, or in an order - * where the tree layout cannot be guessed immediately. - * - * This structure encodes an idealized mipmap tree. The GL image - * commands build these where possible, otherwise store the images in - * temporary system buffers. - */ - - -/** - * Describes the location of each texture image within a texture region. - */ -struct intel_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 intel_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 intel_mipmap_level level[MAX_TEXTURE_LEVELS]; - - /* The data is held here: - */ - struct pipe_region *region; - - /* These are also refcounted: - */ - GLuint refcount; -}; - - - -struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel, +struct pipe_mipmap_tree *intel_miptree_create(struct intel_context *intel, GLenum target, GLenum internal_format, GLuint first_level, @@ -127,15 +45,15 @@ struct intel_mipmap_tree *intel_miptree_create(struct intel_context *intel, GLuint cpp, GLuint compress_byte); -void intel_miptree_reference(struct intel_mipmap_tree **dst, - struct intel_mipmap_tree *src); +void intel_miptree_reference(struct pipe_mipmap_tree **dst, + struct pipe_mipmap_tree *src); void intel_miptree_release(struct intel_context *intel, - struct intel_mipmap_tree **mt); + struct pipe_mipmap_tree **mt); /* Check if an image fits an existing mipmap tree layout */ -GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, +GLboolean intel_miptree_match_image(struct pipe_mipmap_tree *mt, struct gl_texture_image *image, GLuint face, GLuint level); @@ -143,35 +61,35 @@ GLboolean intel_miptree_match_image(struct intel_mipmap_tree *mt, * well. */ GLubyte *intel_miptree_image_map(struct intel_context *intel, - struct intel_mipmap_tree *mt, + struct pipe_mipmap_tree *mt, GLuint face, GLuint level, GLuint * row_stride, GLuint * image_stride); void intel_miptree_image_unmap(struct intel_context *intel, - struct intel_mipmap_tree *mt); + struct pipe_mipmap_tree *mt); /* Return the linear offset of an image relative to the start of the * tree: */ -GLuint intel_miptree_image_offset(struct intel_mipmap_tree *mt, +GLuint intel_miptree_image_offset(struct pipe_mipmap_tree *mt, GLuint face, GLuint level); /* Return pointers to each 2d slice within an image. Indexed by depth * value. */ -const GLuint *intel_miptree_depth_offsets(struct intel_mipmap_tree *mt, +const GLuint *intel_miptree_depth_offsets(struct pipe_mipmap_tree *mt, GLuint level); -void intel_miptree_set_level_info(struct intel_mipmap_tree *mt, +void 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); -void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, +void intel_miptree_set_image_offset(struct pipe_mipmap_tree *mt, GLuint level, GLuint img, GLuint x, GLuint y); @@ -179,7 +97,7 @@ void intel_miptree_set_image_offset(struct intel_mipmap_tree *mt, /* Upload an image into a tree */ void intel_miptree_image_data(struct intel_context *intel, - struct intel_mipmap_tree *dst, + struct pipe_mipmap_tree *dst, GLuint face, GLuint level, void *src, @@ -188,14 +106,14 @@ void intel_miptree_image_data(struct intel_context *intel, /* Copy an image between two trees */ void intel_miptree_image_copy(struct intel_context *intel, - struct intel_mipmap_tree *dst, + struct pipe_mipmap_tree *dst, GLuint face, GLuint level, - struct intel_mipmap_tree *src); + struct pipe_mipmap_tree *src); /* i915_mipmap_tree.c: */ -GLboolean i915_miptree_layout(struct intel_mipmap_tree *mt); -GLboolean i945_miptree_layout(struct intel_mipmap_tree *mt); +GLboolean i915_miptree_layout(struct pipe_context *, struct pipe_mipmap_tree *); +GLboolean i945_miptree_layout(struct pipe_context *, struct pipe_mipmap_tree *); |