2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Texture image storage routines.
41 extern GLboolean _mesa_texstore_rgba(TEXSTORE_PARAMS);
42 extern GLboolean _mesa_texstore_color_index(TEXSTORE_PARAMS);
43 extern GLboolean _mesa_texstore_rgba8888(TEXSTORE_PARAMS);
44 extern GLboolean _mesa_texstore_argb8888(TEXSTORE_PARAMS);
45 extern GLboolean _mesa_texstore_rgb888(TEXSTORE_PARAMS);
46 extern GLboolean _mesa_texstore_bgr888(TEXSTORE_PARAMS);
47 extern GLboolean _mesa_texstore_rgb565(TEXSTORE_PARAMS);
48 extern GLboolean _mesa_texstore_rgb565_rev(TEXSTORE_PARAMS);
49 extern GLboolean _mesa_texstore_argb4444(TEXSTORE_PARAMS);
50 extern GLboolean _mesa_texstore_argb4444_rev(TEXSTORE_PARAMS);
51 extern GLboolean _mesa_texstore_argb1555(TEXSTORE_PARAMS);
52 extern GLboolean _mesa_texstore_argb1555_rev(TEXSTORE_PARAMS);
53 extern GLboolean _mesa_texstore_al88(TEXSTORE_PARAMS);
54 extern GLboolean _mesa_texstore_al88_rev(TEXSTORE_PARAMS);
55 extern GLboolean _mesa_texstore_rgb332(TEXSTORE_PARAMS);
56 extern GLboolean _mesa_texstore_a8(TEXSTORE_PARAMS);
57 extern GLboolean _mesa_texstore_ci8(TEXSTORE_PARAMS);
58 extern GLboolean _mesa_texstore_ycbcr(TEXSTORE_PARAMS);
59 extern GLboolean _mesa_texstore_z24_s8(TEXSTORE_PARAMS);
60 extern GLboolean _mesa_texstore_s8_z24(TEXSTORE_PARAMS);
61 extern GLboolean _mesa_texstore_z16(TEXSTORE_PARAMS);
62 extern GLboolean _mesa_texstore_z32(TEXSTORE_PARAMS);
63 extern GLboolean _mesa_texstore_rgba_float32(TEXSTORE_PARAMS);
64 extern GLboolean _mesa_texstore_rgba_float16(TEXSTORE_PARAMS);
65 extern GLboolean _mesa_texstore_rgb_fxt1(TEXSTORE_PARAMS);
66 extern GLboolean _mesa_texstore_rgba_fxt1(TEXSTORE_PARAMS);
67 extern GLboolean _mesa_texstore_rgb_dxt1(TEXSTORE_PARAMS);
68 extern GLboolean _mesa_texstore_rgba_dxt1(TEXSTORE_PARAMS);
69 extern GLboolean _mesa_texstore_rgba_dxt3(TEXSTORE_PARAMS);
70 extern GLboolean _mesa_texstore_rgba_dxt5(TEXSTORE_PARAMS);
71 #if FEATURE_EXT_texture_sRGB
72 extern GLboolean _mesa_texstore_srgb8(TEXSTORE_PARAMS);
73 extern GLboolean _mesa_texstore_srgba8(TEXSTORE_PARAMS);
74 extern GLboolean _mesa_texstore_sl8(TEXSTORE_PARAMS);
75 extern GLboolean _mesa_texstore_sla8(TEXSTORE_PARAMS);
80 _mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
81 GLenum logicalBaseFormat,
82 GLenum textureBaseFormat,
83 GLint srcWidth, GLint srcHeight, GLint srcDepth,
84 GLenum srcFormat, GLenum srcType,
85 const GLvoid *srcAddr,
86 const struct gl_pixelstore_attrib *srcPacking);
90 _mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims);
94 _mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
96 GLint width, GLint border,
97 GLenum format, GLenum type, const GLvoid *pixels,
98 const struct gl_pixelstore_attrib *packing,
99 struct gl_texture_object *texObj,
100 struct gl_texture_image *texImage);
104 _mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
105 GLint internalFormat,
106 GLint width, GLint height, GLint border,
107 GLenum format, GLenum type, const GLvoid *pixels,
108 const struct gl_pixelstore_attrib *packing,
109 struct gl_texture_object *texObj,
110 struct gl_texture_image *texImage);
114 _mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
115 GLint internalFormat,
116 GLint width, GLint height, GLint depth, GLint border,
117 GLenum format, GLenum type, const GLvoid *pixels,
118 const struct gl_pixelstore_attrib *packing,
119 struct gl_texture_object *texObj,
120 struct gl_texture_image *texImage);
124 _mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
125 GLint xoffset, GLint width,
126 GLenum format, GLenum type, const GLvoid *pixels,
127 const struct gl_pixelstore_attrib *packing,
128 struct gl_texture_object *texObj,
129 struct gl_texture_image *texImage);
133 _mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
134 GLint xoffset, GLint yoffset,
135 GLint width, GLint height,
136 GLenum format, GLenum type, const GLvoid *pixels,
137 const struct gl_pixelstore_attrib *packing,
138 struct gl_texture_object *texObj,
139 struct gl_texture_image *texImage);
143 _mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
144 GLint xoffset, GLint yoffset, GLint zoffset,
145 GLint width, GLint height, GLint depth,
146 GLenum format, GLenum type, const GLvoid *pixels,
147 const struct gl_pixelstore_attrib *packing,
148 struct gl_texture_object *texObj,
149 struct gl_texture_image *texImage);
153 _mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
154 GLint internalFormat,
155 GLint width, GLint border,
156 GLsizei imageSize, const GLvoid *data,
157 struct gl_texture_object *texObj,
158 struct gl_texture_image *texImage);
161 _mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
162 GLint internalFormat,
163 GLint width, GLint height, GLint border,
164 GLsizei imageSize, const GLvoid *data,
165 struct gl_texture_object *texObj,
166 struct gl_texture_image *texImage);
169 _mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
170 GLint internalFormat,
171 GLint width, GLint height, GLint depth,
173 GLsizei imageSize, const GLvoid *data,
174 struct gl_texture_object *texObj,
175 struct gl_texture_image *texImage);
179 _mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
181 GLint xoffset, GLsizei width,
183 GLsizei imageSize, const GLvoid *data,
184 struct gl_texture_object *texObj,
185 struct gl_texture_image *texImage);
188 _mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
190 GLint xoffset, GLint yoffset,
191 GLsizei width, GLsizei height,
193 GLsizei imageSize, const GLvoid *data,
194 struct gl_texture_object *texObj,
195 struct gl_texture_image *texImage);
198 _mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
200 GLint xoffset, GLint yoffset, GLint zoffset,
201 GLsizei width, GLsizei height, GLsizei depth,
203 GLsizei imageSize, const GLvoid *data,
204 struct gl_texture_object *texObj,
205 struct gl_texture_image *texImage);
209 _mesa_get_teximage(GLcontext *ctx, GLenum target, GLint level,
210 GLenum format, GLenum type, GLvoid *pixels,
211 struct gl_texture_object *texObj,
212 struct gl_texture_image *texImage);
216 _mesa_get_compressed_teximage(GLcontext *ctx, GLenum target, GLint level,
218 struct gl_texture_object *texObj,
219 struct gl_texture_image *texImage);
221 extern const GLvoid *
222 _mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions,
223 GLsizei width, GLsizei height, GLsizei depth,
224 GLenum format, GLenum type, const GLvoid *pixels,
225 const struct gl_pixelstore_attrib *unpack,
226 const char *funcName);
228 extern const GLvoid *
229 _mesa_validate_pbo_compressed_teximage(GLcontext *ctx,
230 GLsizei imageSize, const GLvoid *pixels,
231 const struct gl_pixelstore_attrib *packing,
232 const char *funcName);
235 _mesa_unmap_teximage_pbo(GLcontext *ctx,
236 const struct gl_pixelstore_attrib *unpack);