2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2006 Brian Paul All Rights Reserved.
6 * Copyright (c) 2008 VMware, Inc.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Texture image storage routines.
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
58 #define TEXSTORE_PARAMS \
59 struct gl_context *ctx, GLuint dims, \
60 GLenum baseInternalFormat, \
61 gl_format dstFormat, \
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
72 _mesa_texstore(TEXSTORE_PARAMS
);
76 _mesa_make_temp_chan_image(struct gl_context
*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
);
85 _mesa_make_temp_float_image(struct gl_context
*ctx
, GLuint dims
,
86 GLenum logicalBaseFormat
,
87 GLenum textureBaseFormat
,
88 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
89 GLenum srcFormat
, GLenum srcType
,
90 const GLvoid
*srcAddr
,
91 const struct gl_pixelstore_attrib
*srcPacking
,
92 GLbitfield transferOps
);
95 _mesa_store_teximage1d(struct gl_context
*ctx
, GLenum target
, GLint level
,
97 GLint width
, GLint border
,
98 GLenum format
, GLenum type
, const GLvoid
*pixels
,
99 const struct gl_pixelstore_attrib
*packing
,
100 struct gl_texture_object
*texObj
,
101 struct gl_texture_image
*texImage
);
105 _mesa_store_teximage2d(struct gl_context
*ctx
, GLenum target
, GLint level
,
106 GLint internalFormat
,
107 GLint width
, GLint height
, GLint border
,
108 GLenum format
, GLenum type
, const GLvoid
*pixels
,
109 const struct gl_pixelstore_attrib
*packing
,
110 struct gl_texture_object
*texObj
,
111 struct gl_texture_image
*texImage
);
115 _mesa_store_teximage3d(struct gl_context
*ctx
, GLenum target
, GLint level
,
116 GLint internalFormat
,
117 GLint width
, GLint height
, GLint depth
, GLint border
,
118 GLenum format
, GLenum type
, const GLvoid
*pixels
,
119 const struct gl_pixelstore_attrib
*packing
,
120 struct gl_texture_object
*texObj
,
121 struct gl_texture_image
*texImage
);
125 _mesa_store_texsubimage1d(struct gl_context
*ctx
, GLenum target
, GLint level
,
126 GLint xoffset
, GLint width
,
127 GLenum format
, GLenum type
, const GLvoid
*pixels
,
128 const struct gl_pixelstore_attrib
*packing
,
129 struct gl_texture_object
*texObj
,
130 struct gl_texture_image
*texImage
);
134 _mesa_store_texsubimage2d(struct gl_context
*ctx
, GLenum target
, GLint level
,
135 GLint xoffset
, GLint yoffset
,
136 GLint width
, GLint height
,
137 GLenum format
, GLenum type
, const GLvoid
*pixels
,
138 const struct gl_pixelstore_attrib
*packing
,
139 struct gl_texture_object
*texObj
,
140 struct gl_texture_image
*texImage
);
144 _mesa_store_texsubimage3d(struct gl_context
*ctx
, GLenum target
, GLint level
,
145 GLint xoffset
, GLint yoffset
, GLint zoffset
,
146 GLint width
, GLint height
, GLint depth
,
147 GLenum format
, GLenum type
, const GLvoid
*pixels
,
148 const struct gl_pixelstore_attrib
*packing
,
149 struct gl_texture_object
*texObj
,
150 struct gl_texture_image
*texImage
);
154 _mesa_store_compressed_teximage1d(struct gl_context
*ctx
, GLenum target
, GLint level
,
155 GLint internalFormat
,
156 GLint width
, GLint border
,
157 GLsizei imageSize
, const GLvoid
*data
,
158 struct gl_texture_object
*texObj
,
159 struct gl_texture_image
*texImage
);
162 _mesa_store_compressed_teximage2d(struct gl_context
*ctx
, GLenum target
, GLint level
,
163 GLint internalFormat
,
164 GLint width
, GLint height
, GLint border
,
165 GLsizei imageSize
, const GLvoid
*data
,
166 struct gl_texture_object
*texObj
,
167 struct gl_texture_image
*texImage
);
170 _mesa_store_compressed_teximage3d(struct gl_context
*ctx
, GLenum target
, GLint level
,
171 GLint internalFormat
,
172 GLint width
, GLint height
, GLint depth
,
174 GLsizei imageSize
, const GLvoid
*data
,
175 struct gl_texture_object
*texObj
,
176 struct gl_texture_image
*texImage
);
180 _mesa_store_compressed_texsubimage1d(struct gl_context
*ctx
, GLenum target
,
182 GLint xoffset
, GLsizei width
,
184 GLsizei imageSize
, const GLvoid
*data
,
185 struct gl_texture_object
*texObj
,
186 struct gl_texture_image
*texImage
);
189 _mesa_store_compressed_texsubimage2d(struct gl_context
*ctx
, GLenum target
,
191 GLint xoffset
, GLint yoffset
,
192 GLsizei width
, GLsizei height
,
194 GLsizei imageSize
, const GLvoid
*data
,
195 struct gl_texture_object
*texObj
,
196 struct gl_texture_image
*texImage
);
199 _mesa_store_compressed_texsubimage3d(struct gl_context
*ctx
, GLenum target
,
201 GLint xoffset
, GLint yoffset
, GLint zoffset
,
202 GLsizei width
, GLsizei height
, GLsizei depth
,
204 GLsizei imageSize
, const GLvoid
*data
,
205 struct gl_texture_object
*texObj
,
206 struct gl_texture_image
*texImage
);