texstore.h revision e2e7bd6c1f979179e6840cf0e8db72fc72751650
14c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht/*
24c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Mesa 3-D graphics library
34c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Version:  6.5.1
44c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht *
54c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Copyright (C) 1999-2006  Brian Paul   All Rights Reserved.
64c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Copyright (c) 2008 VMware, Inc.
74c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht *
84c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Permission is hereby granted, free of charge, to any person obtaining a
94c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * copy of this software and associated documentation files (the "Software"),
104c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * to deal in the Software without restriction, including without limitation
114c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * the rights to use, copy, modify, merge, publish, distribute, sublicense,
124c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * and/or sell copies of the Software, and to permit persons to whom the
134c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Software is furnished to do so, subject to the following conditions:
144c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht *
15d882f1e23195d1fb16a6fe1887c842d04ab420b7Jin Qian * The above copyright notice and this permission notice shall be included
164c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * in all copies or substantial portions of the Software.
174c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht *
1834f4f33b24280c0a21a95407da4cf4988b275c95Jin Qian * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
1934f4f33b24280c0a21a95407da4cf4988b275c95Jin Qian * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
204c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
214c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
224c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
234c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
244c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht */
254c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht
264c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht
274c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht/**
28c0bd89b31a7719dd3d51137b3d47a9597ba6b038Jin Qian * \file texstore.h
294c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * Texture image storage routines.
304c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht *
314c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht * \author Brian Paul
324c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht */
334c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht
34d882f1e23195d1fb16a6fe1887c842d04ab420b7Jin Qian
35d882f1e23195d1fb16a6fe1887c842d04ab420b7Jin Qian#ifndef TEXSTORE_H
364c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht#define TEXSTORE_H
3734f4f33b24280c0a21a95407da4cf4988b275c95Jin Qian
3834f4f33b24280c0a21a95407da4cf4988b275c95Jin Qian
394c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht#include "mtypes.h"
404c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht#include "formats.h"
414c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht
424c1e1f46301b3ff7f60be1d8e943ecc23b917ca7Adrien Schildknecht
43/**
44 * This macro defines the (many) parameters to the texstore functions.
45 * \param dims  either 1 or 2 or 3
46 * \param baseInternalFormat  user-specified base internal format
47 * \param dstFormat  destination Mesa texture format
48 * \param dstAddr  destination image address
49 * \param dstX/Y/Zoffset  destination x/y/z offset (ala TexSubImage), in texels
50 * \param dstRowStride  destination image row stride, in bytes
51 * \param dstImageOffsets  offset of each 2D slice within 3D texture, in texels
52 * \param srcWidth/Height/Depth  source image size, in pixels
53 * \param srcFormat  incoming image format
54 * \param srcType  incoming image data type
55 * \param srcAddr  source image address
56 * \param srcPacking  source image packing parameters
57 */
58#define TEXSTORE_PARAMS \
59	GLcontext *ctx, GLuint dims, \
60	GLenum baseInternalFormat, \
61	const struct gl_texture_format *dstFormat, \
62	GLvoid *dstAddr, \
63	GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
64	GLint dstRowStride, const GLuint *dstImageOffsets, \
65	GLint srcWidth, GLint srcHeight, GLint srcDepth, \
66	GLenum srcFormat, GLenum srcType, \
67	const GLvoid *srcAddr, \
68	const struct gl_pixelstore_attrib *srcPacking
69
70
71extern GLboolean
72_mesa_texstore(TEXSTORE_PARAMS);
73
74
75extern GLchan *
76_mesa_make_temp_chan_image(GLcontext *ctx, GLuint dims,
77                           GLenum logicalBaseFormat,
78                           GLenum textureBaseFormat,
79                           GLint srcWidth, GLint srcHeight, GLint srcDepth,
80                           GLenum srcFormat, GLenum srcType,
81                           const GLvoid *srcAddr,
82                           const struct gl_pixelstore_attrib *srcPacking);
83
84
85extern void
86_mesa_set_fetch_functions(struct gl_texture_image *texImage, GLuint dims);
87
88
89extern void
90_mesa_store_teximage1d(GLcontext *ctx, GLenum target, GLint level,
91                       GLint internalFormat,
92                       GLint width, GLint border,
93                       GLenum format, GLenum type, const GLvoid *pixels,
94                       const struct gl_pixelstore_attrib *packing,
95                       struct gl_texture_object *texObj,
96                       struct gl_texture_image *texImage);
97
98
99extern void
100_mesa_store_teximage2d(GLcontext *ctx, GLenum target, GLint level,
101                       GLint internalFormat,
102                       GLint width, GLint height, GLint border,
103                       GLenum format, GLenum type, const GLvoid *pixels,
104                       const struct gl_pixelstore_attrib *packing,
105                       struct gl_texture_object *texObj,
106                       struct gl_texture_image *texImage);
107
108
109extern void
110_mesa_store_teximage3d(GLcontext *ctx, GLenum target, GLint level,
111                       GLint internalFormat,
112                       GLint width, GLint height, GLint depth, GLint border,
113                       GLenum format, GLenum type, const GLvoid *pixels,
114                       const struct gl_pixelstore_attrib *packing,
115                       struct gl_texture_object *texObj,
116                       struct gl_texture_image *texImage);
117
118
119extern void
120_mesa_store_texsubimage1d(GLcontext *ctx, GLenum target, GLint level,
121                          GLint xoffset, GLint width,
122                          GLenum format, GLenum type, const GLvoid *pixels,
123                          const struct gl_pixelstore_attrib *packing,
124                          struct gl_texture_object *texObj,
125                          struct gl_texture_image *texImage);
126
127
128extern void
129_mesa_store_texsubimage2d(GLcontext *ctx, GLenum target, GLint level,
130                          GLint xoffset, GLint yoffset,
131                          GLint width, GLint height,
132                          GLenum format, GLenum type, const GLvoid *pixels,
133                          const struct gl_pixelstore_attrib *packing,
134                          struct gl_texture_object *texObj,
135                          struct gl_texture_image *texImage);
136
137
138extern void
139_mesa_store_texsubimage3d(GLcontext *ctx, GLenum target, GLint level,
140                          GLint xoffset, GLint yoffset, GLint zoffset,
141                          GLint width, GLint height, GLint depth,
142                          GLenum format, GLenum type, const GLvoid *pixels,
143                          const struct gl_pixelstore_attrib *packing,
144                          struct gl_texture_object *texObj,
145                          struct gl_texture_image *texImage);
146
147
148extern void
149_mesa_store_compressed_teximage1d(GLcontext *ctx, GLenum target, GLint level,
150                                  GLint internalFormat,
151                                  GLint width, GLint border,
152                                  GLsizei imageSize, const GLvoid *data,
153                                  struct gl_texture_object *texObj,
154                                  struct gl_texture_image *texImage);
155
156extern void
157_mesa_store_compressed_teximage2d(GLcontext *ctx, GLenum target, GLint level,
158                                  GLint internalFormat,
159                                  GLint width, GLint height, GLint border,
160                                  GLsizei imageSize, const GLvoid *data,
161                                  struct gl_texture_object *texObj,
162                                  struct gl_texture_image *texImage);
163
164extern void
165_mesa_store_compressed_teximage3d(GLcontext *ctx, GLenum target, GLint level,
166                                  GLint internalFormat,
167                                  GLint width, GLint height, GLint depth,
168                                  GLint border,
169                                  GLsizei imageSize, const GLvoid *data,
170                                  struct gl_texture_object *texObj,
171                                  struct gl_texture_image *texImage);
172
173
174extern void
175_mesa_store_compressed_texsubimage1d(GLcontext *ctx, GLenum target,
176                                     GLint level,
177                                     GLint xoffset, GLsizei width,
178                                     GLenum format,
179                                     GLsizei imageSize, const GLvoid *data,
180                                     struct gl_texture_object *texObj,
181                                     struct gl_texture_image *texImage);
182
183extern void
184_mesa_store_compressed_texsubimage2d(GLcontext *ctx, GLenum target,
185                                     GLint level,
186                                     GLint xoffset, GLint yoffset,
187                                     GLsizei width, GLsizei height,
188                                     GLenum format,
189                                     GLsizei imageSize, const GLvoid *data,
190                                     struct gl_texture_object *texObj,
191                                     struct gl_texture_image *texImage);
192
193extern void
194_mesa_store_compressed_texsubimage3d(GLcontext *ctx, GLenum target,
195                                GLint level,
196                                GLint xoffset, GLint yoffset, GLint zoffset,
197                                GLsizei width, GLsizei height, GLsizei depth,
198                                GLenum format,
199                                GLsizei imageSize, const GLvoid *data,
200                                struct gl_texture_object *texObj,
201                                struct gl_texture_image *texImage);
202
203
204extern const GLvoid *
205_mesa_validate_pbo_teximage(GLcontext *ctx, GLuint dimensions,
206			    GLsizei width, GLsizei height, GLsizei depth,
207			    GLenum format, GLenum type, const GLvoid *pixels,
208			    const struct gl_pixelstore_attrib *unpack,
209			    const char *funcName);
210
211extern const GLvoid *
212_mesa_validate_pbo_compressed_teximage(GLcontext *ctx,
213                                    GLsizei imageSize, const GLvoid *pixels,
214                                    const struct gl_pixelstore_attrib *packing,
215                                    const char *funcName);
216
217extern void
218_mesa_unmap_teximage_pbo(GLcontext *ctx,
219                         const struct gl_pixelstore_attrib *unpack);
220
221
222#endif
223