1 /* $XFree86: xc/lib/GL/mesa/src/drv/r200/r200_context.h,v 1.2 2002/12/16 16:18:54 dawes Exp $ */
3 Copyright (C) The Weather Channel, Inc. 2002. All Rights Reserved.
5 The Weather Channel (TM) funded Tungsten Graphics to develop the
6 initial release of the Radeon 8500 driver under the XFree86 license.
7 This notice must be preserved.
9 Permission is hereby granted, free of charge, to any person obtaining
10 a copy of this software and associated documentation files (the
11 "Software"), to deal in the Software without restriction, including
12 without limitation the rights to use, copy, modify, merge, publish,
13 distribute, sublicense, and/or sell copies of the Software, and to
14 permit persons to whom the Software is furnished to do so, subject to
15 the following conditions:
17 The above copyright notice and this permission notice (including the
18 next paragraph) shall be included in all copies or substantial
19 portions of the Software.
21 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
22 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
23 MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
24 IN NO EVENT SHALL THE COPYRIGHT OWNER(S) AND/OR ITS SUPPLIERS BE
25 LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
26 OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
27 WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 **************************************************************************/
33 * Keith Whitwell <keith@tungstengraphics.com>
36 #ifndef __R200_CONTEXT_H__
37 #define __R200_CONTEXT_H__
39 #ifdef GLX_DIRECT_RENDERING
41 #include "tnl/t_vertex.h"
43 #include "radeon_drm.h"
51 #include "radeon_context.h"
53 #define ENABLE_HW_3D_TEXTURE 1 /* XXX this is temporary! */
56 typedef struct r200_context r200ContextRec
;
57 typedef struct r200_context
*r200ContextPtr
;
61 /* The blit width for texture uploads
63 #define BLIT_WIDTH_BYTES 1024
65 /* Use the templated vertex format:
68 #define TAG(x) r200##x
69 #include "tnl_dd/t_dd_vertex.h"
72 typedef void (*r200_tri_func
) (r200ContextPtr
,
73 r200Vertex
*, r200Vertex
*, r200Vertex
*);
75 typedef void (*r200_line_func
) (r200ContextPtr
, r200Vertex
*, r200Vertex
*);
77 typedef void (*r200_point_func
) (r200ContextPtr
, r200Vertex
*);
79 struct r200_depthbuffer_state
{
83 struct r200_stencilbuffer_state
{
85 GLuint clear
; /* rb3d_stencilrefmask value */
88 struct r200_stipple_state
{
92 typedef struct r200_tex_obj r200TexObj
, *r200TexObjPtr
;
94 /* Texture object in locally shared texture space.
97 driTextureObject base
;
99 GLuint bufAddr
; /* Offset to start of locally
100 shared texture block */
102 GLuint dirty_state
; /* Flags (1 per texunit) for
103 whether or not this texobj
104 has dirty hardware state
105 (pp_*) that needs to be
109 drm_radeon_tex_image_t image
[6][RADEON_MAX_TEXTURE_LEVELS
];
110 /* Six, for the cube faces */
112 GLuint pp_txfilter
; /* hardware register values */
114 GLuint pp_txformat_x
;
115 GLuint pp_txoffset
; /* Image location in texmem.
116 All cube faces follow. */
117 GLuint pp_txsize
; /* npot only */
118 GLuint pp_txpitch
; /* npot only */
119 GLuint pp_border_color
;
120 GLuint pp_cubic_faces
; /* cube face 1,2,3,4 log2 sizes */
122 GLboolean border_fallback
;
125 struct r200_texture_env_state
{
126 r200TexObjPtr texobj
;
131 #define R200_MAX_TEXTURE_UNITS 6
133 struct r200_texture_state
{
134 struct r200_texture_env_state unit
[R200_MAX_TEXTURE_UNITS
];
137 struct r200_state_atom
{
138 struct r200_state_atom
*next
, *prev
;
139 const char *name
; /* for debug */
140 int cmd_size
; /* size in bytes */
142 int *cmd
; /* one or more cmd's */
143 int *lastcmd
; /* one or more cmd's */
144 int *savedcmd
; /* one or more cmd's */
146 GLboolean(*check
) (GLcontext
*, int); /* is this state active? */
149 /* Trying to keep these relatively short as the variables are becoming
150 * extravagently long. Drop the driver name prefix off the front of
151 * everything - I think we know which driver we're in by now, and keep the
152 * prefix to 3 letters unless absolutely impossible.
156 #define CTX_PP_MISC 1
157 #define CTX_PP_FOG_COLOR 2
158 #define CTX_RE_SOLID_COLOR 3
159 #define CTX_RB3D_BLENDCNTL 4
160 #define CTX_RB3D_DEPTHOFFSET 5
161 #define CTX_RB3D_DEPTHPITCH 6
162 #define CTX_RB3D_ZSTENCILCNTL 7
164 #define CTX_PP_CNTL 9
165 #define CTX_RB3D_CNTL 10
166 #define CTX_RB3D_COLOROFFSET 11
167 #define CTX_CMD_2 12 /* why */
168 #define CTX_RB3D_COLORPITCH 13 /* why */
169 #define CTX_STATE_SIZE_OLDDRM 14
171 #define CTX_RB3D_BLENDCOLOR 15
172 #define CTX_RB3D_ABLENDCNTL 16
173 #define CTX_RB3D_CBLENDCNTL 17
174 #define CTX_STATE_SIZE_NEWDRM 18
177 #define SET_SE_CNTL 1
178 #define SET_RE_CNTL 2 /* replace se_coord_fmt */
179 #define SET_STATE_SIZE 3
182 #define VTE_SE_VTE_CNTL 1
183 #define VTE_STATE_SIZE 2
186 #define LIN_RE_LINE_PATTERN 1
187 #define LIN_RE_LINE_STATE 2
189 #define LIN_SE_LINE_WIDTH 4
190 #define LIN_STATE_SIZE 5
193 #define MSK_RB3D_STENCILREFMASK 1
194 #define MSK_RB3D_ROPCNTL 2
195 #define MSK_RB3D_PLANEMASK 3
196 #define MSK_STATE_SIZE 4
199 #define VPT_SE_VPORT_XSCALE 1
200 #define VPT_SE_VPORT_XOFFSET 2
201 #define VPT_SE_VPORT_YSCALE 3
202 #define VPT_SE_VPORT_YOFFSET 4
203 #define VPT_SE_VPORT_ZSCALE 5
204 #define VPT_SE_VPORT_ZOFFSET 6
205 #define VPT_STATE_SIZE 7
208 #define ZBS_SE_ZBIAS_FACTOR 1
209 #define ZBS_SE_ZBIAS_CONSTANT 2
210 #define ZBS_STATE_SIZE 3
213 #define MSC_RE_MISC 1
214 #define MSC_STATE_SIZE 2
218 #define TAM_STATE_SIZE 2
221 #define TEX_PP_TXFILTER 1 /*2c00 */
222 #define TEX_PP_TXFORMAT 2 /*2c04 */
223 #define TEX_PP_TXFORMAT_X 3 /*2c08 */
224 #define TEX_PP_TXSIZE 4 /*2c0c */
225 #define TEX_PP_TXPITCH 5 /*2c10 */
226 #define TEX_PP_BORDER_COLOR 6 /*2c14 */
228 #define TEX_PP_TXOFFSET 8 /*2d00 */
229 #define TEX_STATE_SIZE 9
231 #define CUBE_CMD_0 0 /* 1 register follows */
232 #define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
233 #define CUBE_CMD_1 2 /* 5 registers follow */
234 #define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
235 #define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
236 #define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */
237 #define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */
238 #define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */
239 #define CUBE_STATE_SIZE 8
242 #define PIX_PP_TXCBLEND 1
243 #define PIX_PP_TXCBLEND2 2
244 #define PIX_PP_TXABLEND 3
245 #define PIX_PP_TXABLEND2 4
246 #define PIX_STATE_SIZE 5
249 #define TF_TFACTOR_0 1
250 #define TF_TFACTOR_1 2
251 #define TF_TFACTOR_2 3
252 #define TF_TFACTOR_3 4
253 #define TF_TFACTOR_4 5
254 #define TF_TFACTOR_5 6
255 #define TF_STATE_SIZE 7
258 #define TCL_LIGHT_MODEL_CTL_0 1
259 #define TCL_LIGHT_MODEL_CTL_1 2
260 #define TCL_PER_LIGHT_CTL_0 3
261 #define TCL_PER_LIGHT_CTL_1 4
262 #define TCL_PER_LIGHT_CTL_2 5
263 #define TCL_PER_LIGHT_CTL_3 6
265 #define TCL_UCP_VERT_BLEND_CTL 8
266 #define TCL_STATE_SIZE 9
269 #define MSL_MATRIX_SELECT_0 1
270 #define MSL_MATRIX_SELECT_1 2
271 #define MSL_MATRIX_SELECT_2 3
272 #define MSL_MATRIX_SELECT_3 4
273 #define MSL_MATRIX_SELECT_4 5
274 #define MSL_STATE_SIZE 6
277 #define TCG_TEX_PROC_CTL_2 1
278 #define TCG_TEX_PROC_CTL_3 2
279 #define TCG_TEX_PROC_CTL_0 3
280 #define TCG_TEX_PROC_CTL_1 4
281 #define TCG_TEX_CYL_WRAP_CTL 5
282 #define TCG_STATE_SIZE 6
285 #define MTL_EMMISSIVE_RED 1
286 #define MTL_EMMISSIVE_GREEN 2
287 #define MTL_EMMISSIVE_BLUE 3
288 #define MTL_EMMISSIVE_ALPHA 4
289 #define MTL_AMBIENT_RED 5
290 #define MTL_AMBIENT_GREEN 6
291 #define MTL_AMBIENT_BLUE 7
292 #define MTL_AMBIENT_ALPHA 8
293 #define MTL_DIFFUSE_RED 9
294 #define MTL_DIFFUSE_GREEN 10
295 #define MTL_DIFFUSE_BLUE 11
296 #define MTL_DIFFUSE_ALPHA 12
297 #define MTL_SPECULAR_RED 13
298 #define MTL_SPECULAR_GREEN 14
299 #define MTL_SPECULAR_BLUE 15
300 #define MTL_SPECULAR_ALPHA 16
302 #define MTL_SHININESS 18
303 #define MTL_STATE_SIZE 19
306 #define VAP_SE_VAP_CNTL 1
307 #define VAP_STATE_SIZE 2
309 /* Replaces a lot of packet info from radeon
312 #define VTX_VTXFMT_0 1
313 #define VTX_VTXFMT_1 2
314 #define VTX_TCL_OUTPUT_VTXFMT_0 3
315 #define VTX_TCL_OUTPUT_VTXFMT_1 4
317 #define VTX_TCL_OUTPUT_COMPSEL 6
319 #define VTX_STATE_CNTL 8
320 #define VTX_STATE_SIZE 9
322 #define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
326 * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
327 * how many components are in texture coordinate \c n.
329 #define VTX_TEXn_COUNT(v,n) (((v) >> (3 * n)) & 0x07)
333 #define MAT_STATE_SIZE 17
336 #define GRD_VERT_GUARD_CLIP_ADJ 1
337 #define GRD_VERT_GUARD_DISCARD_ADJ 2
338 #define GRD_HORZ_GUARD_CLIP_ADJ 3
339 #define GRD_HORZ_GUARD_DISCARD_ADJ 4
340 #define GRD_STATE_SIZE 5
342 /* position changes frequently when lighting in modelpos - separate
343 * out to new state item?
346 #define LIT_AMBIENT_RED 1
347 #define LIT_AMBIENT_GREEN 2
348 #define LIT_AMBIENT_BLUE 3
349 #define LIT_AMBIENT_ALPHA 4
350 #define LIT_DIFFUSE_RED 5
351 #define LIT_DIFFUSE_GREEN 6
352 #define LIT_DIFFUSE_BLUE 7
353 #define LIT_DIFFUSE_ALPHA 8
354 #define LIT_SPECULAR_RED 9
355 #define LIT_SPECULAR_GREEN 10
356 #define LIT_SPECULAR_BLUE 11
357 #define LIT_SPECULAR_ALPHA 12
358 #define LIT_POSITION_X 13
359 #define LIT_POSITION_Y 14
360 #define LIT_POSITION_Z 15
361 #define LIT_POSITION_W 16
362 #define LIT_DIRECTION_X 17
363 #define LIT_DIRECTION_Y 18
364 #define LIT_DIRECTION_Z 19
365 #define LIT_DIRECTION_W 20
366 #define LIT_ATTEN_QUADRATIC 21
367 #define LIT_ATTEN_LINEAR 22
368 #define LIT_ATTEN_CONST 23
369 #define LIT_ATTEN_XXX 24
371 #define LIT_SPOT_DCD 26
372 #define LIT_SPOT_DCM 27
373 #define LIT_SPOT_EXPONENT 28
374 #define LIT_SPOT_CUTOFF 29
375 #define LIT_SPECULAR_THRESH 30
376 #define LIT_RANGE_CUTOFF 31 /* ? */
377 #define LIT_ATTEN_CONST_INV 32
378 #define LIT_STATE_SIZE 33
387 #define FOG_STATE_SIZE 5
396 #define UCP_STATE_SIZE 5
398 /* GLT - Global ambient
405 #define GLT_STATE_SIZE 5
413 #define EYE_RESCALE_FACTOR 4
414 #define EYE_STATE_SIZE 5
416 /* CST - constant state
419 #define CST_PP_CNTL_X 1
421 #define CST_RB3D_DEPTHXY_OFFSET 3
423 #define CST_RE_AUX_SCISSOR_CNTL 5
425 #define CST_RE_SCISSOR_TL_0 7
426 #define CST_RE_SCISSOR_BR_0 8
428 #define CST_SE_VAP_CNTL_STATUS 10
430 #define CST_RE_POINTSIZE 12
432 #define CST_SE_TCL_INPUT_VTX_0 14
433 #define CST_SE_TCL_INPUT_VTX_1 15
434 #define CST_SE_TCL_INPUT_VTX_2 16
435 #define CST_SE_TCL_INPUT_VTX_3 17
436 #define CST_STATE_SIZE 18
438 struct r200_hw_state
{
439 /* Head of the linked list of state atoms. */
440 struct r200_state_atom atomlist
;
442 /* Hardware state, stored as cmdbuf commands:
443 * -- Need to doublebuffer for
444 * - reviving state after loss of context
445 * - eliding noop statechange loops? (except line stipple count)
447 struct r200_state_atom ctx
;
448 struct r200_state_atom set
;
449 struct r200_state_atom vte
;
450 struct r200_state_atom lin
;
451 struct r200_state_atom msk
;
452 struct r200_state_atom vpt
;
453 struct r200_state_atom vap
;
454 struct r200_state_atom vtx
;
455 struct r200_state_atom tcl
;
456 struct r200_state_atom msl
;
457 struct r200_state_atom tcg
;
458 struct r200_state_atom msc
;
459 struct r200_state_atom cst
;
460 struct r200_state_atom tam
;
461 struct r200_state_atom tf
;
462 struct r200_state_atom tex
[6];
463 struct r200_state_atom cube
[6];
464 struct r200_state_atom zbs
;
465 struct r200_state_atom mtl
[2];
466 struct r200_state_atom mat
[9];
467 struct r200_state_atom lit
[8]; /* includes vec, scl commands */
468 struct r200_state_atom ucp
[6];
469 struct r200_state_atom pix
[6]; /* pixshader stages */
470 struct r200_state_atom eye
; /* eye pos */
471 struct r200_state_atom grd
; /* guard band clipping */
472 struct r200_state_atom fog
;
473 struct r200_state_atom glt
;
475 int max_state_size
; /* Number of bytes necessary for a full state emit. */
476 GLboolean is_dirty
, all_dirty
;
479 struct r200_colorbuffer_state
{
484 /* Derived state for internal purposes:
486 struct r200_colorbuffer_state color
;
487 struct r200_depthbuffer_state depth
;
488 struct r200_stencilbuffer_state stencil
;
489 struct r200_stipple_state stipple
;
490 struct r200_texture_state texture
;
493 /* Need refcounting on dma buffers:
495 struct r200_dma_buffer
{
496 int refcount
; /* the number of retained regions in buf */
500 #define GET_START(rvb) (rmesa->radeon.radeonScreen->gart_buffer_offset + \
501 (rvb)->address - rmesa->dma.buf0_address + \
504 /* A retained region, eg vertices for indexed vertices.
506 struct r200_dma_region
{
507 struct r200_dma_buffer
*buf
;
508 char *address
; /* == buf->address */
509 int start
, end
, ptr
; /* offsets from start of buf */
516 /* Active dma region. Allocations for vertices and retained
517 * regions come from here. Also used for emitting random vertices,
518 * these may be flushed by calling flush_current();
520 struct r200_dma_region current
;
522 void (*flush
) (r200ContextPtr
);
524 char *buf0_address
; /* start of buf[0], for index calcs */
525 GLuint nr_released_bufs
; /* flush after so many buffers released */
528 #define R200_CMD_BUF_SZ (8*1024)
533 char cmd_buf
[R200_CMD_BUF_SZ
];
540 struct r200_tcl_info
{
541 GLuint vertex_format
;
545 struct r200_dma_region
*aos_components
[8];
546 GLuint nr_aos_components
;
550 struct r200_dma_region indexed_verts
;
551 struct r200_dma_region obj
;
552 struct r200_dma_region rgba
;
553 struct r200_dma_region spec
;
554 struct r200_dma_region fog
;
555 struct r200_dma_region tex
[R200_MAX_TEXTURE_UNITS
];
556 struct r200_dma_region norm
;
561 struct r200_swtcl_info
{
565 * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is
566 * installed in the Mesa state vector.
571 * Attributes instructing the Mesa TCL pipeline where / how to put vertex
572 * data in the hardware buffer.
574 struct tnl_attr_map vertex_attrs
[VERT_ATTRIB_MAX
];
577 * Number of elements of \c ::vertex_attrs that are actually used.
579 GLuint vertex_attr_count
;
582 * Cached pointer to the buffer where Mesa will store vertex data.
586 /* Fallback rasterization functions
588 r200_point_func draw_point
;
589 r200_line_func draw_line
;
590 r200_tri_func draw_tri
;
593 GLenum render_primitive
;
597 * Offset of the 4UB color data within a hardware (swtcl) vertex.
602 * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
607 * Should Mesa project vertex data or will the hardware do it?
611 struct r200_dma_region indexed_verts
;
615 GLuint vertex_offset
;
619 #define R200_MAX_PRIMS 64
621 /* Want to keep a cache of these around. Each is parameterized by
622 * only a single value which has only a small range. Only expect a
623 * few, so just rescan the list each time?
626 struct dynfn
*next
, *prev
;
632 struct dynfn Vertex2f
;
633 struct dynfn Vertex2fv
;
634 struct dynfn Vertex3f
;
635 struct dynfn Vertex3fv
;
636 struct dynfn Color4ub
;
637 struct dynfn Color4ubv
;
638 struct dynfn Color3ub
;
639 struct dynfn Color3ubv
;
640 struct dynfn Color4f
;
641 struct dynfn Color4fv
;
642 struct dynfn Color3f
;
643 struct dynfn Color3fv
;
644 struct dynfn SecondaryColor3ubEXT
;
645 struct dynfn SecondaryColor3ubvEXT
;
646 struct dynfn SecondaryColor3fEXT
;
647 struct dynfn SecondaryColor3fvEXT
;
648 struct dynfn Normal3f
;
649 struct dynfn Normal3fv
;
650 struct dynfn TexCoord3f
;
651 struct dynfn TexCoord3fv
;
652 struct dynfn TexCoord2f
;
653 struct dynfn TexCoord2fv
;
654 struct dynfn TexCoord1f
;
655 struct dynfn TexCoord1fv
;
656 struct dynfn MultiTexCoord3fARB
;
657 struct dynfn MultiTexCoord3fvARB
;
658 struct dynfn MultiTexCoord2fARB
;
659 struct dynfn MultiTexCoord2fvARB
;
660 struct dynfn MultiTexCoord1fARB
;
661 struct dynfn MultiTexCoord1fvARB
;
664 struct dfn_generators
{
665 struct dynfn
*(*Vertex2f
) (GLcontext
*, const int *);
666 struct dynfn
*(*Vertex2fv
) (GLcontext
*, const int *);
667 struct dynfn
*(*Vertex3f
) (GLcontext
*, const int *);
668 struct dynfn
*(*Vertex3fv
) (GLcontext
*, const int *);
669 struct dynfn
*(*Color4ub
) (GLcontext
*, const int *);
670 struct dynfn
*(*Color4ubv
) (GLcontext
*, const int *);
671 struct dynfn
*(*Color3ub
) (GLcontext
*, const int *);
672 struct dynfn
*(*Color3ubv
) (GLcontext
*, const int *);
673 struct dynfn
*(*Color4f
) (GLcontext
*, const int *);
674 struct dynfn
*(*Color4fv
) (GLcontext
*, const int *);
675 struct dynfn
*(*Color3f
) (GLcontext
*, const int *);
676 struct dynfn
*(*Color3fv
) (GLcontext
*, const int *);
677 struct dynfn
*(*SecondaryColor3ubEXT
) (GLcontext
*, const int *);
678 struct dynfn
*(*SecondaryColor3ubvEXT
) (GLcontext
*, const int *);
679 struct dynfn
*(*SecondaryColor3fEXT
) (GLcontext
*, const int *);
680 struct dynfn
*(*SecondaryColor3fvEXT
) (GLcontext
*, const int *);
681 struct dynfn
*(*Normal3f
) (GLcontext
*, const int *);
682 struct dynfn
*(*Normal3fv
) (GLcontext
*, const int *);
683 struct dynfn
*(*TexCoord3f
) (GLcontext
*, const int *);
684 struct dynfn
*(*TexCoord3fv
) (GLcontext
*, const int *);
685 struct dynfn
*(*TexCoord2f
) (GLcontext
*, const int *);
686 struct dynfn
*(*TexCoord2fv
) (GLcontext
*, const int *);
687 struct dynfn
*(*TexCoord1f
) (GLcontext
*, const int *);
688 struct dynfn
*(*TexCoord1fv
) (GLcontext
*, const int *);
689 struct dynfn
*(*MultiTexCoord3fARB
) (GLcontext
*, const int *);
690 struct dynfn
*(*MultiTexCoord3fvARB
) (GLcontext
*, const int *);
691 struct dynfn
*(*MultiTexCoord2fARB
) (GLcontext
*, const int *);
692 struct dynfn
*(*MultiTexCoord2fvARB
) (GLcontext
*, const int *);
693 struct dynfn
*(*MultiTexCoord1fARB
) (GLcontext
*, const int *);
694 struct dynfn
*(*MultiTexCoord1fvARB
) (GLcontext
*, const int *);
703 /* A maximum total of 29 elements per vertex: 3 floats for position, 3
704 * floats for normal, 4 floats for color, 4 bytes for secondary color,
705 * 3 floats for each texture unit (18 floats total).
707 * we maybe need add. 4 to prevent segfault if someone specifies
708 * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
710 * The position data is never actually stored here, so 3 elements could be
711 * trimmed out of the buffer.
714 #define R200_MAX_VERTEX_SIZE ((3*6)+11)
717 GLint counter
, initial_counter
;
719 void (*notify
) (void);
726 } vertex
[R200_MAX_VERTEX_SIZE
];
729 GLfloat
*floatcolorptr
;
730 r200_color_t
*colorptr
;
731 GLfloat
*floatspecptr
;
732 r200_color_t
*specptr
;
733 GLfloat
*texcoordptr
[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
735 GLenum
*prim
; /* &ctx->Driver.CurrentExecPrimitive */
737 GLboolean enabled
; /* *_NO_VTXFMT / *_NO_TCL env vars */
742 GLuint vtxfmt_0
, vtxfmt_1
;
744 GLuint installed_vertex_format
;
745 GLuint installed_color_3f_sz
;
747 struct r200_prim primlist
[R200_MAX_PRIMS
];
750 struct dfn_lists dfn_cache
;
751 struct dfn_generators codegen
;
752 GLvertexformat vtxfmt
;
756 * R200 context structure.
758 struct r200_context
{
759 struct radeon_context radeon
; /* parent class, must be first */
761 /* Driver and hardware state management
763 struct r200_hw_state hw
;
764 struct r200_state state
;
766 /* Texture object bookkeeping
769 driTexHeap
*texture_heaps
[R200_NR_TEX_HEAPS
];
770 driTextureObject swapped
;
772 float initialMaxAnisotropy
;
774 /* Rasterization and vertex state:
780 struct r200_ioctl ioctl
;
782 struct r200_store store
;
783 GLboolean save_on_next_unlock
;
785 /* Clientdata textures;
787 GLuint prefer_gart_client_texturing
;
791 GLmatrix TexGenMatrix
[R200_MAX_TEXTURE_UNITS
];
792 GLboolean recheck_texgen
[R200_MAX_TEXTURE_UNITS
];
793 GLboolean TexGenNeedNormals
[R200_MAX_TEXTURE_UNITS
];
794 GLuint TexMatEnabled
;
795 GLuint TexMatCompSel
;
796 GLuint TexGenEnabled
;
798 GLuint TexGenCompSel
;
803 struct r200_tcl_info tcl
;
807 struct r200_swtcl_info swtcl
;
811 struct r200_vbinfo vb
;
814 #define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
816 extern void r200DestroyContext(__DRIcontextPrivate
* driContextPriv
);
817 extern GLboolean
r200CreateContext(const __GLcontextModes
* glVisual
,
818 __DRIcontextPrivate
* driContextPriv
,
819 void *sharedContextPrivate
);
822 #endif /* __R200_CONTEXT_H__ */