1 /* $Id: dlist.c,v 1.97 2002/10/07 15:03:14 brianp Exp $ */
4 * Mesa 3-D graphics library
7 * Copyright (C) 1999-2002 Brian Paul All Rights Reserved.
9 * Permission is hereby granted, free of charge, to any person obtaining a
10 * copy of this software and associated documentation files (the "Software"),
11 * to deal in the Software without restriction, including without limitation
12 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
13 * and/or sell copies of the Software, and to permit persons to whom the
14 * Software is furnished to do so, subject to the following conditions:
16 * The above copyright notice and this permission notice shall be included
17 * in all copies or substantial portions of the Software.
19 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
20 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
21 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
22 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
23 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
24 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
32 #include "api_loopback.h"
46 #include "extensions.h"
51 #include "histogram.h"
70 #include "math/m_matrix.h"
71 #include "math/m_xform.h"
78 Functions which aren't compiled but executed immediately:
82 glEndList --- BUT: call ctx->Driver.EndList at end of list execution?
93 Functions which cause errors if called while compiling a display list:
100 * Display list instructions are stored as sequences of "nodes". Nodes
101 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
102 * are linked together with a pointer.
106 /* How many nodes to allocate at a time:
107 * - reduced now that we hold vertices etc. elsewhere.
109 #define BLOCK_SIZE 256
113 * Display list opcodes.
115 * The fact that these identifiers are assigned consecutive
116 * integer values starting at 0 is very important, see InstSize array usage)
125 OPCODE_BLEND_EQUATION
,
127 OPCODE_BLEND_FUNC_SEPARATE
,
129 OPCODE_CALL_LIST_OFFSET
,
135 OPCODE_CLEAR_STENCIL
,
138 OPCODE_COLOR_MATERIAL
,
140 OPCODE_COLOR_TABLE_PARAMETER_FV
,
141 OPCODE_COLOR_TABLE_PARAMETER_IV
,
142 OPCODE_COLOR_SUB_TABLE
,
143 OPCODE_CONVOLUTION_FILTER_1D
,
144 OPCODE_CONVOLUTION_FILTER_2D
,
145 OPCODE_CONVOLUTION_PARAMETER_I
,
146 OPCODE_CONVOLUTION_PARAMETER_IV
,
147 OPCODE_CONVOLUTION_PARAMETER_F
,
148 OPCODE_CONVOLUTION_PARAMETER_FV
,
149 OPCODE_COPY_COLOR_SUB_TABLE
,
150 OPCODE_COPY_COLOR_TABLE
,
152 OPCODE_COPY_TEX_IMAGE1D
,
153 OPCODE_COPY_TEX_IMAGE2D
,
154 OPCODE_COPY_TEX_SUB_IMAGE1D
,
155 OPCODE_COPY_TEX_SUB_IMAGE2D
,
156 OPCODE_COPY_TEX_SUB_IMAGE3D
,
179 OPCODE_LOAD_IDENTITY
,
193 OPCODE_PIXEL_TRANSFER
,
196 OPCODE_POINT_PARAMETERS
,
198 OPCODE_POLYGON_STIPPLE
,
199 OPCODE_POLYGON_OFFSET
,
203 OPCODE_PRIORITIZE_TEXTURE
,
209 OPCODE_RESET_HISTOGRAM
,
210 OPCODE_RESET_MIN_MAX
,
214 OPCODE_SELECT_TEXTURE_SGIS
,
215 OPCODE_SELECT_TEXTURE_COORD_SET
,
226 OPCODE_TEX_SUB_IMAGE1D
,
227 OPCODE_TEX_SUB_IMAGE2D
,
228 OPCODE_TEX_SUB_IMAGE3D
,
232 /* GL_ARB_multitexture */
233 OPCODE_ACTIVE_TEXTURE
,
234 /* GL_SGIX/SGIS_pixel_texture */
235 OPCODE_PIXEL_TEXGEN_SGIX
,
236 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
237 /* GL_ARB_texture_compression */
238 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
239 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
240 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
241 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
242 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
243 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
244 /* GL_ARB_multisample */
245 OPCODE_SAMPLE_COVERAGE
,
246 /* GL_ARB_window_pos */
247 OPCODE_WINDOW_POS_ARB
,
248 /* GL_NV_vertex_program */
249 OPCODE_BIND_PROGRAM_NV
,
250 OPCODE_EXECUTE_PROGRAM_NV
,
251 OPCODE_REQUEST_PROGRAMS_RESIDENT_NV
,
252 OPCODE_LOAD_PROGRAM_NV
,
253 OPCODE_PROGRAM_PARAMETER4F_NV
,
254 OPCODE_TRACK_MATRIX_NV
,
255 /* GL_EXT_stencil_two_side */
256 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
257 /* The following three are meta instructions */
258 OPCODE_ERROR
, /* raise compiled-in error */
266 * Each instruction in the display list is stored as a sequence of
267 * contiguous nodes in memory.
268 * Each node is the union of a variety of datatypes.
282 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
287 /* Number of nodes of storage needed for each instruction. Sizes for
288 * dynamically allocated opcodes are stored in the context struct.
290 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
292 void mesa_print_display_list( GLuint list
);
295 /**********************************************************************/
296 /***** Private *****/
297 /**********************************************************************/
304 * Make an empty display list. This is used by glGenLists() to
305 * reserver display list IDs.
307 static Node
*make_empty_list( void )
309 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
310 n
[0].opcode
= OPCODE_END_OF_LIST
;
317 * Destroy all nodes in a display list.
318 * Input: list - display list number
320 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
328 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
331 done
= block
? GL_FALSE
: GL_TRUE
;
334 /* check for extension opcodes first */
336 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
337 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
338 ctx
->listext
.opcode
[i
].destroy(ctx
, &n
[1]);
339 n
+= ctx
->listext
.opcode
[i
].size
;
342 switch (n
[0].opcode
) {
345 n
+= InstSize
[n
[0].opcode
];
349 n
+= InstSize
[n
[0].opcode
];
351 case OPCODE_DRAW_PIXELS
:
353 n
+= InstSize
[n
[0].opcode
];
357 n
+= InstSize
[n
[0].opcode
];
359 case OPCODE_COLOR_TABLE
:
361 n
+= InstSize
[n
[0].opcode
];
363 case OPCODE_COLOR_SUB_TABLE
:
365 n
+= InstSize
[n
[0].opcode
];
367 case OPCODE_CONVOLUTION_FILTER_1D
:
369 n
+= InstSize
[n
[0].opcode
];
371 case OPCODE_CONVOLUTION_FILTER_2D
:
373 n
+= InstSize
[n
[0].opcode
];
375 case OPCODE_POLYGON_STIPPLE
:
377 n
+= InstSize
[n
[0].opcode
];
379 case OPCODE_TEX_IMAGE1D
:
381 n
+= InstSize
[n
[0].opcode
];
383 case OPCODE_TEX_IMAGE2D
:
385 n
+= InstSize
[n
[0].opcode
];
387 case OPCODE_TEX_IMAGE3D
:
389 n
+= InstSize
[n
[0].opcode
];
391 case OPCODE_TEX_SUB_IMAGE1D
:
393 n
+= InstSize
[n
[0].opcode
];
395 case OPCODE_TEX_SUB_IMAGE2D
:
397 n
+= InstSize
[n
[0].opcode
];
399 case OPCODE_TEX_SUB_IMAGE3D
:
401 n
+= InstSize
[n
[0].opcode
];
403 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
405 n
+= InstSize
[n
[0].opcode
];
407 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
409 n
+= InstSize
[n
[0].opcode
];
411 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
413 n
+= InstSize
[n
[0].opcode
];
415 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
417 n
+= InstSize
[n
[0].opcode
];
419 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
421 n
+= InstSize
[n
[0].opcode
];
423 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
425 n
+= InstSize
[n
[0].opcode
];
427 case OPCODE_CONTINUE
:
428 n
= (Node
*) n
[1].next
;
432 case OPCODE_END_OF_LIST
:
437 /* Most frequent case */
438 n
+= InstSize
[n
[0].opcode
];
444 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
450 * Translate the nth element of list from type to GLuint.
452 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
464 bptr
= (GLbyte
*) list
;
465 return (GLuint
) *(bptr
+n
);
466 case GL_UNSIGNED_BYTE
:
467 ubptr
= (GLubyte
*) list
;
468 return (GLuint
) *(ubptr
+n
);
470 sptr
= (GLshort
*) list
;
471 return (GLuint
) *(sptr
+n
);
472 case GL_UNSIGNED_SHORT
:
473 usptr
= (GLushort
*) list
;
474 return (GLuint
) *(usptr
+n
);
476 iptr
= (GLint
*) list
;
477 return (GLuint
) *(iptr
+n
);
478 case GL_UNSIGNED_INT
:
479 uiptr
= (GLuint
*) list
;
480 return (GLuint
) *(uiptr
+n
);
482 fptr
= (GLfloat
*) list
;
483 return (GLuint
) *(fptr
+n
);
485 ubptr
= ((GLubyte
*) list
) + 2*n
;
486 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
488 ubptr
= ((GLubyte
*) list
) + 3*n
;
489 return (GLuint
) *ubptr
* 65536
490 + (GLuint
) *(ubptr
+1) * 256
491 + (GLuint
) *(ubptr
+2);
493 ubptr
= ((GLubyte
*) list
) + 4*n
;
494 return (GLuint
) *ubptr
* 16777216
495 + (GLuint
) *(ubptr
+1) * 65536
496 + (GLuint
) *(ubptr
+2) * 256
497 + (GLuint
) *(ubptr
+3);
506 /**********************************************************************/
508 /**********************************************************************/
510 void _mesa_init_lists( void )
512 static int init_flag
= 0;
515 InstSize
[OPCODE_ACCUM
] = 3;
516 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
517 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
518 InstSize
[OPCODE_BITMAP
] = 8;
519 InstSize
[OPCODE_BLEND_COLOR
] = 5;
520 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
521 InstSize
[OPCODE_BLEND_FUNC
] = 3;
522 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
523 InstSize
[OPCODE_CALL_LIST
] = 2;
524 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
525 InstSize
[OPCODE_CLEAR
] = 2;
526 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
527 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
528 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
529 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
530 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
531 InstSize
[OPCODE_CLIP_PLANE
] = 6;
532 InstSize
[OPCODE_COLOR_MASK
] = 5;
533 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
534 InstSize
[OPCODE_COLOR_TABLE
] = 7;
535 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
536 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
537 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
538 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
539 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
540 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
541 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
542 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
543 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
544 InstSize
[OPCODE_COPY_PIXELS
] = 6;
545 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
546 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
547 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
548 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
549 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
550 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
551 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
552 InstSize
[OPCODE_CULL_FACE
] = 2;
553 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
554 InstSize
[OPCODE_DEPTH_MASK
] = 2;
555 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
556 InstSize
[OPCODE_DISABLE
] = 2;
557 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
558 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
559 InstSize
[OPCODE_ENABLE
] = 2;
560 InstSize
[OPCODE_EVALMESH1
] = 4;
561 InstSize
[OPCODE_EVALMESH2
] = 6;
562 InstSize
[OPCODE_FOG
] = 6;
563 InstSize
[OPCODE_FRONT_FACE
] = 2;
564 InstSize
[OPCODE_FRUSTUM
] = 7;
565 InstSize
[OPCODE_HINT
] = 3;
566 InstSize
[OPCODE_HISTOGRAM
] = 5;
567 InstSize
[OPCODE_INDEX_MASK
] = 2;
568 InstSize
[OPCODE_INIT_NAMES
] = 1;
569 InstSize
[OPCODE_LIGHT
] = 7;
570 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
571 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
572 InstSize
[OPCODE_LINE_WIDTH
] = 2;
573 InstSize
[OPCODE_LIST_BASE
] = 2;
574 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
575 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
576 InstSize
[OPCODE_LOAD_NAME
] = 2;
577 InstSize
[OPCODE_LOGIC_OP
] = 2;
578 InstSize
[OPCODE_MAP1
] = 7;
579 InstSize
[OPCODE_MAP2
] = 11;
580 InstSize
[OPCODE_MAPGRID1
] = 4;
581 InstSize
[OPCODE_MAPGRID2
] = 7;
582 InstSize
[OPCODE_MATRIX_MODE
] = 2;
583 InstSize
[OPCODE_MIN_MAX
] = 4;
584 InstSize
[OPCODE_MULT_MATRIX
] = 17;
585 InstSize
[OPCODE_ORTHO
] = 7;
586 InstSize
[OPCODE_PASSTHROUGH
] = 2;
587 InstSize
[OPCODE_PIXEL_MAP
] = 4;
588 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
589 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
590 InstSize
[OPCODE_POINT_SIZE
] = 2;
591 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
592 InstSize
[OPCODE_POLYGON_MODE
] = 3;
593 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
594 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
595 InstSize
[OPCODE_POP_ATTRIB
] = 1;
596 InstSize
[OPCODE_POP_MATRIX
] = 1;
597 InstSize
[OPCODE_POP_NAME
] = 1;
598 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
599 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
600 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
601 InstSize
[OPCODE_PUSH_NAME
] = 2;
602 InstSize
[OPCODE_RASTER_POS
] = 5;
603 InstSize
[OPCODE_READ_BUFFER
] = 2;
604 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
605 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
606 InstSize
[OPCODE_ROTATE
] = 5;
607 InstSize
[OPCODE_SCALE
] = 4;
608 InstSize
[OPCODE_SCISSOR
] = 5;
609 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
610 InstSize
[OPCODE_STENCIL_MASK
] = 2;
611 InstSize
[OPCODE_STENCIL_OP
] = 4;
612 InstSize
[OPCODE_SHADE_MODEL
] = 2;
613 InstSize
[OPCODE_TEXENV
] = 7;
614 InstSize
[OPCODE_TEXGEN
] = 7;
615 InstSize
[OPCODE_TEXPARAMETER
] = 7;
616 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
617 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
618 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
619 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
620 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
621 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
622 InstSize
[OPCODE_TRANSLATE
] = 4;
623 InstSize
[OPCODE_VIEWPORT
] = 5;
624 InstSize
[OPCODE_WINDOW_POS
] = 5;
625 InstSize
[OPCODE_CONTINUE
] = 2;
626 InstSize
[OPCODE_ERROR
] = 3;
627 InstSize
[OPCODE_END_OF_LIST
] = 1;
628 /* GL_SGIX/SGIS_pixel_texture */
629 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
630 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
631 /* GL_ARB_texture_compression */
632 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
633 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
634 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
635 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
636 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
637 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
638 /* GL_ARB_multisample */
639 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
640 /* GL_ARB_multitexture */
641 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
642 /* GL_ARB_window_pos */
643 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
644 /* GL_NV_vertex_program */
645 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
646 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
647 InstSize
[OPCODE_REQUEST_PROGRAMS_RESIDENT_NV
] = 2;
648 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 4;
649 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
650 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
651 /* GL_EXT_stencil_two_side */
652 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
659 * Allocate space for a display list instruction.
660 * Input: opcode - type of instruction
661 * argcount - size in bytes of data required.
662 * Return: pointer to the usable data area (not including the internal
666 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
669 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
672 if (opcode
< (int) OPCODE_DRV_0
) {
673 assert( count
== InstSize
[opcode
] );
677 if (ctx
->CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
678 /* This block is full. Allocate a new block and chain to it */
679 n
= ctx
->CurrentBlock
+ ctx
->CurrentPos
;
680 n
[0].opcode
= OPCODE_CONTINUE
;
681 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
683 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
686 n
[1].next
= (Node
*) newblock
;
687 ctx
->CurrentBlock
= newblock
;
691 n
= ctx
->CurrentBlock
+ ctx
->CurrentPos
;
692 ctx
->CurrentPos
+= count
;
694 n
[0].opcode
= (OpCode
) opcode
;
696 return (void *)&n
[1];
700 /* Allow modules and drivers to get their own opcodes.
703 _mesa_alloc_opcode( GLcontext
*ctx
,
705 void (*execute
)( GLcontext
*, void * ),
706 void (*destroy
)( GLcontext
*, void * ),
707 void (*print
)( GLcontext
*, void * ) )
709 if (ctx
->listext
.nr_opcodes
< GL_MAX_EXT_OPCODES
) {
710 GLuint i
= ctx
->listext
.nr_opcodes
++;
711 ctx
->listext
.opcode
[i
].size
= 1 + (sz
+ sizeof(Node
) - 1)/sizeof(Node
);
712 ctx
->listext
.opcode
[i
].execute
= execute
;
713 ctx
->listext
.opcode
[i
].destroy
= destroy
;
714 ctx
->listext
.opcode
[i
].print
= print
;
715 return i
+ OPCODE_DRV_0
;
722 /* Mimic the old behaviour of alloc_instruction:
723 * - sz is in units of sizeof(Node)
724 * - return value a pointer to sizeof(Node) before the actual
727 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
728 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
733 * Display List compilation functions
735 static void save_Accum( GLenum op
, GLfloat value
)
737 GET_CURRENT_CONTEXT(ctx
);
739 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
740 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
745 if (ctx
->ExecuteFlag
) {
746 (*ctx
->Exec
->Accum
)( op
, value
);
751 static void save_AlphaFunc( GLenum func
, GLclampf ref
)
753 GET_CURRENT_CONTEXT(ctx
);
755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
756 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
759 n
[2].f
= (GLfloat
) ref
;
761 if (ctx
->ExecuteFlag
) {
762 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
767 static void save_BindTexture( GLenum target
, GLuint texture
)
769 GET_CURRENT_CONTEXT(ctx
);
771 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
772 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
777 if (ctx
->ExecuteFlag
) {
778 (*ctx
->Exec
->BindTexture
)( target
, texture
);
783 static void save_Bitmap( GLsizei width
, GLsizei height
,
784 GLfloat xorig
, GLfloat yorig
,
785 GLfloat xmove
, GLfloat ymove
,
786 const GLubyte
*pixels
)
788 GET_CURRENT_CONTEXT(ctx
);
789 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
792 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
794 n
[1].i
= (GLint
) width
;
795 n
[2].i
= (GLint
) height
;
805 if (ctx
->ExecuteFlag
) {
806 (*ctx
->Exec
->Bitmap
)( width
, height
,
807 xorig
, yorig
, xmove
, ymove
, pixels
);
812 static void save_BlendEquation( GLenum mode
)
814 GET_CURRENT_CONTEXT(ctx
);
816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
817 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
821 if (ctx
->ExecuteFlag
) {
822 (*ctx
->Exec
->BlendEquation
)( mode
);
827 static void save_BlendFunc( GLenum sfactor
, GLenum dfactor
)
829 GET_CURRENT_CONTEXT(ctx
);
831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
832 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC
, 2 );
837 if (ctx
->ExecuteFlag
) {
838 (*ctx
->Exec
->BlendFunc
)( sfactor
, dfactor
);
843 static void save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
844 GLenum sfactorA
, GLenum dfactorA
)
846 GET_CURRENT_CONTEXT(ctx
);
848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
849 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
856 if (ctx
->ExecuteFlag
) {
857 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
863 static void save_BlendColor( GLfloat red
, GLfloat green
,
864 GLfloat blue
, GLfloat alpha
)
866 GET_CURRENT_CONTEXT(ctx
);
868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
869 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
876 if (ctx
->ExecuteFlag
) {
877 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
882 void _mesa_save_CallList( GLuint list
)
884 GET_CURRENT_CONTEXT(ctx
);
886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
887 FLUSH_CURRENT(ctx
, 0);
889 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
893 if (ctx
->ExecuteFlag
) {
894 (*ctx
->Exec
->CallList
)( list
);
899 void _mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
901 GET_CURRENT_CONTEXT(ctx
);
903 GLboolean typeErrorFlag
;
905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
906 FLUSH_CURRENT(ctx
, 0);
910 case GL_UNSIGNED_BYTE
:
912 case GL_UNSIGNED_SHORT
:
914 case GL_UNSIGNED_INT
:
919 typeErrorFlag
= GL_FALSE
;
922 typeErrorFlag
= GL_TRUE
;
926 GLuint list
= translate_id( i
, type
, lists
);
927 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
930 n
[2].b
= typeErrorFlag
;
933 if (ctx
->ExecuteFlag
) {
934 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
939 static void save_Clear( GLbitfield mask
)
941 GET_CURRENT_CONTEXT(ctx
);
943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
944 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
948 if (ctx
->ExecuteFlag
) {
949 (*ctx
->Exec
->Clear
)( mask
);
954 static void save_ClearAccum( GLfloat red
, GLfloat green
,
955 GLfloat blue
, GLfloat alpha
)
957 GET_CURRENT_CONTEXT(ctx
);
959 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
960 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
967 if (ctx
->ExecuteFlag
) {
968 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
973 static void save_ClearColor( GLclampf red
, GLclampf green
,
974 GLclampf blue
, GLclampf alpha
)
976 GET_CURRENT_CONTEXT(ctx
);
978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
979 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
986 if (ctx
->ExecuteFlag
) {
987 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
992 static void save_ClearDepth( GLclampd depth
)
994 GET_CURRENT_CONTEXT(ctx
);
996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
997 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
999 n
[1].f
= (GLfloat
) depth
;
1001 if (ctx
->ExecuteFlag
) {
1002 (*ctx
->Exec
->ClearDepth
)( depth
);
1007 static void save_ClearIndex( GLfloat c
)
1009 GET_CURRENT_CONTEXT(ctx
);
1011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1012 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1016 if (ctx
->ExecuteFlag
) {
1017 (*ctx
->Exec
->ClearIndex
)( c
);
1022 static void save_ClearStencil( GLint s
)
1024 GET_CURRENT_CONTEXT(ctx
);
1026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1027 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1031 if (ctx
->ExecuteFlag
) {
1032 (*ctx
->Exec
->ClearStencil
)( s
);
1037 static void save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1039 GET_CURRENT_CONTEXT(ctx
);
1041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1042 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1045 n
[2].f
= (GLfloat
) equ
[0];
1046 n
[3].f
= (GLfloat
) equ
[1];
1047 n
[4].f
= (GLfloat
) equ
[2];
1048 n
[5].f
= (GLfloat
) equ
[3];
1050 if (ctx
->ExecuteFlag
) {
1051 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1057 static void save_ColorMask( GLboolean red
, GLboolean green
,
1058 GLboolean blue
, GLboolean alpha
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1070 if (ctx
->ExecuteFlag
) {
1071 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1076 static void save_ColorMaterial( GLenum face
, GLenum mode
)
1078 GET_CURRENT_CONTEXT(ctx
);
1080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1081 FLUSH_CURRENT(ctx
, 0);
1083 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1088 if (ctx
->ExecuteFlag
) {
1089 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1094 static void save_ColorTable( GLenum target
, GLenum internalFormat
,
1095 GLsizei width
, GLenum format
, GLenum type
,
1096 const GLvoid
*table
)
1098 GET_CURRENT_CONTEXT(ctx
);
1099 if (target
== GL_PROXY_TEXTURE_1D
||
1100 target
== GL_PROXY_TEXTURE_2D
||
1101 target
== GL_PROXY_TEXTURE_3D
||
1102 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1103 /* execute immediately */
1104 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1105 format
, type
, table
);
1108 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, table
,
1111 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1112 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1115 n
[2].e
= internalFormat
;
1124 if (ctx
->ExecuteFlag
) {
1125 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1126 format
, type
, table
);
1134 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1136 GET_CURRENT_CONTEXT(ctx
);
1139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1141 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1146 if (pname
== GL_COLOR_TABLE_SGI
||
1147 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1148 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
) {
1155 if (ctx
->ExecuteFlag
) {
1156 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1162 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1164 GET_CURRENT_CONTEXT(ctx
);
1167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1169 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1174 if (pname
== GL_COLOR_TABLE_SGI
||
1175 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1176 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
) {
1183 if (ctx
->ExecuteFlag
) {
1184 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1190 static void save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1191 GLenum format
, GLenum type
,
1192 const GLvoid
*table
)
1194 GET_CURRENT_CONTEXT(ctx
);
1195 GLvoid
*image
= _mesa_unpack_image(count
, 1, 1, format
, type
, table
,
1198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1199 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1211 if (ctx
->ExecuteFlag
) {
1212 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1218 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1219 GLint x
, GLint y
, GLsizei width
)
1221 GET_CURRENT_CONTEXT(ctx
);
1224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1233 if (ctx
->ExecuteFlag
) {
1234 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1240 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1241 GLint x
, GLint y
, GLsizei width
)
1243 GET_CURRENT_CONTEXT(ctx
);
1246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1247 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1250 n
[2].e
= internalformat
;
1255 if (ctx
->ExecuteFlag
) {
1256 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1262 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1263 GLenum format
, GLenum type
, const GLvoid
*filter
)
1265 GET_CURRENT_CONTEXT(ctx
);
1266 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, filter
,
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1273 n
[2].e
= internalFormat
;
1282 if (ctx
->ExecuteFlag
) {
1283 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1284 format
, type
, filter
);
1290 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1291 GLsizei width
, GLsizei height
, GLenum format
,
1292 GLenum type
, const GLvoid
*filter
)
1294 GET_CURRENT_CONTEXT(ctx
);
1295 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
, filter
,
1298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1299 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1302 n
[2].e
= internalFormat
;
1312 if (ctx
->ExecuteFlag
) {
1313 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1314 format
, type
, filter
);
1320 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1322 GET_CURRENT_CONTEXT(ctx
);
1324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1325 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1331 if (ctx
->ExecuteFlag
) {
1332 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1338 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1340 GET_CURRENT_CONTEXT(ctx
);
1342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1343 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1348 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1349 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1350 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1356 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1359 if (ctx
->ExecuteFlag
) {
1360 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1366 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1368 GET_CURRENT_CONTEXT(ctx
);
1370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1371 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1377 if (ctx
->ExecuteFlag
) {
1378 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1384 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1386 GET_CURRENT_CONTEXT(ctx
);
1388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1389 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1394 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1395 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1396 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1402 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1405 if (ctx
->ExecuteFlag
) {
1406 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1412 save_CopyPixels( GLint x
, GLint y
,
1413 GLsizei width
, GLsizei height
, GLenum type
)
1415 GET_CURRENT_CONTEXT(ctx
);
1417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1418 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1422 n
[3].i
= (GLint
) width
;
1423 n
[4].i
= (GLint
) height
;
1426 if (ctx
->ExecuteFlag
) {
1427 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1434 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1435 GLint x
, GLint y
, GLsizei width
, GLint border
)
1437 GET_CURRENT_CONTEXT(ctx
);
1439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1440 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1444 n
[3].e
= internalformat
;
1450 if (ctx
->ExecuteFlag
) {
1451 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1452 x
, y
, width
, border
);
1458 save_CopyTexImage2D( GLenum target
, GLint level
,
1459 GLenum internalformat
,
1460 GLint x
, GLint y
, GLsizei width
,
1461 GLsizei height
, GLint border
)
1463 GET_CURRENT_CONTEXT(ctx
);
1465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1466 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1470 n
[3].e
= internalformat
;
1477 if (ctx
->ExecuteFlag
) {
1478 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1479 x
, y
, width
, height
, border
);
1486 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1487 GLint xoffset
, GLint x
, GLint y
,
1490 GET_CURRENT_CONTEXT(ctx
);
1492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1493 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1502 if (ctx
->ExecuteFlag
) {
1503 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1509 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1510 GLint xoffset
, GLint yoffset
,
1512 GLsizei width
, GLint height
)
1514 GET_CURRENT_CONTEXT(ctx
);
1516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1517 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1528 if (ctx
->ExecuteFlag
) {
1529 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1530 x
, y
, width
, height
);
1536 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1537 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1539 GLsizei width
, GLint height
)
1541 GET_CURRENT_CONTEXT(ctx
);
1543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1544 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1556 if (ctx
->ExecuteFlag
) {
1557 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1558 xoffset
, yoffset
, zoffset
,
1559 x
, y
, width
, height
);
1564 static void save_CullFace( GLenum mode
)
1566 GET_CURRENT_CONTEXT(ctx
);
1568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1569 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1573 if (ctx
->ExecuteFlag
) {
1574 (*ctx
->Exec
->CullFace
)( mode
);
1579 static void save_DepthFunc( GLenum func
)
1581 GET_CURRENT_CONTEXT(ctx
);
1583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1584 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1588 if (ctx
->ExecuteFlag
) {
1589 (*ctx
->Exec
->DepthFunc
)( func
);
1594 static void save_DepthMask( GLboolean mask
)
1596 GET_CURRENT_CONTEXT(ctx
);
1598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1599 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1603 if (ctx
->ExecuteFlag
) {
1604 (*ctx
->Exec
->DepthMask
)( mask
);
1609 static void save_DepthRange( GLclampd nearval
, GLclampd farval
)
1611 GET_CURRENT_CONTEXT(ctx
);
1613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1614 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1616 n
[1].f
= (GLfloat
) nearval
;
1617 n
[2].f
= (GLfloat
) farval
;
1619 if (ctx
->ExecuteFlag
) {
1620 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1625 static void save_Disable( GLenum cap
)
1627 GET_CURRENT_CONTEXT(ctx
);
1629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1634 if (ctx
->ExecuteFlag
) {
1635 (*ctx
->Exec
->Disable
)( cap
);
1640 static void save_DrawBuffer( GLenum mode
)
1642 GET_CURRENT_CONTEXT(ctx
);
1644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1645 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1649 if (ctx
->ExecuteFlag
) {
1650 (*ctx
->Exec
->DrawBuffer
)( mode
);
1655 static void save_DrawPixels( GLsizei width
, GLsizei height
,
1656 GLenum format
, GLenum type
,
1657 const GLvoid
*pixels
)
1659 GET_CURRENT_CONTEXT(ctx
);
1660 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
1661 pixels
, &ctx
->Unpack
);
1663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1664 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1675 if (ctx
->ExecuteFlag
) {
1676 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1682 static void save_Enable( GLenum cap
)
1684 GET_CURRENT_CONTEXT(ctx
);
1686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1687 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1691 if (ctx
->ExecuteFlag
) {
1692 (*ctx
->Exec
->Enable
)( cap
);
1698 void _mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1700 GET_CURRENT_CONTEXT(ctx
);
1702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1703 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1709 if (ctx
->ExecuteFlag
) {
1710 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1715 void _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1717 GET_CURRENT_CONTEXT(ctx
);
1719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1720 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1728 if (ctx
->ExecuteFlag
) {
1729 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1736 static void save_Fogfv( GLenum pname
, const GLfloat
*params
)
1738 GET_CURRENT_CONTEXT(ctx
);
1740 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1741 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1749 if (ctx
->ExecuteFlag
) {
1750 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1755 static void save_Fogf( GLenum pname
, GLfloat param
)
1757 save_Fogfv(pname
, ¶m
);
1761 static void save_Fogiv(GLenum pname
, const GLint
*params
)
1766 case GL_FOG_DENSITY
:
1770 p
[0] = (GLfloat
) *params
;
1773 p
[0] = INT_TO_FLOAT( params
[0] );
1774 p
[1] = INT_TO_FLOAT( params
[1] );
1775 p
[2] = INT_TO_FLOAT( params
[2] );
1776 p
[3] = INT_TO_FLOAT( params
[3] );
1779 /* Error will be caught later in gl_Fogfv */
1782 save_Fogfv(pname
, p
);
1786 static void save_Fogi(GLenum pname
, GLint param
)
1788 save_Fogiv(pname
, ¶m
);
1792 static void save_FrontFace( GLenum mode
)
1794 GET_CURRENT_CONTEXT(ctx
);
1796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1797 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1801 if (ctx
->ExecuteFlag
) {
1802 (*ctx
->Exec
->FrontFace
)( mode
);
1807 static void save_Frustum( GLdouble left
, GLdouble right
,
1808 GLdouble bottom
, GLdouble top
,
1809 GLdouble nearval
, GLdouble farval
)
1811 GET_CURRENT_CONTEXT(ctx
);
1813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1814 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1816 n
[1].f
= (GLfloat
) left
;
1817 n
[2].f
= (GLfloat
) right
;
1818 n
[3].f
= (GLfloat
) bottom
;
1819 n
[4].f
= (GLfloat
) top
;
1820 n
[5].f
= (GLfloat
) nearval
;
1821 n
[6].f
= (GLfloat
) farval
;
1823 if (ctx
->ExecuteFlag
) {
1824 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
1829 static void save_Hint( GLenum target
, GLenum mode
)
1831 GET_CURRENT_CONTEXT(ctx
);
1833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1834 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
1839 if (ctx
->ExecuteFlag
) {
1840 (*ctx
->Exec
->Hint
)( target
, mode
);
1846 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
1848 GET_CURRENT_CONTEXT(ctx
);
1851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1852 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
1856 n
[3].e
= internalFormat
;
1859 if (ctx
->ExecuteFlag
) {
1860 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
1865 static void save_IndexMask( GLuint mask
)
1867 GET_CURRENT_CONTEXT(ctx
);
1869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1870 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
1874 if (ctx
->ExecuteFlag
) {
1875 (*ctx
->Exec
->IndexMask
)( mask
);
1880 static void save_InitNames( void )
1882 GET_CURRENT_CONTEXT(ctx
);
1883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1884 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
1885 if (ctx
->ExecuteFlag
) {
1886 (*ctx
->Exec
->InitNames
)();
1891 static void save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
1893 GET_CURRENT_CONTEXT(ctx
);
1895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1896 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
1914 case GL_SPOT_DIRECTION
:
1917 case GL_SPOT_EXPONENT
:
1920 case GL_SPOT_CUTOFF
:
1923 case GL_CONSTANT_ATTENUATION
:
1926 case GL_LINEAR_ATTENUATION
:
1929 case GL_QUADRATIC_ATTENUATION
:
1935 for (i
= 0; i
< nParams
; i
++) {
1936 n
[3+i
].f
= params
[i
];
1939 if (ctx
->ExecuteFlag
) {
1940 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
1945 static void save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
1947 save_Lightfv(light
, pname
, ¶ms
);
1951 static void save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
1958 fparam
[0] = INT_TO_FLOAT( params
[0] );
1959 fparam
[1] = INT_TO_FLOAT( params
[1] );
1960 fparam
[2] = INT_TO_FLOAT( params
[2] );
1961 fparam
[3] = INT_TO_FLOAT( params
[3] );
1964 fparam
[0] = (GLfloat
) params
[0];
1965 fparam
[1] = (GLfloat
) params
[1];
1966 fparam
[2] = (GLfloat
) params
[2];
1967 fparam
[3] = (GLfloat
) params
[3];
1969 case GL_SPOT_DIRECTION
:
1970 fparam
[0] = (GLfloat
) params
[0];
1971 fparam
[1] = (GLfloat
) params
[1];
1972 fparam
[2] = (GLfloat
) params
[2];
1974 case GL_SPOT_EXPONENT
:
1975 case GL_SPOT_CUTOFF
:
1976 case GL_CONSTANT_ATTENUATION
:
1977 case GL_LINEAR_ATTENUATION
:
1978 case GL_QUADRATIC_ATTENUATION
:
1979 fparam
[0] = (GLfloat
) params
[0];
1982 /* error will be caught later in gl_Lightfv */
1985 save_Lightfv( light
, pname
, fparam
);
1989 static void save_Lighti( GLenum light
, GLenum pname
, GLint param
)
1991 save_Lightiv( light
, pname
, ¶m
);
1995 static void save_LightModelfv( GLenum pname
, const GLfloat
*params
)
1997 GET_CURRENT_CONTEXT(ctx
);
1999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2000 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2008 if (ctx
->ExecuteFlag
) {
2009 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2014 static void save_LightModelf( GLenum pname
, GLfloat param
)
2016 save_LightModelfv(pname
, ¶m
);
2020 static void save_LightModeliv( GLenum pname
, const GLint
*params
)
2024 case GL_LIGHT_MODEL_AMBIENT
:
2025 fparam
[0] = INT_TO_FLOAT( params
[0] );
2026 fparam
[1] = INT_TO_FLOAT( params
[1] );
2027 fparam
[2] = INT_TO_FLOAT( params
[2] );
2028 fparam
[3] = INT_TO_FLOAT( params
[3] );
2030 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2031 case GL_LIGHT_MODEL_TWO_SIDE
:
2032 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2033 fparam
[0] = (GLfloat
) params
[0];
2036 /* Error will be caught later in gl_LightModelfv */
2039 save_LightModelfv(pname
, fparam
);
2043 static void save_LightModeli( GLenum pname
, GLint param
)
2045 save_LightModeliv(pname
, ¶m
);
2049 static void save_LineStipple( GLint factor
, GLushort pattern
)
2051 GET_CURRENT_CONTEXT(ctx
);
2053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2054 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2059 if (ctx
->ExecuteFlag
) {
2060 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2065 static void save_LineWidth( GLfloat width
)
2067 GET_CURRENT_CONTEXT(ctx
);
2069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2070 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2074 if (ctx
->ExecuteFlag
) {
2075 (*ctx
->Exec
->LineWidth
)( width
);
2080 static void save_ListBase( GLuint base
)
2082 GET_CURRENT_CONTEXT(ctx
);
2084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2085 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2089 if (ctx
->ExecuteFlag
) {
2090 (*ctx
->Exec
->ListBase
)( base
);
2095 static void save_LoadIdentity( void )
2097 GET_CURRENT_CONTEXT(ctx
);
2098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2099 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2100 if (ctx
->ExecuteFlag
) {
2101 (*ctx
->Exec
->LoadIdentity
)();
2106 static void save_LoadMatrixf( const GLfloat
*m
)
2108 GET_CURRENT_CONTEXT(ctx
);
2110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2111 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2114 for (i
=0;i
<16;i
++) {
2118 if (ctx
->ExecuteFlag
) {
2119 (*ctx
->Exec
->LoadMatrixf
)( m
);
2124 static void save_LoadMatrixd( const GLdouble
*m
)
2128 for (i
= 0; i
< 16; i
++) {
2129 f
[i
] = (GLfloat
) m
[i
];
2131 save_LoadMatrixf(f
);
2135 static void save_LoadName( GLuint name
)
2137 GET_CURRENT_CONTEXT(ctx
);
2139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2140 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2144 if (ctx
->ExecuteFlag
) {
2145 (*ctx
->Exec
->LoadName
)( name
);
2150 static void save_LogicOp( GLenum opcode
)
2152 GET_CURRENT_CONTEXT(ctx
);
2154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2155 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2159 if (ctx
->ExecuteFlag
) {
2160 (*ctx
->Exec
->LogicOp
)( opcode
);
2165 static void save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2166 GLint order
, const GLdouble
*points
)
2168 GET_CURRENT_CONTEXT(ctx
);
2170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2171 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2173 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2175 n
[2].f
= (GLfloat
) u1
;
2176 n
[3].f
= (GLfloat
) u2
;
2177 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2179 n
[6].data
= (void *) pnts
;
2181 if (ctx
->ExecuteFlag
) {
2182 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2186 static void save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2187 GLint order
, const GLfloat
*points
)
2189 GET_CURRENT_CONTEXT(ctx
);
2191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2192 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2194 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2198 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2200 n
[6].data
= (void *) pnts
;
2202 if (ctx
->ExecuteFlag
) {
2203 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2208 static void save_Map2d( GLenum target
,
2209 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2210 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2211 const GLdouble
*points
)
2213 GET_CURRENT_CONTEXT(ctx
);
2215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2216 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2218 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2219 vstride
, vorder
, points
);
2221 n
[2].f
= (GLfloat
) u1
;
2222 n
[3].f
= (GLfloat
) u2
;
2223 n
[4].f
= (GLfloat
) v1
;
2224 n
[5].f
= (GLfloat
) v2
;
2225 /* XXX verify these strides are correct */
2226 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2227 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2230 n
[10].data
= (void *) pnts
;
2232 if (ctx
->ExecuteFlag
) {
2233 (*ctx
->Exec
->Map2d
)( target
,
2234 u1
, u2
, ustride
, uorder
,
2235 v1
, v2
, vstride
, vorder
, points
);
2240 static void save_Map2f( GLenum target
,
2241 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2242 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2243 const GLfloat
*points
)
2245 GET_CURRENT_CONTEXT(ctx
);
2247 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2248 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2250 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2251 vstride
, vorder
, points
);
2257 /* XXX verify these strides are correct */
2258 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2259 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2262 n
[10].data
= (void *) pnts
;
2264 if (ctx
->ExecuteFlag
) {
2265 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2266 v1
, v2
, vstride
, vorder
, points
);
2271 static void save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2273 GET_CURRENT_CONTEXT(ctx
);
2275 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2276 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2282 if (ctx
->ExecuteFlag
) {
2283 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2288 static void save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2290 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2294 static void save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2295 GLint vn
, GLfloat v1
, GLfloat v2
)
2297 GET_CURRENT_CONTEXT(ctx
);
2299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2300 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2309 if (ctx
->ExecuteFlag
) {
2310 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2316 static void save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2317 GLint vn
, GLdouble v1
, GLdouble v2
)
2319 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2320 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2324 static void save_MatrixMode( GLenum mode
)
2326 GET_CURRENT_CONTEXT(ctx
);
2328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2329 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2333 if (ctx
->ExecuteFlag
) {
2334 (*ctx
->Exec
->MatrixMode
)( mode
);
2340 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2342 GET_CURRENT_CONTEXT(ctx
);
2345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2346 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2349 n
[2].e
= internalFormat
;
2352 if (ctx
->ExecuteFlag
) {
2353 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2358 static void save_MultMatrixf( const GLfloat
*m
)
2360 GET_CURRENT_CONTEXT(ctx
);
2362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2363 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2366 for (i
=0;i
<16;i
++) {
2370 if (ctx
->ExecuteFlag
) {
2371 (*ctx
->Exec
->MultMatrixf
)( m
);
2376 static void save_MultMatrixd( const GLdouble
*m
)
2380 for (i
= 0; i
< 16; i
++) {
2381 f
[i
] = (GLfloat
) m
[i
];
2383 save_MultMatrixf(f
);
2387 static void save_NewList( GLuint list
, GLenum mode
)
2389 GET_CURRENT_CONTEXT(ctx
);
2390 /* It's an error to call this function while building a display list */
2391 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2398 static void save_Ortho( GLdouble left
, GLdouble right
,
2399 GLdouble bottom
, GLdouble top
,
2400 GLdouble nearval
, GLdouble farval
)
2402 GET_CURRENT_CONTEXT(ctx
);
2404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2405 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2407 n
[1].f
= (GLfloat
) left
;
2408 n
[2].f
= (GLfloat
) right
;
2409 n
[3].f
= (GLfloat
) bottom
;
2410 n
[4].f
= (GLfloat
) top
;
2411 n
[5].f
= (GLfloat
) nearval
;
2412 n
[6].f
= (GLfloat
) farval
;
2414 if (ctx
->ExecuteFlag
) {
2415 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2421 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2423 GET_CURRENT_CONTEXT(ctx
);
2425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2426 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2430 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2431 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2433 if (ctx
->ExecuteFlag
) {
2434 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2440 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2442 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2444 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2445 for (i
=0;i
<mapsize
;i
++) {
2446 fvalues
[i
] = (GLfloat
) values
[i
];
2450 for (i
=0;i
<mapsize
;i
++) {
2451 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2454 save_PixelMapfv(map
, mapsize
, fvalues
);
2459 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2461 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2463 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2464 for (i
=0;i
<mapsize
;i
++) {
2465 fvalues
[i
] = (GLfloat
) values
[i
];
2469 for (i
=0;i
<mapsize
;i
++) {
2470 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2473 save_PixelMapfv(map
, mapsize
, fvalues
);
2478 save_PixelTransferf( GLenum pname
, GLfloat param
)
2480 GET_CURRENT_CONTEXT(ctx
);
2482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2483 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2488 if (ctx
->ExecuteFlag
) {
2489 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2495 save_PixelTransferi( GLenum pname
, GLint param
)
2497 save_PixelTransferf( pname
, (GLfloat
) param
);
2502 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2504 GET_CURRENT_CONTEXT(ctx
);
2506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2507 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2512 if (ctx
->ExecuteFlag
) {
2513 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2519 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2521 GET_CURRENT_CONTEXT(ctx
);
2523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2524 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2531 if (ctx
->ExecuteFlag
) {
2532 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2537 static void save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2539 save_PointParameterfvEXT(pname
, ¶m
);
2542 static void save_PointParameteriNV( GLenum pname
, GLint param
)
2544 GLfloat p
= (GLfloat
) param
;
2545 save_PointParameterfvEXT(pname
, &p
);
2548 static void save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2550 GLfloat p
= (GLfloat
) param
[0];
2551 save_PointParameterfvEXT(pname
, &p
);
2555 static void save_PointSize( GLfloat size
)
2557 GET_CURRENT_CONTEXT(ctx
);
2559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2560 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2564 if (ctx
->ExecuteFlag
) {
2565 (*ctx
->Exec
->PointSize
)( size
);
2570 static void save_PolygonMode( GLenum face
, GLenum mode
)
2572 GET_CURRENT_CONTEXT(ctx
);
2574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2575 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2580 if (ctx
->ExecuteFlag
) {
2581 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2587 * Polygon stipple must have been upacked already!
2589 static void save_PolygonStipple( const GLubyte
*pattern
)
2591 GET_CURRENT_CONTEXT(ctx
);
2593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2594 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2597 n
[1].data
= MALLOC( 32 * 4 );
2598 data
= n
[1].data
; /* This needed for Acorn compiler */
2599 MEMCPY( data
, pattern
, 32 * 4 );
2601 if (ctx
->ExecuteFlag
) {
2602 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2607 static void save_PolygonOffset( GLfloat factor
, GLfloat units
)
2609 GET_CURRENT_CONTEXT(ctx
);
2611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2612 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2617 if (ctx
->ExecuteFlag
) {
2618 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2623 static void save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2625 GET_CURRENT_CONTEXT(ctx
);
2626 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2630 static void save_PopAttrib( void )
2632 GET_CURRENT_CONTEXT(ctx
);
2633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2634 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2635 if (ctx
->ExecuteFlag
) {
2636 (*ctx
->Exec
->PopAttrib
)();
2641 static void save_PopMatrix( void )
2643 GET_CURRENT_CONTEXT(ctx
);
2644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2645 FLUSH_CURRENT(ctx
, 0);
2646 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2647 if (ctx
->ExecuteFlag
) {
2648 (*ctx
->Exec
->PopMatrix
)();
2653 static void save_PopName( void )
2655 GET_CURRENT_CONTEXT(ctx
);
2656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2657 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2658 if (ctx
->ExecuteFlag
) {
2659 (*ctx
->Exec
->PopName
)();
2664 static void save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2665 const GLclampf
*priorities
)
2667 GET_CURRENT_CONTEXT(ctx
);
2669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2671 for (i
=0;i
<num
;i
++) {
2673 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2675 n
[1].ui
= textures
[i
];
2676 n
[2].f
= priorities
[i
];
2679 if (ctx
->ExecuteFlag
) {
2680 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2685 static void save_PushAttrib( GLbitfield mask
)
2687 GET_CURRENT_CONTEXT(ctx
);
2689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2690 FLUSH_CURRENT(ctx
, 0);
2691 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2695 if (ctx
->ExecuteFlag
) {
2696 (*ctx
->Exec
->PushAttrib
)( mask
);
2701 static void save_PushMatrix( void )
2703 GET_CURRENT_CONTEXT(ctx
);
2704 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2705 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2706 if (ctx
->ExecuteFlag
) {
2707 (*ctx
->Exec
->PushMatrix
)();
2712 static void save_PushName( GLuint name
)
2714 GET_CURRENT_CONTEXT(ctx
);
2716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2717 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2721 if (ctx
->ExecuteFlag
) {
2722 (*ctx
->Exec
->PushName
)( name
);
2727 static void save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2729 GET_CURRENT_CONTEXT(ctx
);
2731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2732 FLUSH_CURRENT(ctx
, 0);
2733 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2740 if (ctx
->ExecuteFlag
) {
2741 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2745 static void save_RasterPos2d(GLdouble x
, GLdouble y
)
2747 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2750 static void save_RasterPos2f(GLfloat x
, GLfloat y
)
2752 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2755 static void save_RasterPos2i(GLint x
, GLint y
)
2757 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2760 static void save_RasterPos2s(GLshort x
, GLshort y
)
2762 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2765 static void save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2767 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2770 static void save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2772 save_RasterPos4f(x
, y
, z
, 1.0F
);
2775 static void save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2777 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2780 static void save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2782 save_RasterPos4f(x
, y
, z
, 1.0F
);
2785 static void save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2787 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2790 static void save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2792 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2795 static void save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2797 save_RasterPos4f(x
, y
, z
, w
);
2800 static void save_RasterPos2dv(const GLdouble
*v
)
2802 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2805 static void save_RasterPos2fv(const GLfloat
*v
)
2807 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2810 static void save_RasterPos2iv(const GLint
*v
)
2812 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2815 static void save_RasterPos2sv(const GLshort
*v
)
2817 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2820 static void save_RasterPos3dv(const GLdouble
*v
)
2822 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2825 static void save_RasterPos3fv(const GLfloat
*v
)
2827 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2830 static void save_RasterPos3iv(const GLint
*v
)
2832 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2835 static void save_RasterPos3sv(const GLshort
*v
)
2837 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2840 static void save_RasterPos4dv(const GLdouble
*v
)
2842 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2843 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2846 static void save_RasterPos4fv(const GLfloat
*v
)
2848 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2851 static void save_RasterPos4iv(const GLint
*v
)
2853 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2854 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2857 static void save_RasterPos4sv(const GLshort
*v
)
2859 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2863 static void save_PassThrough( GLfloat token
)
2865 GET_CURRENT_CONTEXT(ctx
);
2867 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2868 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
2872 if (ctx
->ExecuteFlag
) {
2873 (*ctx
->Exec
->PassThrough
)( token
);
2878 static void save_ReadBuffer( GLenum mode
)
2880 GET_CURRENT_CONTEXT(ctx
);
2882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2883 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
2887 if (ctx
->ExecuteFlag
) {
2888 (*ctx
->Exec
->ReadBuffer
)( mode
);
2894 save_ResetHistogram(GLenum target
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2899 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
2903 if (ctx
->ExecuteFlag
) {
2904 (*ctx
->Exec
->ResetHistogram
)( target
);
2910 save_ResetMinmax(GLenum target
)
2912 GET_CURRENT_CONTEXT(ctx
);
2914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2915 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
2919 if (ctx
->ExecuteFlag
) {
2920 (*ctx
->Exec
->ResetMinmax
)( target
);
2925 static void save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
2927 GET_CURRENT_CONTEXT(ctx
);
2929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2930 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
2937 if (ctx
->ExecuteFlag
) {
2938 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
2943 static void save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
2945 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
2949 static void save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
2951 GET_CURRENT_CONTEXT(ctx
);
2953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2954 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
2960 if (ctx
->ExecuteFlag
) {
2961 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
2966 static void save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
2968 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
2972 static void save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
2974 GET_CURRENT_CONTEXT(ctx
);
2976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2977 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
2984 if (ctx
->ExecuteFlag
) {
2985 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
2990 static void save_ShadeModel( GLenum mode
)
2992 GET_CURRENT_CONTEXT(ctx
);
2994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2995 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
2999 if (ctx
->ExecuteFlag
) {
3000 (*ctx
->Exec
->ShadeModel
)( mode
);
3005 static void save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3007 GET_CURRENT_CONTEXT(ctx
);
3009 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3010 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3016 if (ctx
->ExecuteFlag
) {
3017 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3022 static void save_StencilMask( GLuint mask
)
3024 GET_CURRENT_CONTEXT(ctx
);
3026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3027 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3031 if (ctx
->ExecuteFlag
) {
3032 (*ctx
->Exec
->StencilMask
)( mask
);
3037 static void save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3039 GET_CURRENT_CONTEXT(ctx
);
3041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3042 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3048 if (ctx
->ExecuteFlag
) {
3049 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3054 static void save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3056 GET_CURRENT_CONTEXT(ctx
);
3058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3059 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3068 if (ctx
->ExecuteFlag
) {
3069 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3074 static void save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3076 save_TexEnvfv( target
, pname
, ¶m
);
3080 static void save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3083 p
[0] = (GLfloat
) param
;
3084 p
[1] = p
[2] = p
[3] = 0.0;
3085 save_TexEnvfv( target
, pname
, p
);
3089 static void save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3092 p
[0] = INT_TO_FLOAT( param
[0] );
3093 p
[1] = INT_TO_FLOAT( param
[1] );
3094 p
[2] = INT_TO_FLOAT( param
[2] );
3095 p
[3] = INT_TO_FLOAT( param
[3] );
3096 save_TexEnvfv( target
, pname
, p
);
3100 static void save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3102 GET_CURRENT_CONTEXT(ctx
);
3104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3105 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3114 if (ctx
->ExecuteFlag
) {
3115 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3120 static void save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3123 p
[0] = (GLfloat
) params
[0];
3124 p
[1] = (GLfloat
) params
[1];
3125 p
[2] = (GLfloat
) params
[2];
3126 p
[3] = (GLfloat
) params
[3];
3127 save_TexGenfv(coord
, pname
, p
);
3131 static void save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3133 GLfloat p
= (GLfloat
) param
;
3134 save_TexGenfv( coord
, pname
, &p
);
3138 static void save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3141 p
[0] = (GLfloat
) params
[0];
3142 p
[1] = (GLfloat
) params
[1];
3143 p
[2] = (GLfloat
) params
[2];
3144 p
[3] = (GLfloat
) params
[3];
3145 save_TexGenfv( coord
, pname
, p
);
3149 static void save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3151 save_TexGenfv(coord
, pname
, ¶m
);
3155 static void save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3157 save_TexGeniv( coord
, pname
, ¶m
);
3161 static void save_TexParameterfv( GLenum target
,
3162 GLenum pname
, const GLfloat
*params
)
3164 GET_CURRENT_CONTEXT(ctx
);
3166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3176 if (ctx
->ExecuteFlag
) {
3177 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3182 static void save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3184 save_TexParameterfv(target
, pname
, ¶m
);
3188 static void save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3191 fparam
[0] = (GLfloat
) param
;
3192 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3193 save_TexParameterfv(target
, pname
, fparam
);
3197 static void save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3200 fparam
[0] = (GLfloat
) params
[0];
3201 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3202 save_TexParameterfv(target
, pname
, fparam
);
3206 static void save_TexImage1D( GLenum target
,
3207 GLint level
, GLint components
,
3208 GLsizei width
, GLint border
,
3209 GLenum format
, GLenum type
,
3210 const GLvoid
*pixels
)
3212 GET_CURRENT_CONTEXT(ctx
);
3213 if (target
== GL_PROXY_TEXTURE_1D
) {
3214 /* don't compile, execute immediately */
3215 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3216 border
, format
, type
, pixels
);
3219 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3220 pixels
, &ctx
->Unpack
);
3222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3223 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3227 n
[3].i
= components
;
3228 n
[4].i
= (GLint
) width
;
3237 if (ctx
->ExecuteFlag
) {
3238 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3239 border
, format
, type
, pixels
);
3245 static void save_TexImage2D( GLenum target
,
3246 GLint level
, GLint components
,
3247 GLsizei width
, GLsizei height
, GLint border
,
3248 GLenum format
, GLenum type
,
3249 const GLvoid
*pixels
)
3251 GET_CURRENT_CONTEXT(ctx
);
3252 if (target
== GL_PROXY_TEXTURE_2D
) {
3253 /* don't compile, execute immediately */
3254 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3255 height
, border
, format
, type
, pixels
);
3258 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3259 pixels
, &ctx
->Unpack
);
3261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3262 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3266 n
[3].i
= components
;
3267 n
[4].i
= (GLint
) width
;
3268 n
[5].i
= (GLint
) height
;
3277 if (ctx
->ExecuteFlag
) {
3278 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3279 height
, border
, format
, type
, pixels
);
3285 static void save_TexImage3D( GLenum target
,
3286 GLint level
, GLint internalFormat
,
3287 GLsizei width
, GLsizei height
, GLsizei depth
,
3289 GLenum format
, GLenum type
,
3290 const GLvoid
*pixels
)
3292 GET_CURRENT_CONTEXT(ctx
);
3293 if (target
== GL_PROXY_TEXTURE_3D
) {
3294 /* don't compile, execute immediately */
3295 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3296 height
, depth
, border
, format
, type
, pixels
);
3300 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3301 pixels
, &ctx
->Unpack
);
3302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3303 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3307 n
[3].i
= (GLint
) internalFormat
;
3308 n
[4].i
= (GLint
) width
;
3309 n
[5].i
= (GLint
) height
;
3310 n
[6].i
= (GLint
) depth
;
3319 if (ctx
->ExecuteFlag
) {
3320 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3321 height
, depth
, border
, format
, type
, pixels
);
3327 static void save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3328 GLsizei width
, GLenum format
, GLenum type
,
3329 const GLvoid
*pixels
)
3331 GET_CURRENT_CONTEXT(ctx
);
3333 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3334 pixels
, &ctx
->Unpack
);
3335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3336 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3341 n
[4].i
= (GLint
) width
;
3349 if (ctx
->ExecuteFlag
) {
3350 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3351 format
, type
, pixels
);
3356 static void save_TexSubImage2D( GLenum target
, GLint level
,
3357 GLint xoffset
, GLint yoffset
,
3358 GLsizei width
, GLsizei height
,
3359 GLenum format
, GLenum type
,
3360 const GLvoid
*pixels
)
3362 GET_CURRENT_CONTEXT(ctx
);
3364 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3365 pixels
, &ctx
->Unpack
);
3366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3367 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3373 n
[5].i
= (GLint
) width
;
3374 n
[6].i
= (GLint
) height
;
3382 if (ctx
->ExecuteFlag
) {
3383 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3384 width
, height
, format
, type
, pixels
);
3389 static void save_TexSubImage3D( GLenum target
, GLint level
,
3390 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3391 GLsizei width
, GLsizei height
, GLsizei depth
,
3392 GLenum format
, GLenum type
,
3393 const GLvoid
*pixels
)
3395 GET_CURRENT_CONTEXT(ctx
);
3397 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3398 pixels
, &ctx
->Unpack
);
3399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3400 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3407 n
[6].i
= (GLint
) width
;
3408 n
[7].i
= (GLint
) height
;
3409 n
[8].i
= (GLint
) depth
;
3417 if (ctx
->ExecuteFlag
) {
3418 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3419 xoffset
, yoffset
, zoffset
,
3420 width
, height
, depth
, format
, type
, pixels
);
3425 static void save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3427 GET_CURRENT_CONTEXT(ctx
);
3429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3430 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3436 if (ctx
->ExecuteFlag
) {
3437 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3442 static void save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3444 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3449 static void save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3451 GET_CURRENT_CONTEXT(ctx
);
3453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3454 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3458 n
[3].i
= (GLint
) width
;
3459 n
[4].i
= (GLint
) height
;
3461 if (ctx
->ExecuteFlag
) {
3462 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3467 static void save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3469 GET_CURRENT_CONTEXT(ctx
);
3471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3472 FLUSH_CURRENT(ctx
, 0);
3473 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3480 if (ctx
->ExecuteFlag
) {
3481 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3485 static void save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3487 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3490 static void save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3492 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3495 static void save_WindowPos2iMESA(GLint x
, GLint y
)
3497 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3500 static void save_WindowPos2sMESA(GLshort x
, GLshort y
)
3502 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3505 static void save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3507 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3510 static void save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3512 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3515 static void save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3517 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3520 static void save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3522 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3525 static void save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3527 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3530 static void save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3532 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3535 static void save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3537 save_WindowPos4fMESA(x
, y
, z
, w
);
3540 static void save_WindowPos2dvMESA(const GLdouble
*v
)
3542 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3545 static void save_WindowPos2fvMESA(const GLfloat
*v
)
3547 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3550 static void save_WindowPos2ivMESA(const GLint
*v
)
3552 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3555 static void save_WindowPos2svMESA(const GLshort
*v
)
3557 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3560 static void save_WindowPos3dvMESA(const GLdouble
*v
)
3562 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3565 static void save_WindowPos3fvMESA(const GLfloat
*v
)
3567 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3570 static void save_WindowPos3ivMESA(const GLint
*v
)
3572 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3575 static void save_WindowPos3svMESA(const GLshort
*v
)
3577 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3580 static void save_WindowPos4dvMESA(const GLdouble
*v
)
3582 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3583 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3586 static void save_WindowPos4fvMESA(const GLfloat
*v
)
3588 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3591 static void save_WindowPos4ivMESA(const GLint
*v
)
3593 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3594 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3597 static void save_WindowPos4svMESA(const GLshort
*v
)
3599 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3604 /* GL_ARB_multitexture */
3605 static void save_ActiveTextureARB( GLenum target
)
3607 GET_CURRENT_CONTEXT(ctx
);
3609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3610 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3614 if (ctx
->ExecuteFlag
) {
3615 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3620 /* GL_ARB_transpose_matrix */
3622 static void save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3625 _math_transposefd(tm
, m
);
3626 save_LoadMatrixf(tm
);
3630 static void save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3633 _math_transposef(tm
, m
);
3634 save_LoadMatrixf(tm
);
3639 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3642 _math_transposefd(tm
, m
);
3643 save_MultMatrixf(tm
);
3648 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3651 _math_transposef(tm
, m
);
3652 save_MultMatrixf(tm
);
3657 save_PixelTexGenSGIX(GLenum mode
)
3659 GET_CURRENT_CONTEXT(ctx
);
3661 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3662 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3666 if (ctx
->ExecuteFlag
) {
3667 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3672 /* GL_ARB_texture_compression */
3674 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3675 GLenum internalFormat
, GLsizei width
,
3676 GLint border
, GLsizei imageSize
,
3679 GET_CURRENT_CONTEXT(ctx
);
3680 if (target
== GL_PROXY_TEXTURE_1D
) {
3681 /* don't compile, execute immediately */
3682 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3683 width
, border
, imageSize
, data
);
3688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3689 /* make copy of image */
3690 image
= MALLOC(imageSize
);
3692 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3695 MEMCPY(image
, data
, imageSize
);
3696 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3700 n
[3].e
= internalFormat
;
3701 n
[4].i
= (GLint
) width
;
3709 if (ctx
->ExecuteFlag
) {
3710 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3711 width
, border
, imageSize
, data
);
3718 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3719 GLenum internalFormat
, GLsizei width
,
3720 GLsizei height
, GLint border
, GLsizei imageSize
,
3723 GET_CURRENT_CONTEXT(ctx
);
3724 if (target
== GL_PROXY_TEXTURE_2D
) {
3725 /* don't compile, execute immediately */
3726 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3727 width
, height
, border
, imageSize
, data
);
3732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3733 /* make copy of image */
3734 image
= MALLOC(imageSize
);
3736 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3739 MEMCPY(image
, data
, imageSize
);
3740 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3744 n
[3].e
= internalFormat
;
3745 n
[4].i
= (GLint
) width
;
3746 n
[5].i
= (GLint
) height
;
3754 if (ctx
->ExecuteFlag
) {
3755 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3756 width
, height
, border
, imageSize
, data
);
3763 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3764 GLenum internalFormat
, GLsizei width
,
3765 GLsizei height
, GLsizei depth
, GLint border
,
3766 GLsizei imageSize
, const GLvoid
*data
)
3768 GET_CURRENT_CONTEXT(ctx
);
3769 if (target
== GL_PROXY_TEXTURE_3D
) {
3770 /* don't compile, execute immediately */
3771 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3772 width
, height
, depth
, border
, imageSize
, data
);
3777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3778 /* make copy of image */
3779 image
= MALLOC(imageSize
);
3781 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3784 MEMCPY(image
, data
, imageSize
);
3785 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3789 n
[3].e
= internalFormat
;
3790 n
[4].i
= (GLint
) width
;
3791 n
[5].i
= (GLint
) height
;
3792 n
[6].i
= (GLint
) depth
;
3800 if (ctx
->ExecuteFlag
) {
3801 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3802 width
, height
, depth
, border
, imageSize
, data
);
3809 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3810 GLsizei width
, GLenum format
,
3811 GLsizei imageSize
, const GLvoid
*data
)
3816 GET_CURRENT_CONTEXT(ctx
);
3817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3819 /* make copy of image */
3820 image
= MALLOC(imageSize
);
3822 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
3825 MEMCPY(image
, data
, imageSize
);
3826 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
3831 n
[4].i
= (GLint
) width
;
3839 if (ctx
->ExecuteFlag
) {
3840 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
3841 width
, format
, imageSize
, data
);
3847 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
3848 GLint yoffset
, GLsizei width
, GLsizei height
,
3849 GLenum format
, GLsizei imageSize
,
3855 GET_CURRENT_CONTEXT(ctx
);
3856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3858 /* make copy of image */
3859 image
= MALLOC(imageSize
);
3861 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
3864 MEMCPY(image
, data
, imageSize
);
3865 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
3871 n
[5].i
= (GLint
) width
;
3872 n
[6].i
= (GLint
) height
;
3880 if (ctx
->ExecuteFlag
) {
3881 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
3882 width
, height
, format
, imageSize
, data
);
3888 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
3889 GLint yoffset
, GLint zoffset
, GLsizei width
,
3890 GLsizei height
, GLsizei depth
, GLenum format
,
3891 GLsizei imageSize
, const GLvoid
*data
)
3896 GET_CURRENT_CONTEXT(ctx
);
3897 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3899 /* make copy of image */
3900 image
= MALLOC(imageSize
);
3902 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
3905 MEMCPY(image
, data
, imageSize
);
3906 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
3913 n
[6].i
= (GLint
) width
;
3914 n
[7].i
= (GLint
) height
;
3915 n
[8].i
= (GLint
) depth
;
3917 n
[10].i
= imageSize
;
3923 if (ctx
->ExecuteFlag
) {
3924 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
3925 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
3930 /* GL_ARB_multisample */
3932 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
3934 GET_CURRENT_CONTEXT(ctx
);
3936 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3937 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
3942 if (ctx
->ExecuteFlag
) {
3943 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
3948 /* GL_SGIS_pixel_texture */
3951 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
3953 GET_CURRENT_CONTEXT(ctx
);
3955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3956 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
3961 if (ctx
->ExecuteFlag
) {
3962 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
3968 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
3970 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
3975 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
3977 save_PixelTexGenParameteriSGIS(target
, *value
);
3982 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
3984 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
3989 * GL_NV_vertex_program
3992 save_BindProgramNV(GLenum target
, GLuint id
)
3994 GET_CURRENT_CONTEXT(ctx
);
3996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3997 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4002 if (ctx
->ExecuteFlag
) {
4003 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4008 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4010 GET_CURRENT_CONTEXT(ctx
);
4012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4013 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4022 if (ctx
->ExecuteFlag
) {
4023 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4029 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4030 GLfloat x
, GLfloat y
,
4031 GLfloat z
, GLfloat w
)
4033 GET_CURRENT_CONTEXT(ctx
);
4035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4036 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4045 if (ctx
->ExecuteFlag
) {
4046 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4052 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4054 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4055 params
[2], params
[3]);
4060 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4061 GLdouble x
, GLdouble y
,
4062 GLdouble z
, GLdouble w
)
4064 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4065 (GLfloat
) z
, (GLfloat
) w
);
4070 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4071 const GLdouble
*params
)
4073 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4074 (GLfloat
) params
[1], (GLfloat
) params
[2],
4075 (GLfloat
) params
[3]);
4080 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4081 GLuint num
, const GLdouble
*params
)
4084 for (i
= 0; i
< num
; i
++) {
4085 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4091 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4092 GLuint num
, const GLfloat
*params
)
4095 for (i
= 0; i
< num
; i
++) {
4096 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4103 save_TrackMatrixNV(GLenum target
, GLuint address
,
4104 GLenum matrix
, GLenum transform
)
4106 GET_CURRENT_CONTEXT(ctx
);
4108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4109 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4116 if (ctx
->ExecuteFlag
) {
4117 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4122 /* GL_EXT_stencil_two_side */
4123 static void save_ActiveStencilFaceEXT( GLenum face
)
4125 GET_CURRENT_CONTEXT(ctx
);
4127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4128 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4132 if (ctx
->ExecuteFlag
) {
4133 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4139 /* KW: Compile commands
4141 * Will appear in the list before the vertex buffer containing the
4142 * command that provoked the error. I don't see this as a problem.
4145 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
4148 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
4151 n
[2].data
= (void *) s
;
4153 /* execute already done */
4158 * Compile an error into current display list.
4161 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
4163 if (ctx
->CompileFlag
)
4164 _mesa_save_error( ctx
, error
, s
);
4166 if (ctx
->ExecuteFlag
)
4167 _mesa_error( ctx
, error
, s
);
4173 islist(GLcontext
*ctx
, GLuint list
)
4175 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
4185 /**********************************************************************/
4186 /* Display list execution */
4187 /**********************************************************************/
4191 * Execute a display list. Note that the ListBase offset must have already
4192 * been added before calling this function. I.e. the list argument is
4193 * the absolute list number, not relative to ListBase.
4194 * Input: list - display list number
4197 execute_list( GLcontext
*ctx
, GLuint list
)
4202 if (!islist(ctx
,list
))
4205 if (ctx
->Driver
.BeginCallList
)
4206 ctx
->Driver
.BeginCallList( ctx
, list
);
4210 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
4214 OpCode opcode
= n
[0].opcode
;
4215 int i
= (int)n
[0].opcode
- (int)OPCODE_DRV_0
;
4217 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
4218 ctx
->listext
.opcode
[i
].execute(ctx
, &n
[1]);
4219 n
+= ctx
->listext
.opcode
[i
].size
;
4224 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
4227 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
4229 case OPCODE_ALPHA_FUNC
:
4230 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
4232 case OPCODE_BIND_TEXTURE
:
4233 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
4237 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4238 ctx
->Unpack
= _mesa_native_packing
;
4239 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
4240 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
4241 ctx
->Unpack
= save
; /* restore */
4244 case OPCODE_BLEND_COLOR
:
4245 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4247 case OPCODE_BLEND_EQUATION
:
4248 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
4250 case OPCODE_BLEND_FUNC
:
4251 (*ctx
->Exec
->BlendFunc
)( n
[1].e
, n
[2].e
);
4253 case OPCODE_BLEND_FUNC_SEPARATE
:
4254 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
4256 case OPCODE_CALL_LIST
:
4257 /* Generated by glCallList(), don't add ListBase */
4258 if (ctx
->CallDepth
<MAX_LIST_NESTING
) {
4259 execute_list( ctx
, n
[1].ui
);
4262 case OPCODE_CALL_LIST_OFFSET
:
4263 /* Generated by glCallLists() so we must add ListBase */
4265 /* user specified a bad datatype at compile time */
4266 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
4268 else if (ctx
->CallDepth
< MAX_LIST_NESTING
) {
4269 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
4273 (*ctx
->Exec
->Clear
)( n
[1].bf
);
4275 case OPCODE_CLEAR_COLOR
:
4276 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4278 case OPCODE_CLEAR_ACCUM
:
4279 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4281 case OPCODE_CLEAR_DEPTH
:
4282 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
4284 case OPCODE_CLEAR_INDEX
:
4285 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
4287 case OPCODE_CLEAR_STENCIL
:
4288 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
4290 case OPCODE_CLIP_PLANE
:
4297 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
4300 case OPCODE_COLOR_MASK
:
4301 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
4303 case OPCODE_COLOR_MATERIAL
:
4304 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
4306 case OPCODE_COLOR_TABLE
:
4308 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4309 ctx
->Unpack
= _mesa_native_packing
;
4310 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
4311 n
[5].e
, n
[6].data
);
4312 ctx
->Unpack
= save
; /* restore */
4315 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
4322 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
4325 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
4332 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
4335 case OPCODE_COLOR_SUB_TABLE
:
4337 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4338 ctx
->Unpack
= _mesa_native_packing
;
4339 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
4340 n
[4].e
, n
[5].e
, n
[6].data
);
4341 ctx
->Unpack
= save
; /* restore */
4344 case OPCODE_CONVOLUTION_FILTER_1D
:
4346 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4347 ctx
->Unpack
= _mesa_native_packing
;
4348 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4349 n
[4].e
, n
[5].e
, n
[6].data
);
4350 ctx
->Unpack
= save
; /* restore */
4353 case OPCODE_CONVOLUTION_FILTER_2D
:
4355 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4356 ctx
->Unpack
= _mesa_native_packing
;
4357 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4358 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
4359 ctx
->Unpack
= save
; /* restore */
4362 case OPCODE_CONVOLUTION_PARAMETER_I
:
4363 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
4365 case OPCODE_CONVOLUTION_PARAMETER_IV
:
4372 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
4375 case OPCODE_CONVOLUTION_PARAMETER_F
:
4376 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
4378 case OPCODE_CONVOLUTION_PARAMETER_FV
:
4385 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
4388 case OPCODE_COPY_COLOR_SUB_TABLE
:
4389 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
4390 n
[3].i
, n
[4].i
, n
[5].i
);
4392 case OPCODE_COPY_COLOR_TABLE
:
4393 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
4394 n
[3].i
, n
[4].i
, n
[5].i
);
4396 case OPCODE_COPY_PIXELS
:
4397 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
4398 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
4400 case OPCODE_COPY_TEX_IMAGE1D
:
4401 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
4402 n
[5].i
, n
[6].i
, n
[7].i
);
4404 case OPCODE_COPY_TEX_IMAGE2D
:
4405 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
4406 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
4408 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
4409 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4410 n
[4].i
, n
[5].i
, n
[6].i
);
4412 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
4413 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4414 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
4416 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
4417 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4418 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
4420 case OPCODE_CULL_FACE
:
4421 (*ctx
->Exec
->CullFace
)( n
[1].e
);
4423 case OPCODE_DEPTH_FUNC
:
4424 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
4426 case OPCODE_DEPTH_MASK
:
4427 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
4429 case OPCODE_DEPTH_RANGE
:
4430 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
4432 case OPCODE_DISABLE
:
4433 (*ctx
->Exec
->Disable
)( n
[1].e
);
4435 case OPCODE_DRAW_BUFFER
:
4436 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
4438 case OPCODE_DRAW_PIXELS
:
4440 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4441 ctx
->Unpack
= _mesa_native_packing
;
4442 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
4444 ctx
->Unpack
= save
; /* restore */
4448 (*ctx
->Exec
->Enable
)( n
[1].e
);
4450 case OPCODE_EVALMESH1
:
4451 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
4453 case OPCODE_EVALMESH2
:
4454 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
4463 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
4466 case OPCODE_FRONT_FACE
:
4467 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
4469 case OPCODE_FRUSTUM
:
4470 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
4473 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
4475 case OPCODE_HISTOGRAM
:
4476 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
4478 case OPCODE_INDEX_MASK
:
4479 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
4481 case OPCODE_INIT_NAMES
:
4482 (*ctx
->Exec
->InitNames
)();
4491 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
4494 case OPCODE_LIGHT_MODEL
:
4501 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
4504 case OPCODE_LINE_STIPPLE
:
4505 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
4507 case OPCODE_LINE_WIDTH
:
4508 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
4510 case OPCODE_LIST_BASE
:
4511 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
4513 case OPCODE_LOAD_IDENTITY
:
4514 (*ctx
->Exec
->LoadIdentity
)();
4516 case OPCODE_LOAD_MATRIX
:
4517 if (sizeof(Node
)==sizeof(GLfloat
)) {
4518 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
4523 for (i
=0;i
<16;i
++) {
4526 (*ctx
->Exec
->LoadMatrixf
)( m
);
4529 case OPCODE_LOAD_NAME
:
4530 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
4532 case OPCODE_LOGIC_OP
:
4533 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
4537 GLenum target
= n
[1].e
;
4538 GLint ustride
= _mesa_evaluator_components(target
);
4539 GLint uorder
= n
[5].i
;
4540 GLfloat u1
= n
[2].f
;
4541 GLfloat u2
= n
[3].f
;
4542 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
4543 (GLfloat
*) n
[6].data
);
4548 GLenum target
= n
[1].e
;
4549 GLfloat u1
= n
[2].f
;
4550 GLfloat u2
= n
[3].f
;
4551 GLfloat v1
= n
[4].f
;
4552 GLfloat v2
= n
[5].f
;
4553 GLint ustride
= n
[6].i
;
4554 GLint vstride
= n
[7].i
;
4555 GLint uorder
= n
[8].i
;
4556 GLint vorder
= n
[9].i
;
4557 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
4558 v1
, v2
, vstride
, vorder
,
4559 (GLfloat
*) n
[10].data
);
4562 case OPCODE_MAPGRID1
:
4563 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
4565 case OPCODE_MAPGRID2
:
4566 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
4568 case OPCODE_MATRIX_MODE
:
4569 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
4571 case OPCODE_MIN_MAX
:
4572 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
4574 case OPCODE_MULT_MATRIX
:
4575 if (sizeof(Node
)==sizeof(GLfloat
)) {
4576 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
4581 for (i
=0;i
<16;i
++) {
4584 (*ctx
->Exec
->MultMatrixf
)( m
);
4588 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
4590 case OPCODE_PASSTHROUGH
:
4591 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
4593 case OPCODE_PIXEL_MAP
:
4594 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
4596 case OPCODE_PIXEL_TRANSFER
:
4597 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
4599 case OPCODE_PIXEL_ZOOM
:
4600 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
4602 case OPCODE_POINT_SIZE
:
4603 (*ctx
->Exec
->PointSize
)( n
[1].f
);
4605 case OPCODE_POINT_PARAMETERS
:
4611 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
4614 case OPCODE_POLYGON_MODE
:
4615 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
4617 case OPCODE_POLYGON_STIPPLE
:
4618 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
4620 case OPCODE_POLYGON_OFFSET
:
4621 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
4623 case OPCODE_POP_ATTRIB
:
4624 (*ctx
->Exec
->PopAttrib
)();
4626 case OPCODE_POP_MATRIX
:
4627 (*ctx
->Exec
->PopMatrix
)();
4629 case OPCODE_POP_NAME
:
4630 (*ctx
->Exec
->PopName
)();
4632 case OPCODE_PRIORITIZE_TEXTURE
:
4633 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
4635 case OPCODE_PUSH_ATTRIB
:
4636 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
4638 case OPCODE_PUSH_MATRIX
:
4639 (*ctx
->Exec
->PushMatrix
)();
4641 case OPCODE_PUSH_NAME
:
4642 (*ctx
->Exec
->PushName
)( n
[1].ui
);
4644 case OPCODE_RASTER_POS
:
4645 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4647 case OPCODE_READ_BUFFER
:
4648 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
4650 case OPCODE_RESET_HISTOGRAM
:
4651 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
4653 case OPCODE_RESET_MIN_MAX
:
4654 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
4657 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4660 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
4662 case OPCODE_SCISSOR
:
4663 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
4665 case OPCODE_SHADE_MODEL
:
4666 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
4668 case OPCODE_STENCIL_FUNC
:
4669 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
4671 case OPCODE_STENCIL_MASK
:
4672 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
4674 case OPCODE_STENCIL_OP
:
4675 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
4684 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
4694 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
4697 case OPCODE_TEXPARAMETER
:
4704 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
4707 case OPCODE_TEX_IMAGE1D
:
4709 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4710 ctx
->Unpack
= _mesa_native_packing
;
4711 (*ctx
->Exec
->TexImage1D
)(
4712 n
[1].e
, /* target */
4714 n
[3].i
, /* components */
4716 n
[5].e
, /* border */
4717 n
[6].e
, /* format */
4720 ctx
->Unpack
= save
; /* restore */
4723 case OPCODE_TEX_IMAGE2D
:
4725 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4726 ctx
->Unpack
= _mesa_native_packing
;
4727 (*ctx
->Exec
->TexImage2D
)(
4728 n
[1].e
, /* target */
4730 n
[3].i
, /* components */
4732 n
[5].i
, /* height */
4733 n
[6].e
, /* border */
4734 n
[7].e
, /* format */
4737 ctx
->Unpack
= save
; /* restore */
4740 case OPCODE_TEX_IMAGE3D
:
4742 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4743 ctx
->Unpack
= _mesa_native_packing
;
4744 (*ctx
->Exec
->TexImage3D
)(
4745 n
[1].e
, /* target */
4747 n
[3].i
, /* components */
4749 n
[5].i
, /* height */
4751 n
[7].e
, /* border */
4752 n
[8].e
, /* format */
4755 ctx
->Unpack
= save
; /* restore */
4758 case OPCODE_TEX_SUB_IMAGE1D
:
4760 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4761 ctx
->Unpack
= _mesa_native_packing
;
4762 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4764 n
[6].e
, n
[7].data
);
4765 ctx
->Unpack
= save
; /* restore */
4768 case OPCODE_TEX_SUB_IMAGE2D
:
4770 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4771 ctx
->Unpack
= _mesa_native_packing
;
4772 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4774 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
4775 ctx
->Unpack
= save
; /* restore */
4778 case OPCODE_TEX_SUB_IMAGE3D
:
4780 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4781 ctx
->Unpack
= _mesa_native_packing
;
4782 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4783 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
4784 n
[8].i
, n
[9].e
, n
[10].e
,
4786 ctx
->Unpack
= save
; /* restore */
4789 case OPCODE_TRANSLATE
:
4790 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
4792 case OPCODE_VIEWPORT
:
4793 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
4794 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
4796 case OPCODE_WINDOW_POS
:
4797 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4799 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
4800 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
4802 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
4803 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
4805 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
4806 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
4808 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
4809 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
4810 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
4812 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
4813 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
4814 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
4816 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
4817 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
4818 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
4820 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
4821 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
4822 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
4824 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
4825 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
4826 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
4828 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
4829 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
4830 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
4831 n
[9].e
, n
[10].i
, n
[11].data
);
4833 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
4834 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
4836 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
4837 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
4839 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
4840 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
4842 case OPCODE_EXECUTE_PROGRAM_NV
:
4849 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
4852 case OPCODE_REQUEST_PROGRAMS_RESIDENT_NV
:
4854 (*ctx->Exec->RequestResidentProgramsNV)();
4857 case OPCODE_LOAD_PROGRAM_NV
:
4859 (*ctx->Exec->LoadProgramNV)();
4862 case OPCODE_PROGRAM_PARAMETER4F_NV
:
4863 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
4864 n
[4].f
, n
[5].f
, n
[6].f
);
4866 case OPCODE_TRACK_MATRIX_NV
:
4867 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
4870 case OPCODE_CONTINUE
:
4871 n
= (Node
*) n
[1].next
;
4873 case OPCODE_END_OF_LIST
:
4879 _mesa_sprintf( ctx
, msg
, "Error in execute_list: opcode=%d", (int) opcode
);
4880 _mesa_problem( ctx
, msg
);
4885 /* increment n to point to next compiled command */
4886 if (opcode
!=OPCODE_CONTINUE
) {
4887 n
+= InstSize
[opcode
];
4893 if (ctx
->Driver
.EndCallList
)
4894 ctx
->Driver
.EndCallList( ctx
);
4901 /**********************************************************************/
4903 /**********************************************************************/
4909 * Test if a display list number is valid.
4912 _mesa_IsList( GLuint list
)
4914 GET_CURRENT_CONTEXT(ctx
);
4915 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
4916 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
4917 return islist(ctx
, list
);
4922 * Delete a sequence of consecutive display lists.
4925 _mesa_DeleteLists( GLuint list
, GLsizei range
)
4927 GET_CURRENT_CONTEXT(ctx
);
4929 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
4930 ASSERT_OUTSIDE_BEGIN_END(ctx
);
4933 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
4936 for (i
=list
;i
<list
+range
;i
++) {
4937 _mesa_destroy_list( ctx
, i
);
4944 * Return a display list number, n, such that lists n through n+range-1
4948 _mesa_GenLists(GLsizei range
)
4950 GET_CURRENT_CONTEXT(ctx
);
4952 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
4953 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
4956 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
4964 * Make this an atomic operation
4966 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
4968 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
4970 /* reserve the list IDs by with empty/dummy lists */
4972 for (i
=0; i
<range
; i
++) {
4973 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
4977 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
4985 * Begin a new display list.
4988 _mesa_NewList( GLuint list
, GLenum mode
)
4990 GET_CURRENT_CONTEXT(ctx
);
4991 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
4992 ASSERT_OUTSIDE_BEGIN_END(ctx
);
4994 if (MESA_VERBOSE
&VERBOSE_API
)
4995 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
4996 _mesa_lookup_enum_by_nr(mode
));
4999 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
5003 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
5004 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
5008 if (ctx
->CurrentListPtr
) {
5009 /* already compiling a display list */
5010 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
5014 /* Allocate new display list */
5015 ctx
->CurrentListNum
= list
;
5016 ctx
->CurrentBlock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
5017 ctx
->CurrentListPtr
= ctx
->CurrentBlock
;
5018 ctx
->CurrentPos
= 0;
5019 ctx
->CompileFlag
= GL_TRUE
;
5020 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
5022 ctx
->Driver
.NewList( ctx
, list
, mode
);
5024 ctx
->CurrentDispatch
= ctx
->Save
;
5025 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5031 * End definition of current display list. Is the current
5032 * ASSERT_OUTSIDE_BEGIN_END strong enough to really guarentee that
5033 * we are outside begin/end calls?
5036 _mesa_EndList( void )
5038 GET_CURRENT_CONTEXT(ctx
);
5039 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
5040 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
5042 if (MESA_VERBOSE
&VERBOSE_API
)
5043 _mesa_debug(ctx
, "glEndList\n");
5045 /* Check that a list is under construction */
5046 if (!ctx
->CurrentListPtr
) {
5047 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
5051 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
5053 /* Destroy old list, if any */
5054 _mesa_destroy_list(ctx
, ctx
->CurrentListNum
);
5055 /* Install the list */
5056 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->CurrentListNum
, ctx
->CurrentListPtr
);
5059 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
5060 mesa_print_display_list(ctx
->CurrentListNum
);
5062 ctx
->CurrentListNum
= 0;
5063 ctx
->CurrentListPtr
= NULL
;
5064 ctx
->ExecuteFlag
= GL_TRUE
;
5065 ctx
->CompileFlag
= GL_FALSE
;
5067 ctx
->Driver
.EndList( ctx
);
5069 ctx
->CurrentDispatch
= ctx
->Exec
;
5070 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5076 _mesa_CallList( GLuint list
)
5078 GLboolean save_compile_flag
;
5079 GET_CURRENT_CONTEXT(ctx
);
5080 FLUSH_CURRENT(ctx
, 0);
5081 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
5082 /* execute the display list, and restore the CompileFlag. */
5085 if (MESA_VERBOSE
& VERBOSE_API
)
5086 _mesa_debug(ctx
, "_mesa_CallList %d\n", list
);
5088 /* mesa_print_display_list( list ); */
5090 save_compile_flag
= ctx
->CompileFlag
;
5091 if (save_compile_flag
) {
5092 ctx
->CompileFlag
= GL_FALSE
;
5095 execute_list( ctx
, list
);
5096 ctx
->CompileFlag
= save_compile_flag
;
5098 /* also restore API function pointers to point to "save" versions */
5099 if (save_compile_flag
) {
5100 ctx
->CurrentDispatch
= ctx
->Save
;
5101 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5108 * Execute glCallLists: call multiple display lists.
5111 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
5113 GET_CURRENT_CONTEXT(ctx
);
5116 GLboolean save_compile_flag
;
5118 if (MESA_VERBOSE
& VERBOSE_API
)
5119 _mesa_debug(ctx
, "_mesa_CallLists %d\n", n
);
5123 case GL_UNSIGNED_BYTE
:
5125 case GL_UNSIGNED_SHORT
:
5127 case GL_UNSIGNED_INT
:
5135 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5139 /* Save the CompileFlag status, turn it off, execute display list,
5140 * and restore the CompileFlag.
5142 save_compile_flag
= ctx
->CompileFlag
;
5143 ctx
->CompileFlag
= GL_FALSE
;
5146 list
= translate_id( i
, type
, lists
);
5147 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
5150 ctx
->CompileFlag
= save_compile_flag
;
5152 /* also restore API function pointers to point to "save" versions */
5153 if (save_compile_flag
) {
5154 ctx
->CurrentDispatch
= ctx
->Save
;
5155 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5162 * Set the offset added to list numbers in glCallLists.
5165 _mesa_ListBase( GLuint base
)
5167 GET_CURRENT_CONTEXT(ctx
);
5168 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
5169 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5170 ctx
->List
.ListBase
= base
;
5174 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
5176 static void exec_Finish( void )
5178 GET_CURRENT_CONTEXT(ctx
);
5179 FLUSH_VERTICES(ctx
, 0);
5180 ctx
->Exec
->Finish();
5183 static void exec_Flush( void )
5185 GET_CURRENT_CONTEXT(ctx
);
5186 FLUSH_VERTICES(ctx
, 0);
5187 ctx
->Exec
->Flush( );
5190 static void exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
5192 GET_CURRENT_CONTEXT(ctx
);
5193 FLUSH_VERTICES(ctx
, 0);
5194 ctx
->Exec
->GetBooleanv( pname
, params
);
5197 static void exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
5199 GET_CURRENT_CONTEXT(ctx
);
5200 FLUSH_VERTICES(ctx
, 0);
5201 ctx
->Exec
->GetClipPlane( plane
, equation
);
5204 static void exec_GetDoublev( GLenum pname
, GLdouble
*params
)
5206 GET_CURRENT_CONTEXT(ctx
);
5207 FLUSH_VERTICES(ctx
, 0);
5208 ctx
->Exec
->GetDoublev( pname
, params
);
5211 static GLenum
exec_GetError( void )
5213 GET_CURRENT_CONTEXT(ctx
);
5214 FLUSH_VERTICES(ctx
, 0);
5215 return ctx
->Exec
->GetError( );
5218 static void exec_GetFloatv( GLenum pname
, GLfloat
*params
)
5220 GET_CURRENT_CONTEXT(ctx
);
5221 FLUSH_VERTICES(ctx
, 0);
5222 ctx
->Exec
->GetFloatv( pname
, params
);
5225 static void exec_GetIntegerv( GLenum pname
, GLint
*params
)
5227 GET_CURRENT_CONTEXT(ctx
);
5228 FLUSH_VERTICES(ctx
, 0);
5229 ctx
->Exec
->GetIntegerv( pname
, params
);
5232 static void exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
5234 GET_CURRENT_CONTEXT(ctx
);
5235 FLUSH_VERTICES(ctx
, 0);
5236 ctx
->Exec
->GetLightfv( light
, pname
, params
);
5239 static void exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
5241 GET_CURRENT_CONTEXT(ctx
);
5242 FLUSH_VERTICES(ctx
, 0);
5243 ctx
->Exec
->GetLightiv( light
, pname
, params
);
5246 static void exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
5248 GET_CURRENT_CONTEXT(ctx
);
5249 FLUSH_VERTICES(ctx
, 0);
5250 ctx
->Exec
->GetMapdv( target
, query
, v
);
5253 static void exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
5255 GET_CURRENT_CONTEXT(ctx
);
5256 FLUSH_VERTICES(ctx
, 0);
5257 ctx
->Exec
->GetMapfv( target
, query
, v
);
5260 static void exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
5262 GET_CURRENT_CONTEXT(ctx
);
5263 FLUSH_VERTICES(ctx
, 0);
5264 ctx
->Exec
->GetMapiv( target
, query
, v
);
5267 static void exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
5269 GET_CURRENT_CONTEXT(ctx
);
5270 FLUSH_VERTICES(ctx
, 0);
5271 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
5274 static void exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
5276 GET_CURRENT_CONTEXT(ctx
);
5277 FLUSH_VERTICES(ctx
, 0);
5278 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
5281 static void exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
5283 GET_CURRENT_CONTEXT(ctx
);
5284 FLUSH_VERTICES(ctx
, 0);
5285 ctx
->Exec
->GetPixelMapfv( map
, values
);
5288 static void exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
5290 GET_CURRENT_CONTEXT(ctx
);
5291 FLUSH_VERTICES(ctx
, 0);
5292 ctx
->Exec
->GetPixelMapuiv( map
, values
);
5295 static void exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
5297 GET_CURRENT_CONTEXT(ctx
);
5298 FLUSH_VERTICES(ctx
, 0);
5299 ctx
->Exec
->GetPixelMapusv( map
, values
);
5302 static void exec_GetPolygonStipple( GLubyte
*dest
)
5304 GET_CURRENT_CONTEXT(ctx
);
5305 FLUSH_VERTICES(ctx
, 0);
5306 ctx
->Exec
->GetPolygonStipple( dest
);
5309 static const GLubyte
*exec_GetString( GLenum name
)
5311 GET_CURRENT_CONTEXT(ctx
);
5312 FLUSH_VERTICES(ctx
, 0);
5313 return ctx
->Exec
->GetString( name
);
5316 static void exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
5318 GET_CURRENT_CONTEXT(ctx
);
5319 FLUSH_VERTICES(ctx
, 0);
5320 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
5323 static void exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
5325 GET_CURRENT_CONTEXT(ctx
);
5326 FLUSH_VERTICES(ctx
, 0);
5327 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
5330 static void exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
5332 GET_CURRENT_CONTEXT(ctx
);
5333 FLUSH_VERTICES(ctx
, 0);
5334 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
5337 static void exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
5339 GET_CURRENT_CONTEXT(ctx
);
5340 FLUSH_VERTICES(ctx
, 0);
5341 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
5344 static void exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
5346 GET_CURRENT_CONTEXT(ctx
);
5347 FLUSH_VERTICES(ctx
, 0);
5348 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
5351 static void exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
5352 GLenum type
, GLvoid
*pixels
)
5354 GET_CURRENT_CONTEXT(ctx
);
5355 FLUSH_VERTICES(ctx
, 0);
5356 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
5359 static void exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
5360 GLenum pname
, GLfloat
*params
)
5362 GET_CURRENT_CONTEXT(ctx
);
5363 FLUSH_VERTICES(ctx
, 0);
5364 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
5367 static void exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
5368 GLenum pname
, GLint
*params
)
5370 GET_CURRENT_CONTEXT(ctx
);
5371 FLUSH_VERTICES(ctx
, 0);
5372 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
5375 static void exec_GetTexParameterfv( GLenum target
, GLenum pname
,
5378 GET_CURRENT_CONTEXT(ctx
);
5379 FLUSH_VERTICES(ctx
, 0);
5380 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
5383 static void exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
5385 GET_CURRENT_CONTEXT(ctx
);
5386 FLUSH_VERTICES(ctx
, 0);
5387 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
5390 static GLboolean
exec_IsEnabled( GLenum cap
)
5392 GET_CURRENT_CONTEXT(ctx
);
5393 FLUSH_VERTICES(ctx
, 0);
5394 return ctx
->Exec
->IsEnabled( cap
);
5397 static void exec_PixelStoref( GLenum pname
, GLfloat param
)
5399 GET_CURRENT_CONTEXT(ctx
);
5400 FLUSH_VERTICES(ctx
, 0);
5401 ctx
->Exec
->PixelStoref( pname
, param
);
5404 static void exec_PixelStorei( GLenum pname
, GLint param
)
5406 GET_CURRENT_CONTEXT(ctx
);
5407 FLUSH_VERTICES(ctx
, 0);
5408 ctx
->Exec
->PixelStorei( pname
, param
);
5411 static void exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
5412 GLenum format
, GLenum type
, GLvoid
*pixels
)
5414 GET_CURRENT_CONTEXT(ctx
);
5415 FLUSH_VERTICES(ctx
, 0);
5416 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
5419 static GLint
exec_RenderMode( GLenum mode
)
5421 GET_CURRENT_CONTEXT(ctx
);
5422 FLUSH_VERTICES(ctx
, 0);
5423 return ctx
->Exec
->RenderMode( mode
);
5426 static void exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
5428 GET_CURRENT_CONTEXT(ctx
);
5429 FLUSH_VERTICES(ctx
, 0);
5430 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
5433 static void exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
5435 GET_CURRENT_CONTEXT(ctx
);
5436 FLUSH_VERTICES(ctx
, 0);
5437 ctx
->Exec
->SelectBuffer( size
, buffer
);
5440 static GLboolean
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
5441 GLboolean
*residences
)
5443 GET_CURRENT_CONTEXT(ctx
);
5444 FLUSH_VERTICES(ctx
, 0);
5445 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
5448 static void exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
5451 GET_CURRENT_CONTEXT(ctx
);
5452 FLUSH_VERTICES(ctx
, 0);
5453 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
5456 static void exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
5458 GET_CURRENT_CONTEXT(ctx
);
5459 FLUSH_VERTICES(ctx
, 0);
5460 ctx
->Exec
->DeleteTextures( n
, texName
);
5463 static void exec_DisableClientState( GLenum cap
)
5465 GET_CURRENT_CONTEXT(ctx
);
5466 FLUSH_VERTICES(ctx
, 0);
5467 ctx
->Exec
->DisableClientState( cap
);
5470 static void exec_EdgeFlagPointer(GLsizei stride
, const void *vptr
)
5472 GET_CURRENT_CONTEXT(ctx
);
5473 FLUSH_VERTICES(ctx
, 0);
5474 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
5477 static void exec_EnableClientState( GLenum cap
)
5479 GET_CURRENT_CONTEXT(ctx
);
5480 FLUSH_VERTICES(ctx
, 0);
5481 ctx
->Exec
->EnableClientState( cap
);
5484 static void exec_GenTextures( GLsizei n
, GLuint
*texName
)
5486 GET_CURRENT_CONTEXT(ctx
);
5487 FLUSH_VERTICES(ctx
, 0);
5488 ctx
->Exec
->GenTextures( n
, texName
);
5491 static void exec_GetPointerv( GLenum pname
, GLvoid
**params
)
5493 GET_CURRENT_CONTEXT(ctx
);
5494 FLUSH_VERTICES(ctx
, 0);
5495 ctx
->Exec
->GetPointerv( pname
, params
);
5498 static void exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
5500 GET_CURRENT_CONTEXT(ctx
);
5501 FLUSH_VERTICES(ctx
, 0);
5502 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
5505 static void exec_InterleavedArrays(GLenum format
, GLsizei stride
,
5506 const GLvoid
*pointer
)
5508 GET_CURRENT_CONTEXT(ctx
);
5509 FLUSH_VERTICES(ctx
, 0);
5510 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
5513 static GLboolean
exec_IsTexture( GLuint texture
)
5515 GET_CURRENT_CONTEXT(ctx
);
5516 FLUSH_VERTICES(ctx
, 0);
5517 return ctx
->Exec
->IsTexture( texture
);
5520 static void exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
5522 GET_CURRENT_CONTEXT(ctx
);
5523 FLUSH_VERTICES(ctx
, 0);
5524 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
5527 static void exec_PopClientAttrib(void)
5529 GET_CURRENT_CONTEXT(ctx
);
5530 FLUSH_VERTICES(ctx
, 0);
5531 ctx
->Exec
->PopClientAttrib();
5534 static void exec_PushClientAttrib(GLbitfield mask
)
5536 GET_CURRENT_CONTEXT(ctx
);
5537 FLUSH_VERTICES(ctx
, 0);
5538 ctx
->Exec
->PushClientAttrib( mask
);
5541 static void exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
5544 GET_CURRENT_CONTEXT(ctx
);
5545 FLUSH_VERTICES(ctx
, 0);
5546 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
5549 static void exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
5552 GET_CURRENT_CONTEXT(ctx
);
5553 FLUSH_VERTICES(ctx
, 0);
5554 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
5557 static void exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
5560 GET_CURRENT_CONTEXT(ctx
);
5561 FLUSH_VERTICES(ctx
, 0);
5562 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
5565 static void exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
5566 GLint x
, GLint y
, GLsizei width
)
5568 GET_CURRENT_CONTEXT(ctx
);
5569 FLUSH_VERTICES(ctx
, 0);
5570 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
5573 static void exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
5574 GLint x
, GLint y
, GLsizei width
,
5577 GET_CURRENT_CONTEXT(ctx
);
5578 FLUSH_VERTICES(ctx
, 0);
5579 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
5583 static void exec_GetColorTable( GLenum target
, GLenum format
,
5584 GLenum type
, GLvoid
*data
)
5586 GET_CURRENT_CONTEXT(ctx
);
5587 FLUSH_VERTICES(ctx
, 0);
5588 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
5591 static void exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
5594 GET_CURRENT_CONTEXT(ctx
);
5595 FLUSH_VERTICES(ctx
, 0);
5596 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
5599 static void exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
5602 GET_CURRENT_CONTEXT(ctx
);
5603 FLUSH_VERTICES(ctx
, 0);
5604 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
5607 static void exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
5610 GET_CURRENT_CONTEXT(ctx
);
5611 FLUSH_VERTICES(ctx
, 0);
5612 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
5615 static void exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
5618 GET_CURRENT_CONTEXT(ctx
);
5619 FLUSH_VERTICES(ctx
, 0);
5620 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
5623 static void exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
5626 GET_CURRENT_CONTEXT(ctx
);
5627 FLUSH_VERTICES(ctx
, 0);
5628 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
5631 static void exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
5632 GLenum type
, GLvoid
*values
)
5634 GET_CURRENT_CONTEXT(ctx
);
5635 FLUSH_VERTICES(ctx
, 0);
5636 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
5639 static void exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
5642 GET_CURRENT_CONTEXT(ctx
);
5643 FLUSH_VERTICES(ctx
, 0);
5644 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
5647 static void exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
5650 GET_CURRENT_CONTEXT(ctx
);
5651 FLUSH_VERTICES(ctx
, 0);
5652 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
5655 static void exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
5656 GLenum type
, GLvoid
*values
)
5658 GET_CURRENT_CONTEXT(ctx
);
5659 FLUSH_VERTICES(ctx
, 0);
5660 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
5663 static void exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
5666 GET_CURRENT_CONTEXT(ctx
);
5667 FLUSH_VERTICES(ctx
, 0);
5668 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
5671 static void exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
5674 GET_CURRENT_CONTEXT(ctx
);
5675 FLUSH_VERTICES(ctx
, 0);
5676 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
5679 static void exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
5680 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
5682 GET_CURRENT_CONTEXT(ctx
);
5683 FLUSH_VERTICES(ctx
, 0);
5684 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
5687 static void exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
5688 GLsizei width
, GLsizei height
, GLenum format
,
5689 GLenum type
, const GLvoid
*row
,
5690 const GLvoid
*column
)
5692 GET_CURRENT_CONTEXT(ctx
);
5693 FLUSH_VERTICES(ctx
, 0);
5694 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
5698 static void exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
5700 GET_CURRENT_CONTEXT(ctx
);
5701 FLUSH_VERTICES(ctx
, 0);
5702 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
5705 static void exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
5707 GET_CURRENT_CONTEXT(ctx
);
5708 FLUSH_VERTICES(ctx
, 0);
5709 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
5712 static void exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
5713 GLsizei count
, const GLvoid
*ptr
)
5715 GET_CURRENT_CONTEXT(ctx
);
5716 FLUSH_VERTICES(ctx
, 0);
5717 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
5720 static void exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
5721 const GLboolean
*ptr
)
5723 GET_CURRENT_CONTEXT(ctx
);
5724 FLUSH_VERTICES(ctx
, 0);
5725 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
5728 static void exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
5731 GET_CURRENT_CONTEXT(ctx
);
5732 FLUSH_VERTICES(ctx
, 0);
5733 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
5736 static void exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
5739 GET_CURRENT_CONTEXT(ctx
);
5740 FLUSH_VERTICES(ctx
, 0);
5741 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
5744 static void exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
5745 GLsizei count
, const GLvoid
*ptr
)
5747 GET_CURRENT_CONTEXT(ctx
);
5748 FLUSH_VERTICES(ctx
, 0);
5749 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
5752 static void exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
5753 GLsizei count
, const GLvoid
*ptr
)
5755 GET_CURRENT_CONTEXT(ctx
);
5756 FLUSH_VERTICES(ctx
, 0);
5757 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
5760 static void exec_LockArraysEXT(GLint first
, GLsizei count
)
5762 GET_CURRENT_CONTEXT(ctx
);
5763 FLUSH_VERTICES(ctx
, 0);
5764 ctx
->Exec
->LockArraysEXT( first
, count
);
5767 static void exec_UnlockArraysEXT( void )
5769 GET_CURRENT_CONTEXT(ctx
);
5770 FLUSH_VERTICES(ctx
, 0);
5771 ctx
->Exec
->UnlockArraysEXT( );
5774 static void exec_ResizeBuffersMESA( void )
5776 GET_CURRENT_CONTEXT(ctx
);
5777 FLUSH_VERTICES(ctx
, 0);
5778 ctx
->Exec
->ResizeBuffersMESA( );
5782 static void exec_ClientActiveTextureARB( GLenum target
)
5784 GET_CURRENT_CONTEXT(ctx
);
5785 FLUSH_VERTICES(ctx
, 0);
5786 ctx
->Exec
->ClientActiveTextureARB(target
);
5789 static void exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
5790 GLsizei stride
, const GLvoid
*ptr
)
5792 GET_CURRENT_CONTEXT(ctx
);
5793 FLUSH_VERTICES(ctx
, 0);
5794 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
5797 static void exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
5800 GET_CURRENT_CONTEXT(ctx
);
5801 FLUSH_VERTICES(ctx
, 0);
5802 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
5805 /* GL_EXT_multi_draw_arrays */
5806 static void exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
5807 GLsizei
*count
, GLsizei primcount
)
5809 GET_CURRENT_CONTEXT(ctx
);
5810 FLUSH_VERTICES(ctx
, 0);
5811 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
5814 /* GL_EXT_multi_draw_arrays */
5815 static void exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
5816 GLenum type
, const GLvoid
**indices
,
5819 GET_CURRENT_CONTEXT(ctx
);
5820 FLUSH_VERTICES(ctx
, 0);
5821 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
5827 * Assign all the pointers in <table> to point to Mesa's display list
5828 * building functions.
5830 * This does not include any of the tnl functions - they are
5831 * initialized from _mesa_init_api_defaults and from the active vtxfmt
5835 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
5837 _mesa_init_no_op_table(table
, tableSize
);
5839 _mesa_loopback_init_api_table( table
, GL_TRUE
);
5842 table
->Accum
= save_Accum
;
5843 table
->AlphaFunc
= save_AlphaFunc
;
5844 table
->Bitmap
= save_Bitmap
;
5845 table
->BlendFunc
= save_BlendFunc
;
5846 table
->CallList
= _mesa_save_CallList
;
5847 table
->CallLists
= _mesa_save_CallLists
;
5848 table
->Clear
= save_Clear
;
5849 table
->ClearAccum
= save_ClearAccum
;
5850 table
->ClearColor
= save_ClearColor
;
5851 table
->ClearDepth
= save_ClearDepth
;
5852 table
->ClearIndex
= save_ClearIndex
;
5853 table
->ClearStencil
= save_ClearStencil
;
5854 table
->ClipPlane
= save_ClipPlane
;
5855 table
->ColorMask
= save_ColorMask
;
5856 table
->ColorMaterial
= save_ColorMaterial
;
5857 table
->CopyPixels
= save_CopyPixels
;
5858 table
->CullFace
= save_CullFace
;
5859 table
->DeleteLists
= _mesa_DeleteLists
;
5860 table
->DepthFunc
= save_DepthFunc
;
5861 table
->DepthMask
= save_DepthMask
;
5862 table
->DepthRange
= save_DepthRange
;
5863 table
->Disable
= save_Disable
;
5864 table
->DrawBuffer
= save_DrawBuffer
;
5865 table
->DrawPixels
= save_DrawPixels
;
5866 table
->Enable
= save_Enable
;
5867 table
->EndList
= _mesa_EndList
;
5868 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
5869 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
5870 table
->Finish
= exec_Finish
;
5871 table
->Flush
= exec_Flush
;
5872 table
->Fogf
= save_Fogf
;
5873 table
->Fogfv
= save_Fogfv
;
5874 table
->Fogi
= save_Fogi
;
5875 table
->Fogiv
= save_Fogiv
;
5876 table
->FrontFace
= save_FrontFace
;
5877 table
->Frustum
= save_Frustum
;
5878 table
->GenLists
= _mesa_GenLists
;
5879 table
->GetBooleanv
= exec_GetBooleanv
;
5880 table
->GetClipPlane
= exec_GetClipPlane
;
5881 table
->GetDoublev
= exec_GetDoublev
;
5882 table
->GetError
= exec_GetError
;
5883 table
->GetFloatv
= exec_GetFloatv
;
5884 table
->GetIntegerv
= exec_GetIntegerv
;
5885 table
->GetLightfv
= exec_GetLightfv
;
5886 table
->GetLightiv
= exec_GetLightiv
;
5887 table
->GetMapdv
= exec_GetMapdv
;
5888 table
->GetMapfv
= exec_GetMapfv
;
5889 table
->GetMapiv
= exec_GetMapiv
;
5890 table
->GetMaterialfv
= exec_GetMaterialfv
;
5891 table
->GetMaterialiv
= exec_GetMaterialiv
;
5892 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
5893 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
5894 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
5895 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
5896 table
->GetString
= exec_GetString
;
5897 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
5898 table
->GetTexEnviv
= exec_GetTexEnviv
;
5899 table
->GetTexGendv
= exec_GetTexGendv
;
5900 table
->GetTexGenfv
= exec_GetTexGenfv
;
5901 table
->GetTexGeniv
= exec_GetTexGeniv
;
5902 table
->GetTexImage
= exec_GetTexImage
;
5903 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
5904 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
5905 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
5906 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
5907 table
->Hint
= save_Hint
;
5908 table
->IndexMask
= save_IndexMask
;
5909 table
->InitNames
= save_InitNames
;
5910 table
->IsEnabled
= exec_IsEnabled
;
5911 table
->IsList
= _mesa_IsList
;
5912 table
->LightModelf
= save_LightModelf
;
5913 table
->LightModelfv
= save_LightModelfv
;
5914 table
->LightModeli
= save_LightModeli
;
5915 table
->LightModeliv
= save_LightModeliv
;
5916 table
->Lightf
= save_Lightf
;
5917 table
->Lightfv
= save_Lightfv
;
5918 table
->Lighti
= save_Lighti
;
5919 table
->Lightiv
= save_Lightiv
;
5920 table
->LineStipple
= save_LineStipple
;
5921 table
->LineWidth
= save_LineWidth
;
5922 table
->ListBase
= save_ListBase
;
5923 table
->LoadIdentity
= save_LoadIdentity
;
5924 table
->LoadMatrixd
= save_LoadMatrixd
;
5925 table
->LoadMatrixf
= save_LoadMatrixf
;
5926 table
->LoadName
= save_LoadName
;
5927 table
->LogicOp
= save_LogicOp
;
5928 table
->Map1d
= save_Map1d
;
5929 table
->Map1f
= save_Map1f
;
5930 table
->Map2d
= save_Map2d
;
5931 table
->Map2f
= save_Map2f
;
5932 table
->MapGrid1d
= save_MapGrid1d
;
5933 table
->MapGrid1f
= save_MapGrid1f
;
5934 table
->MapGrid2d
= save_MapGrid2d
;
5935 table
->MapGrid2f
= save_MapGrid2f
;
5936 table
->MatrixMode
= save_MatrixMode
;
5937 table
->MultMatrixd
= save_MultMatrixd
;
5938 table
->MultMatrixf
= save_MultMatrixf
;
5939 table
->NewList
= save_NewList
;
5940 table
->Ortho
= save_Ortho
;
5941 table
->PassThrough
= save_PassThrough
;
5942 table
->PixelMapfv
= save_PixelMapfv
;
5943 table
->PixelMapuiv
= save_PixelMapuiv
;
5944 table
->PixelMapusv
= save_PixelMapusv
;
5945 table
->PixelStoref
= exec_PixelStoref
;
5946 table
->PixelStorei
= exec_PixelStorei
;
5947 table
->PixelTransferf
= save_PixelTransferf
;
5948 table
->PixelTransferi
= save_PixelTransferi
;
5949 table
->PixelZoom
= save_PixelZoom
;
5950 table
->PointSize
= save_PointSize
;
5951 table
->PolygonMode
= save_PolygonMode
;
5952 table
->PolygonOffset
= save_PolygonOffset
;
5953 table
->PolygonStipple
= save_PolygonStipple
;
5954 table
->PopAttrib
= save_PopAttrib
;
5955 table
->PopMatrix
= save_PopMatrix
;
5956 table
->PopName
= save_PopName
;
5957 table
->PushAttrib
= save_PushAttrib
;
5958 table
->PushMatrix
= save_PushMatrix
;
5959 table
->PushName
= save_PushName
;
5960 table
->RasterPos2d
= save_RasterPos2d
;
5961 table
->RasterPos2dv
= save_RasterPos2dv
;
5962 table
->RasterPos2f
= save_RasterPos2f
;
5963 table
->RasterPos2fv
= save_RasterPos2fv
;
5964 table
->RasterPos2i
= save_RasterPos2i
;
5965 table
->RasterPos2iv
= save_RasterPos2iv
;
5966 table
->RasterPos2s
= save_RasterPos2s
;
5967 table
->RasterPos2sv
= save_RasterPos2sv
;
5968 table
->RasterPos3d
= save_RasterPos3d
;
5969 table
->RasterPos3dv
= save_RasterPos3dv
;
5970 table
->RasterPos3f
= save_RasterPos3f
;
5971 table
->RasterPos3fv
= save_RasterPos3fv
;
5972 table
->RasterPos3i
= save_RasterPos3i
;
5973 table
->RasterPos3iv
= save_RasterPos3iv
;
5974 table
->RasterPos3s
= save_RasterPos3s
;
5975 table
->RasterPos3sv
= save_RasterPos3sv
;
5976 table
->RasterPos4d
= save_RasterPos4d
;
5977 table
->RasterPos4dv
= save_RasterPos4dv
;
5978 table
->RasterPos4f
= save_RasterPos4f
;
5979 table
->RasterPos4fv
= save_RasterPos4fv
;
5980 table
->RasterPos4i
= save_RasterPos4i
;
5981 table
->RasterPos4iv
= save_RasterPos4iv
;
5982 table
->RasterPos4s
= save_RasterPos4s
;
5983 table
->RasterPos4sv
= save_RasterPos4sv
;
5984 table
->ReadBuffer
= save_ReadBuffer
;
5985 table
->ReadPixels
= exec_ReadPixels
;
5986 table
->RenderMode
= exec_RenderMode
;
5987 table
->Rotated
= save_Rotated
;
5988 table
->Rotatef
= save_Rotatef
;
5989 table
->Scaled
= save_Scaled
;
5990 table
->Scalef
= save_Scalef
;
5991 table
->Scissor
= save_Scissor
;
5992 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
5993 table
->SelectBuffer
= exec_SelectBuffer
;
5994 table
->ShadeModel
= save_ShadeModel
;
5995 table
->StencilFunc
= save_StencilFunc
;
5996 table
->StencilMask
= save_StencilMask
;
5997 table
->StencilOp
= save_StencilOp
;
5998 table
->TexEnvf
= save_TexEnvf
;
5999 table
->TexEnvfv
= save_TexEnvfv
;
6000 table
->TexEnvi
= save_TexEnvi
;
6001 table
->TexEnviv
= save_TexEnviv
;
6002 table
->TexGend
= save_TexGend
;
6003 table
->TexGendv
= save_TexGendv
;
6004 table
->TexGenf
= save_TexGenf
;
6005 table
->TexGenfv
= save_TexGenfv
;
6006 table
->TexGeni
= save_TexGeni
;
6007 table
->TexGeniv
= save_TexGeniv
;
6008 table
->TexImage1D
= save_TexImage1D
;
6009 table
->TexImage2D
= save_TexImage2D
;
6010 table
->TexParameterf
= save_TexParameterf
;
6011 table
->TexParameterfv
= save_TexParameterfv
;
6012 table
->TexParameteri
= save_TexParameteri
;
6013 table
->TexParameteriv
= save_TexParameteriv
;
6014 table
->Translated
= save_Translated
;
6015 table
->Translatef
= save_Translatef
;
6016 table
->Viewport
= save_Viewport
;
6019 table
->AreTexturesResident
= exec_AreTexturesResident
;
6020 table
->BindTexture
= save_BindTexture
;
6021 table
->ColorPointer
= exec_ColorPointer
;
6022 table
->CopyTexImage1D
= save_CopyTexImage1D
;
6023 table
->CopyTexImage2D
= save_CopyTexImage2D
;
6024 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
6025 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
6026 table
->DeleteTextures
= exec_DeleteTextures
;
6027 table
->DisableClientState
= exec_DisableClientState
;
6028 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
6029 table
->EnableClientState
= exec_EnableClientState
;
6030 table
->GenTextures
= exec_GenTextures
;
6031 table
->GetPointerv
= exec_GetPointerv
;
6032 table
->IndexPointer
= exec_IndexPointer
;
6033 table
->InterleavedArrays
= exec_InterleavedArrays
;
6034 table
->IsTexture
= exec_IsTexture
;
6035 table
->NormalPointer
= exec_NormalPointer
;
6036 table
->PopClientAttrib
= exec_PopClientAttrib
;
6037 table
->PrioritizeTextures
= save_PrioritizeTextures
;
6038 table
->PushClientAttrib
= exec_PushClientAttrib
;
6039 table
->TexCoordPointer
= exec_TexCoordPointer
;
6040 table
->TexSubImage1D
= save_TexSubImage1D
;
6041 table
->TexSubImage2D
= save_TexSubImage2D
;
6042 table
->VertexPointer
= exec_VertexPointer
;
6045 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
6046 table
->TexImage3D
= save_TexImage3D
;
6047 table
->TexSubImage3D
= save_TexSubImage3D
;
6049 /* GL_ARB_imaging */
6050 /* Not all are supported */
6051 table
->BlendColor
= save_BlendColor
;
6052 table
->BlendEquation
= save_BlendEquation
;
6053 table
->ColorSubTable
= save_ColorSubTable
;
6054 table
->ColorTable
= save_ColorTable
;
6055 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
6056 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
6057 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
6058 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
6059 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
6060 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
6061 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
6062 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
6063 table
->CopyColorSubTable
= save_CopyColorSubTable
;
6064 table
->CopyColorTable
= save_CopyColorTable
;
6065 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
6066 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
6067 table
->GetColorTable
= exec_GetColorTable
;
6068 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
6069 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
6070 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
6071 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
6072 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
6073 table
->GetHistogram
= exec_GetHistogram
;
6074 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
6075 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
6076 table
->GetMinmax
= exec_GetMinmax
;
6077 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
6078 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
6079 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
6080 table
->Histogram
= save_Histogram
;
6081 table
->Minmax
= save_Minmax
;
6082 table
->ResetHistogram
= save_ResetHistogram
;
6083 table
->ResetMinmax
= save_ResetMinmax
;
6084 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
6086 /* 2. GL_EXT_blend_color */
6088 table
->BlendColorEXT
= save_BlendColorEXT
;
6091 /* 3. GL_EXT_polygon_offset */
6092 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
6094 /* 6. GL_EXT_texture3d */
6096 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
6097 table
->TexImage3DEXT
= save_TexImage3DEXT
;
6098 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
6101 /* 15. GL_SGIX_pixel_texture */
6102 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
6104 /* 15. GL_SGIS_pixel_texture */
6105 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
6106 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
6107 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
6108 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
6109 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
6110 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
6112 /* 30. GL_EXT_vertex_array */
6113 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
6114 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
6115 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
6116 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
6117 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
6118 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
6120 /* 37. GL_EXT_blend_minmax */
6122 table
->BlendEquationEXT
= save_BlendEquationEXT
;
6125 /* 54. GL_EXT_point_parameters */
6126 table
->PointParameterfEXT
= save_PointParameterfEXT
;
6127 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
6129 /* 78. GL_EXT_paletted_texture */
6131 table
->ColorTableEXT
= save_ColorTable
;
6132 table
->ColorSubTableEXT
= save_ColorSubTable
;
6134 table
->GetColorTableEXT
= exec_GetColorTable
;
6135 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
6136 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
6138 /* 97. GL_EXT_compiled_vertex_array */
6139 table
->LockArraysEXT
= exec_LockArraysEXT
;
6140 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
6142 /* 145. GL_EXT_secondary_color */
6143 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
6145 /* 148. GL_EXT_multi_draw_arrays */
6146 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
6147 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
6149 /* 149. GL_EXT_fog_coord */
6150 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
6152 /* 173. GL_EXT_blend_func_separate */
6153 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
6155 /* 196. GL_MESA_resize_buffers */
6156 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
6158 /* 197. GL_MESA_window_pos */
6159 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
6160 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
6161 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
6162 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
6163 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
6164 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
6165 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
6166 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
6167 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
6168 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
6169 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
6170 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
6171 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
6172 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
6173 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
6174 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
6175 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
6176 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
6177 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
6178 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
6179 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
6180 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
6181 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
6182 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
6184 /* 233. GL_NV_vertex_program */
6185 /* The following commands DO NOT go into display lists:
6186 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
6187 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
6189 table
->BindProgramNV
= save_BindProgramNV
;
6190 table
->DeleteProgramsNV
= _mesa_DeleteProgramsNV
;
6191 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
6192 table
->GenProgramsNV
= _mesa_GenProgramsNV
;
6193 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
6194 table
->RequestResidentProgramsNV
= _mesa_RequestResidentProgramsNV
;
6195 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
6196 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
6197 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
6198 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
6199 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
6200 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
6201 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
6202 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
6203 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
6204 table
->IsProgramNV
= _mesa_IsProgramNV
;
6205 table
->LoadProgramNV
= _mesa_LoadProgramNV
;
6206 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
6207 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
6208 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
6209 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
6210 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
6211 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
6212 table
->TrackMatrixNV
= save_TrackMatrixNV
;
6213 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
6215 /* 262. GL_NV_point_sprite */
6216 table
->PointParameteriNV
= save_PointParameteriNV
;
6217 table
->PointParameterivNV
= save_PointParameterivNV
;
6219 /* 268. GL_EXT_stencil_two_side */
6220 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
6222 /* ARB 1. GL_ARB_multitexture */
6223 table
->ActiveTextureARB
= save_ActiveTextureARB
;
6224 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
6226 /* ARB 3. GL_ARB_transpose_matrix */
6227 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
6228 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
6229 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
6230 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
6232 /* ARB 5. GL_ARB_multisample */
6233 table
->SampleCoverageARB
= save_SampleCoverageARB
;
6235 /* ARB 12. GL_ARB_texture_compression */
6236 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
6237 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
6238 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
6239 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
6240 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
6241 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
6242 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
6244 /* ARB 14. GL_ARB_point_parameters */
6245 /* re-use EXT_point_parameters functions */
6247 /* ARB 25. GL_ARB_window_pos */
6248 /* re-use MESA_window_pos functions */
6256 static const char *enum_string( GLenum k
)
6258 return _mesa_lookup_enum_by_nr( k
);
6263 * Print the commands in a display list. For debugging only.
6264 * TODO: many commands aren't handled yet.
6266 static void print_list( GLcontext
*ctx
, GLuint list
)
6271 if (!glIsList(list
)) {
6272 _mesa_printf(ctx
, "%u is not a display list ID\n", list
);
6276 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
6278 _mesa_printf(ctx
, "START-LIST %u, address %p\n", list
, (void*)n
);
6280 done
= n
? GL_FALSE
: GL_TRUE
;
6282 OpCode opcode
= n
[0].opcode
;
6283 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
6285 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
6286 ctx
->listext
.opcode
[i
].print(ctx
, &n
[1]);
6287 n
+= ctx
->listext
.opcode
[i
].size
;
6292 _mesa_printf(ctx
, "accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
6295 _mesa_printf(ctx
, "Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
6296 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
6298 case OPCODE_CALL_LIST
:
6299 _mesa_printf(ctx
, "CallList %d\n", (int) n
[1].ui
);
6301 case OPCODE_CALL_LIST_OFFSET
:
6302 _mesa_printf(ctx
, "CallList %d + offset %u = %u\n", (int) n
[1].ui
,
6303 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
6305 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6306 _mesa_printf(ctx
, "ColorTableParameterfv %s %s %f %f %f %f\n",
6307 enum_string(n
[1].e
), enum_string(n
[2].e
),
6308 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6310 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6311 _mesa_printf(ctx
, "ColorTableParameteriv %s %s %d %d %d %d\n",
6312 enum_string(n
[1].e
), enum_string(n
[2].e
),
6313 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
6315 case OPCODE_DISABLE
:
6316 _mesa_printf(ctx
, "Disable %s\n", enum_string(n
[1].e
));
6319 _mesa_printf(ctx
, "Enable %s\n", enum_string(n
[1].e
));
6321 case OPCODE_FRUSTUM
:
6322 _mesa_printf(ctx
, "Frustum %g %g %g %g %g %g\n",
6323 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6325 case OPCODE_LINE_STIPPLE
:
6326 _mesa_printf(ctx
, "LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
6328 case OPCODE_LOAD_IDENTITY
:
6329 _mesa_printf(ctx
, "LoadIdentity\n");
6331 case OPCODE_LOAD_MATRIX
:
6332 _mesa_printf(ctx
, "LoadMatrix\n");
6333 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6334 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
6335 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6336 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
6337 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6338 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
6339 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6340 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
6342 case OPCODE_MULT_MATRIX
:
6343 _mesa_printf(ctx
, "MultMatrix (or Rotate)\n");
6344 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6345 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
6346 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6347 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
6348 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6349 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
6350 _mesa_printf(ctx
, " %8f %8f %8f %8f\n",
6351 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
6354 _mesa_printf(ctx
, "Ortho %g %g %g %g %g %g\n",
6355 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6357 case OPCODE_POP_ATTRIB
:
6358 _mesa_printf(ctx
, "PopAttrib\n");
6360 case OPCODE_POP_MATRIX
:
6361 _mesa_printf(ctx
, "PopMatrix\n");
6363 case OPCODE_POP_NAME
:
6364 _mesa_printf(ctx
, "PopName\n");
6366 case OPCODE_PUSH_ATTRIB
:
6367 _mesa_printf(ctx
, "PushAttrib %x\n", n
[1].bf
);
6369 case OPCODE_PUSH_MATRIX
:
6370 _mesa_printf(ctx
, "PushMatrix\n");
6372 case OPCODE_PUSH_NAME
:
6373 _mesa_printf(ctx
, "PushName %d\n", (int) n
[1].ui
);
6375 case OPCODE_RASTER_POS
:
6376 _mesa_printf(ctx
, "RasterPos %g %g %g %g\n",
6377 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
6380 _mesa_printf(ctx
, "Rotate %g %g %g %g\n",
6381 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6384 _mesa_printf(ctx
, "Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
6386 case OPCODE_TRANSLATE
:
6387 _mesa_printf(ctx
, "Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
6389 case OPCODE_BIND_TEXTURE
:
6390 _mesa_printf(ctx
, "BindTexture %s %d\n",
6391 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
6393 case OPCODE_SHADE_MODEL
:
6394 _mesa_printf(ctx
, "ShadeModel %s\n",
6395 _mesa_lookup_enum_by_nr(n
[1].ui
));
6398 _mesa_printf(ctx
, "Map1 %s %.3f %.3f %d %d\n",
6399 _mesa_lookup_enum_by_nr(n
[1].ui
),
6400 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
6403 _mesa_printf(ctx
, "Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
6404 _mesa_lookup_enum_by_nr(n
[1].ui
),
6405 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
6406 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
6408 case OPCODE_MAPGRID1
:
6409 _mesa_printf(ctx
, "MapGrid1 %d %.3f %.3f\n",
6410 n
[1].i
, n
[2].f
, n
[3].f
);
6412 case OPCODE_MAPGRID2
:
6413 _mesa_printf(ctx
, "MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
6414 n
[1].i
, n
[2].f
, n
[3].f
,
6415 n
[4].i
, n
[5].f
, n
[6].f
);
6417 case OPCODE_EVALMESH1
:
6418 _mesa_printf(ctx
, "EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
6420 case OPCODE_EVALMESH2
:
6421 _mesa_printf(ctx
, "EvalMesh2 %d %d %d %d\n",
6422 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
6426 * meta opcodes/commands
6429 _mesa_printf(ctx
, "Error: %s %s\n",
6430 enum_string(n
[1].e
), (const char *)n
[2].data
);
6432 case OPCODE_CONTINUE
:
6433 _mesa_printf(ctx
, "DISPLAY-LIST-CONTINUE\n");
6434 n
= (Node
*) n
[1].next
;
6436 case OPCODE_END_OF_LIST
:
6437 _mesa_printf(ctx
, "END-LIST %u\n", list
);
6441 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
6443 "ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
6448 _mesa_printf(ctx
, "command %d, %u operands\n",
6449 opcode
, InstSize
[opcode
]);
6452 /* increment n to point to next compiled command */
6453 if (opcode
!=OPCODE_CONTINUE
) {
6454 n
+= InstSize
[opcode
];
6463 * Clients may call this function to help debug display list problems.
6464 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
6465 * changed, or break in the future without notice.
6467 void mesa_print_display_list( GLuint list
)
6469 GET_CURRENT_CONTEXT(ctx
);
6470 print_list( ctx
, list
);