2 * Copyright (C) 2008 Nicolai Haehnle.
3 * Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
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.
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:
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.
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.
31 #ifndef RADEON_TEXTURE_H
32 #define RADEON_TEXTURE_H
34 #include "main/formats.h"
36 void copy_rows(void* dst
, GLuint dststride
, const void* src
, GLuint srcstride
,
37 GLuint numrows
, GLuint rowsize
);
38 struct gl_texture_image
*radeonNewTextureImage(GLcontext
*ctx
);
39 void radeonFreeTexImageData(GLcontext
*ctx
, struct gl_texture_image
*timage
);
41 void radeon_teximage_map(radeon_texture_image
*image
, GLboolean write_enable
);
42 void radeon_teximage_unmap(radeon_texture_image
*image
);
43 void radeonMapTexture(GLcontext
*ctx
, struct gl_texture_object
*texObj
);
44 void radeonUnmapTexture(GLcontext
*ctx
, struct gl_texture_object
*texObj
);
45 void radeonGenerateMipmap(GLcontext
* ctx
, GLenum target
, struct gl_texture_object
*texObj
);
46 int radeon_validate_texture_miptree(GLcontext
* ctx
, struct gl_texture_object
*texObj
);
47 GLuint
radeon_face_for_target(GLenum target
);
49 gl_format
radeonChooseTextureFormat_mesa(GLcontext
* ctx
,
54 gl_format
radeonChooseTextureFormat(GLcontext
* ctx
,
57 GLenum type
, GLboolean fbo
);
59 void radeonTexImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
61 GLint width
, 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 radeonTexImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
68 GLint width
, GLint height
, GLint border
,
69 GLenum format
, GLenum type
, const GLvoid
* pixels
,
70 const struct gl_pixelstore_attrib
*packing
,
71 struct gl_texture_object
*texObj
,
72 struct gl_texture_image
*texImage
);
73 void radeonCompressedTexImage2D(GLcontext
* ctx
, GLenum target
,
74 GLint level
, GLint internalFormat
,
75 GLint width
, GLint height
, GLint border
,
76 GLsizei imageSize
, const GLvoid
* data
,
77 struct gl_texture_object
*texObj
,
78 struct gl_texture_image
*texImage
);
79 void radeonTexImage3D(GLcontext
* ctx
, GLenum target
, GLint level
,
81 GLint width
, GLint height
, GLint depth
,
83 GLenum format
, GLenum type
, const GLvoid
* pixels
,
84 const struct gl_pixelstore_attrib
*packing
,
85 struct gl_texture_object
*texObj
,
86 struct gl_texture_image
*texImage
);
87 void radeonTexSubImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
90 GLenum format
, GLenum type
,
91 const GLvoid
* pixels
,
92 const struct gl_pixelstore_attrib
*packing
,
93 struct gl_texture_object
*texObj
,
94 struct gl_texture_image
*texImage
);
95 void radeonTexSubImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
96 GLint xoffset
, GLint yoffset
,
97 GLsizei width
, GLsizei height
,
98 GLenum format
, GLenum type
,
99 const GLvoid
* pixels
,
100 const struct gl_pixelstore_attrib
*packing
,
101 struct gl_texture_object
*texObj
,
102 struct gl_texture_image
*texImage
);
103 void radeonCompressedTexSubImage2D(GLcontext
* ctx
, GLenum target
,
104 GLint level
, GLint xoffset
,
105 GLint yoffset
, GLsizei width
,
106 GLsizei height
, GLenum format
,
107 GLsizei imageSize
, const GLvoid
* data
,
108 struct gl_texture_object
*texObj
,
109 struct gl_texture_image
*texImage
);
111 void radeonTexSubImage3D(GLcontext
* ctx
, GLenum target
, GLint level
,
112 GLint xoffset
, GLint yoffset
, GLint zoffset
,
113 GLsizei width
, GLsizei height
, GLsizei depth
,
114 GLenum format
, GLenum type
,
115 const GLvoid
* pixels
,
116 const struct gl_pixelstore_attrib
*packing
,
117 struct gl_texture_object
*texObj
,
118 struct gl_texture_image
*texImage
);
120 void radeonGetTexImage(GLcontext
* ctx
, GLenum target
, GLint level
,
121 GLenum format
, GLenum type
, GLvoid
* pixels
,
122 struct gl_texture_object
*texObj
,
123 struct gl_texture_image
*texImage
);
124 void radeonGetCompressedTexImage(GLcontext
*ctx
, GLenum target
, GLint level
,
126 struct gl_texture_object
*texObj
,
127 struct gl_texture_image
*texImage
);