intel_tex.h revision dc58da3e063d2a4018eea9149b43a3656a93a7ca
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 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 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 143void intelGetCompressedTexImage(GLcontext *ctx, GLenum target, GLint level, 144 GLvoid *pixels, 145 struct gl_texture_object *texObj, 146 struct gl_texture_image *texImage); 147 148void intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, 149 unsigned long long offset, GLint depth, GLuint pitch); 150void intelSetTexBuffer(__DRIcontext *pDRICtx, 151 GLint target, __DRIdrawable *pDraw); 152 153GLuint intel_finalize_mipmap_tree(struct intel_context *intel, GLuint unit); 154 155void intel_tex_map_level_images(struct intel_context *intel, 156 struct intel_texture_object *intelObj, 157 int level); 158 159void intel_tex_unmap_level_images(struct intel_context *intel, 160 struct intel_texture_object *intelObj, 161 int level); 162 163void intel_tex_map_images(struct intel_context *intel, 164 struct intel_texture_object *intelObj); 165 166void intel_tex_unmap_images(struct intel_context *intel, 167 struct intel_texture_object *intelObj); 168 169int intel_compressed_num_bytes(GLuint mesaFormat); 170 171void intel_generate_mipmap(GLcontext *ctx, GLenum target, 172 struct gl_texture_object *texObj); 173 174#endif 175