1 /**************************************************************************
3 * Copyright 2003 Tungsten Graphics, Inc., Cedar Park, Texas.
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:
14 * The above copyright notice and this permission notice (including the
15 * next paragraph) shall be included in all copies or substantial portions
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.
26 **************************************************************************/
31 #include "main/mtypes.h"
32 #include "intel_context.h"
36 void intelInitTextureFuncs(struct dd_function_table
*functions
);
38 const struct gl_texture_format
*intelChooseTextureFormat(GLcontext
* ctx
,
44 void intelTexImage3D(GLcontext
* ctx
,
45 GLenum target
, GLint level
,
47 GLint width
, GLint height
, GLint depth
,
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
);
54 void intelTexSubImage3D(GLcontext
* ctx
,
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
);
65 void intelTexImage2D(GLcontext
* ctx
,
66 GLenum target
, GLint level
,
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
);
74 void intelTexSubImage2D(GLcontext
* ctx
,
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
);
85 void intelTexImage1D(GLcontext
* ctx
,
86 GLenum target
, GLint level
,
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
);
94 void intelTexSubImage1D(GLcontext
* ctx
,
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
);
105 void intelCopyTexImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
106 GLenum internalFormat
,
107 GLint x
, GLint y
, GLsizei width
, GLint border
);
109 void intelCopyTexImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
110 GLenum internalFormat
,
111 GLint x
, GLint y
, GLsizei width
, GLsizei height
,
114 void intelCopyTexSubImage1D(GLcontext
* ctx
, GLenum target
, GLint level
,
115 GLint xoffset
, GLint x
, GLint y
, GLsizei width
);
117 void intelCopyTexSubImage2D(GLcontext
* ctx
, GLenum target
, GLint level
,
118 GLint xoffset
, GLint yoffset
,
119 GLint x
, GLint y
, GLsizei width
, GLsizei height
);
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
);
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
);
133 void intelCompressedTexSubImage2D(GLcontext
* ctx
,
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
);
143 void intelGetCompressedTexImage(GLcontext
*ctx
, GLenum target
, GLint level
,
145 struct gl_texture_object
*texObj
,
146 struct gl_texture_image
*texImage
);
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
);
155 GLuint
intel_finalize_mipmap_tree(struct intel_context
*intel
, GLuint unit
);
157 void intel_tex_map_level_images(struct intel_context
*intel
,
158 struct intel_texture_object
*intelObj
,
161 void intel_tex_unmap_level_images(struct intel_context
*intel
,
162 struct intel_texture_object
*intelObj
,
165 void intel_tex_map_images(struct intel_context
*intel
,
166 struct intel_texture_object
*intelObj
);
168 void intel_tex_unmap_images(struct intel_context
*intel
,
169 struct intel_texture_object
*intelObj
);
171 int intel_compressed_num_bytes(GLuint mesaFormat
);
173 void intel_generate_mipmap(GLcontext
*ctx
, GLenum target
,
174 struct gl_texture_object
*texObj
);