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
{
100 typedef struct r200_tex_obj r200TexObj
, *r200TexObjPtr
;
102 /* Texture object in locally shared texture space.
104 struct r200_tex_obj
{
105 driTextureObject base
;
107 GLuint bufAddr
; /* Offset to start of locally
108 shared texture block */
110 GLuint dirty_state
; /* Flags (1 per texunit) for
111 whether or not this texobj
112 has dirty hardware state
113 (pp_*) that needs to be
117 drm_radeon_tex_image_t image
[6][RADEON_MAX_TEXTURE_LEVELS
];
118 /* Six, for the cube faces */
120 GLuint pp_txfilter
; /* hardware register values */
122 GLuint pp_txformat_x
;
123 GLuint pp_txoffset
; /* Image location in texmem.
124 All cube faces follow. */
125 GLuint pp_txsize
; /* npot only */
126 GLuint pp_txpitch
; /* npot only */
127 GLuint pp_border_color
;
128 GLuint pp_cubic_faces
; /* cube face 1,2,3,4 log2 sizes */
130 GLboolean border_fallback
;
133 struct r200_texture_env_state
{
134 r200TexObjPtr texobj
;
139 #define R200_MAX_TEXTURE_UNITS 6
141 struct r200_texture_state
{
142 struct r200_texture_env_state unit
[R200_MAX_TEXTURE_UNITS
];
145 struct r200_state_atom
{
146 struct r200_state_atom
*next
, *prev
;
147 const char *name
; /* for debug */
148 int cmd_size
; /* size in bytes */
150 int *cmd
; /* one or more cmd's */
151 int *lastcmd
; /* one or more cmd's */
152 int *savedcmd
; /* one or more cmd's */
154 GLboolean(*check
) (GLcontext
*, int); /* is this state active? */
157 /* Trying to keep these relatively short as the variables are becoming
158 * extravagently long. Drop the driver name prefix off the front of
159 * everything - I think we know which driver we're in by now, and keep the
160 * prefix to 3 letters unless absolutely impossible.
164 #define CTX_PP_MISC 1
165 #define CTX_PP_FOG_COLOR 2
166 #define CTX_RE_SOLID_COLOR 3
167 #define CTX_RB3D_BLENDCNTL 4
168 #define CTX_RB3D_DEPTHOFFSET 5
169 #define CTX_RB3D_DEPTHPITCH 6
170 #define CTX_RB3D_ZSTENCILCNTL 7
172 #define CTX_PP_CNTL 9
173 #define CTX_RB3D_CNTL 10
174 #define CTX_RB3D_COLOROFFSET 11
175 #define CTX_CMD_2 12 /* why */
176 #define CTX_RB3D_COLORPITCH 13 /* why */
177 #define CTX_STATE_SIZE_OLDDRM 14
179 #define CTX_RB3D_BLENDCOLOR 15
180 #define CTX_RB3D_ABLENDCNTL 16
181 #define CTX_RB3D_CBLENDCNTL 17
182 #define CTX_STATE_SIZE_NEWDRM 18
185 #define SET_SE_CNTL 1
186 #define SET_RE_CNTL 2 /* replace se_coord_fmt */
187 #define SET_STATE_SIZE 3
190 #define VTE_SE_VTE_CNTL 1
191 #define VTE_STATE_SIZE 2
194 #define LIN_RE_LINE_PATTERN 1
195 #define LIN_RE_LINE_STATE 2
197 #define LIN_SE_LINE_WIDTH 4
198 #define LIN_STATE_SIZE 5
201 #define MSK_RB3D_STENCILREFMASK 1
202 #define MSK_RB3D_ROPCNTL 2
203 #define MSK_RB3D_PLANEMASK 3
204 #define MSK_STATE_SIZE 4
207 #define VPT_SE_VPORT_XSCALE 1
208 #define VPT_SE_VPORT_XOFFSET 2
209 #define VPT_SE_VPORT_YSCALE 3
210 #define VPT_SE_VPORT_YOFFSET 4
211 #define VPT_SE_VPORT_ZSCALE 5
212 #define VPT_SE_VPORT_ZOFFSET 6
213 #define VPT_STATE_SIZE 7
216 #define ZBS_SE_ZBIAS_FACTOR 1
217 #define ZBS_SE_ZBIAS_CONSTANT 2
218 #define ZBS_STATE_SIZE 3
221 #define MSC_RE_MISC 1
222 #define MSC_STATE_SIZE 2
226 #define TAM_STATE_SIZE 2
229 #define TEX_PP_TXFILTER 1 /*2c00 */
230 #define TEX_PP_TXFORMAT 2 /*2c04 */
231 #define TEX_PP_TXFORMAT_X 3 /*2c08 */
232 #define TEX_PP_TXSIZE 4 /*2c0c */
233 #define TEX_PP_TXPITCH 5 /*2c10 */
234 #define TEX_PP_BORDER_COLOR 6 /*2c14 */
236 #define TEX_PP_TXOFFSET 8 /*2d00 */
237 #define TEX_STATE_SIZE 9
239 #define CUBE_CMD_0 0 /* 1 register follows */
240 #define CUBE_PP_CUBIC_FACES 1 /* 0x2c18 */
241 #define CUBE_CMD_1 2 /* 5 registers follow */
242 #define CUBE_PP_CUBIC_OFFSET_F1 3 /* 0x2d04 */
243 #define CUBE_PP_CUBIC_OFFSET_F2 4 /* 0x2d08 */
244 #define CUBE_PP_CUBIC_OFFSET_F3 5 /* 0x2d0c */
245 #define CUBE_PP_CUBIC_OFFSET_F4 6 /* 0x2d10 */
246 #define CUBE_PP_CUBIC_OFFSET_F5 7 /* 0x2d14 */
247 #define CUBE_STATE_SIZE 8
250 #define PIX_PP_TXCBLEND 1
251 #define PIX_PP_TXCBLEND2 2
252 #define PIX_PP_TXABLEND 3
253 #define PIX_PP_TXABLEND2 4
254 #define PIX_STATE_SIZE 5
257 #define TF_TFACTOR_0 1
258 #define TF_TFACTOR_1 2
259 #define TF_TFACTOR_2 3
260 #define TF_TFACTOR_3 4
261 #define TF_TFACTOR_4 5
262 #define TF_TFACTOR_5 6
263 #define TF_STATE_SIZE 7
266 #define TCL_LIGHT_MODEL_CTL_0 1
267 #define TCL_LIGHT_MODEL_CTL_1 2
268 #define TCL_PER_LIGHT_CTL_0 3
269 #define TCL_PER_LIGHT_CTL_1 4
270 #define TCL_PER_LIGHT_CTL_2 5
271 #define TCL_PER_LIGHT_CTL_3 6
273 #define TCL_UCP_VERT_BLEND_CTL 8
274 #define TCL_STATE_SIZE 9
277 #define MSL_MATRIX_SELECT_0 1
278 #define MSL_MATRIX_SELECT_1 2
279 #define MSL_MATRIX_SELECT_2 3
280 #define MSL_MATRIX_SELECT_3 4
281 #define MSL_MATRIX_SELECT_4 5
282 #define MSL_STATE_SIZE 6
285 #define TCG_TEX_PROC_CTL_2 1
286 #define TCG_TEX_PROC_CTL_3 2
287 #define TCG_TEX_PROC_CTL_0 3
288 #define TCG_TEX_PROC_CTL_1 4
289 #define TCG_TEX_CYL_WRAP_CTL 5
290 #define TCG_STATE_SIZE 6
293 #define MTL_EMMISSIVE_RED 1
294 #define MTL_EMMISSIVE_GREEN 2
295 #define MTL_EMMISSIVE_BLUE 3
296 #define MTL_EMMISSIVE_ALPHA 4
297 #define MTL_AMBIENT_RED 5
298 #define MTL_AMBIENT_GREEN 6
299 #define MTL_AMBIENT_BLUE 7
300 #define MTL_AMBIENT_ALPHA 8
301 #define MTL_DIFFUSE_RED 9
302 #define MTL_DIFFUSE_GREEN 10
303 #define MTL_DIFFUSE_BLUE 11
304 #define MTL_DIFFUSE_ALPHA 12
305 #define MTL_SPECULAR_RED 13
306 #define MTL_SPECULAR_GREEN 14
307 #define MTL_SPECULAR_BLUE 15
308 #define MTL_SPECULAR_ALPHA 16
310 #define MTL_SHININESS 18
311 #define MTL_STATE_SIZE 19
314 #define VAP_SE_VAP_CNTL 1
315 #define VAP_STATE_SIZE 2
317 /* Replaces a lot of packet info from radeon
320 #define VTX_VTXFMT_0 1
321 #define VTX_VTXFMT_1 2
322 #define VTX_TCL_OUTPUT_VTXFMT_0 3
323 #define VTX_TCL_OUTPUT_VTXFMT_1 4
325 #define VTX_TCL_OUTPUT_COMPSEL 6
327 #define VTX_STATE_CNTL 8
328 #define VTX_STATE_SIZE 9
330 #define VTX_COLOR(v,n) (((v)>>(R200_VTX_COLOR_0_SHIFT+(n)*2))&\
334 * Given the \c R200_SE_VTX_FMT_1 for the current vertex state, determine
335 * how many components are in texture coordinate \c n.
337 #define VTX_TEXn_COUNT(v,n) (((v) >> (3 * n)) & 0x07)
341 #define MAT_STATE_SIZE 17
344 #define GRD_VERT_GUARD_CLIP_ADJ 1
345 #define GRD_VERT_GUARD_DISCARD_ADJ 2
346 #define GRD_HORZ_GUARD_CLIP_ADJ 3
347 #define GRD_HORZ_GUARD_DISCARD_ADJ 4
348 #define GRD_STATE_SIZE 5
350 /* position changes frequently when lighting in modelpos - separate
351 * out to new state item?
354 #define LIT_AMBIENT_RED 1
355 #define LIT_AMBIENT_GREEN 2
356 #define LIT_AMBIENT_BLUE 3
357 #define LIT_AMBIENT_ALPHA 4
358 #define LIT_DIFFUSE_RED 5
359 #define LIT_DIFFUSE_GREEN 6
360 #define LIT_DIFFUSE_BLUE 7
361 #define LIT_DIFFUSE_ALPHA 8
362 #define LIT_SPECULAR_RED 9
363 #define LIT_SPECULAR_GREEN 10
364 #define LIT_SPECULAR_BLUE 11
365 #define LIT_SPECULAR_ALPHA 12
366 #define LIT_POSITION_X 13
367 #define LIT_POSITION_Y 14
368 #define LIT_POSITION_Z 15
369 #define LIT_POSITION_W 16
370 #define LIT_DIRECTION_X 17
371 #define LIT_DIRECTION_Y 18
372 #define LIT_DIRECTION_Z 19
373 #define LIT_DIRECTION_W 20
374 #define LIT_ATTEN_QUADRATIC 21
375 #define LIT_ATTEN_LINEAR 22
376 #define LIT_ATTEN_CONST 23
377 #define LIT_ATTEN_XXX 24
379 #define LIT_SPOT_DCD 26
380 #define LIT_SPOT_DCM 27
381 #define LIT_SPOT_EXPONENT 28
382 #define LIT_SPOT_CUTOFF 29
383 #define LIT_SPECULAR_THRESH 30
384 #define LIT_RANGE_CUTOFF 31 /* ? */
385 #define LIT_ATTEN_CONST_INV 32
386 #define LIT_STATE_SIZE 33
395 #define FOG_STATE_SIZE 5
404 #define UCP_STATE_SIZE 5
406 /* GLT - Global ambient
413 #define GLT_STATE_SIZE 5
421 #define EYE_RESCALE_FACTOR 4
422 #define EYE_STATE_SIZE 5
424 /* CST - constant state
427 #define CST_PP_CNTL_X 1
429 #define CST_RB3D_DEPTHXY_OFFSET 3
431 #define CST_RE_AUX_SCISSOR_CNTL 5
433 #define CST_RE_SCISSOR_TL_0 7
434 #define CST_RE_SCISSOR_BR_0 8
436 #define CST_SE_VAP_CNTL_STATUS 10
438 #define CST_RE_POINTSIZE 12
440 #define CST_SE_TCL_INPUT_VTX_0 14
441 #define CST_SE_TCL_INPUT_VTX_1 15
442 #define CST_SE_TCL_INPUT_VTX_2 16
443 #define CST_SE_TCL_INPUT_VTX_3 17
444 #define CST_STATE_SIZE 18
446 struct r200_hw_state
{
447 /* Head of the linked list of state atoms. */
448 struct r200_state_atom atomlist
;
450 /* Hardware state, stored as cmdbuf commands:
451 * -- Need to doublebuffer for
452 * - reviving state after loss of context
453 * - eliding noop statechange loops? (except line stipple count)
455 struct r200_state_atom ctx
;
456 struct r200_state_atom set
;
457 struct r200_state_atom vte
;
458 struct r200_state_atom lin
;
459 struct r200_state_atom msk
;
460 struct r200_state_atom vpt
;
461 struct r200_state_atom vap
;
462 struct r200_state_atom vtx
;
463 struct r200_state_atom tcl
;
464 struct r200_state_atom msl
;
465 struct r200_state_atom tcg
;
466 struct r200_state_atom msc
;
467 struct r200_state_atom cst
;
468 struct r200_state_atom tam
;
469 struct r200_state_atom tf
;
470 struct r200_state_atom tex
[6];
471 struct r200_state_atom cube
[6];
472 struct r200_state_atom zbs
;
473 struct r200_state_atom mtl
[2];
474 struct r200_state_atom mat
[9];
475 struct r200_state_atom lit
[8]; /* includes vec, scl commands */
476 struct r200_state_atom ucp
[6];
477 struct r200_state_atom pix
[6]; /* pixshader stages */
478 struct r200_state_atom eye
; /* eye pos */
479 struct r200_state_atom grd
; /* guard band clipping */
480 struct r200_state_atom fog
;
481 struct r200_state_atom glt
;
483 int max_state_size
; /* Number of bytes necessary for a full state emit. */
484 GLboolean is_dirty
, all_dirty
;
487 struct r200_colorbuffer_state
{
492 /* Derived state for internal purposes:
494 struct r200_colorbuffer_state color
;
495 struct r200_depthbuffer_state depth
;
496 struct r200_stencilbuffer_state stencil
;
497 struct r200_stipple_state stipple
;
498 struct r200_texture_state texture
;
501 /* Need refcounting on dma buffers:
503 struct r200_dma_buffer
{
504 int refcount
; /* the number of retained regions in buf */
508 #define GET_START(rvb) (rmesa->radeon.radeonScreen->gart_buffer_offset + \
509 (rvb)->address - rmesa->dma.buf0_address + \
512 /* A retained region, eg vertices for indexed vertices.
514 struct r200_dma_region
{
515 struct r200_dma_buffer
*buf
;
516 char *address
; /* == buf->address */
517 int start
, end
, ptr
; /* offsets from start of buf */
524 /* Active dma region. Allocations for vertices and retained
525 * regions come from here. Also used for emitting random vertices,
526 * these may be flushed by calling flush_current();
528 struct r200_dma_region current
;
530 void (*flush
) (r200ContextPtr
);
532 char *buf0_address
; /* start of buf[0], for index calcs */
533 GLuint nr_released_bufs
; /* flush after so many buffers released */
536 #define R200_CMD_BUF_SZ (8*1024)
541 char cmd_buf
[R200_CMD_BUF_SZ
];
548 struct r200_tcl_info
{
549 GLuint vertex_format
;
553 struct r200_dma_region
*aos_components
[8];
554 GLuint nr_aos_components
;
558 struct r200_dma_region indexed_verts
;
559 struct r200_dma_region obj
;
560 struct r200_dma_region rgba
;
561 struct r200_dma_region spec
;
562 struct r200_dma_region fog
;
563 struct r200_dma_region tex
[R200_MAX_TEXTURE_UNITS
];
564 struct r200_dma_region norm
;
569 struct r200_swtcl_info
{
573 * Size of a hardware vertex. This is calculated when \c ::vertex_attrs is
574 * installed in the Mesa state vector.
579 * Attributes instructing the Mesa TCL pipeline where / how to put vertex
580 * data in the hardware buffer.
582 struct tnl_attr_map vertex_attrs
[VERT_ATTRIB_MAX
];
585 * Number of elements of \c ::vertex_attrs that are actually used.
587 GLuint vertex_attr_count
;
590 * Cached pointer to the buffer where Mesa will store vertex data.
594 /* Fallback rasterization functions
596 r200_point_func draw_point
;
597 r200_line_func draw_line
;
598 r200_tri_func draw_tri
;
601 GLenum render_primitive
;
605 * Offset of the 4UB color data within a hardware (swtcl) vertex.
610 * Offset of the 3UB specular color data within a hardware (swtcl) vertex.
615 * Should Mesa project vertex data or will the hardware do it?
619 struct r200_dma_region indexed_verts
;
623 GLuint vertex_offset
;
627 #define R200_MAX_PRIMS 64
629 /* Want to keep a cache of these around. Each is parameterized by
630 * only a single value which has only a small range. Only expect a
631 * few, so just rescan the list each time?
634 struct dynfn
*next
, *prev
;
640 struct dynfn Vertex2f
;
641 struct dynfn Vertex2fv
;
642 struct dynfn Vertex3f
;
643 struct dynfn Vertex3fv
;
644 struct dynfn Color4ub
;
645 struct dynfn Color4ubv
;
646 struct dynfn Color3ub
;
647 struct dynfn Color3ubv
;
648 struct dynfn Color4f
;
649 struct dynfn Color4fv
;
650 struct dynfn Color3f
;
651 struct dynfn Color3fv
;
652 struct dynfn SecondaryColor3ubEXT
;
653 struct dynfn SecondaryColor3ubvEXT
;
654 struct dynfn SecondaryColor3fEXT
;
655 struct dynfn SecondaryColor3fvEXT
;
656 struct dynfn Normal3f
;
657 struct dynfn Normal3fv
;
658 struct dynfn TexCoord3f
;
659 struct dynfn TexCoord3fv
;
660 struct dynfn TexCoord2f
;
661 struct dynfn TexCoord2fv
;
662 struct dynfn TexCoord1f
;
663 struct dynfn TexCoord1fv
;
664 struct dynfn MultiTexCoord3fARB
;
665 struct dynfn MultiTexCoord3fvARB
;
666 struct dynfn MultiTexCoord2fARB
;
667 struct dynfn MultiTexCoord2fvARB
;
668 struct dynfn MultiTexCoord1fARB
;
669 struct dynfn MultiTexCoord1fvARB
;
672 struct dfn_generators
{
673 struct dynfn
*(*Vertex2f
) (GLcontext
*, const int *);
674 struct dynfn
*(*Vertex2fv
) (GLcontext
*, const int *);
675 struct dynfn
*(*Vertex3f
) (GLcontext
*, const int *);
676 struct dynfn
*(*Vertex3fv
) (GLcontext
*, const int *);
677 struct dynfn
*(*Color4ub
) (GLcontext
*, const int *);
678 struct dynfn
*(*Color4ubv
) (GLcontext
*, const int *);
679 struct dynfn
*(*Color3ub
) (GLcontext
*, const int *);
680 struct dynfn
*(*Color3ubv
) (GLcontext
*, const int *);
681 struct dynfn
*(*Color4f
) (GLcontext
*, const int *);
682 struct dynfn
*(*Color4fv
) (GLcontext
*, const int *);
683 struct dynfn
*(*Color3f
) (GLcontext
*, const int *);
684 struct dynfn
*(*Color3fv
) (GLcontext
*, const int *);
685 struct dynfn
*(*SecondaryColor3ubEXT
) (GLcontext
*, const int *);
686 struct dynfn
*(*SecondaryColor3ubvEXT
) (GLcontext
*, const int *);
687 struct dynfn
*(*SecondaryColor3fEXT
) (GLcontext
*, const int *);
688 struct dynfn
*(*SecondaryColor3fvEXT
) (GLcontext
*, const int *);
689 struct dynfn
*(*Normal3f
) (GLcontext
*, const int *);
690 struct dynfn
*(*Normal3fv
) (GLcontext
*, const int *);
691 struct dynfn
*(*TexCoord3f
) (GLcontext
*, const int *);
692 struct dynfn
*(*TexCoord3fv
) (GLcontext
*, const int *);
693 struct dynfn
*(*TexCoord2f
) (GLcontext
*, const int *);
694 struct dynfn
*(*TexCoord2fv
) (GLcontext
*, const int *);
695 struct dynfn
*(*TexCoord1f
) (GLcontext
*, const int *);
696 struct dynfn
*(*TexCoord1fv
) (GLcontext
*, const int *);
697 struct dynfn
*(*MultiTexCoord3fARB
) (GLcontext
*, const int *);
698 struct dynfn
*(*MultiTexCoord3fvARB
) (GLcontext
*, const int *);
699 struct dynfn
*(*MultiTexCoord2fARB
) (GLcontext
*, const int *);
700 struct dynfn
*(*MultiTexCoord2fvARB
) (GLcontext
*, const int *);
701 struct dynfn
*(*MultiTexCoord1fARB
) (GLcontext
*, const int *);
702 struct dynfn
*(*MultiTexCoord1fvARB
) (GLcontext
*, const int *);
711 /* A maximum total of 29 elements per vertex: 3 floats for position, 3
712 * floats for normal, 4 floats for color, 4 bytes for secondary color,
713 * 3 floats for each texture unit (18 floats total).
715 * we maybe need add. 4 to prevent segfault if someone specifies
716 * GL_TEXTURE6/GL_TEXTURE7 (esp. for the codegen-path) (FIXME: )
718 * The position data is never actually stored here, so 3 elements could be
719 * trimmed out of the buffer.
722 #define R200_MAX_VERTEX_SIZE ((3*6)+11)
725 GLint counter
, initial_counter
;
727 void (*notify
) (void);
734 } vertex
[R200_MAX_VERTEX_SIZE
];
737 GLfloat
*floatcolorptr
;
738 r200_color_t
*colorptr
;
739 GLfloat
*floatspecptr
;
740 r200_color_t
*specptr
;
741 GLfloat
*texcoordptr
[8]; /* 6 (TMU) + 2 for r200_vtxfmt_c.c when GL_TEXTURE6/7 */
743 GLenum
*prim
; /* &ctx->Driver.CurrentExecPrimitive */
745 GLboolean enabled
; /* *_NO_VTXFMT / *_NO_TCL env vars */
750 GLuint vtxfmt_0
, vtxfmt_1
;
752 GLuint installed_vertex_format
;
753 GLuint installed_color_3f_sz
;
755 struct r200_prim primlist
[R200_MAX_PRIMS
];
758 struct dfn_lists dfn_cache
;
759 struct dfn_generators codegen
;
760 GLvertexformat vtxfmt
;
764 * R200 context structure.
766 struct r200_context
{
767 struct radeon_context radeon
; /* parent class, must be first */
769 /* Driver and hardware state management
771 struct r200_hw_state hw
;
772 struct r200_state state
;
774 /* Texture object bookkeeping
777 driTexHeap
*texture_heaps
[R200_NR_TEX_HEAPS
];
778 driTextureObject swapped
;
780 float initialMaxAnisotropy
;
782 /* Rasterization and vertex state:
788 struct r200_ioctl ioctl
;
790 struct r200_store store
;
791 GLboolean save_on_next_unlock
;
793 /* Clientdata textures;
795 GLuint prefer_gart_client_texturing
;
799 GLmatrix TexGenMatrix
[R200_MAX_TEXTURE_UNITS
];
800 GLboolean recheck_texgen
[R200_MAX_TEXTURE_UNITS
];
801 GLboolean TexGenNeedNormals
[R200_MAX_TEXTURE_UNITS
];
802 GLuint TexMatEnabled
;
803 GLuint TexMatCompSel
;
804 GLuint TexGenEnabled
;
806 GLuint TexGenCompSel
;
811 struct r200_tcl_info tcl
;
815 struct r200_swtcl_info swtcl
;
819 struct r200_vbinfo vb
;
822 #define R200_CONTEXT(ctx) ((r200ContextPtr)(ctx->DriverCtx))
824 extern void r200DestroyContext(__DRIcontextPrivate
* driContextPriv
);
825 extern GLboolean
r200CreateContext(const __GLcontextModes
* glVisual
,
826 __DRIcontextPrivate
* driContextPriv
,
827 void *sharedContextPrivate
);
830 #endif /* __R200_CONTEXT_H__ */