2a9b17743a52ad01fca873defe350f1eec148a79
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 dstX/Y/Zoffset destination x/y/z offset (ala TexSubImage), in texels
49 * \param dstRowStride destination image row stride, in bytes
50 * \param dstSlices array of addresses of image slices (for 3D, array texture)
51 * \param srcWidth/Height/Depth source image size, in pixels
52 * \param srcFormat incoming image format
53 * \param srcType incoming image data type
54 * \param srcAddr source image address
55 * \param srcPacking source image packing parameters
57 #define TEXSTORE_PARAMS \
58 struct gl_context *ctx, GLuint dims, \
59 GLenum baseInternalFormat, \
60 gl_format dstFormat, \
61 GLint dstXoffset, GLint dstYoffset, GLint dstZoffset, \
63 GLubyte **dstSlices, \
64 GLint srcWidth, GLint srcHeight, GLint srcDepth, \
65 GLenum srcFormat, GLenum srcType, \
66 const GLvoid *srcAddr, \
67 const struct gl_pixelstore_attrib *srcPacking
71 _mesa_texstore(TEXSTORE_PARAMS
);
75 _mesa_make_temp_ubyte_image(struct gl_context
*ctx
, GLuint dims
,
76 GLenum logicalBaseFormat
,
77 GLenum textureBaseFormat
,
78 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
79 GLenum srcFormat
, GLenum srcType
,
80 const GLvoid
*srcAddr
,
81 const struct gl_pixelstore_attrib
*srcPacking
);
84 _mesa_make_temp_float_image(struct gl_context
*ctx
, GLuint dims
,
85 GLenum logicalBaseFormat
,
86 GLenum textureBaseFormat
,
87 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
88 GLenum srcFormat
, GLenum srcType
,
89 const GLvoid
*srcAddr
,
90 const struct gl_pixelstore_attrib
*srcPacking
,
91 GLbitfield transferOps
);
94 _mesa_store_teximage1d(struct gl_context
*ctx
,
95 struct gl_texture_image
*texImage
,
97 GLint width
, GLint border
,
98 GLenum format
, GLenum type
, const GLvoid
*pixels
,
99 const struct gl_pixelstore_attrib
*packing
);
103 _mesa_store_teximage2d(struct gl_context
*ctx
,
104 struct gl_texture_image
*texImage
,
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
);
112 _mesa_store_teximage3d(struct gl_context
*ctx
,
113 struct gl_texture_image
*texImage
,
114 GLint internalFormat
,
115 GLint width
, GLint height
, GLint depth
, GLint border
,
116 GLenum format
, GLenum type
, const GLvoid
*pixels
,
117 const struct gl_pixelstore_attrib
*packing
);
121 _mesa_store_texsubimage1d(struct gl_context
*ctx
,
122 struct gl_texture_image
*texImage
,
123 GLint xoffset
, GLint width
,
124 GLenum format
, GLenum type
, const GLvoid
*pixels
,
125 const struct gl_pixelstore_attrib
*packing
);
129 _mesa_store_texsubimage2d(struct gl_context
*ctx
,
130 struct gl_texture_image
*texImage
,
131 GLint xoffset
, GLint yoffset
,
132 GLint width
, GLint height
,
133 GLenum format
, GLenum type
, const GLvoid
*pixels
,
134 const struct gl_pixelstore_attrib
*packing
);
138 _mesa_store_texsubimage3d(struct gl_context
*ctx
,
139 struct gl_texture_image
*texImage
,
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
);
147 _mesa_store_compressed_teximage1d(struct gl_context
*ctx
, GLenum target
, GLint level
,
148 GLint internalFormat
,
149 GLint width
, GLint border
,
150 GLsizei imageSize
, const GLvoid
*data
,
151 struct gl_texture_object
*texObj
,
152 struct gl_texture_image
*texImage
);
155 _mesa_store_compressed_teximage2d(struct gl_context
*ctx
, GLenum target
, GLint level
,
156 GLint internalFormat
,
157 GLint width
, GLint height
, GLint border
,
158 GLsizei imageSize
, const GLvoid
*data
,
159 struct gl_texture_object
*texObj
,
160 struct gl_texture_image
*texImage
);
163 _mesa_store_compressed_teximage3d(struct gl_context
*ctx
, GLenum target
, GLint level
,
164 GLint internalFormat
,
165 GLint width
, GLint height
, GLint depth
,
167 GLsizei imageSize
, const GLvoid
*data
,
168 struct gl_texture_object
*texObj
,
169 struct gl_texture_image
*texImage
);
173 _mesa_store_compressed_texsubimage1d(struct gl_context
*ctx
, GLenum target
,
175 GLint xoffset
, GLsizei width
,
177 GLsizei imageSize
, const GLvoid
*data
,
178 struct gl_texture_object
*texObj
,
179 struct gl_texture_image
*texImage
);
182 _mesa_store_compressed_texsubimage2d(struct gl_context
*ctx
, GLenum target
,
184 GLint xoffset
, GLint yoffset
,
185 GLsizei width
, GLsizei height
,
187 GLsizei imageSize
, const GLvoid
*data
,
188 struct gl_texture_object
*texObj
,
189 struct gl_texture_image
*texImage
);
192 _mesa_store_compressed_texsubimage3d(struct gl_context
*ctx
, GLenum target
,
194 GLint xoffset
, GLint yoffset
, GLint zoffset
,
195 GLsizei width
, GLsizei height
, GLsizei depth
,
197 GLsizei imageSize
, const GLvoid
*data
,
198 struct gl_texture_object
*texObj
,
199 struct gl_texture_image
*texImage
);