Merge branch 'const-buffer-changes'
[mesa.git] / src / mesa / drivers / dri / intel / 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 "main/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 void 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
133 void intelCompressedTexSubImage2D(GLcontext * ctx,
134 GLenum target,
135 GLint level,
136 GLint xoffset, GLint yoffset,
137 GLsizei width, GLsizei height,
138 GLenum format, GLsizei imageSize,
139 const GLvoid * pixels,
140 struct gl_texture_object *texObj,
141 struct gl_texture_image *texImage);
142
143 void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level,
144 GLvoid *pixels,
145 struct gl_texture_object *texObj,
146 struct gl_texture_image *texImage);
147
148 void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname,
149 unsigned long long offset, GLint depth, GLuint pitch);
150 void intelSetTexBuffer(__DRIcontext *pDRICtx,
151 GLint target, __DRIdrawable *pDraw);
152 void intelSetTexBuffer2(__DRIcontext *pDRICtx,
153 GLint target, GLint format, __DRIdrawable *pDraw);
154
155 GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit);
156
157 void intel_tex_map_level_images(struct intel_context *intel,
158 struct intel_texture_object *intelObj,
159 int level);
160
161 void intel_tex_unmap_level_images(struct intel_context *intel,
162 struct intel_texture_object *intelObj,
163 int level);
164
165 void intel_tex_map_images(struct intel_context *intel,
166 struct intel_texture_object *intelObj);
167
168 void intel_tex_unmap_images(struct intel_context *intel,
169 struct intel_texture_object *intelObj);
170
171 int intel_compressed_num_bytes(GLuint mesaFormat);
172
173 void intel_generate_mipmap(GLcontext *ctx, GLenum target,
174 struct gl_texture_object *texObj);
175
176 #endif