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, \
62 GLubyte **dstSlices, \
63 GLint srcWidth, GLint srcHeight, GLint srcDepth, \
64 GLenum srcFormat, GLenum srcType, \
65 const GLvoid *srcAddr, \
66 const struct gl_pixelstore_attrib *srcPacking
70 _mesa_texstore(TEXSTORE_PARAMS
);
74 _mesa_make_temp_ubyte_image(struct gl_context
*ctx
, GLuint dims
,
75 GLenum logicalBaseFormat
,
76 GLenum textureBaseFormat
,
77 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
78 GLenum srcFormat
, GLenum srcType
,
79 const GLvoid
*srcAddr
,
80 const struct gl_pixelstore_attrib
*srcPacking
);
83 _mesa_make_temp_float_image(struct gl_context
*ctx
, GLuint dims
,
84 GLenum logicalBaseFormat
,
85 GLenum textureBaseFormat
,
86 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
87 GLenum srcFormat
, GLenum srcType
,
88 const GLvoid
*srcAddr
,
89 const struct gl_pixelstore_attrib
*srcPacking
,
90 GLbitfield transferOps
);
93 _mesa_store_teximage1d(struct gl_context
*ctx
,
94 struct gl_texture_image
*texImage
,
96 GLint width
, GLint border
,
97 GLenum format
, GLenum type
, const GLvoid
*pixels
,
98 const struct gl_pixelstore_attrib
*packing
);
102 _mesa_store_teximage2d(struct gl_context
*ctx
,
103 struct gl_texture_image
*texImage
,
104 GLint internalFormat
,
105 GLint width
, GLint height
, GLint border
,
106 GLenum format
, GLenum type
, const GLvoid
*pixels
,
107 const struct gl_pixelstore_attrib
*packing
);
111 _mesa_store_teximage3d(struct gl_context
*ctx
,
112 struct gl_texture_image
*texImage
,
113 GLint internalFormat
,
114 GLint width
, GLint height
, GLint depth
, GLint border
,
115 GLenum format
, GLenum type
, const GLvoid
*pixels
,
116 const struct gl_pixelstore_attrib
*packing
);
120 _mesa_store_texsubimage1d(struct gl_context
*ctx
,
121 struct gl_texture_image
*texImage
,
122 GLint xoffset
, GLint width
,
123 GLenum format
, GLenum type
, const GLvoid
*pixels
,
124 const struct gl_pixelstore_attrib
*packing
);
128 _mesa_store_texsubimage2d(struct gl_context
*ctx
,
129 struct gl_texture_image
*texImage
,
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
);
137 _mesa_store_texsubimage3d(struct gl_context
*ctx
,
138 struct gl_texture_image
*texImage
,
139 GLint xoffset
, GLint yoffset
, GLint zoffset
,
140 GLint width
, GLint height
, GLint depth
,
141 GLenum format
, GLenum type
, const GLvoid
*pixels
,
142 const struct gl_pixelstore_attrib
*packing
);
146 _mesa_store_compressed_teximage1d(struct gl_context
*ctx
,
147 struct gl_texture_image
*texImage
,
148 GLint internalFormat
,
149 GLint width
, GLint border
,
150 GLsizei imageSize
, const GLvoid
*data
);
153 _mesa_store_compressed_teximage2d(struct gl_context
*ctx
,
154 struct gl_texture_image
*texImage
,
155 GLint internalFormat
,
156 GLint width
, GLint height
, GLint border
,
157 GLsizei imageSize
, const GLvoid
*data
);
160 _mesa_store_compressed_teximage3d(struct gl_context
*ctx
,
161 struct gl_texture_image
*texImage
,
162 GLint internalFormat
,
163 GLint width
, GLint height
, GLint depth
,
165 GLsizei imageSize
, const GLvoid
*data
);
169 _mesa_store_compressed_texsubimage1d(struct gl_context
*ctx
,
170 struct gl_texture_image
*texImage
,
171 GLint xoffset
, GLsizei width
,
173 GLsizei imageSize
, const GLvoid
*data
);
176 _mesa_store_compressed_texsubimage2d(struct gl_context
*ctx
,
177 struct gl_texture_image
*texImage
,
178 GLint xoffset
, GLint yoffset
,
179 GLsizei width
, GLsizei height
,
181 GLsizei imageSize
, const GLvoid
*data
);
184 _mesa_store_compressed_texsubimage3d(struct gl_context
*ctx
,
185 struct gl_texture_image
*texImage
,
186 GLint xoffset
, GLint yoffset
, GLint zoffset
,
187 GLsizei width
, GLsizei height
, GLsizei depth
,
189 GLsizei imageSize
, const GLvoid
*data
);