a3bcee4b6956d187a9491da146e1b4c7d99db2a0
[mesa.git] / src / mesa / drivers / dri / tdfx / tdfx_tex.h
1 /* -*- mode: c; c-basic-offset: 3 -*-
2 *
3 * Copyright 2000 VA Linux Systems Inc., Fremont, California.
4 *
5 * All Rights Reserved.
6 *
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
13 *
14 * The above copyright notice and this permission notice (including the next
15 * paragraph) shall be included in all copies or substantial portions of the
16 * Software.
17 *
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * VA LINUX SYSTEMS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
22 * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF
23 * OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 * SOFTWARE.
25 */
26 /* $XFree86: xc/lib/GL/mesa/src/drv/tdfx/tdfx_tex.h,v 1.2 2002/02/22 21:45:04 dawes Exp $ */
27
28 /*
29 * Original rewrite:
30 * Gareth Hughes <gareth@valinux.com>, 29 Sep - 1 Oct 2000
31 *
32 * Authors:
33 * Gareth Hughes <gareth@valinux.com>
34 * Brian Paul <brianp@valinux.com>
35 *
36 */
37
38 #ifndef _TDFX_TEX_H_
39 #define _TDFX_TEX_H_
40
41
42 #include "texutil.h"
43
44
45 #define tdfxDDIsCompressedFormatMacro(internalFormat) \
46 (((internalFormat) == GL_COMPRESSED_RGB_FXT1_3DFX) || \
47 ((internalFormat) == GL_COMPRESSED_RGBA_FXT1_3DFX))
48 #define tdfxDDIsCompressedGlideFormatMacro(internalFormat) \
49 ((internalFormat) == GR_TEXFMT_ARGB_CMP_FXT1)
50
51
52
53 extern void
54 tdfxTexValidate(GLcontext * ctx, struct gl_texture_object *tObj);
55
56
57 #if 000 /* DEAD? */
58 extern void
59 fxDDTexUseGlobalPalette(GLcontext * ctx, GLboolean state);
60 #endif
61
62 extern GLboolean
63 tdfxTestProxyTexImage(GLcontext *ctx, GLenum target,
64 GLint level, GLint internalFormat,
65 GLenum format, GLenum type,
66 GLint width, GLint height,
67 GLint depth, GLint border);
68
69 extern GLvoid *
70 tdfxDDGetTexImage(GLcontext * ctx, GLenum target, GLint level,
71 const struct gl_texture_object *texObj,
72 GLenum * formatOut, GLenum * typeOut,
73 GLboolean * freeImageOut);
74
75 extern void
76 tdfxDDGetCompressedTexImage( GLcontext *ctx, GLenum target,
77 GLint lod, void *image,
78 const struct gl_texture_object *texObj,
79 struct gl_texture_image *texImage );
80
81 extern GLint
82 tdfxSpecificCompressedTexFormat(GLcontext *ctx,
83 GLint internalFormat,
84 GLint numDimensions);
85
86 extern GLint
87 tdfxBaseCompressedTexFormat(GLcontext *ctx,
88 GLint internalFormat);
89
90 extern GLboolean
91 tdfxDDIsCompressedFormat(GLcontext *ctx, GLint internalFormat);
92
93 extern GLsizei
94 tdfxDDCompressedImageSize(GLcontext *ctx,
95 GLenum intFormat,
96 GLuint numDimensions,
97 GLuint width,
98 GLuint height,
99 GLuint depth);
100
101
102 extern void
103 tdfxInitTextureFuncs( struct dd_function_table *functions );
104
105 #endif