Merge branch 'mesa_7_5_branch'
[mesa.git] / src / mesa / drivers / dri / radeon / radeon_texture.h
1 /*
2 * Copyright (C) 2008 Nicolai Haehnle.
3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
4 *
5 * The Weather Channel (TM) funded Tungsten Graphics to develop the
6 * initial release of the Radeon 8500 driver under the XFree86 license.
7 * This notice must be preserved.
8 *
9 * Permission is hereby granted, free of charge, to any person obtaining
10 * a copy of this software and associated documentation files (the
11 * "Software"), to deal in the Software without restriction, including
12 * without limitation the rights to use, copy, modify, merge, publish,
13 * distribute, sublicense, and/or sell copies of the Software, and to
14 * permit persons to whom the Software is furnished to do so, subject to
15 * the following conditions:
16 *
17 * The above copyright notice and this permission notice (including the
18 * next paragraph) shall be included in all copies or substantial
19 * portions of the Software.
20 *
21 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 * IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
25 * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 *
29 */
30
31 #ifndef RADEON_TEXTURE_H
32 #define RADEON_TEXTURE_H
33 struct gl_texture_image *radeonNewTextureImage(GLcontext *ctx);
34 void radeonFreeTexImageData(GLcontext *ctx, struct gl_texture_image *timage);
35
36 void radeon_teximage_map(radeon_texture_image *image, GLboolean write_enable);
37 void radeon_teximage_unmap(radeon_texture_image *image);
38 void radeonMapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
39 void radeonUnmapTexture(GLcontext *ctx, struct gl_texture_object *texObj);
40 void radeonGenerateMipmap(GLcontext* ctx, GLenum target, struct gl_texture_object *texObj);
41 int radeon_validate_texture_miptree(GLcontext * ctx, struct gl_texture_object *texObj);
42 GLuint radeon_face_for_target(GLenum target);
43 const struct gl_texture_format *radeonChooseTextureFormat_mesa(GLcontext * ctx,
44 GLint internalFormat,
45 GLenum format,
46 GLenum type);
47 const struct gl_texture_format *radeonChooseTextureFormat(GLcontext * ctx,
48 GLint internalFormat,
49 GLenum format,
50 GLenum type, GLboolean fbo);
51
52 void radeonTexImage1D(GLcontext * ctx, GLenum target, GLint level,
53 GLint internalFormat,
54 GLint width, GLint border,
55 GLenum format, GLenum type, const GLvoid * pixels,
56 const struct gl_pixelstore_attrib *packing,
57 struct gl_texture_object *texObj,
58 struct gl_texture_image *texImage);
59 void radeonTexImage2D(GLcontext * ctx, GLenum target, GLint level,
60 GLint internalFormat,
61 GLint width, GLint height, GLint border,
62 GLenum format, GLenum type, const GLvoid * pixels,
63 const struct gl_pixelstore_attrib *packing,
64 struct gl_texture_object *texObj,
65 struct gl_texture_image *texImage);
66 void radeonCompressedTexImage2D(GLcontext * ctx, GLenum target,
67 GLint level, GLint internalFormat,
68 GLint width, GLint height, GLint border,
69 GLsizei imageSize, const GLvoid * data,
70 struct gl_texture_object *texObj,
71 struct gl_texture_image *texImage);
72 void radeonTexImage3D(GLcontext * ctx, GLenum target, GLint level,
73 GLint internalFormat,
74 GLint width, GLint height, GLint depth,
75 GLint border,
76 GLenum format, GLenum type, const GLvoid * pixels,
77 const struct gl_pixelstore_attrib *packing,
78 struct gl_texture_object *texObj,
79 struct gl_texture_image *texImage);
80 void radeonTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
81 GLint xoffset,
82 GLsizei width,
83 GLenum format, GLenum type,
84 const GLvoid * pixels,
85 const struct gl_pixelstore_attrib *packing,
86 struct gl_texture_object *texObj,
87 struct gl_texture_image *texImage);
88 void radeonTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
89 GLint xoffset, GLint yoffset,
90 GLsizei width, GLsizei height,
91 GLenum format, GLenum type,
92 const GLvoid * pixels,
93 const struct gl_pixelstore_attrib *packing,
94 struct gl_texture_object *texObj,
95 struct gl_texture_image *texImage);
96 void radeonCompressedTexSubImage2D(GLcontext * ctx, GLenum target,
97 GLint level, GLint xoffset,
98 GLint yoffset, GLsizei width,
99 GLsizei height, GLenum format,
100 GLsizei imageSize, const GLvoid * data,
101 struct gl_texture_object *texObj,
102 struct gl_texture_image *texImage);
103
104 void radeonTexSubImage3D(GLcontext * ctx, GLenum target, GLint level,
105 GLint xoffset, GLint yoffset, GLint zoffset,
106 GLsizei width, GLsizei height, GLsizei depth,
107 GLenum format, GLenum type,
108 const GLvoid * pixels,
109 const struct gl_pixelstore_attrib *packing,
110 struct gl_texture_object *texObj,
111 struct gl_texture_image *texImage);
112
113 void radeonGetTexImage(GLcontext * ctx, GLenum target, GLint level,
114 GLenum format, GLenum type, GLvoid * pixels,
115 struct gl_texture_object *texObj,
116 struct gl_texture_image *texImage);
117 void radeonGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
118 GLvoid *pixels,
119 struct gl_texture_object *texObj,
120 struct gl_texture_image *texImage);
121
122 #endif