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 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
22 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
23 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
24 * OTHER DEALINGS IN THE SOFTWARE.
30 * Texture image storage routines.
45 * This macro defines the (many) parameters to the texstore functions.
46 * \param dims either 1 or 2 or 3
47 * \param baseInternalFormat user-specified base internal format
48 * \param dstFormat destination Mesa texture format
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 dstSlices array of addresses of image slices (for 3D, array texture)
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 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
);
74 _mesa_texstore_needs_transfer_ops(struct gl_context
*ctx
,
75 GLenum baseInternalFormat
,
79 _mesa_texstore_can_use_memcpy(struct gl_context
*ctx
,
80 GLenum baseInternalFormat
, gl_format dstFormat
,
81 GLenum srcFormat
, GLenum srcType
,
82 const struct gl_pixelstore_attrib
*srcPacking
);
86 _mesa_make_temp_ubyte_image(struct gl_context
*ctx
, GLuint dims
,
87 GLenum logicalBaseFormat
,
88 GLenum textureBaseFormat
,
89 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
90 GLenum srcFormat
, GLenum srcType
,
91 const GLvoid
*srcAddr
,
92 const struct gl_pixelstore_attrib
*srcPacking
);
95 _mesa_make_temp_float_image(struct gl_context
*ctx
, GLuint dims
,
96 GLenum logicalBaseFormat
,
97 GLenum textureBaseFormat
,
98 GLint srcWidth
, GLint srcHeight
, GLint srcDepth
,
99 GLenum srcFormat
, GLenum srcType
,
100 const GLvoid
*srcAddr
,
101 const struct gl_pixelstore_attrib
*srcPacking
,
102 GLbitfield transferOps
);
105 _mesa_store_teximage(struct gl_context
*ctx
,
107 struct gl_texture_image
*texImage
,
108 GLenum format
, GLenum type
, const GLvoid
*pixels
,
109 const struct gl_pixelstore_attrib
*packing
);
113 _mesa_store_texsubimage(struct gl_context
*ctx
, GLuint dims
,
114 struct gl_texture_image
*texImage
,
115 GLint xoffset
, GLint yoffset
, GLint zoffset
,
116 GLint width
, GLint height
, GLint depth
,
117 GLenum format
, GLenum type
, const GLvoid
*pixels
,
118 const struct gl_pixelstore_attrib
*packing
);
122 _mesa_store_compressed_teximage(struct gl_context
*ctx
, GLuint dims
,
123 struct gl_texture_image
*texImage
,
124 GLsizei imageSize
, const GLvoid
*data
);
128 _mesa_store_compressed_texsubimage(struct gl_context
*ctx
, GLuint dims
,
129 struct gl_texture_image
*texImage
,
130 GLint xoffset
, GLint yoffset
, GLint zoffset
,
131 GLsizei width
, GLsizei height
, GLsizei depth
,
133 GLsizei imageSize
, const GLvoid
*data
);