1 /**************************************************************************
3 * Copyright 2007 Tungsten Graphics, Inc., Cedar Park, Texas.
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
26 **************************************************************************/
32 #include "main/mtypes.h"
38 extern struct pipe_texture
*
39 st_texture_create(struct st_context
*st
,
47 GLuint compress_byte
);
50 /* Check if an image fits an existing texture
53 st_texture_match_image(struct pipe_texture
*pt
,
54 struct gl_texture_image
*image
,
55 GLuint face
, GLuint level
);
57 /* Return a pointer to an image within a texture. Return image stride as
61 st_texture_image_map(struct st_context
*st
,
62 struct st_texture_image
*stImage
,
66 st_texture_image_unmap(struct st_texture_image
*stImage
);
69 /* Return pointers to each 2d slice within an image. Indexed by depth
73 st_texture_depth_offsets(struct pipe_texture
*pt
, GLuint level
);
76 /* Return the linear offset of an image relative to the start of its region:
79 st_texture_image_offset(const struct pipe_texture
*pt
,
80 GLuint face
, GLuint level
);
83 st_texture_texel_offset(const struct pipe_texture
* pt
,
84 GLuint face
, GLuint level
,
85 GLuint col
, GLuint row
, GLuint img
);
88 /* Upload an image into a texture
91 st_texture_image_data(struct pipe_context
*pipe
,
92 struct pipe_texture
*dst
,
93 GLuint face
, GLuint level
, void *src
,
94 GLuint src_row_pitch
, GLuint src_image_pitch
);
97 /* Copy an image between two textures
100 st_texture_image_copy(struct pipe_context
*pipe
,
101 struct pipe_texture
*dst
,
102 GLuint face
, GLuint level
,
103 struct pipe_texture
*src
);