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
);
48 gl_format
radeonChooseTextureFormat_mesa(GLcontext
* ctx
,
53 gl_format
radeonChooseTextureFormat(GLcontext
* ctx
,
56 GLenum type
, GLboolean fbo
);
58 void radeonTexImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
60 GLint width
, GLint border
,
61 GLenum format
, GLenum type
, const GLvoid
* pixels
,
62 const struct gl_pixelstore_attrib
*packing
,
63 struct gl_texture_object
*texObj
,
64 struct gl_texture_image
*texImage
);
65 void radeonTexImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
67 GLint width
, GLint height
, GLint border
,
68 GLenum format
, GLenum type
, const GLvoid
* pixels
,
69 const struct gl_pixelstore_attrib
*packing
,
70 struct gl_texture_object
*texObj
,
71 struct gl_texture_image
*texImage
);
72 void radeonCompressedTexImage2D(GLcontext
* ctx
, GLenum target
,
73 GLint level
, GLint internalFormat
,
74 GLint width
, GLint height
, GLint border
,
75 GLsizei imageSize
, const GLvoid
* data
,
76 struct gl_texture_object
*texObj
,
77 struct gl_texture_image
*texImage
);
78 void radeonTexImage3D(GLcontext
* ctx
, GLenum target
, GLint level
,
80 GLint width
, GLint height
, GLint depth
,
82 GLenum format
, GLenum type
, const GLvoid
* pixels
,
83 const struct gl_pixelstore_attrib
*packing
,
84 struct gl_texture_object
*texObj
,
85 struct gl_texture_image
*texImage
);
86 void radeonTexSubImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
89 GLenum format
, GLenum type
,
90 const GLvoid
* pixels
,
91 const struct gl_pixelstore_attrib
*packing
,
92 struct gl_texture_object
*texObj
,
93 struct gl_texture_image
*texImage
);
94 void radeonTexSubImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
95 GLint xoffset
, GLint yoffset
,
96 GLsizei width
, GLsizei height
,
97 GLenum format
, GLenum type
,
98 const GLvoid
* pixels
,
99 const struct gl_pixelstore_attrib
*packing
,
100 struct gl_texture_object
*texObj
,
101 struct gl_texture_image
*texImage
);
102 void radeonCompressedTexSubImage2D(GLcontext
* ctx
, GLenum target
,
103 GLint level
, GLint xoffset
,
104 GLint yoffset
, GLsizei width
,
105 GLsizei height
, GLenum format
,
106 GLsizei imageSize
, const GLvoid
* data
,
107 struct gl_texture_object
*texObj
,
108 struct gl_texture_image
*texImage
);
110 void radeonTexSubImage3D(GLcontext
* ctx
, GLenum target
, GLint level
,
111 GLint xoffset
, GLint yoffset
, GLint zoffset
,
112 GLsizei width
, GLsizei height
, GLsizei depth
,
113 GLenum format
, GLenum type
,
114 const GLvoid
* pixels
,
115 const struct gl_pixelstore_attrib
*packing
,
116 struct gl_texture_object
*texObj
,
117 struct gl_texture_image
*texImage
);
119 void radeonGetTexImage(GLcontext
* ctx
, GLenum target
, GLint level
,
120 GLenum format
, GLenum type
, GLvoid
* pixels
,
121 struct gl_texture_object
*texObj
,
122 struct gl_texture_image
*texImage
);
123 void radeonGetCompressedTexImage(GLcontext
*ctx
, GLenum target
, GLint level
,
125 struct gl_texture_object
*texObj
,
126 struct gl_texture_image
*texImage
);
128 void radeonCopyTexImage2D(GLcontext
*ctx
, GLenum target
, GLint level
,
129 GLenum internalFormat
,
130 GLint x
, GLint y
, GLsizei width
, GLsizei height
,
133 void radeonCopyTexSubImage2D(GLcontext
*ctx
, GLenum target
, GLint level
,
134 GLint xoffset
, GLint yoffset
,
136 GLsizei width
, GLsizei height
);