mesa: remove last of _mesa_unreference_framebuffer() calls
[mesa.git] / src / mesa / drivers / dri / i810 / i810tex.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 *
24 */
25
26 #ifndef I810TEX_INC
27 #define I810TEX_INC
28
29 #include "main/mtypes.h"
30 #include "main/mm.h"
31
32 #include "i810context.h"
33 #include "i810_3d_reg.h"
34 #include "texmem.h"
35
36 #define I810_TEX_MAXLEVELS 11
37
38 /* For shared texture space managment, these texture objects may also
39 * be used as proxies for regions of texture memory containing other
40 * client's textures. Such proxy textures (not to be confused with GL
41 * proxy textures) are subject to the same LRU aging we use for our
42 * own private textures, and thus we have a mechanism where we can
43 * fairly decide between kicking out our own textures and those of
44 * other clients.
45 *
46 * Non-local texture objects have a valid MemBlock to describe the
47 * region managed by the other client, and can be identified by
48 * 't->globj == 0'
49 */
50 struct i810_texture_object_t {
51 driTextureObject base;
52
53 int Pitch;
54 int Height;
55 int texelBytes;
56 char *BufAddr;
57
58 GLuint max_level;
59
60 struct {
61 const struct gl_texture_image *image;
62 int offset; /* into BufAddr */
63 int height;
64 int internalFormat;
65 } image[I810_TEX_MAXLEVELS];
66
67 GLuint Setup[I810_TEX_SETUP_SIZE];
68 GLuint dirty;
69
70 };
71
72 void i810UpdateTextureState( GLcontext *ctx );
73 void i810InitTextureFuncs( struct dd_function_table *functions );
74
75 void i810DestroyTexObj( i810ContextPtr imesa, i810TextureObjectPtr t );
76 int i810UploadTexImagesLocked( i810ContextPtr imesa, i810TextureObjectPtr t );
77
78 #endif