merge current trunk into vbo branch
[mesa.git] / src / mesa / drivers / dri / i915tex / intel_tex.h
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
36 void intelInitTextureFuncs(struct dd_function_table *functions);
37
38 const struct gl_texture_format *intelChooseTextureFormat(GLcontext * ctx,
39 GLint internalFormat,
40 GLenum format,
41 GLenum type);
42
43
44 void 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
54 void 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
65 void 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
74 void 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
85 void 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
94 void 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
105 void intelCopyTexImage1D(GLcontext * ctx, GLenum target, GLint level,
106 GLenum internalFormat,
107 GLint x, GLint y, GLsizei width, GLint border);
108
109 void intelCopyTexImage2D(GLcontext * ctx, GLenum target, GLint level,
110 GLenum internalFormat,
111 GLint x, GLint y, GLsizei width, GLsizei height,
112 GLint border);
113
114 void intelCopyTexSubImage1D(GLcontext * ctx, GLenum target, GLint level,
115 GLint xoffset, GLint x, GLint y, GLsizei width);
116
117 void intelCopyTexSubImage2D(GLcontext * ctx, GLenum target, GLint level,
118 GLint xoffset, GLint yoffset,
119 GLint x, GLint y, GLsizei width, GLsizei height);
120
121 void 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
126 GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
127
128 void intel_tex_map_images(struct intel_context *intel,
129 struct intel_texture_object *intelObj);
130
131 void intel_tex_unmap_images(struct intel_context *intel,
132 struct intel_texture_object *intelObj);
133
134 #endif