summaryrefslogtreecommitdiff
path: root/xc/lib/GL/mesa/src/drv/i810/i810context.h
blob: 754a0e3f1a83c7e3173f57794039262be07e2a11 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
/*
 * GLX Hardware Device Driver for Intel i810
 * Copyright (C) 1999 Keith Whitwell
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the "Software"),
 * to deal in the Software without restriction, including without limitation
 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
 * and/or sell copies of the Software, and to permit persons to whom the
 * Software is furnished to do so, subject to the following conditions:
 *
 * The above copyright notice and this permission notice shall be included
 * in all copies or substantial portions of the Software.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 * KEITH WHITWELL, OR ANY OTHER CONTRIBUTORS BE LIABLE FOR ANY CLAIM, 
 * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR 
 * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE 
 * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 *
 */


#ifndef I810CONTEXT_INC
#define I810CONTEXT_INC


#include "mesaglx/types.h"

#include "i810common.h"
#include "i810buf.h"
#include "i810tex.h"
#include "i810vb.h"

#include "xsmesaP.h"

/* Hmmm */
#define FALLBACK_TEXTURE   1



#define I810_NEW_TEXTURE 0x20
#define I810_NEW_CONTEXT 0x100



struct i810_context_t {
   GLint refcount;

   struct i810_dest_buffer *DB;
   GLcontext *gl_ctx;

   i810TextureObjectPtr CurrentTex0Obj;
   i810TextureObjectPtr CurrentTex1Obj;

   struct i810_texture_object_t TexObjList, SwappedOut;

   int TextureMode;

   /* flags 
    */
   int GlobalPaletteUpdated:1; 


   /* Hardware state
    */
   GLuint Setup[I810_CTX_SETUP_SIZE];
   

   /* Context hardware state mirrors.
    */
   GLushort GlobalPalette[256];

   /* Support for CVA and the fast paths.
    */
   GLuint setupdone;
   GLuint setupindex;
   GLuint renderindex;
   GLuint using_fast_path;
/*     gl_vertex_interp_func interp; */

   /* Shortcircuit some state changes.
    */
   points_func PointsFunc;
   line_func LineFunc;
   triangle_func TriangleFunc;
   quad_func QuadFunc;

   /* Manage our own state */
   GLuint new_state; 
   GLuint reg_dirty;
   
   /* One of the few bits of hardware state that can't be calculated
    * completely on the fly:
    */
   GLuint LcsCullMode;

   /* For mono span and pixel funcs.
    */
   GLushort CurrentColor;

   /* DRI stuff
    */
   GLuint needClip;
   GLuint clipMinX;
   GLuint clipMaxX;
   GLuint clipMinY;
   GLuint clipMaxY;
   

   drmContext hHWContext;
   int numClipRects;
   XF86DRIClipRectPtr pClipRects;
   i810ScreenPrivate *i810ScrnPriv; 
};

typedef struct i810_context_t i810Context;
typedef struct i810_context_t *i810ContextPtr;


i810ContextPtr i810CreateContext(GLcontext *ctx); /* Do I need visual info? */
int i810DestroyContext(i810ContextPtr ctx);
int i810BindBuffer(i810ContextPtr ctx, struct i810_dest_buffer *buf);

extern GLuint i810DDRegisterPipelineStages( struct gl_pipeline_stage *out,
					   const struct gl_pipeline_stage *in,
					   GLuint nr );

extern GLboolean i810DDBuildPrecalcPipeline( GLcontext *ctx );



#endif