intel_tex.h revision dcbe215c015c8dc48440f578023c2b9d12b934e4
1/**************************************************************************
2 *
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
4 * All Rights Reserved.
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining a
7 * copy of this software and associated documentation files (the
8 * "Software"), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sub license, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
16 * of the Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
20 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT.
21 * IN NO EVENT SHALL TUNGSTEN GRAPHICS AND/OR ITS SUPPLIERS BE LIABLE FOR
22 * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
23 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
24 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
25 *
26 **************************************************************************/
27
28#ifndef INTELTEX_INC
29#define INTELTEX_INC
30
31#include "mtypes.h"
32#include "intel_context.h"
33#include "texmem.h"
34
35
36void intelInitTextureFuncs(struct dd_function_table *functions);
37
38const struct gl_texture_format *intelChooseTextureFormat(GLcontext * ctx,
39                                                         GLint internalFormat,
40                                                         GLenum format,
41                                                         GLenum type);
42
43
44void intelTexImage3D(GLcontext * ctx,
45                     GLenum target, GLint level,
46                     GLint internalFormat,
47                     GLint width, GLint height, GLint depth,
48                     GLint border,
49                     GLenum format, GLenum type, const void *pixels,
50                     const struct gl_pixelstore_attrib *packing,
51                     struct gl_texture_object *texObj,
52                     struct gl_texture_image *texImage);
53
54void intelTexSubImage3D(GLcontext * ctx,
55                        GLenum target,
56                        GLint level,
57                        GLint xoffset, GLint yoffset, GLint zoffset,
58                        GLsizei width, GLsizei height, GLsizei depth,
59                        GLenum format, GLenum type,
60                        const GLvoid * pixels,
61                        const struct gl_pixelstore_attrib *packing,
62                        struct gl_texture_object *texObj,
63                        struct gl_texture_image *texImage);
64
65void intelTexImage2D(GLcontext * ctx,
66                     GLenum target, GLint level,
67                     GLint internalFormat,
68                     GLint width, GLint height, GLint border,
69                     GLenum format, GLenum type, const void *pixels,
70                     const struct gl_pixelstore_attrib *packing,
71                     struct gl_texture_object *texObj,
72                     struct gl_texture_image *texImage);
73
74void intelTexSubImage2D(GLcontext * ctx,
75                        GLenum target,
76                        GLint level,
77                        GLint xoffset, GLint yoffset,
78                        GLsizei width, GLsizei height,
79                        GLenum format, GLenum type,
80                        const GLvoid * pixels,
81                        const struct gl_pixelstore_attrib *packing,
82                        struct gl_texture_object *texObj,
83                        struct gl_texture_image *texImage);
84
85void intelTexImage1D(GLcontext * ctx,
86                     GLenum target, GLint level,
87                     GLint internalFormat,
88                     GLint width, GLint border,
89                     GLenum format, GLenum type, const void *pixels,
90                     const struct gl_pixelstore_attrib *packing,
91                     struct gl_texture_object *texObj,
92                     struct gl_texture_image *texImage);
93
94void intelTexSubImage1D(GLcontext * ctx,
95                        GLenum target,
96                        GLint level,
97                        GLint xoffset,
98                        GLsizei width,
99                        GLenum format, GLenum type,
100                        const GLvoid * pixels,
101                        const struct gl_pixelstore_attrib *packing,
102                        struct gl_texture_object *texObj,
103                        struct gl_texture_image *texImage);
104
105void intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level,
106                         GLenum internalFormat,
107                         GLint x, GLint y, GLsizei width, GLint border);
108
109void intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
110                         GLenum internalFormat,
111                         GLint x, GLint y, GLsizei width, GLsizei height,
112                         GLint border);
113
114void intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
115                            GLint xoffset, GLint x, GLint y, GLsizei width);
116
117void intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
118                            GLint xoffset, GLint yoffset,
119                            GLint x, GLint y, GLsizei width, GLsizei height);
120
121void intelGetTexImage(GLcontext * ctx, GLenum target, GLint level,
122                      GLenum format, GLenum type, GLvoid * pixels,
123                      struct gl_texture_object *texObj,
124                      struct gl_texture_image *texImage);
125
126void intelCompressedTexImage2D( GLcontext *ctx, GLenum target, GLint level,
127				GLint internalFormat,
128				GLint width, GLint height, GLint border,
129				GLsizei imageSize, const GLvoid *data,
130				struct gl_texture_object *texObj,
131				struct gl_texture_image *texImage );
132
133void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
134				GLvoid *pixels,
135				struct gl_texture_object *texObj,
136				struct gl_texture_image *texImage);
137
138void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
139		       unsigned long long offset, GLint depth, GLuint pitch);
140void intelSetTexBuffer(__DRIcontext *pDRICtx,
141		       GLint target, __DRIdrawable *pDraw);
142
143GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
144
145void intel_tex_map_images(struct intel_context *intel,
146                          struct intel_texture_object *intelObj);
147
148void intel_tex_unmap_images(struct intel_context *intel,
149                            struct intel_texture_object *intelObj);
150
151int intel_compressed_num_bytes(GLuint mesaFormat);
152
153void intel_generate_mipmap(GLcontext *ctx, GLenum target,
154			   const struct gl_texture_unit *texUnit,
155			   struct gl_texture_object *texObj);
156
157#endif
158