1f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
2f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgCopyright (C) The Weather Channel, Inc.  2002.  All Rights Reserved.
3f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
4f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgThe Weather Channel (TM) funded Tungsten Graphics to develop the
5f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orginitial release of the Radeon 8500 driver under the XFree86 license.
6f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgThis notice must be preserved.
7f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
8f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgPermission is hereby granted, free of charge, to any person obtaining
9f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orga copy of this software and associated documentation files (the
10f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org"Software"), to deal in the Software without restriction, including
11f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgwithout limitation the rights to use, copy, modify, merge, publish,
12f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgdistribute, sublicense, and/or sell copies of the Software, and to
13f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgpermit persons to whom the Software is furnished to do so, subject to
14f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgthe following conditions:
15f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
16f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgThe above copyright notice and this permission notice (including the
17f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgnext paragraph) shall be included in all copies or substantial
18f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgportions of the Software.
19f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
20f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgTHE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
21f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
22f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
23f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgIN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
24f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgLIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
25f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgOF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
26f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgWITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
27f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
28f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org**************************************************************************/
29f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
30f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/*
31f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Authors:
32f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org *   Keith Whitwell <keith@tungstengraphics.com>
33f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
34f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
35f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef __R200_CONTEXT_H__
36f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define __R200_CONTEXT_H__
37f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
38f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "tnl/t_vertex.h"
39f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "drm.h"
40f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "radeon_drm.h"
41f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "dri_util.h"
42f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
43f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "main/macros.h"
44f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "main/mtypes.h"
45f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "main/colormac.h"
46f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "r200_reg.h"
47f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "r200_vertprog.h"
48f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
49f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#ifndef R200_EMIT_VAP_PVS_CNTL
50f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#error This driver requires a newer libdrm to compile
51f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif
52f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
53f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "radeon_screen.h"
54f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "radeon_common.h"
55f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
56f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_context;
57f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgtypedef struct r200_context r200ContextRec;
58f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgtypedef struct r200_context *r200ContextPtr;
59f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
60f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#include "main/mm.h"
61f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
62f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_vertex_program {
63f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        struct gl_vertex_program mesa_program; /* Must be first */
64f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int translated;
65f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        /* need excess instr: 1 for late loop checking, 2 for
66f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org           additional instr due to instr/attr, 3 for fog */
67f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        VERTEX_SHADER_INSTRUCTION instr[R200_VSF_MAX_INST + 6];
68f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int pos_end;
69f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int inputs[VERT_ATTRIB_MAX];
70f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        GLubyte inputmap_rev[16];
71f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int native;
72f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int fogpidx;
73f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org        int fogmode;
74f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
75f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
76f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_TEX_ALL 0x3f
77f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
78f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
79f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_texture_env_state {
80f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   radeonTexObjPtr texobj;
81f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint outputreg;
82f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint unitneeded;
83f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
84f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
85f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_MAX_TEXTURE_UNITS 6
86f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
87f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_texture_state {
88f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_texture_env_state unit[R200_MAX_TEXTURE_UNITS];
89f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
90f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
91f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
92f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Trying to keep these relatively short as the variables are becoming
93f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * extravagently long.  Drop the driver name prefix off the front of
94f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * everything - I think we know which driver we're in by now, and keep the
95f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * prefix to 3 letters unless absolutely impossible.
96f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
97f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
98f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_CMD_0             0
99f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_PP_MISC           1
100f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_PP_FOG_COLOR      2
101f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RE_SOLID_COLOR    3
102f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_BLENDCNTL    4
103f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_DEPTHOFFSET  5
104f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_DEPTHPITCH   6
105f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_ZSTENCILCNTL 7
106f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_CMD_1             8
107f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_PP_CNTL           9
108f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_CNTL         10
109f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_COLOROFFSET  11
110f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_CMD_2             12 /* why */
111f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_COLORPITCH   13 /* why */
112f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_STATE_SIZE_OLDDRM 14
113f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_CMD_3             14
114f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_BLENDCOLOR   15
115f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_ABLENDCNTL   16
116f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_RB3D_CBLENDCNTL   17
117f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CTX_STATE_SIZE_NEWDRM 18
118f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
119f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SET_CMD_0               0
120f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SET_SE_CNTL             1
121f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SET_RE_CNTL             2 /* replace se_coord_fmt */
122f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SET_STATE_SIZE          3
123f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
124f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTE_CMD_0               0
125f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTE_SE_VTE_CNTL         1
126f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTE_STATE_SIZE          2
127f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
128f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_CMD_0               0
129f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_RE_LINE_PATTERN     1
130f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_RE_LINE_STATE       2
131f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_CMD_1               3
132f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_SE_LINE_WIDTH       4
133f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIN_STATE_SIZE          5
134f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
135f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSK_CMD_0               0
136f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSK_RB3D_STENCILREFMASK 1
137f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSK_RB3D_ROPCNTL        2
138f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSK_RB3D_PLANEMASK      3
139f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSK_STATE_SIZE          4
140f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
141f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_CMD_0           0
142f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_XSCALE          1
143f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_XOFFSET         2
144f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_YSCALE          3
145f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_YOFFSET         4
146f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_ZSCALE          5
147f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_SE_VPORT_ZOFFSET         6
148f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPT_STATE_SIZE      7
149f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
150f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ZBS_CMD_0               0
151f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ZBS_SE_ZBIAS_FACTOR     1
152f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ZBS_SE_ZBIAS_CONSTANT   2
153f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ZBS_STATE_SIZE          3
154f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
155f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSC_CMD_0               0
156f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSC_RE_MISC             1
157f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSC_STATE_SIZE          2
158f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
159f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TAM_CMD_0               0
160f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TAM_DEBUG3              1
161f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TAM_STATE_SIZE          2
162f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
163f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_CMD_0                   0
164f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXFILTER             1  /*2c00*/
165f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXFORMAT             2  /*2c04*/
166f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXFORMAT_X           3  /*2c08*/
167f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXSIZE               4  /*2c0c*/
168f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXPITCH              5  /*2c10*/
169f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_BORDER_COLOR         6  /*2c14*/
170f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_CMD_1_OLDDRM            7
171f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXOFFSET_OLDDRM      8  /*2d00 */
172f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_STATE_SIZE_OLDDRM       9
173f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_CUBIC_FACES          7
174f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXMULTI_CTL          8
175f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_CMD_1_NEWDRM            9
176f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_PP_TXOFFSET_NEWDRM     10
177f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TEX_STATE_SIZE_NEWDRM      11
178f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
179f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_CMD_0                  0  /* 1 register follows */ /* this command unnecessary */
180f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_FACES         1  /* 0x2c18 */             /* with new enough drm */
181f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_CMD_1                  2  /* 5 registers follow */
182f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_OFFSET_F1     3  /* 0x2d04 */
183f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_OFFSET_F2     4  /* 0x2d08 */
184f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_OFFSET_F3     5  /* 0x2d0c */
185f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_OFFSET_F4     6  /* 0x2d10 */
186f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_PP_CUBIC_OFFSET_F5     7  /* 0x2d14 */
187f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CUBE_STATE_SIZE             8
188f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
189f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_CMD_0                   0
190f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_PP_TXCBLEND             1
191f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_PP_TXCBLEND2            2
192f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_PP_TXABLEND             3
193f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_PP_TXABLEND2            4
194f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PIX_STATE_SIZE              5
195f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
196f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_CMD_0                    0
197f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_0                1
198f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_1                2
199f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_2                3
200f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_3                4
201f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_4                5
202f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_TFACTOR_5                6
203f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TF_STATE_SIZE               7
204f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
205f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_CMD_0                   0
206f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_0               1
207f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_1               2
208f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_2               3
209f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_3               4
210f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_4               5
211f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_5               6
212f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_6               7
213f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_TFACTOR_7               8
214f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define ATF_STATE_SIZE              9
215f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
216f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* ATI_FRAGMENT_SHADER */
217f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_CMD_0                 0
218f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_IC0                   1 /* 2f00 */
219f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_IC1                   2 /* 2f04 */
220f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_IA0                   3 /* 2f08 */
221f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_IA1                   4 /* 2f0c */
222f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define AFS_STATE_SIZE           33
223f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
224f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PVS_CMD_0                 0
225f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PVS_CNTL_1                1
226f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PVS_CNTL_2                2
227f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PVS_STATE_SIZE            3
228f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
229f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* those are quite big... */
230f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_CMD_0                 0
231f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_OPDST_0               1
232f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC0_0                2
233f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC1_0                3
234f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC2_0                4
235f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_OPDST_63              253
236f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC0_63               254
237f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC1_63               255
238f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_SRC2_63               256
239f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPI_STATE_SIZE            257
240f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
241f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_CMD_0                0
242f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM0_0             1
243f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM1_0             2
244f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM2_0             3
245f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM3_0             4
246f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM0_95            381
247f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM1_95            382
248f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM2_95            383
249f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_PARAM3_95            384
250f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VPP_STATE_SIZE           385
251f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
252f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_CMD_0                 0
253f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_LIGHT_MODEL_CTL_0     1
254f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_LIGHT_MODEL_CTL_1     2
255f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_PER_LIGHT_CTL_0       3
256f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_PER_LIGHT_CTL_1       4
257f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_PER_LIGHT_CTL_2       5
258f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_PER_LIGHT_CTL_3       6
259f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_CMD_1                 7
260f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_UCP_VERT_BLEND_CTL    8
261f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCL_STATE_SIZE            9
262f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
263f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_CMD_0                     0
264f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_MATRIX_SELECT_0           1
265f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_MATRIX_SELECT_1           2
266f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_MATRIX_SELECT_2           3
267f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_MATRIX_SELECT_3           4
268f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_MATRIX_SELECT_4           5
269f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MSL_STATE_SIZE                6
270f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
271f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_CMD_0                 0
272f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_TEX_PROC_CTL_2            1
273f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_TEX_PROC_CTL_3            2
274f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_TEX_PROC_CTL_0            3
275f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_TEX_PROC_CTL_1            4
276f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_TEX_CYL_WRAP_CTL      5
277f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define TCG_STATE_SIZE            6
278f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
279f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_CMD_0            0
280f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_EMMISSIVE_RED    1
281f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_EMMISSIVE_GREEN  2
282f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_EMMISSIVE_BLUE   3
283f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_EMMISSIVE_ALPHA  4
284f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_AMBIENT_RED      5
285f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_AMBIENT_GREEN    6
286f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_AMBIENT_BLUE     7
287f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_AMBIENT_ALPHA    8
288f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_DIFFUSE_RED      9
289f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_DIFFUSE_GREEN    10
290f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_DIFFUSE_BLUE     11
291f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_DIFFUSE_ALPHA    12
292f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_SPECULAR_RED     13
293f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_SPECULAR_GREEN   14
294f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_SPECULAR_BLUE    15
295f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_SPECULAR_ALPHA   16
296f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_CMD_1            17
297f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_SHININESS        18
298f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MTL_STATE_SIZE       19
299f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
300f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VAP_CMD_0                   0
301f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VAP_SE_VAP_CNTL             1
302f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VAP_STATE_SIZE              2
303f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
304f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Replaces a lot of packet info from radeon
305f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
306f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_CMD_0                   0
307f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_VTXFMT_0            1
308f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_VTXFMT_1            2
309f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_TCL_OUTPUT_VTXFMT_0 3
310f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_TCL_OUTPUT_VTXFMT_1 4
311f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_CMD_1               5
312f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_TCL_OUTPUT_COMPSEL  6
313f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_CMD_2               7
314f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_STATE_CNTL          8
315f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_STATE_SIZE          9
316f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
317f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* SPR - point sprite state
318f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
319f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SPR_CMD_0              0
320f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SPR_POINT_SPRITE_CNTL  1
321f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SPR_STATE_SIZE         2
322f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
323f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CMD_0              0
324f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_VPORT_SCALE_0      1
325f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_VPORT_SCALE_1      2
326f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_VPORT_SCALE_PTSIZE 3
327f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_VPORT_SCALE_3      4
328f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CMD_1              5
329f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_ATT_CONST_QUAD     6
330f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_ATT_CONST_LIN      7
331f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_ATT_CONST_CON      8
332f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_ATT_CONST_3        9
333f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_EYE_X             10
334f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_EYE_Y             11
335f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_EYE_Z             12
336f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_EYE_3             13
337f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CLAMP_MIN         14
338f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CLAMP_MAX         15
339f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CLAMP_2           16
340f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_CLAMP_3           17
341f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PTP_STATE_SIZE        18
342f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
343f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_COLOR(v,n)   (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
344f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org                         R200_VTX_COLOR_MASK)
345f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
346f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/**
347f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
348f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * how many components are in texture coordinate \c n.
349f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
350f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define VTX_TEXn_COUNT(v,n)   (((v) >> (3 * n)) & 0x07)
351f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
352f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MAT_CMD_0              0
353f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MAT_ELT_0              1
354f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define MAT_STATE_SIZE         17
355f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
356f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_CMD_0                  0
357f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_VERT_GUARD_CLIP_ADJ    1
358f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_VERT_GUARD_DISCARD_ADJ 2
359f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_HORZ_GUARD_CLIP_ADJ    3
360f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_HORZ_GUARD_DISCARD_ADJ 4
361f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GRD_STATE_SIZE             5
362f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
363f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* position changes frequently when lighting in modelpos - separate
364f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * out to new state item?
365f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
366f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_CMD_0                  0
367f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_AMBIENT_RED            1
368f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_AMBIENT_GREEN          2
369f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_AMBIENT_BLUE           3
370f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_AMBIENT_ALPHA          4
371f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIFFUSE_RED            5
372f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIFFUSE_GREEN          6
373f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIFFUSE_BLUE           7
374f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIFFUSE_ALPHA          8
375f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPECULAR_RED           9
376f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPECULAR_GREEN         10
377f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPECULAR_BLUE          11
378f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPECULAR_ALPHA         12
379f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_POSITION_X             13
380f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_POSITION_Y             14
381f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_POSITION_Z             15
382f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_POSITION_W             16
383f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIRECTION_X            17
384f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIRECTION_Y            18
385f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIRECTION_Z            19
386f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_DIRECTION_W            20
387f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_ATTEN_QUADRATIC        21
388f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_ATTEN_LINEAR           22
389f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_ATTEN_CONST            23
390f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_ATTEN_XXX              24
391f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_CMD_1                  25
392f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPOT_DCD               26
393f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPOT_DCM               27
394f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPOT_EXPONENT          28
395f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPOT_CUTOFF            29
396f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_SPECULAR_THRESH        30
397f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_RANGE_CUTOFF           31 /* ? */
398f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_ATTEN_CONST_INV        32
399f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define LIT_STATE_SIZE             33
400f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
401f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* Fog
402f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
403f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_CMD_0      0
404f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_R          1
405f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_C          2
406f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_D          3
407f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_PAD        4
408f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define FOG_STATE_SIZE 5
409f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
410f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* UCP
411f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
412f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_CMD_0      0
413f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_X          1
414f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_Y          2
415f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_Z          3
416f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_W          4
417f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define UCP_STATE_SIZE 5
418f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
419f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* GLT - Global ambient
420f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
421f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_CMD_0      0
422f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_RED        1
423f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_GREEN      2
424f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_BLUE       3
425f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_ALPHA      4
426f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define GLT_STATE_SIZE 5
427f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
428f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* EYE
429f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
430f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_CMD_0          0
431f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_X              1
432f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_Y              2
433f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_Z              3
434f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_RESCALE_FACTOR 4
435f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define EYE_STATE_SIZE     5
436f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
437f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* CST - constant state
438f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
439f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_0                             0
440f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_PP_CNTL_X                         1
441f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_1                             2
442f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_RB3D_DEPTHXY_OFFSET               3
443f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_2                             4
444f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_RE_AUX_SCISSOR_CNTL               5
445f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_4                             6
446f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_SE_VAP_CNTL_STATUS                7
447f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_5                             8
448f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_RE_POINTSIZE                      9
449f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_CMD_6                             10
450f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_SE_TCL_INPUT_VTX_0                11
451f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_SE_TCL_INPUT_VTX_1                12
452f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_SE_TCL_INPUT_VTX_2                13
453f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_SE_TCL_INPUT_VTX_3                14
454f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define CST_STATE_SIZE                        15
455f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
456f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRF_CMD_0         0
457f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRF_PP_TRI_PERF   1
458f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRF_PP_PERF_CNTL  2
459f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define PRF_STATE_SIZE    3
460f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
461f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
462f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCI_CMD_1         0
463f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCI_XY_1          1
464f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCI_CMD_2         2
465f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCI_XY_2          3
466f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define SCI_STATE_SIZE    4
467f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
468f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_QUERYOBJ_CMD_0  0
469f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_QUERYOBJ_DATA_0 1
470f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_QUERYOBJ_CMDSIZE  2
471f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
472f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STP_CMD_0 0
473f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STP_DATA_0 1
474f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STP_CMD_1 2
475f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define STP_STATE_SIZE 35
476f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
477f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_hw_state {
478f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* Hardware state, stored as cmdbuf commands:
479f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    *   -- Need to doublebuffer for
480f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    *           - reviving state after loss of context
481f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    *           - eliding noop statechange loops? (except line stipple count)
482f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
483f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom ctx;
484f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom set;
485f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom sci;
486f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vte;
487f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom lin;
488f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom msk;
489f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vpt;
490f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vap;
491f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vtx;
492f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom tcl;
493f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom msl;
494f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom tcg;
495f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom msc;
496f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom cst;
497f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom tam;
498f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom tf;
499f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom tex[6];
500f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom cube[6];
501f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom zbs;
502f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom mtl[2];
503f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom mat[9];
504f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom lit[8]; /* includes vec, scl commands */
505f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom ucp[6];
506f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom pix[6]; /* pixshader stages */
507f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom eye; /* eye pos */
508f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom grd; /* guard band clipping */
509f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom fog;
510f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom glt;
511f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom prf;
512f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom afs[2];
513f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom pvs;
514f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vpi[2];
515f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom vpp[2];
516f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom atf;
517f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom spr;
518f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom ptp;
519f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_state_atom stp;
520f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
521f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
522f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_state {
523f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* Derived state for internal purposes:
524f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
525f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_texture_state texture;
526f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint envneeded;
527f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
528f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
529f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_CMD_BUF_SZ  (16*1024)
530f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
531f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_ELT_BUF_SZ  (16*1024)
532f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* r200_tcl.c
533f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
534f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_tcl_info {
535f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint hw_primitive;
536f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
537f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   int elt_used;
538f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
539f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
540f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
541f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
542f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* r200_swtcl.c
543f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
544f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_swtcl_info {
545f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
546f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
547f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   radeon_point_func draw_point;
548f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   radeon_line_func draw_line;
549f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   radeon_tri_func draw_tri;
550f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
551f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /**
552f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * Offset of the 4UB color data within a hardware (swtcl) vertex.
553f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
554f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint coloroffset;
555f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
556f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /**
557f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
558f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
559f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint specoffset;
560f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
561f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /**
562f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * Should Mesa project vertex data or will the hardware do it?
563f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
564f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLboolean needproj;
565f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
566f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
567f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
568f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
569f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
570f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* A maximum total of 29 elements per vertex:  3 floats for position, 3
571f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * floats for normal, 4 floats for color, 4 bytes for secondary color,
572f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * 3 floats for each texture unit (18 floats total).
573f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    *
574f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * we maybe need add. 4 to prevent segfault if someone specifies
575f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
576f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    *
577f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * The position data is never actually stored here, so 3 elements could be
578f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    * trimmed out of the buffer.
579f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
580f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
581f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_MAX_VERTEX_SIZE ((3*6)+11)
582f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
583f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgstruct r200_context {
584f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_context radeon;
585f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
586f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* Driver and hardware state management
587f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
588f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_hw_state hw;
589f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_state state;
590f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_vertex_program *curr_vp_hw;
591f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
592f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* Vertex buffers
593f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
594f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_ioctl ioctl;
595f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct radeon_store store;
596f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
597f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* Clientdata textures;
598f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
599f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint prefer_gart_client_texturing;
600f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
601f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* TCL stuff
602f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
603f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLmatrix TexGenMatrix[R200_MAX_TEXTURE_UNITS];
604f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLboolean recheck_texgen[R200_MAX_TEXTURE_UNITS];
605f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLboolean TexGenNeedNormals[R200_MAX_TEXTURE_UNITS];
606f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint TexMatEnabled;
607f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint TexMatCompSel;
608f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint TexGenEnabled;
609f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLuint TexGenCompSel;
610f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLmatrix tmpmat;
611f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
612f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* r200_tcl.c
613f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
614f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_tcl_info tcl;
615f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
616f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   /* r200_swtcl.c
617f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org    */
618f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   struct r200_swtcl_info swtcl;
619f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
620f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLboolean using_hyperz;
621f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org   GLboolean texmicrotile;
622f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
623f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org  struct ati_fragment_shader *afs_loaded;
624f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org};
625f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
626f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_CONTEXT(ctx)		((r200ContextPtr)(ctx->DriverCtx))
627f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
628f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
629f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void r200DestroyContext( __DRIcontext *driContextPriv );
630f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern GLboolean r200CreateContext( gl_api api,
631f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    const struct gl_config *glVisual,
632f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    __DRIcontext *driContextPriv,
633f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    unsigned major_version,
634f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    unsigned minor_version,
635f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    uint32_t flags,
636f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    unsigned *error,
637f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				    void *sharedContextPrivate);
638f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern GLboolean r200MakeCurrent( __DRIcontext *driContextPriv,
639f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				  __DRIdrawable *driDrawPriv,
640f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org				  __DRIdrawable *driReadPriv );
641f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern GLboolean r200UnbindContext( __DRIcontext *driContextPriv );
642f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
643f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.orgextern void r200_init_texcopy_functions(struct dd_function_table *table);
644f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
645f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org/* ================================================================
646f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org * Debugging:
647f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org */
648f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
649f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#define R200_DEBUG RADEON_DEBUG
650f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
651f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
652f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org
653f2ba7591b1407a7ee9209f842c50696914dc2dedkbr@chromium.org#endif /* __R200_CONTEXT_H__ */
654