Fix a possible segfault caused by the SGI_make_current_read changes.
[mesa.git] / src / mesa / drivers / dri / i830 / i830_tex.h
1 /*
2 * GLX Hardware Device Driver for Intel i810
3 * Copyright (C) 1999 Keith Whitwell
4 *
5 * Permission is hereby granted, free of charge, to any person obtaining a
6 * copy of this software and associated documentation files (the "Software"),
7 * to deal in the Software without restriction, including without limitation
8 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
9 * and/or sell copies of the Software, and to permit persons to whom the
10 * Software is furnished to do so, subject to the following conditions:
11 *
12 * The above copyright notice and this permission notice shall be included
13 * in all copies or substantial portions of the Software.
14 *
15 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
16 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
18 * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM,
19 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
20 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE
21 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
22 *
23 * Adapted for use in the I830M driver:
24 * Jeff Hartmann <jhartmann@2d3d.com>
25 */
26
27 #ifndef I830TEX_INC
28 #define I830TEX_INC
29
30 #include "mtypes.h"
31 #include "i830_context.h"
32 #include "i830_3d_reg.h"
33 #include "texmem.h"
34
35 #define I830_TEX_MAXLEVELS 10
36
37 struct i830_texture_object_t
38 {
39 driTextureObject base;
40
41 int texelBytes;
42 int Pitch;
43 int Height;
44 char *BufAddr;
45 GLenum palette_format;
46 GLuint palette[256];
47 struct {
48 const struct gl_texture_image *image;
49 int offset; /* into BufAddr */
50 int height;
51 int internalFormat;
52 } image[6][I830_TEX_MAXLEVELS];
53
54 /* Support for multitexture.
55 */
56
57 GLuint current_unit;
58 GLuint Setup[I830_TEX_SETUP_SIZE];
59 GLuint dirty;
60
61 GLfloat max_anisotropy;
62 };
63
64 void i830UpdateTextureState( GLcontext *ctx );
65 void i830InitTextureFuncs( struct dd_function_table *functions );
66
67 void i830DestroyTexObj( i830ContextPtr imesa, i830TextureObjectPtr t );
68 int i830UploadTexImagesLocked( i830ContextPtr imesa, i830TextureObjectPtr t );
69
70 #endif