3 * Display lists management functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #include "api_loopback.h"
35 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
36 #include "arbprogram.h"
42 #if FEATURE_ARB_vertex_buffer_object
43 #include "bufferobj.h"
55 #include "extensions.h"
60 #include "histogram.h"
76 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
77 #include "nvprogram.h"
81 #include "math/m_matrix.h"
82 #include "math/m_xform.h"
87 * Macro to assert that the API call was made outside the
88 * glBegin()/glEnd() pair, with return value.
90 * \param ctx GL context.
91 * \param retval value to return value in case the assertion fails.
93 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
95 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
96 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
97 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
103 * Macro to assert that the API call was made outside the
104 * glBegin()/glEnd() pair.
106 * \param ctx GL context.
108 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
110 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
111 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
112 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
118 * Macro to assert that the API call was made outside the
119 * glBegin()/glEnd() pair and flush the vertices.
121 * \param ctx GL context.
123 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
125 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
126 FLUSH_VERTICES(ctx, 0); \
130 * Macro to assert that the API call was made outside the
131 * glBegin()/glEnd() pair and flush the vertices, with return value.
133 * \param ctx GL context.
134 * \param retval value to return value in case the assertion fails.
136 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
138 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
139 FLUSH_VERTICES(ctx, 0); \
145 * Display list opcodes.
147 * The fact that these identifiers are assigned consecutive
148 * integer values starting at 0 is very important, see InstSize array usage)
156 OPCODE_BLEND_EQUATION
,
158 OPCODE_BLEND_FUNC_SEPARATE
,
160 OPCODE_CALL_LIST_OFFSET
,
166 OPCODE_CLEAR_STENCIL
,
169 OPCODE_COLOR_MATERIAL
,
171 OPCODE_COLOR_TABLE_PARAMETER_FV
,
172 OPCODE_COLOR_TABLE_PARAMETER_IV
,
173 OPCODE_COLOR_SUB_TABLE
,
174 OPCODE_CONVOLUTION_FILTER_1D
,
175 OPCODE_CONVOLUTION_FILTER_2D
,
176 OPCODE_CONVOLUTION_PARAMETER_I
,
177 OPCODE_CONVOLUTION_PARAMETER_IV
,
178 OPCODE_CONVOLUTION_PARAMETER_F
,
179 OPCODE_CONVOLUTION_PARAMETER_FV
,
180 OPCODE_COPY_COLOR_SUB_TABLE
,
181 OPCODE_COPY_COLOR_TABLE
,
183 OPCODE_COPY_TEX_IMAGE1D
,
184 OPCODE_COPY_TEX_IMAGE2D
,
185 OPCODE_COPY_TEX_SUB_IMAGE1D
,
186 OPCODE_COPY_TEX_SUB_IMAGE2D
,
187 OPCODE_COPY_TEX_SUB_IMAGE3D
,
210 OPCODE_LOAD_IDENTITY
,
224 OPCODE_PIXEL_TRANSFER
,
227 OPCODE_POINT_PARAMETERS
,
229 OPCODE_POLYGON_STIPPLE
,
230 OPCODE_POLYGON_OFFSET
,
234 OPCODE_PRIORITIZE_TEXTURE
,
240 OPCODE_RESET_HISTOGRAM
,
241 OPCODE_RESET_MIN_MAX
,
245 OPCODE_SELECT_TEXTURE_SGIS
,
246 OPCODE_SELECT_TEXTURE_COORD_SET
,
257 OPCODE_TEX_SUB_IMAGE1D
,
258 OPCODE_TEX_SUB_IMAGE2D
,
259 OPCODE_TEX_SUB_IMAGE3D
,
263 /* GL_ARB_multitexture */
264 OPCODE_ACTIVE_TEXTURE
,
265 /* GL_SGIX/SGIS_pixel_texture */
266 OPCODE_PIXEL_TEXGEN_SGIX
,
267 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
268 /* GL_ARB_texture_compression */
269 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
270 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
271 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
272 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
273 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
274 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
275 /* GL_ARB_multisample */
276 OPCODE_SAMPLE_COVERAGE
,
277 /* GL_ARB_window_pos */
278 OPCODE_WINDOW_POS_ARB
,
279 /* GL_NV_vertex_program */
280 OPCODE_BIND_PROGRAM_NV
,
281 OPCODE_EXECUTE_PROGRAM_NV
,
282 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
283 OPCODE_LOAD_PROGRAM_NV
,
284 OPCODE_PROGRAM_PARAMETER4F_NV
,
285 OPCODE_TRACK_MATRIX_NV
,
286 /* GL_NV_fragment_program */
287 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
288 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
289 /* GL_EXT_stencil_two_side */
290 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
291 /* GL_EXT_depth_bounds_test */
292 OPCODE_DEPTH_BOUNDS_EXT
,
293 /* GL_ARB_vertex/fragment_program */
294 OPCODE_PROGRAM_STRING_ARB
,
295 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
297 /* The following three are meta instructions */
298 OPCODE_ERROR
, /* raise compiled-in error */
309 * Display list instructions are stored as sequences of "nodes". Nodes
310 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
311 * are linked together with a pointer.
313 * Each instruction in the display list is stored as a sequence of
314 * contiguous nodes in memory.
315 * Each node is the union of a variety of data types.
329 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
334 * How many nodes to allocate at a time.
336 * \note Reduced now that we hold vertices etc. elsewhere.
338 #define BLOCK_SIZE 256
343 * Number of nodes of storage needed for each instruction.
344 * Sizes for dynamically allocated opcodes are stored in the context struct.
346 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
348 void mesa_print_display_list( GLuint list
);
351 /**********************************************************************/
352 /***** Private *****/
353 /**********************************************************************/
356 * Make an empty display list. This is used by glGenLists() to
357 * reserver display list IDs.
359 static Node
*make_empty_list( void )
361 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
362 n
[0].opcode
= OPCODE_END_OF_LIST
;
369 * Destroy all nodes in a display list.
370 * \param list - display list number
372 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
380 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
383 done
= block
? GL_FALSE
: GL_TRUE
;
386 /* check for extension opcodes first */
388 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
389 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
390 ctx
->listext
.opcode
[i
].destroy(ctx
, &n
[1]);
391 n
+= ctx
->listext
.opcode
[i
].size
;
394 switch (n
[0].opcode
) {
395 /* for some commands, we need to free malloc'd memory */
398 n
+= InstSize
[n
[0].opcode
];
402 n
+= InstSize
[n
[0].opcode
];
404 case OPCODE_DRAW_PIXELS
:
406 n
+= InstSize
[n
[0].opcode
];
410 n
+= InstSize
[n
[0].opcode
];
412 case OPCODE_COLOR_TABLE
:
414 n
+= InstSize
[n
[0].opcode
];
416 case OPCODE_COLOR_SUB_TABLE
:
418 n
+= InstSize
[n
[0].opcode
];
420 case OPCODE_CONVOLUTION_FILTER_1D
:
422 n
+= InstSize
[n
[0].opcode
];
424 case OPCODE_CONVOLUTION_FILTER_2D
:
426 n
+= InstSize
[n
[0].opcode
];
428 case OPCODE_POLYGON_STIPPLE
:
430 n
+= InstSize
[n
[0].opcode
];
432 case OPCODE_TEX_IMAGE1D
:
434 n
+= InstSize
[n
[0].opcode
];
436 case OPCODE_TEX_IMAGE2D
:
438 n
+= InstSize
[n
[0].opcode
];
440 case OPCODE_TEX_IMAGE3D
:
442 n
+= InstSize
[n
[0].opcode
];
444 case OPCODE_TEX_SUB_IMAGE1D
:
446 n
+= InstSize
[n
[0].opcode
];
448 case OPCODE_TEX_SUB_IMAGE2D
:
450 n
+= InstSize
[n
[0].opcode
];
452 case OPCODE_TEX_SUB_IMAGE3D
:
454 n
+= InstSize
[n
[0].opcode
];
456 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
458 n
+= InstSize
[n
[0].opcode
];
460 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
462 n
+= InstSize
[n
[0].opcode
];
464 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
466 n
+= InstSize
[n
[0].opcode
];
468 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
470 n
+= InstSize
[n
[0].opcode
];
472 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
478 n
+= InstSize
[n
[0].opcode
];
480 #if FEATURE_NV_vertex_program
481 case OPCODE_LOAD_PROGRAM_NV
:
482 FREE(n
[4].data
); /* program string */
483 n
+= InstSize
[n
[0].opcode
];
485 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
486 FREE(n
[2].data
); /* array of program ids */
487 n
+= InstSize
[n
[0].opcode
];
490 #if FEATURE_NV_fragment_program
491 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
492 FREE(n
[3].data
); /* parameter name */
493 n
+= InstSize
[n
[0].opcode
];
496 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
497 case OPCODE_PROGRAM_STRING_ARB
:
498 FREE(n
[4].data
); /* program string */
499 n
+= InstSize
[n
[0].opcode
];
502 case OPCODE_CONTINUE
:
503 n
= (Node
*) n
[1].next
;
507 case OPCODE_END_OF_LIST
:
512 /* Most frequent case */
513 n
+= InstSize
[n
[0].opcode
];
519 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
525 * Translate the nth element of list from type to GLuint.
527 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
539 bptr
= (GLbyte
*) list
;
540 return (GLuint
) *(bptr
+n
);
541 case GL_UNSIGNED_BYTE
:
542 ubptr
= (GLubyte
*) list
;
543 return (GLuint
) *(ubptr
+n
);
545 sptr
= (GLshort
*) list
;
546 return (GLuint
) *(sptr
+n
);
547 case GL_UNSIGNED_SHORT
:
548 usptr
= (GLushort
*) list
;
549 return (GLuint
) *(usptr
+n
);
551 iptr
= (GLint
*) list
;
552 return (GLuint
) *(iptr
+n
);
553 case GL_UNSIGNED_INT
:
554 uiptr
= (GLuint
*) list
;
555 return (GLuint
) *(uiptr
+n
);
557 fptr
= (GLfloat
*) list
;
558 return (GLuint
) *(fptr
+n
);
560 ubptr
= ((GLubyte
*) list
) + 2*n
;
561 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
563 ubptr
= ((GLubyte
*) list
) + 3*n
;
564 return (GLuint
) *ubptr
* 65536
565 + (GLuint
) *(ubptr
+1) * 256
566 + (GLuint
) *(ubptr
+2);
568 ubptr
= ((GLubyte
*) list
) + 4*n
;
569 return (GLuint
) *ubptr
* 16777216
570 + (GLuint
) *(ubptr
+1) * 65536
571 + (GLuint
) *(ubptr
+2) * 256
572 + (GLuint
) *(ubptr
+3);
581 /**********************************************************************/
583 /**********************************************************************/
585 void _mesa_init_lists( void )
587 static int init_flag
= 0;
590 InstSize
[OPCODE_ACCUM
] = 3;
591 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
592 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
593 InstSize
[OPCODE_BITMAP
] = 8;
594 InstSize
[OPCODE_BLEND_COLOR
] = 5;
595 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
596 InstSize
[OPCODE_BLEND_FUNC
] = 3;
597 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
598 InstSize
[OPCODE_CALL_LIST
] = 2;
599 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
600 InstSize
[OPCODE_CLEAR
] = 2;
601 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
602 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
603 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
604 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
605 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
606 InstSize
[OPCODE_CLIP_PLANE
] = 6;
607 InstSize
[OPCODE_COLOR_MASK
] = 5;
608 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
609 InstSize
[OPCODE_COLOR_TABLE
] = 7;
610 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
611 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
612 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
613 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
614 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
615 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
616 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
617 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
618 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
619 InstSize
[OPCODE_COPY_PIXELS
] = 6;
620 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
621 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
622 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
623 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
624 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
625 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
626 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
627 InstSize
[OPCODE_CULL_FACE
] = 2;
628 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
629 InstSize
[OPCODE_DEPTH_MASK
] = 2;
630 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
631 InstSize
[OPCODE_DISABLE
] = 2;
632 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
633 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
634 InstSize
[OPCODE_ENABLE
] = 2;
635 InstSize
[OPCODE_EVALMESH1
] = 4;
636 InstSize
[OPCODE_EVALMESH2
] = 6;
637 InstSize
[OPCODE_FOG
] = 6;
638 InstSize
[OPCODE_FRONT_FACE
] = 2;
639 InstSize
[OPCODE_FRUSTUM
] = 7;
640 InstSize
[OPCODE_HINT
] = 3;
641 InstSize
[OPCODE_HISTOGRAM
] = 5;
642 InstSize
[OPCODE_INDEX_MASK
] = 2;
643 InstSize
[OPCODE_INIT_NAMES
] = 1;
644 InstSize
[OPCODE_LIGHT
] = 7;
645 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
646 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
647 InstSize
[OPCODE_LINE_WIDTH
] = 2;
648 InstSize
[OPCODE_LIST_BASE
] = 2;
649 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
650 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
651 InstSize
[OPCODE_LOAD_NAME
] = 2;
652 InstSize
[OPCODE_LOGIC_OP
] = 2;
653 InstSize
[OPCODE_MAP1
] = 7;
654 InstSize
[OPCODE_MAP2
] = 11;
655 InstSize
[OPCODE_MAPGRID1
] = 4;
656 InstSize
[OPCODE_MAPGRID2
] = 7;
657 InstSize
[OPCODE_MATRIX_MODE
] = 2;
658 InstSize
[OPCODE_MIN_MAX
] = 4;
659 InstSize
[OPCODE_MULT_MATRIX
] = 17;
660 InstSize
[OPCODE_ORTHO
] = 7;
661 InstSize
[OPCODE_PASSTHROUGH
] = 2;
662 InstSize
[OPCODE_PIXEL_MAP
] = 4;
663 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
664 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
665 InstSize
[OPCODE_POINT_SIZE
] = 2;
666 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
667 InstSize
[OPCODE_POLYGON_MODE
] = 3;
668 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
669 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
670 InstSize
[OPCODE_POP_ATTRIB
] = 1;
671 InstSize
[OPCODE_POP_MATRIX
] = 1;
672 InstSize
[OPCODE_POP_NAME
] = 1;
673 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
674 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
675 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
676 InstSize
[OPCODE_PUSH_NAME
] = 2;
677 InstSize
[OPCODE_RASTER_POS
] = 5;
678 InstSize
[OPCODE_READ_BUFFER
] = 2;
679 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
680 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
681 InstSize
[OPCODE_ROTATE
] = 5;
682 InstSize
[OPCODE_SCALE
] = 4;
683 InstSize
[OPCODE_SCISSOR
] = 5;
684 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
685 InstSize
[OPCODE_STENCIL_MASK
] = 2;
686 InstSize
[OPCODE_STENCIL_OP
] = 4;
687 InstSize
[OPCODE_SHADE_MODEL
] = 2;
688 InstSize
[OPCODE_TEXENV
] = 7;
689 InstSize
[OPCODE_TEXGEN
] = 7;
690 InstSize
[OPCODE_TEXPARAMETER
] = 7;
691 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
692 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
693 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
694 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
695 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
696 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
697 InstSize
[OPCODE_TRANSLATE
] = 4;
698 InstSize
[OPCODE_VIEWPORT
] = 5;
699 InstSize
[OPCODE_WINDOW_POS
] = 5;
700 InstSize
[OPCODE_CONTINUE
] = 2;
701 InstSize
[OPCODE_ERROR
] = 3;
702 InstSize
[OPCODE_END_OF_LIST
] = 1;
703 /* GL_SGIX/SGIS_pixel_texture */
704 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
705 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
706 /* GL_ARB_texture_compression */
707 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
708 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
709 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
710 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
711 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
712 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
713 /* GL_ARB_multisample */
714 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
715 /* GL_ARB_multitexture */
716 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
717 /* GL_ARB_window_pos */
718 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
719 /* GL_NV_vertex_program */
720 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
721 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
722 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
723 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
724 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
725 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
726 /* GL_NV_fragment_program */
727 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
728 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
729 /* GL_EXT_stencil_two_side */
730 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
731 /* GL_EXT_depth_bounds_test */
732 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
733 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
734 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
735 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
743 * Allocate space for a display list instruction.
744 * \param opcode - type of instruction
745 * argcount - size in bytes of data required.
746 * \return pointer to the usable data area (not including the internal
750 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
753 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
756 if (opcode
< (int) OPCODE_DRV_0
) {
757 assert( count
== InstSize
[opcode
] );
761 if (ctx
->CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
762 /* This block is full. Allocate a new block and chain to it */
763 n
= ctx
->CurrentBlock
+ ctx
->CurrentPos
;
764 n
[0].opcode
= OPCODE_CONTINUE
;
765 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
767 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
770 n
[1].next
= (Node
*) newblock
;
771 ctx
->CurrentBlock
= newblock
;
775 n
= ctx
->CurrentBlock
+ ctx
->CurrentPos
;
776 ctx
->CurrentPos
+= count
;
778 n
[0].opcode
= (OpCode
) opcode
;
780 return (void *)&n
[1];
784 /* Allow modules and drivers to get their own opcodes.
787 _mesa_alloc_opcode( GLcontext
*ctx
,
789 void (*execute
)( GLcontext
*, void * ),
790 void (*destroy
)( GLcontext
*, void * ),
791 void (*print
)( GLcontext
*, void * ) )
793 if (ctx
->listext
.nr_opcodes
< GL_MAX_EXT_OPCODES
) {
794 GLuint i
= ctx
->listext
.nr_opcodes
++;
795 ctx
->listext
.opcode
[i
].size
= 1 + (sz
+ sizeof(Node
) - 1)/sizeof(Node
);
796 ctx
->listext
.opcode
[i
].execute
= execute
;
797 ctx
->listext
.opcode
[i
].destroy
= destroy
;
798 ctx
->listext
.opcode
[i
].print
= print
;
799 return i
+ OPCODE_DRV_0
;
806 /* Mimic the old behaviour of alloc_instruction:
807 * - sz is in units of sizeof(Node)
808 * - return value a pointer to sizeof(Node) before the actual
811 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
812 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
817 * Display List compilation functions
819 static void save_Accum( GLenum op
, GLfloat value
)
821 GET_CURRENT_CONTEXT(ctx
);
823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
824 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
829 if (ctx
->ExecuteFlag
) {
830 (*ctx
->Exec
->Accum
)( op
, value
);
835 static void save_AlphaFunc( GLenum func
, GLclampf ref
)
837 GET_CURRENT_CONTEXT(ctx
);
839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
840 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
843 n
[2].f
= (GLfloat
) ref
;
845 if (ctx
->ExecuteFlag
) {
846 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
851 static void save_BindTexture( GLenum target
, GLuint texture
)
853 GET_CURRENT_CONTEXT(ctx
);
855 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
856 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
861 if (ctx
->ExecuteFlag
) {
862 (*ctx
->Exec
->BindTexture
)( target
, texture
);
867 static void save_Bitmap( GLsizei width
, GLsizei height
,
868 GLfloat xorig
, GLfloat yorig
,
869 GLfloat xmove
, GLfloat ymove
,
870 const GLubyte
*pixels
)
872 GET_CURRENT_CONTEXT(ctx
);
873 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
876 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
878 n
[1].i
= (GLint
) width
;
879 n
[2].i
= (GLint
) height
;
889 if (ctx
->ExecuteFlag
) {
890 (*ctx
->Exec
->Bitmap
)( width
, height
,
891 xorig
, yorig
, xmove
, ymove
, pixels
);
896 static void save_BlendEquation( GLenum mode
)
898 GET_CURRENT_CONTEXT(ctx
);
900 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
901 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
905 if (ctx
->ExecuteFlag
) {
906 (*ctx
->Exec
->BlendEquation
)( mode
);
911 static void save_BlendFunc( GLenum sfactor
, GLenum dfactor
)
913 GET_CURRENT_CONTEXT(ctx
);
915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
916 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC
, 2 );
921 if (ctx
->ExecuteFlag
) {
922 (*ctx
->Exec
->BlendFunc
)( sfactor
, dfactor
);
927 static void save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
928 GLenum sfactorA
, GLenum dfactorA
)
930 GET_CURRENT_CONTEXT(ctx
);
932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
933 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
940 if (ctx
->ExecuteFlag
) {
941 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
947 static void save_BlendColor( GLfloat red
, GLfloat green
,
948 GLfloat blue
, GLfloat alpha
)
950 GET_CURRENT_CONTEXT(ctx
);
952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
953 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
960 if (ctx
->ExecuteFlag
) {
961 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
966 void _mesa_save_CallList( GLuint list
)
968 GET_CURRENT_CONTEXT(ctx
);
970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
971 FLUSH_CURRENT(ctx
, 0);
973 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
977 if (ctx
->ExecuteFlag
) {
978 (*ctx
->Exec
->CallList
)( list
);
983 void _mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
985 GET_CURRENT_CONTEXT(ctx
);
987 GLboolean typeErrorFlag
;
989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
990 FLUSH_CURRENT(ctx
, 0);
994 case GL_UNSIGNED_BYTE
:
996 case GL_UNSIGNED_SHORT
:
998 case GL_UNSIGNED_INT
:
1003 typeErrorFlag
= GL_FALSE
;
1006 typeErrorFlag
= GL_TRUE
;
1010 GLuint list
= translate_id( i
, type
, lists
);
1011 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1014 n
[2].b
= typeErrorFlag
;
1017 if (ctx
->ExecuteFlag
) {
1018 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1023 static void save_Clear( GLbitfield mask
)
1025 GET_CURRENT_CONTEXT(ctx
);
1027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1028 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1032 if (ctx
->ExecuteFlag
) {
1033 (*ctx
->Exec
->Clear
)( mask
);
1038 static void save_ClearAccum( GLfloat red
, GLfloat green
,
1039 GLfloat blue
, GLfloat alpha
)
1041 GET_CURRENT_CONTEXT(ctx
);
1043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1044 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1051 if (ctx
->ExecuteFlag
) {
1052 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1057 static void save_ClearColor( GLclampf red
, GLclampf green
,
1058 GLclampf blue
, GLclampf alpha
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1070 if (ctx
->ExecuteFlag
) {
1071 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1076 static void save_ClearDepth( GLclampd depth
)
1078 GET_CURRENT_CONTEXT(ctx
);
1080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1081 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1083 n
[1].f
= (GLfloat
) depth
;
1085 if (ctx
->ExecuteFlag
) {
1086 (*ctx
->Exec
->ClearDepth
)( depth
);
1091 static void save_ClearIndex( GLfloat c
)
1093 GET_CURRENT_CONTEXT(ctx
);
1095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1096 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1100 if (ctx
->ExecuteFlag
) {
1101 (*ctx
->Exec
->ClearIndex
)( c
);
1106 static void save_ClearStencil( GLint s
)
1108 GET_CURRENT_CONTEXT(ctx
);
1110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1111 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1115 if (ctx
->ExecuteFlag
) {
1116 (*ctx
->Exec
->ClearStencil
)( s
);
1121 static void save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1123 GET_CURRENT_CONTEXT(ctx
);
1125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1126 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1129 n
[2].f
= (GLfloat
) equ
[0];
1130 n
[3].f
= (GLfloat
) equ
[1];
1131 n
[4].f
= (GLfloat
) equ
[2];
1132 n
[5].f
= (GLfloat
) equ
[3];
1134 if (ctx
->ExecuteFlag
) {
1135 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1141 static void save_ColorMask( GLboolean red
, GLboolean green
,
1142 GLboolean blue
, GLboolean alpha
)
1144 GET_CURRENT_CONTEXT(ctx
);
1146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1147 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1154 if (ctx
->ExecuteFlag
) {
1155 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1160 static void save_ColorMaterial( GLenum face
, GLenum mode
)
1162 GET_CURRENT_CONTEXT(ctx
);
1164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1165 FLUSH_CURRENT(ctx
, 0);
1167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1172 if (ctx
->ExecuteFlag
) {
1173 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1178 static void save_ColorTable( GLenum target
, GLenum internalFormat
,
1179 GLsizei width
, GLenum format
, GLenum type
,
1180 const GLvoid
*table
)
1182 GET_CURRENT_CONTEXT(ctx
);
1183 if (target
== GL_PROXY_TEXTURE_1D
||
1184 target
== GL_PROXY_TEXTURE_2D
||
1185 target
== GL_PROXY_TEXTURE_3D
||
1186 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1187 /* execute immediately */
1188 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1189 format
, type
, table
);
1192 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, table
,
1195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1196 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1199 n
[2].e
= internalFormat
;
1208 if (ctx
->ExecuteFlag
) {
1209 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1210 format
, type
, table
);
1218 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1220 GET_CURRENT_CONTEXT(ctx
);
1223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1230 if (pname
== GL_COLOR_TABLE_SGI
||
1231 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1232 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1233 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1240 if (ctx
->ExecuteFlag
) {
1241 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1247 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1249 GET_CURRENT_CONTEXT(ctx
);
1252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1254 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1259 if (pname
== GL_COLOR_TABLE_SGI
||
1260 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1261 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1262 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1269 if (ctx
->ExecuteFlag
) {
1270 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1276 static void save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1277 GLenum format
, GLenum type
,
1278 const GLvoid
*table
)
1280 GET_CURRENT_CONTEXT(ctx
);
1281 GLvoid
*image
= _mesa_unpack_image(count
, 1, 1, format
, type
, table
,
1284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1285 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1297 if (ctx
->ExecuteFlag
) {
1298 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1304 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1305 GLint x
, GLint y
, GLsizei width
)
1307 GET_CURRENT_CONTEXT(ctx
);
1310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1311 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1319 if (ctx
->ExecuteFlag
) {
1320 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1326 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1327 GLint x
, GLint y
, GLsizei width
)
1329 GET_CURRENT_CONTEXT(ctx
);
1332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1333 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1336 n
[2].e
= internalformat
;
1341 if (ctx
->ExecuteFlag
) {
1342 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1348 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1349 GLenum format
, GLenum type
, const GLvoid
*filter
)
1351 GET_CURRENT_CONTEXT(ctx
);
1352 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, filter
,
1355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1356 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1359 n
[2].e
= internalFormat
;
1368 if (ctx
->ExecuteFlag
) {
1369 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1370 format
, type
, filter
);
1376 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1377 GLsizei width
, GLsizei height
, GLenum format
,
1378 GLenum type
, const GLvoid
*filter
)
1380 GET_CURRENT_CONTEXT(ctx
);
1381 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
, filter
,
1384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1385 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1388 n
[2].e
= internalFormat
;
1398 if (ctx
->ExecuteFlag
) {
1399 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1400 format
, type
, filter
);
1406 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1408 GET_CURRENT_CONTEXT(ctx
);
1410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1411 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1417 if (ctx
->ExecuteFlag
) {
1418 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1424 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1426 GET_CURRENT_CONTEXT(ctx
);
1428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1429 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1434 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1435 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1436 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1442 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1445 if (ctx
->ExecuteFlag
) {
1446 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1452 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1454 GET_CURRENT_CONTEXT(ctx
);
1456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1457 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1463 if (ctx
->ExecuteFlag
) {
1464 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1470 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1472 GET_CURRENT_CONTEXT(ctx
);
1474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1475 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1480 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1481 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1482 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1488 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1491 if (ctx
->ExecuteFlag
) {
1492 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1498 save_CopyPixels( GLint x
, GLint y
,
1499 GLsizei width
, GLsizei height
, GLenum type
)
1501 GET_CURRENT_CONTEXT(ctx
);
1503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1504 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1508 n
[3].i
= (GLint
) width
;
1509 n
[4].i
= (GLint
) height
;
1512 if (ctx
->ExecuteFlag
) {
1513 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1520 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1521 GLint x
, GLint y
, GLsizei width
, GLint border
)
1523 GET_CURRENT_CONTEXT(ctx
);
1525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1526 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1530 n
[3].e
= internalformat
;
1536 if (ctx
->ExecuteFlag
) {
1537 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1538 x
, y
, width
, border
);
1544 save_CopyTexImage2D( GLenum target
, GLint level
,
1545 GLenum internalformat
,
1546 GLint x
, GLint y
, GLsizei width
,
1547 GLsizei height
, GLint border
)
1549 GET_CURRENT_CONTEXT(ctx
);
1551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1552 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1556 n
[3].e
= internalformat
;
1563 if (ctx
->ExecuteFlag
) {
1564 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1565 x
, y
, width
, height
, border
);
1572 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1573 GLint xoffset
, GLint x
, GLint y
,
1576 GET_CURRENT_CONTEXT(ctx
);
1578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1588 if (ctx
->ExecuteFlag
) {
1589 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1595 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1596 GLint xoffset
, GLint yoffset
,
1598 GLsizei width
, GLint height
)
1600 GET_CURRENT_CONTEXT(ctx
);
1602 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1603 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1614 if (ctx
->ExecuteFlag
) {
1615 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1616 x
, y
, width
, height
);
1622 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1623 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1625 GLsizei width
, GLint height
)
1627 GET_CURRENT_CONTEXT(ctx
);
1629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1642 if (ctx
->ExecuteFlag
) {
1643 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1644 xoffset
, yoffset
, zoffset
,
1645 x
, y
, width
, height
);
1650 static void save_CullFace( GLenum mode
)
1652 GET_CURRENT_CONTEXT(ctx
);
1654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1655 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1659 if (ctx
->ExecuteFlag
) {
1660 (*ctx
->Exec
->CullFace
)( mode
);
1665 static void save_DepthFunc( GLenum func
)
1667 GET_CURRENT_CONTEXT(ctx
);
1669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1670 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1674 if (ctx
->ExecuteFlag
) {
1675 (*ctx
->Exec
->DepthFunc
)( func
);
1680 static void save_DepthMask( GLboolean mask
)
1682 GET_CURRENT_CONTEXT(ctx
);
1684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1685 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1689 if (ctx
->ExecuteFlag
) {
1690 (*ctx
->Exec
->DepthMask
)( mask
);
1695 static void save_DepthRange( GLclampd nearval
, GLclampd farval
)
1697 GET_CURRENT_CONTEXT(ctx
);
1699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1700 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1702 n
[1].f
= (GLfloat
) nearval
;
1703 n
[2].f
= (GLfloat
) farval
;
1705 if (ctx
->ExecuteFlag
) {
1706 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1711 static void save_Disable( GLenum cap
)
1713 GET_CURRENT_CONTEXT(ctx
);
1715 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1716 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1720 if (ctx
->ExecuteFlag
) {
1721 (*ctx
->Exec
->Disable
)( cap
);
1726 static void save_DrawBuffer( GLenum mode
)
1728 GET_CURRENT_CONTEXT(ctx
);
1730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1731 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1735 if (ctx
->ExecuteFlag
) {
1736 (*ctx
->Exec
->DrawBuffer
)( mode
);
1741 static void save_DrawPixels( GLsizei width
, GLsizei height
,
1742 GLenum format
, GLenum type
,
1743 const GLvoid
*pixels
)
1745 GET_CURRENT_CONTEXT(ctx
);
1746 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
1747 pixels
, &ctx
->Unpack
);
1749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1750 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1761 if (ctx
->ExecuteFlag
) {
1762 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1768 static void save_Enable( GLenum cap
)
1770 GET_CURRENT_CONTEXT(ctx
);
1772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1773 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1777 if (ctx
->ExecuteFlag
) {
1778 (*ctx
->Exec
->Enable
)( cap
);
1784 void _mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1786 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1795 if (ctx
->ExecuteFlag
) {
1796 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1801 void _mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1803 GET_CURRENT_CONTEXT(ctx
);
1805 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1806 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1814 if (ctx
->ExecuteFlag
) {
1815 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1822 static void save_Fogfv( GLenum pname
, const GLfloat
*params
)
1824 GET_CURRENT_CONTEXT(ctx
);
1826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1827 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1835 if (ctx
->ExecuteFlag
) {
1836 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1841 static void save_Fogf( GLenum pname
, GLfloat param
)
1843 save_Fogfv(pname
, ¶m
);
1847 static void save_Fogiv(GLenum pname
, const GLint
*params
)
1852 case GL_FOG_DENSITY
:
1856 p
[0] = (GLfloat
) *params
;
1859 p
[0] = INT_TO_FLOAT( params
[0] );
1860 p
[1] = INT_TO_FLOAT( params
[1] );
1861 p
[2] = INT_TO_FLOAT( params
[2] );
1862 p
[3] = INT_TO_FLOAT( params
[3] );
1865 /* Error will be caught later in gl_Fogfv */
1868 save_Fogfv(pname
, p
);
1872 static void save_Fogi(GLenum pname
, GLint param
)
1874 save_Fogiv(pname
, ¶m
);
1878 static void save_FrontFace( GLenum mode
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1887 if (ctx
->ExecuteFlag
) {
1888 (*ctx
->Exec
->FrontFace
)( mode
);
1893 static void save_Frustum( GLdouble left
, GLdouble right
,
1894 GLdouble bottom
, GLdouble top
,
1895 GLdouble nearval
, GLdouble farval
)
1897 GET_CURRENT_CONTEXT(ctx
);
1899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1900 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1902 n
[1].f
= (GLfloat
) left
;
1903 n
[2].f
= (GLfloat
) right
;
1904 n
[3].f
= (GLfloat
) bottom
;
1905 n
[4].f
= (GLfloat
) top
;
1906 n
[5].f
= (GLfloat
) nearval
;
1907 n
[6].f
= (GLfloat
) farval
;
1909 if (ctx
->ExecuteFlag
) {
1910 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
1915 static void save_Hint( GLenum target
, GLenum mode
)
1917 GET_CURRENT_CONTEXT(ctx
);
1919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1920 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
1925 if (ctx
->ExecuteFlag
) {
1926 (*ctx
->Exec
->Hint
)( target
, mode
);
1932 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
1934 GET_CURRENT_CONTEXT(ctx
);
1937 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1938 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
1942 n
[3].e
= internalFormat
;
1945 if (ctx
->ExecuteFlag
) {
1946 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
1951 static void save_IndexMask( GLuint mask
)
1953 GET_CURRENT_CONTEXT(ctx
);
1955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1956 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
1960 if (ctx
->ExecuteFlag
) {
1961 (*ctx
->Exec
->IndexMask
)( mask
);
1966 static void save_InitNames( void )
1968 GET_CURRENT_CONTEXT(ctx
);
1969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1970 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
1971 if (ctx
->ExecuteFlag
) {
1972 (*ctx
->Exec
->InitNames
)();
1977 static void save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
1979 GET_CURRENT_CONTEXT(ctx
);
1981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1982 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2000 case GL_SPOT_DIRECTION
:
2003 case GL_SPOT_EXPONENT
:
2006 case GL_SPOT_CUTOFF
:
2009 case GL_CONSTANT_ATTENUATION
:
2012 case GL_LINEAR_ATTENUATION
:
2015 case GL_QUADRATIC_ATTENUATION
:
2021 for (i
= 0; i
< nParams
; i
++) {
2022 n
[3+i
].f
= params
[i
];
2025 if (ctx
->ExecuteFlag
) {
2026 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2031 static void save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2033 save_Lightfv(light
, pname
, ¶ms
);
2037 static void save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2044 fparam
[0] = INT_TO_FLOAT( params
[0] );
2045 fparam
[1] = INT_TO_FLOAT( params
[1] );
2046 fparam
[2] = INT_TO_FLOAT( params
[2] );
2047 fparam
[3] = INT_TO_FLOAT( params
[3] );
2050 fparam
[0] = (GLfloat
) params
[0];
2051 fparam
[1] = (GLfloat
) params
[1];
2052 fparam
[2] = (GLfloat
) params
[2];
2053 fparam
[3] = (GLfloat
) params
[3];
2055 case GL_SPOT_DIRECTION
:
2056 fparam
[0] = (GLfloat
) params
[0];
2057 fparam
[1] = (GLfloat
) params
[1];
2058 fparam
[2] = (GLfloat
) params
[2];
2060 case GL_SPOT_EXPONENT
:
2061 case GL_SPOT_CUTOFF
:
2062 case GL_CONSTANT_ATTENUATION
:
2063 case GL_LINEAR_ATTENUATION
:
2064 case GL_QUADRATIC_ATTENUATION
:
2065 fparam
[0] = (GLfloat
) params
[0];
2068 /* error will be caught later in gl_Lightfv */
2071 save_Lightfv( light
, pname
, fparam
);
2075 static void save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2077 save_Lightiv( light
, pname
, ¶m
);
2081 static void save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2083 GET_CURRENT_CONTEXT(ctx
);
2085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2086 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2094 if (ctx
->ExecuteFlag
) {
2095 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2100 static void save_LightModelf( GLenum pname
, GLfloat param
)
2102 save_LightModelfv(pname
, ¶m
);
2106 static void save_LightModeliv( GLenum pname
, const GLint
*params
)
2110 case GL_LIGHT_MODEL_AMBIENT
:
2111 fparam
[0] = INT_TO_FLOAT( params
[0] );
2112 fparam
[1] = INT_TO_FLOAT( params
[1] );
2113 fparam
[2] = INT_TO_FLOAT( params
[2] );
2114 fparam
[3] = INT_TO_FLOAT( params
[3] );
2116 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2117 case GL_LIGHT_MODEL_TWO_SIDE
:
2118 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2119 fparam
[0] = (GLfloat
) params
[0];
2122 /* Error will be caught later in gl_LightModelfv */
2125 save_LightModelfv(pname
, fparam
);
2129 static void save_LightModeli( GLenum pname
, GLint param
)
2131 save_LightModeliv(pname
, ¶m
);
2135 static void save_LineStipple( GLint factor
, GLushort pattern
)
2137 GET_CURRENT_CONTEXT(ctx
);
2139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2140 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2145 if (ctx
->ExecuteFlag
) {
2146 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2151 static void save_LineWidth( GLfloat width
)
2153 GET_CURRENT_CONTEXT(ctx
);
2155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2156 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2160 if (ctx
->ExecuteFlag
) {
2161 (*ctx
->Exec
->LineWidth
)( width
);
2166 static void save_ListBase( GLuint base
)
2168 GET_CURRENT_CONTEXT(ctx
);
2170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2171 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2175 if (ctx
->ExecuteFlag
) {
2176 (*ctx
->Exec
->ListBase
)( base
);
2181 static void save_LoadIdentity( void )
2183 GET_CURRENT_CONTEXT(ctx
);
2184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2185 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2186 if (ctx
->ExecuteFlag
) {
2187 (*ctx
->Exec
->LoadIdentity
)();
2192 static void save_LoadMatrixf( const GLfloat
*m
)
2194 GET_CURRENT_CONTEXT(ctx
);
2196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2197 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2200 for (i
=0;i
<16;i
++) {
2204 if (ctx
->ExecuteFlag
) {
2205 (*ctx
->Exec
->LoadMatrixf
)( m
);
2210 static void save_LoadMatrixd( const GLdouble
*m
)
2214 for (i
= 0; i
< 16; i
++) {
2215 f
[i
] = (GLfloat
) m
[i
];
2217 save_LoadMatrixf(f
);
2221 static void save_LoadName( GLuint name
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2230 if (ctx
->ExecuteFlag
) {
2231 (*ctx
->Exec
->LoadName
)( name
);
2236 static void save_LogicOp( GLenum opcode
)
2238 GET_CURRENT_CONTEXT(ctx
);
2240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2241 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2245 if (ctx
->ExecuteFlag
) {
2246 (*ctx
->Exec
->LogicOp
)( opcode
);
2251 static void save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2252 GLint order
, const GLdouble
*points
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2259 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2261 n
[2].f
= (GLfloat
) u1
;
2262 n
[3].f
= (GLfloat
) u2
;
2263 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2265 n
[6].data
= (void *) pnts
;
2267 if (ctx
->ExecuteFlag
) {
2268 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2272 static void save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2273 GLint order
, const GLfloat
*points
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2280 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2284 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2286 n
[6].data
= (void *) pnts
;
2288 if (ctx
->ExecuteFlag
) {
2289 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2294 static void save_Map2d( GLenum target
,
2295 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2296 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2297 const GLdouble
*points
)
2299 GET_CURRENT_CONTEXT(ctx
);
2301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2302 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2304 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2305 vstride
, vorder
, points
);
2307 n
[2].f
= (GLfloat
) u1
;
2308 n
[3].f
= (GLfloat
) u2
;
2309 n
[4].f
= (GLfloat
) v1
;
2310 n
[5].f
= (GLfloat
) v2
;
2311 /* XXX verify these strides are correct */
2312 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2313 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2316 n
[10].data
= (void *) pnts
;
2318 if (ctx
->ExecuteFlag
) {
2319 (*ctx
->Exec
->Map2d
)( target
,
2320 u1
, u2
, ustride
, uorder
,
2321 v1
, v2
, vstride
, vorder
, points
);
2326 static void save_Map2f( GLenum target
,
2327 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2328 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2329 const GLfloat
*points
)
2331 GET_CURRENT_CONTEXT(ctx
);
2333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2334 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2336 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2337 vstride
, vorder
, points
);
2343 /* XXX verify these strides are correct */
2344 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2345 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2348 n
[10].data
= (void *) pnts
;
2350 if (ctx
->ExecuteFlag
) {
2351 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2352 v1
, v2
, vstride
, vorder
, points
);
2357 static void save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2359 GET_CURRENT_CONTEXT(ctx
);
2361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2362 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2368 if (ctx
->ExecuteFlag
) {
2369 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2374 static void save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2376 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2380 static void save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2381 GLint vn
, GLfloat v1
, GLfloat v2
)
2383 GET_CURRENT_CONTEXT(ctx
);
2385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2386 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2395 if (ctx
->ExecuteFlag
) {
2396 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2402 static void save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2403 GLint vn
, GLdouble v1
, GLdouble v2
)
2405 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2406 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2410 static void save_MatrixMode( GLenum mode
)
2412 GET_CURRENT_CONTEXT(ctx
);
2414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2415 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2419 if (ctx
->ExecuteFlag
) {
2420 (*ctx
->Exec
->MatrixMode
)( mode
);
2426 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2428 GET_CURRENT_CONTEXT(ctx
);
2431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2432 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2435 n
[2].e
= internalFormat
;
2438 if (ctx
->ExecuteFlag
) {
2439 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2444 static void save_MultMatrixf( const GLfloat
*m
)
2446 GET_CURRENT_CONTEXT(ctx
);
2448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2449 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2452 for (i
=0;i
<16;i
++) {
2456 if (ctx
->ExecuteFlag
) {
2457 (*ctx
->Exec
->MultMatrixf
)( m
);
2462 static void save_MultMatrixd( const GLdouble
*m
)
2466 for (i
= 0; i
< 16; i
++) {
2467 f
[i
] = (GLfloat
) m
[i
];
2469 save_MultMatrixf(f
);
2473 static void save_NewList( GLuint list
, GLenum mode
)
2475 GET_CURRENT_CONTEXT(ctx
);
2476 /* It's an error to call this function while building a display list */
2477 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2484 static void save_Ortho( GLdouble left
, GLdouble right
,
2485 GLdouble bottom
, GLdouble top
,
2486 GLdouble nearval
, GLdouble farval
)
2488 GET_CURRENT_CONTEXT(ctx
);
2490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2491 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2493 n
[1].f
= (GLfloat
) left
;
2494 n
[2].f
= (GLfloat
) right
;
2495 n
[3].f
= (GLfloat
) bottom
;
2496 n
[4].f
= (GLfloat
) top
;
2497 n
[5].f
= (GLfloat
) nearval
;
2498 n
[6].f
= (GLfloat
) farval
;
2500 if (ctx
->ExecuteFlag
) {
2501 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2507 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2509 GET_CURRENT_CONTEXT(ctx
);
2511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2512 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2516 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2517 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2519 if (ctx
->ExecuteFlag
) {
2520 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2526 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2528 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2530 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2531 for (i
=0;i
<mapsize
;i
++) {
2532 fvalues
[i
] = (GLfloat
) values
[i
];
2536 for (i
=0;i
<mapsize
;i
++) {
2537 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2540 save_PixelMapfv(map
, mapsize
, fvalues
);
2545 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2547 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2549 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2550 for (i
=0;i
<mapsize
;i
++) {
2551 fvalues
[i
] = (GLfloat
) values
[i
];
2555 for (i
=0;i
<mapsize
;i
++) {
2556 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2559 save_PixelMapfv(map
, mapsize
, fvalues
);
2564 save_PixelTransferf( GLenum pname
, GLfloat param
)
2566 GET_CURRENT_CONTEXT(ctx
);
2568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2569 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2574 if (ctx
->ExecuteFlag
) {
2575 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2581 save_PixelTransferi( GLenum pname
, GLint param
)
2583 save_PixelTransferf( pname
, (GLfloat
) param
);
2588 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2590 GET_CURRENT_CONTEXT(ctx
);
2592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2593 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2598 if (ctx
->ExecuteFlag
) {
2599 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2605 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2607 GET_CURRENT_CONTEXT(ctx
);
2609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2610 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2617 if (ctx
->ExecuteFlag
) {
2618 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2623 static void save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2625 save_PointParameterfvEXT(pname
, ¶m
);
2628 static void save_PointParameteriNV( GLenum pname
, GLint param
)
2630 GLfloat p
= (GLfloat
) param
;
2631 save_PointParameterfvEXT(pname
, &p
);
2634 static void save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2636 GLfloat p
= (GLfloat
) param
[0];
2637 save_PointParameterfvEXT(pname
, &p
);
2641 static void save_PointSize( GLfloat size
)
2643 GET_CURRENT_CONTEXT(ctx
);
2645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2646 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2650 if (ctx
->ExecuteFlag
) {
2651 (*ctx
->Exec
->PointSize
)( size
);
2656 static void save_PolygonMode( GLenum face
, GLenum mode
)
2658 GET_CURRENT_CONTEXT(ctx
);
2660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2661 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2666 if (ctx
->ExecuteFlag
) {
2667 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2673 * Polygon stipple must have been upacked already!
2675 static void save_PolygonStipple( const GLubyte
*pattern
)
2677 GET_CURRENT_CONTEXT(ctx
);
2679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2680 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2683 n
[1].data
= MALLOC( 32 * 4 );
2684 data
= n
[1].data
; /* This needed for Acorn compiler */
2685 MEMCPY( data
, pattern
, 32 * 4 );
2687 if (ctx
->ExecuteFlag
) {
2688 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2693 static void save_PolygonOffset( GLfloat factor
, GLfloat units
)
2695 GET_CURRENT_CONTEXT(ctx
);
2697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2698 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2703 if (ctx
->ExecuteFlag
) {
2704 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2709 static void save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2711 GET_CURRENT_CONTEXT(ctx
);
2712 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2716 static void save_PopAttrib( void )
2718 GET_CURRENT_CONTEXT(ctx
);
2719 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2720 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2721 if (ctx
->ExecuteFlag
) {
2722 (*ctx
->Exec
->PopAttrib
)();
2727 static void save_PopMatrix( void )
2729 GET_CURRENT_CONTEXT(ctx
);
2730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2731 FLUSH_CURRENT(ctx
, 0);
2732 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2733 if (ctx
->ExecuteFlag
) {
2734 (*ctx
->Exec
->PopMatrix
)();
2739 static void save_PopName( void )
2741 GET_CURRENT_CONTEXT(ctx
);
2742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2743 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2744 if (ctx
->ExecuteFlag
) {
2745 (*ctx
->Exec
->PopName
)();
2750 static void save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2751 const GLclampf
*priorities
)
2753 GET_CURRENT_CONTEXT(ctx
);
2755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2757 for (i
=0;i
<num
;i
++) {
2759 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2761 n
[1].ui
= textures
[i
];
2762 n
[2].f
= priorities
[i
];
2765 if (ctx
->ExecuteFlag
) {
2766 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2771 static void save_PushAttrib( GLbitfield mask
)
2773 GET_CURRENT_CONTEXT(ctx
);
2775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2776 FLUSH_CURRENT(ctx
, 0);
2777 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2781 if (ctx
->ExecuteFlag
) {
2782 (*ctx
->Exec
->PushAttrib
)( mask
);
2787 static void save_PushMatrix( void )
2789 GET_CURRENT_CONTEXT(ctx
);
2790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2791 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2792 if (ctx
->ExecuteFlag
) {
2793 (*ctx
->Exec
->PushMatrix
)();
2798 static void save_PushName( GLuint name
)
2800 GET_CURRENT_CONTEXT(ctx
);
2802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2803 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2807 if (ctx
->ExecuteFlag
) {
2808 (*ctx
->Exec
->PushName
)( name
);
2813 static void save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2815 GET_CURRENT_CONTEXT(ctx
);
2817 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2818 FLUSH_CURRENT(ctx
, 0);
2819 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2826 if (ctx
->ExecuteFlag
) {
2827 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2831 static void save_RasterPos2d(GLdouble x
, GLdouble y
)
2833 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2836 static void save_RasterPos2f(GLfloat x
, GLfloat y
)
2838 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2841 static void save_RasterPos2i(GLint x
, GLint y
)
2843 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2846 static void save_RasterPos2s(GLshort x
, GLshort y
)
2848 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2851 static void save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2853 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2856 static void save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2858 save_RasterPos4f(x
, y
, z
, 1.0F
);
2861 static void save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2863 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2866 static void save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2868 save_RasterPos4f(x
, y
, z
, 1.0F
);
2871 static void save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2873 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2876 static void save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2878 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2881 static void save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2883 save_RasterPos4f(x
, y
, z
, w
);
2886 static void save_RasterPos2dv(const GLdouble
*v
)
2888 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2891 static void save_RasterPos2fv(const GLfloat
*v
)
2893 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2896 static void save_RasterPos2iv(const GLint
*v
)
2898 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2901 static void save_RasterPos2sv(const GLshort
*v
)
2903 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2906 static void save_RasterPos3dv(const GLdouble
*v
)
2908 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2911 static void save_RasterPos3fv(const GLfloat
*v
)
2913 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2916 static void save_RasterPos3iv(const GLint
*v
)
2918 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2921 static void save_RasterPos3sv(const GLshort
*v
)
2923 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2926 static void save_RasterPos4dv(const GLdouble
*v
)
2928 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2929 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2932 static void save_RasterPos4fv(const GLfloat
*v
)
2934 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2937 static void save_RasterPos4iv(const GLint
*v
)
2939 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2940 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2943 static void save_RasterPos4sv(const GLshort
*v
)
2945 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2949 static void save_PassThrough( GLfloat token
)
2951 GET_CURRENT_CONTEXT(ctx
);
2953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2954 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
2958 if (ctx
->ExecuteFlag
) {
2959 (*ctx
->Exec
->PassThrough
)( token
);
2964 static void save_ReadBuffer( GLenum mode
)
2966 GET_CURRENT_CONTEXT(ctx
);
2968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2969 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
2973 if (ctx
->ExecuteFlag
) {
2974 (*ctx
->Exec
->ReadBuffer
)( mode
);
2980 save_ResetHistogram(GLenum target
)
2982 GET_CURRENT_CONTEXT(ctx
);
2984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2985 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
2989 if (ctx
->ExecuteFlag
) {
2990 (*ctx
->Exec
->ResetHistogram
)( target
);
2996 save_ResetMinmax(GLenum target
)
2998 GET_CURRENT_CONTEXT(ctx
);
3000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3001 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3005 if (ctx
->ExecuteFlag
) {
3006 (*ctx
->Exec
->ResetMinmax
)( target
);
3011 static void save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3013 GET_CURRENT_CONTEXT(ctx
);
3015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3016 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3023 if (ctx
->ExecuteFlag
) {
3024 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3029 static void save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3031 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3035 static void save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3037 GET_CURRENT_CONTEXT(ctx
);
3039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3040 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3046 if (ctx
->ExecuteFlag
) {
3047 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3052 static void save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3054 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3058 static void save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3060 GET_CURRENT_CONTEXT(ctx
);
3062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3070 if (ctx
->ExecuteFlag
) {
3071 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3076 static void save_ShadeModel( GLenum mode
)
3078 GET_CURRENT_CONTEXT(ctx
);
3080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3081 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3085 if (ctx
->ExecuteFlag
) {
3086 (*ctx
->Exec
->ShadeModel
)( mode
);
3091 static void save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3093 GET_CURRENT_CONTEXT(ctx
);
3095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3096 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3102 if (ctx
->ExecuteFlag
) {
3103 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3108 static void save_StencilMask( GLuint mask
)
3110 GET_CURRENT_CONTEXT(ctx
);
3112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3113 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3117 if (ctx
->ExecuteFlag
) {
3118 (*ctx
->Exec
->StencilMask
)( mask
);
3123 static void save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3125 GET_CURRENT_CONTEXT(ctx
);
3127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3128 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3134 if (ctx
->ExecuteFlag
) {
3135 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3140 static void save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3142 GET_CURRENT_CONTEXT(ctx
);
3144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3145 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3154 if (ctx
->ExecuteFlag
) {
3155 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3160 static void save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3162 save_TexEnvfv( target
, pname
, ¶m
);
3166 static void save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3169 p
[0] = (GLfloat
) param
;
3170 p
[1] = p
[2] = p
[3] = 0.0;
3171 save_TexEnvfv( target
, pname
, p
);
3175 static void save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3178 p
[0] = INT_TO_FLOAT( param
[0] );
3179 p
[1] = INT_TO_FLOAT( param
[1] );
3180 p
[2] = INT_TO_FLOAT( param
[2] );
3181 p
[3] = INT_TO_FLOAT( param
[3] );
3182 save_TexEnvfv( target
, pname
, p
);
3186 static void save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3188 GET_CURRENT_CONTEXT(ctx
);
3190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3191 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3200 if (ctx
->ExecuteFlag
) {
3201 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3206 static void save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3209 p
[0] = (GLfloat
) params
[0];
3210 p
[1] = (GLfloat
) params
[1];
3211 p
[2] = (GLfloat
) params
[2];
3212 p
[3] = (GLfloat
) params
[3];
3213 save_TexGenfv(coord
, pname
, p
);
3217 static void save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3219 GLfloat p
= (GLfloat
) param
;
3220 save_TexGenfv( coord
, pname
, &p
);
3224 static void save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3227 p
[0] = (GLfloat
) params
[0];
3228 p
[1] = (GLfloat
) params
[1];
3229 p
[2] = (GLfloat
) params
[2];
3230 p
[3] = (GLfloat
) params
[3];
3231 save_TexGenfv( coord
, pname
, p
);
3235 static void save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3237 save_TexGenfv(coord
, pname
, ¶m
);
3241 static void save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3243 save_TexGeniv( coord
, pname
, ¶m
);
3247 static void save_TexParameterfv( GLenum target
,
3248 GLenum pname
, const GLfloat
*params
)
3250 GET_CURRENT_CONTEXT(ctx
);
3252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3253 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3262 if (ctx
->ExecuteFlag
) {
3263 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3268 static void save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3270 save_TexParameterfv(target
, pname
, ¶m
);
3274 static void save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3277 fparam
[0] = (GLfloat
) param
;
3278 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3279 save_TexParameterfv(target
, pname
, fparam
);
3283 static void save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3286 fparam
[0] = (GLfloat
) params
[0];
3287 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3288 save_TexParameterfv(target
, pname
, fparam
);
3292 static void save_TexImage1D( GLenum target
,
3293 GLint level
, GLint components
,
3294 GLsizei width
, GLint border
,
3295 GLenum format
, GLenum type
,
3296 const GLvoid
*pixels
)
3298 GET_CURRENT_CONTEXT(ctx
);
3299 if (target
== GL_PROXY_TEXTURE_1D
) {
3300 /* don't compile, execute immediately */
3301 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3302 border
, format
, type
, pixels
);
3305 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3306 pixels
, &ctx
->Unpack
);
3308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3309 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3313 n
[3].i
= components
;
3314 n
[4].i
= (GLint
) width
;
3323 if (ctx
->ExecuteFlag
) {
3324 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3325 border
, format
, type
, pixels
);
3331 static void save_TexImage2D( GLenum target
,
3332 GLint level
, GLint components
,
3333 GLsizei width
, GLsizei height
, GLint border
,
3334 GLenum format
, GLenum type
,
3335 const GLvoid
*pixels
)
3337 GET_CURRENT_CONTEXT(ctx
);
3338 if (target
== GL_PROXY_TEXTURE_2D
) {
3339 /* don't compile, execute immediately */
3340 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3341 height
, border
, format
, type
, pixels
);
3344 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3345 pixels
, &ctx
->Unpack
);
3347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3348 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3352 n
[3].i
= components
;
3353 n
[4].i
= (GLint
) width
;
3354 n
[5].i
= (GLint
) height
;
3363 if (ctx
->ExecuteFlag
) {
3364 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3365 height
, border
, format
, type
, pixels
);
3371 static void save_TexImage3D( GLenum target
,
3372 GLint level
, GLint internalFormat
,
3373 GLsizei width
, GLsizei height
, GLsizei depth
,
3375 GLenum format
, GLenum type
,
3376 const GLvoid
*pixels
)
3378 GET_CURRENT_CONTEXT(ctx
);
3379 if (target
== GL_PROXY_TEXTURE_3D
) {
3380 /* don't compile, execute immediately */
3381 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3382 height
, depth
, border
, format
, type
, pixels
);
3386 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3387 pixels
, &ctx
->Unpack
);
3388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3389 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3393 n
[3].i
= (GLint
) internalFormat
;
3394 n
[4].i
= (GLint
) width
;
3395 n
[5].i
= (GLint
) height
;
3396 n
[6].i
= (GLint
) depth
;
3405 if (ctx
->ExecuteFlag
) {
3406 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3407 height
, depth
, border
, format
, type
, pixels
);
3413 static void save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3414 GLsizei width
, GLenum format
, GLenum type
,
3415 const GLvoid
*pixels
)
3417 GET_CURRENT_CONTEXT(ctx
);
3419 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3420 pixels
, &ctx
->Unpack
);
3421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3422 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3427 n
[4].i
= (GLint
) width
;
3435 if (ctx
->ExecuteFlag
) {
3436 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3437 format
, type
, pixels
);
3442 static void save_TexSubImage2D( GLenum target
, GLint level
,
3443 GLint xoffset
, GLint yoffset
,
3444 GLsizei width
, GLsizei height
,
3445 GLenum format
, GLenum type
,
3446 const GLvoid
*pixels
)
3448 GET_CURRENT_CONTEXT(ctx
);
3450 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3451 pixels
, &ctx
->Unpack
);
3452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3453 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3459 n
[5].i
= (GLint
) width
;
3460 n
[6].i
= (GLint
) height
;
3468 if (ctx
->ExecuteFlag
) {
3469 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3470 width
, height
, format
, type
, pixels
);
3475 static void save_TexSubImage3D( GLenum target
, GLint level
,
3476 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3477 GLsizei width
, GLsizei height
, GLsizei depth
,
3478 GLenum format
, GLenum type
,
3479 const GLvoid
*pixels
)
3481 GET_CURRENT_CONTEXT(ctx
);
3483 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3484 pixels
, &ctx
->Unpack
);
3485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3486 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3493 n
[6].i
= (GLint
) width
;
3494 n
[7].i
= (GLint
) height
;
3495 n
[8].i
= (GLint
) depth
;
3503 if (ctx
->ExecuteFlag
) {
3504 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3505 xoffset
, yoffset
, zoffset
,
3506 width
, height
, depth
, format
, type
, pixels
);
3511 static void save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3513 GET_CURRENT_CONTEXT(ctx
);
3515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3516 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3522 if (ctx
->ExecuteFlag
) {
3523 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3528 static void save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3530 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3535 static void save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3537 GET_CURRENT_CONTEXT(ctx
);
3539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3540 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3544 n
[3].i
= (GLint
) width
;
3545 n
[4].i
= (GLint
) height
;
3547 if (ctx
->ExecuteFlag
) {
3548 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3553 static void save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3555 GET_CURRENT_CONTEXT(ctx
);
3557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3558 FLUSH_CURRENT(ctx
, 0);
3559 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3566 if (ctx
->ExecuteFlag
) {
3567 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3571 static void save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3573 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3576 static void save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3578 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3581 static void save_WindowPos2iMESA(GLint x
, GLint y
)
3583 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3586 static void save_WindowPos2sMESA(GLshort x
, GLshort y
)
3588 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3591 static void save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3593 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3596 static void save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3598 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3601 static void save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3603 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3606 static void save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3608 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3611 static void save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3613 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3616 static void save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3618 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3621 static void save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3623 save_WindowPos4fMESA(x
, y
, z
, w
);
3626 static void save_WindowPos2dvMESA(const GLdouble
*v
)
3628 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3631 static void save_WindowPos2fvMESA(const GLfloat
*v
)
3633 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3636 static void save_WindowPos2ivMESA(const GLint
*v
)
3638 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3641 static void save_WindowPos2svMESA(const GLshort
*v
)
3643 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3646 static void save_WindowPos3dvMESA(const GLdouble
*v
)
3648 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3651 static void save_WindowPos3fvMESA(const GLfloat
*v
)
3653 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3656 static void save_WindowPos3ivMESA(const GLint
*v
)
3658 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3661 static void save_WindowPos3svMESA(const GLshort
*v
)
3663 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3666 static void save_WindowPos4dvMESA(const GLdouble
*v
)
3668 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3669 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3672 static void save_WindowPos4fvMESA(const GLfloat
*v
)
3674 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3677 static void save_WindowPos4ivMESA(const GLint
*v
)
3679 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3680 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3683 static void save_WindowPos4svMESA(const GLshort
*v
)
3685 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3690 /* GL_ARB_multitexture */
3691 static void save_ActiveTextureARB( GLenum target
)
3693 GET_CURRENT_CONTEXT(ctx
);
3695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3696 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3700 if (ctx
->ExecuteFlag
) {
3701 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3706 /* GL_ARB_transpose_matrix */
3708 static void save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3711 _math_transposefd(tm
, m
);
3712 save_LoadMatrixf(tm
);
3716 static void save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3719 _math_transposef(tm
, m
);
3720 save_LoadMatrixf(tm
);
3725 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3728 _math_transposefd(tm
, m
);
3729 save_MultMatrixf(tm
);
3734 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3737 _math_transposef(tm
, m
);
3738 save_MultMatrixf(tm
);
3743 save_PixelTexGenSGIX(GLenum mode
)
3745 GET_CURRENT_CONTEXT(ctx
);
3747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3748 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3752 if (ctx
->ExecuteFlag
) {
3753 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3758 /* GL_ARB_texture_compression */
3760 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3761 GLenum internalFormat
, GLsizei width
,
3762 GLint border
, GLsizei imageSize
,
3765 GET_CURRENT_CONTEXT(ctx
);
3766 if (target
== GL_PROXY_TEXTURE_1D
) {
3767 /* don't compile, execute immediately */
3768 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3769 width
, border
, imageSize
, data
);
3774 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3775 /* make copy of image */
3776 image
= MALLOC(imageSize
);
3778 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3781 MEMCPY(image
, data
, imageSize
);
3782 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3786 n
[3].e
= internalFormat
;
3787 n
[4].i
= (GLint
) width
;
3795 if (ctx
->ExecuteFlag
) {
3796 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3797 width
, border
, imageSize
, data
);
3804 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3805 GLenum internalFormat
, GLsizei width
,
3806 GLsizei height
, GLint border
, GLsizei imageSize
,
3809 GET_CURRENT_CONTEXT(ctx
);
3810 if (target
== GL_PROXY_TEXTURE_2D
) {
3811 /* don't compile, execute immediately */
3812 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3813 width
, height
, border
, imageSize
, data
);
3818 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
, "glCompressedTexImage2DARB");
3825 MEMCPY(image
, data
, imageSize
);
3826 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3830 n
[3].e
= internalFormat
;
3831 n
[4].i
= (GLint
) width
;
3832 n
[5].i
= (GLint
) height
;
3840 if (ctx
->ExecuteFlag
) {
3841 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3842 width
, height
, border
, imageSize
, data
);
3849 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3850 GLenum internalFormat
, GLsizei width
,
3851 GLsizei height
, GLsizei depth
, GLint border
,
3852 GLsizei imageSize
, const GLvoid
*data
)
3854 GET_CURRENT_CONTEXT(ctx
);
3855 if (target
== GL_PROXY_TEXTURE_3D
) {
3856 /* don't compile, execute immediately */
3857 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3858 width
, height
, depth
, border
, imageSize
, data
);
3863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3864 /* make copy of image */
3865 image
= MALLOC(imageSize
);
3867 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3870 MEMCPY(image
, data
, imageSize
);
3871 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3875 n
[3].e
= internalFormat
;
3876 n
[4].i
= (GLint
) width
;
3877 n
[5].i
= (GLint
) height
;
3878 n
[6].i
= (GLint
) depth
;
3886 if (ctx
->ExecuteFlag
) {
3887 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3888 width
, height
, depth
, border
, imageSize
, data
);
3895 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3896 GLsizei width
, GLenum format
,
3897 GLsizei imageSize
, const GLvoid
*data
)
3902 GET_CURRENT_CONTEXT(ctx
);
3903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3905 /* make copy of image */
3906 image
= MALLOC(imageSize
);
3908 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
3911 MEMCPY(image
, data
, imageSize
);
3912 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
3917 n
[4].i
= (GLint
) width
;
3925 if (ctx
->ExecuteFlag
) {
3926 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
3927 width
, format
, imageSize
, data
);
3933 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
3934 GLint yoffset
, GLsizei width
, GLsizei height
,
3935 GLenum format
, GLsizei imageSize
,
3941 GET_CURRENT_CONTEXT(ctx
);
3942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3944 /* make copy of image */
3945 image
= MALLOC(imageSize
);
3947 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
3950 MEMCPY(image
, data
, imageSize
);
3951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
3957 n
[5].i
= (GLint
) width
;
3958 n
[6].i
= (GLint
) height
;
3966 if (ctx
->ExecuteFlag
) {
3967 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
3968 width
, height
, format
, imageSize
, data
);
3974 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
3975 GLint yoffset
, GLint zoffset
, GLsizei width
,
3976 GLsizei height
, GLsizei depth
, GLenum format
,
3977 GLsizei imageSize
, const GLvoid
*data
)
3982 GET_CURRENT_CONTEXT(ctx
);
3983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3985 /* make copy of image */
3986 image
= MALLOC(imageSize
);
3988 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
3991 MEMCPY(image
, data
, imageSize
);
3992 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
3999 n
[6].i
= (GLint
) width
;
4000 n
[7].i
= (GLint
) height
;
4001 n
[8].i
= (GLint
) depth
;
4003 n
[10].i
= imageSize
;
4009 if (ctx
->ExecuteFlag
) {
4010 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4011 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4016 /* GL_ARB_multisample */
4018 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4020 GET_CURRENT_CONTEXT(ctx
);
4022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4028 if (ctx
->ExecuteFlag
) {
4029 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4034 /* GL_SGIS_pixel_texture */
4037 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4039 GET_CURRENT_CONTEXT(ctx
);
4041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4042 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4047 if (ctx
->ExecuteFlag
) {
4048 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4054 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4056 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4061 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4063 save_PixelTexGenParameteriSGIS(target
, *value
);
4068 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4070 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4075 * GL_NV_vertex_program
4077 #if FEATURE_NV_vertex_program
4079 save_BindProgramNV(GLenum target
, GLuint id
)
4081 GET_CURRENT_CONTEXT(ctx
);
4083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4084 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4089 if (ctx
->ExecuteFlag
) {
4090 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4095 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4097 GET_CURRENT_CONTEXT(ctx
);
4099 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4100 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4109 if (ctx
->ExecuteFlag
) {
4110 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4116 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4117 GLfloat x
, GLfloat y
,
4118 GLfloat z
, GLfloat w
)
4120 GET_CURRENT_CONTEXT(ctx
);
4122 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4123 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4132 if (ctx
->ExecuteFlag
) {
4133 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4139 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4141 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4142 params
[2], params
[3]);
4147 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4148 GLdouble x
, GLdouble y
,
4149 GLdouble z
, GLdouble w
)
4151 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4152 (GLfloat
) z
, (GLfloat
) w
);
4157 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4158 const GLdouble
*params
)
4160 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4161 (GLfloat
) params
[1], (GLfloat
) params
[2],
4162 (GLfloat
) params
[3]);
4167 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4168 GLuint num
, const GLdouble
*params
)
4171 for (i
= 0; i
< num
; i
++) {
4172 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4178 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4179 GLuint num
, const GLfloat
*params
)
4182 for (i
= 0; i
< num
; i
++) {
4183 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4189 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4190 const GLubyte
*program
)
4192 GET_CURRENT_CONTEXT(ctx
);
4194 GLubyte
*programCopy
;
4196 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4198 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4201 _mesa_memcpy(programCopy
, program
, len
);
4203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4204 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4209 n
[4].data
= programCopy
;
4211 if (ctx
->ExecuteFlag
) {
4212 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4218 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4220 GET_CURRENT_CONTEXT(ctx
);
4222 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4224 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4227 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4229 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4234 if (ctx
->ExecuteFlag
) {
4235 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4241 save_TrackMatrixNV(GLenum target
, GLuint address
,
4242 GLenum matrix
, GLenum transform
)
4244 GET_CURRENT_CONTEXT(ctx
);
4246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4247 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4254 if (ctx
->ExecuteFlag
) {
4255 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4258 #endif /* FEATURE_NV_vertex_program */
4262 * GL_NV_fragment_program
4264 #if FEATURE_NV_fragment_program
4266 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4267 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4269 GET_CURRENT_CONTEXT(ctx
);
4271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4272 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4281 if (ctx
->ExecuteFlag
) {
4282 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4288 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4289 const GLfloat
*params
)
4291 GET_CURRENT_CONTEXT(ctx
);
4293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4294 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4303 if (ctx
->ExecuteFlag
) {
4304 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4310 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4311 GLdouble x
, GLdouble y
,
4312 GLdouble z
, GLdouble w
)
4314 GET_CURRENT_CONTEXT(ctx
);
4316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4317 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4321 n
[3].f
= (GLfloat
) x
;
4322 n
[4].f
= (GLfloat
) y
;
4323 n
[5].f
= (GLfloat
) z
;
4324 n
[6].f
= (GLfloat
) w
;
4326 if (ctx
->ExecuteFlag
) {
4327 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4333 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4334 const GLdouble
*params
)
4336 GET_CURRENT_CONTEXT(ctx
);
4338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4339 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4343 n
[3].f
= (GLfloat
) params
[0];
4344 n
[4].f
= (GLfloat
) params
[1];
4345 n
[5].f
= (GLfloat
) params
[2];
4346 n
[6].f
= (GLfloat
) params
[3];
4348 if (ctx
->ExecuteFlag
) {
4349 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4354 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4355 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4357 GET_CURRENT_CONTEXT(ctx
);
4359 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4361 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4364 _mesa_memcpy(nameCopy
, name
, len
);
4366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4367 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4371 n
[3].data
= nameCopy
;
4377 if (ctx
->ExecuteFlag
) {
4378 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4384 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4387 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4392 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4393 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4395 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4396 (GLfloat
) z
,(GLfloat
) w
);
4401 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4404 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4405 (GLfloat
) v
[1], (GLfloat
) v
[2],
4409 #endif /* FEATURE_NV_fragment_program */
4413 /* GL_EXT_stencil_two_side */
4414 static void save_ActiveStencilFaceEXT( GLenum face
)
4416 GET_CURRENT_CONTEXT(ctx
);
4418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4419 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4423 if (ctx
->ExecuteFlag
) {
4424 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4429 /* GL_EXT_depth_bounds_test */
4430 static void save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4432 GET_CURRENT_CONTEXT(ctx
);
4434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4435 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4437 n
[1].f
= (GLfloat
) zmin
;
4438 n
[2].f
= (GLfloat
) zmax
;
4440 if (ctx
->ExecuteFlag
) {
4441 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4447 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4450 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4451 const GLvoid
*string
)
4453 GET_CURRENT_CONTEXT(ctx
);
4455 GLubyte
*programCopy
;
4457 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4459 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4462 _mesa_memcpy(programCopy
, string
, len
);
4464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4465 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4470 n
[4].data
= programCopy
;
4472 if (ctx
->ExecuteFlag
) {
4473 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4479 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4480 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4482 GET_CURRENT_CONTEXT(ctx
);
4484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4485 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4494 if (ctx
->ExecuteFlag
) {
4495 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4501 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4502 const GLfloat
*params
)
4504 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4505 params
[2], params
[3]);
4510 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4511 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4513 save_ProgramEnvParameter4fARB(target
, index
,
4522 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4523 const GLdouble
*params
)
4525 save_ProgramEnvParameter4fARB(target
, index
,
4526 (GLfloat
) params
[0],
4527 (GLfloat
) params
[1],
4528 (GLfloat
) params
[2],
4529 (GLfloat
) params
[3]);
4532 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4536 /* KW: Compile commands
4538 * Will appear in the list before the vertex buffer containing the
4539 * command that provoked the error. I don't see this as a problem.
4542 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
4545 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
4548 n
[2].data
= (void *) s
;
4550 /* execute already done */
4555 * Compile an error into current display list.
4558 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
4560 if (ctx
->CompileFlag
)
4561 _mesa_save_error( ctx
, error
, s
);
4563 if (ctx
->ExecuteFlag
)
4564 _mesa_error( ctx
, error
, s
);
4570 islist(GLcontext
*ctx
, GLuint list
)
4572 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
4582 /**********************************************************************/
4583 /* Display list execution */
4584 /**********************************************************************/
4588 * Execute a display list. Note that the ListBase offset must have already
4589 * been added before calling this function. I.e. the list argument is
4590 * the absolute list number, not relative to ListBase.
4591 * \param list - display list number
4594 execute_list( GLcontext
*ctx
, GLuint list
)
4599 if (list
== 0 || !islist(ctx
,list
))
4602 if (ctx
->Driver
.BeginCallList
)
4603 ctx
->Driver
.BeginCallList( ctx
, list
);
4607 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
4611 OpCode opcode
= n
[0].opcode
;
4612 int i
= (int)n
[0].opcode
- (int)OPCODE_DRV_0
;
4614 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
4615 ctx
->listext
.opcode
[i
].execute(ctx
, &n
[1]);
4616 n
+= ctx
->listext
.opcode
[i
].size
;
4621 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
4624 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
4626 case OPCODE_ALPHA_FUNC
:
4627 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
4629 case OPCODE_BIND_TEXTURE
:
4630 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
4634 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4635 ctx
->Unpack
= _mesa_native_packing
;
4636 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
4637 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
4638 ctx
->Unpack
= save
; /* restore */
4641 case OPCODE_BLEND_COLOR
:
4642 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4644 case OPCODE_BLEND_EQUATION
:
4645 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
4647 case OPCODE_BLEND_FUNC
:
4648 (*ctx
->Exec
->BlendFunc
)( n
[1].e
, n
[2].e
);
4650 case OPCODE_BLEND_FUNC_SEPARATE
:
4651 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
4653 case OPCODE_CALL_LIST
:
4654 /* Generated by glCallList(), don't add ListBase */
4655 if (ctx
->CallDepth
<MAX_LIST_NESTING
) {
4656 execute_list( ctx
, n
[1].ui
);
4659 case OPCODE_CALL_LIST_OFFSET
:
4660 /* Generated by glCallLists() so we must add ListBase */
4662 /* user specified a bad data type at compile time */
4663 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
4665 else if (ctx
->CallDepth
< MAX_LIST_NESTING
) {
4666 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
4670 (*ctx
->Exec
->Clear
)( n
[1].bf
);
4672 case OPCODE_CLEAR_COLOR
:
4673 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4675 case OPCODE_CLEAR_ACCUM
:
4676 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
4678 case OPCODE_CLEAR_DEPTH
:
4679 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
4681 case OPCODE_CLEAR_INDEX
:
4682 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
4684 case OPCODE_CLEAR_STENCIL
:
4685 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
4687 case OPCODE_CLIP_PLANE
:
4694 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
4697 case OPCODE_COLOR_MASK
:
4698 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
4700 case OPCODE_COLOR_MATERIAL
:
4701 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
4703 case OPCODE_COLOR_TABLE
:
4705 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4706 ctx
->Unpack
= _mesa_native_packing
;
4707 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
4708 n
[5].e
, n
[6].data
);
4709 ctx
->Unpack
= save
; /* restore */
4712 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
4719 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
4722 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
4729 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
4732 case OPCODE_COLOR_SUB_TABLE
:
4734 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4735 ctx
->Unpack
= _mesa_native_packing
;
4736 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
4737 n
[4].e
, n
[5].e
, n
[6].data
);
4738 ctx
->Unpack
= save
; /* restore */
4741 case OPCODE_CONVOLUTION_FILTER_1D
:
4743 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4744 ctx
->Unpack
= _mesa_native_packing
;
4745 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4746 n
[4].e
, n
[5].e
, n
[6].data
);
4747 ctx
->Unpack
= save
; /* restore */
4750 case OPCODE_CONVOLUTION_FILTER_2D
:
4752 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4753 ctx
->Unpack
= _mesa_native_packing
;
4754 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4755 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
4756 ctx
->Unpack
= save
; /* restore */
4759 case OPCODE_CONVOLUTION_PARAMETER_I
:
4760 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
4762 case OPCODE_CONVOLUTION_PARAMETER_IV
:
4769 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
4772 case OPCODE_CONVOLUTION_PARAMETER_F
:
4773 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
4775 case OPCODE_CONVOLUTION_PARAMETER_FV
:
4782 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
4785 case OPCODE_COPY_COLOR_SUB_TABLE
:
4786 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
4787 n
[3].i
, n
[4].i
, n
[5].i
);
4789 case OPCODE_COPY_COLOR_TABLE
:
4790 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
4791 n
[3].i
, n
[4].i
, n
[5].i
);
4793 case OPCODE_COPY_PIXELS
:
4794 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
4795 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
4797 case OPCODE_COPY_TEX_IMAGE1D
:
4798 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
4799 n
[5].i
, n
[6].i
, n
[7].i
);
4801 case OPCODE_COPY_TEX_IMAGE2D
:
4802 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
4803 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
4805 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
4806 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4807 n
[4].i
, n
[5].i
, n
[6].i
);
4809 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
4810 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4811 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
4813 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
4814 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
4815 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
4817 case OPCODE_CULL_FACE
:
4818 (*ctx
->Exec
->CullFace
)( n
[1].e
);
4820 case OPCODE_DEPTH_FUNC
:
4821 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
4823 case OPCODE_DEPTH_MASK
:
4824 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
4826 case OPCODE_DEPTH_RANGE
:
4827 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
4829 case OPCODE_DISABLE
:
4830 (*ctx
->Exec
->Disable
)( n
[1].e
);
4832 case OPCODE_DRAW_BUFFER
:
4833 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
4835 case OPCODE_DRAW_PIXELS
:
4837 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
4838 ctx
->Unpack
= _mesa_native_packing
;
4839 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
4841 ctx
->Unpack
= save
; /* restore */
4845 (*ctx
->Exec
->Enable
)( n
[1].e
);
4847 case OPCODE_EVALMESH1
:
4848 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
4850 case OPCODE_EVALMESH2
:
4851 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
4860 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
4863 case OPCODE_FRONT_FACE
:
4864 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
4866 case OPCODE_FRUSTUM
:
4867 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
4870 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
4872 case OPCODE_HISTOGRAM
:
4873 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
4875 case OPCODE_INDEX_MASK
:
4876 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
4878 case OPCODE_INIT_NAMES
:
4879 (*ctx
->Exec
->InitNames
)();
4888 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
4891 case OPCODE_LIGHT_MODEL
:
4898 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
4901 case OPCODE_LINE_STIPPLE
:
4902 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
4904 case OPCODE_LINE_WIDTH
:
4905 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
4907 case OPCODE_LIST_BASE
:
4908 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
4910 case OPCODE_LOAD_IDENTITY
:
4911 (*ctx
->Exec
->LoadIdentity
)();
4913 case OPCODE_LOAD_MATRIX
:
4914 if (sizeof(Node
)==sizeof(GLfloat
)) {
4915 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
4920 for (i
=0;i
<16;i
++) {
4923 (*ctx
->Exec
->LoadMatrixf
)( m
);
4926 case OPCODE_LOAD_NAME
:
4927 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
4929 case OPCODE_LOGIC_OP
:
4930 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
4934 GLenum target
= n
[1].e
;
4935 GLint ustride
= _mesa_evaluator_components(target
);
4936 GLint uorder
= n
[5].i
;
4937 GLfloat u1
= n
[2].f
;
4938 GLfloat u2
= n
[3].f
;
4939 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
4940 (GLfloat
*) n
[6].data
);
4945 GLenum target
= n
[1].e
;
4946 GLfloat u1
= n
[2].f
;
4947 GLfloat u2
= n
[3].f
;
4948 GLfloat v1
= n
[4].f
;
4949 GLfloat v2
= n
[5].f
;
4950 GLint ustride
= n
[6].i
;
4951 GLint vstride
= n
[7].i
;
4952 GLint uorder
= n
[8].i
;
4953 GLint vorder
= n
[9].i
;
4954 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
4955 v1
, v2
, vstride
, vorder
,
4956 (GLfloat
*) n
[10].data
);
4959 case OPCODE_MAPGRID1
:
4960 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
4962 case OPCODE_MAPGRID2
:
4963 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
4965 case OPCODE_MATRIX_MODE
:
4966 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
4968 case OPCODE_MIN_MAX
:
4969 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
4971 case OPCODE_MULT_MATRIX
:
4972 if (sizeof(Node
)==sizeof(GLfloat
)) {
4973 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
4978 for (i
=0;i
<16;i
++) {
4981 (*ctx
->Exec
->MultMatrixf
)( m
);
4985 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
4987 case OPCODE_PASSTHROUGH
:
4988 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
4990 case OPCODE_PIXEL_MAP
:
4991 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
4993 case OPCODE_PIXEL_TRANSFER
:
4994 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
4996 case OPCODE_PIXEL_ZOOM
:
4997 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
4999 case OPCODE_POINT_SIZE
:
5000 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5002 case OPCODE_POINT_PARAMETERS
:
5008 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5011 case OPCODE_POLYGON_MODE
:
5012 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5014 case OPCODE_POLYGON_STIPPLE
:
5015 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5017 case OPCODE_POLYGON_OFFSET
:
5018 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5020 case OPCODE_POP_ATTRIB
:
5021 (*ctx
->Exec
->PopAttrib
)();
5023 case OPCODE_POP_MATRIX
:
5024 (*ctx
->Exec
->PopMatrix
)();
5026 case OPCODE_POP_NAME
:
5027 (*ctx
->Exec
->PopName
)();
5029 case OPCODE_PRIORITIZE_TEXTURE
:
5030 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5032 case OPCODE_PUSH_ATTRIB
:
5033 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5035 case OPCODE_PUSH_MATRIX
:
5036 (*ctx
->Exec
->PushMatrix
)();
5038 case OPCODE_PUSH_NAME
:
5039 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5041 case OPCODE_RASTER_POS
:
5042 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5044 case OPCODE_READ_BUFFER
:
5045 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5047 case OPCODE_RESET_HISTOGRAM
:
5048 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5050 case OPCODE_RESET_MIN_MAX
:
5051 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5054 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5057 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5059 case OPCODE_SCISSOR
:
5060 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5062 case OPCODE_SHADE_MODEL
:
5063 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5065 case OPCODE_STENCIL_FUNC
:
5066 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5068 case OPCODE_STENCIL_MASK
:
5069 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5071 case OPCODE_STENCIL_OP
:
5072 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5081 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5091 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5094 case OPCODE_TEXPARAMETER
:
5101 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5104 case OPCODE_TEX_IMAGE1D
:
5106 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5107 ctx
->Unpack
= _mesa_native_packing
;
5108 (*ctx
->Exec
->TexImage1D
)(
5109 n
[1].e
, /* target */
5111 n
[3].i
, /* components */
5113 n
[5].e
, /* border */
5114 n
[6].e
, /* format */
5117 ctx
->Unpack
= save
; /* restore */
5120 case OPCODE_TEX_IMAGE2D
:
5122 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5123 ctx
->Unpack
= _mesa_native_packing
;
5124 (*ctx
->Exec
->TexImage2D
)(
5125 n
[1].e
, /* target */
5127 n
[3].i
, /* components */
5129 n
[5].i
, /* height */
5130 n
[6].e
, /* border */
5131 n
[7].e
, /* format */
5134 ctx
->Unpack
= save
; /* restore */
5137 case OPCODE_TEX_IMAGE3D
:
5139 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5140 ctx
->Unpack
= _mesa_native_packing
;
5141 (*ctx
->Exec
->TexImage3D
)(
5142 n
[1].e
, /* target */
5144 n
[3].i
, /* components */
5146 n
[5].i
, /* height */
5148 n
[7].e
, /* border */
5149 n
[8].e
, /* format */
5152 ctx
->Unpack
= save
; /* restore */
5155 case OPCODE_TEX_SUB_IMAGE1D
:
5157 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5158 ctx
->Unpack
= _mesa_native_packing
;
5159 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5161 n
[6].e
, n
[7].data
);
5162 ctx
->Unpack
= save
; /* restore */
5165 case OPCODE_TEX_SUB_IMAGE2D
:
5167 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5168 ctx
->Unpack
= _mesa_native_packing
;
5169 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5171 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5172 ctx
->Unpack
= save
; /* restore */
5175 case OPCODE_TEX_SUB_IMAGE3D
:
5177 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5178 ctx
->Unpack
= _mesa_native_packing
;
5179 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5180 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5181 n
[8].i
, n
[9].e
, n
[10].e
,
5183 ctx
->Unpack
= save
; /* restore */
5186 case OPCODE_TRANSLATE
:
5187 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5189 case OPCODE_VIEWPORT
:
5190 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5191 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5193 case OPCODE_WINDOW_POS
:
5194 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5196 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5197 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5199 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5200 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5202 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5203 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5205 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5206 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5207 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5209 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5210 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5211 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5213 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5214 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5215 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5217 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5218 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5219 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5221 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5222 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5223 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5225 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5226 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5227 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5228 n
[9].e
, n
[10].i
, n
[11].data
);
5230 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5231 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5233 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5234 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5236 #if FEATURE_NV_vertex_program
5237 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5238 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5240 case OPCODE_EXECUTE_PROGRAM_NV
:
5247 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5250 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5251 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5252 (GLuint
*) n
[2].data
);
5254 case OPCODE_LOAD_PROGRAM_NV
:
5255 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5256 (const GLubyte
*) n
[4].data
);
5258 case OPCODE_PROGRAM_PARAMETER4F_NV
:
5259 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5260 n
[4].f
, n
[5].f
, n
[6].f
);
5262 case OPCODE_TRACK_MATRIX_NV
:
5263 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
5267 #if FEATURE_NV_fragment_program
5268 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
5269 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5270 n
[4].f
, n
[5].f
, n
[6].f
);
5272 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
5273 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
5274 (const GLubyte
*) n
[3].data
,
5275 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
5279 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
5280 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
5282 case OPCODE_DEPTH_BOUNDS_EXT
:
5283 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
5285 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5286 case OPCODE_PROGRAM_STRING_ARB
:
5287 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
5289 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
5290 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5291 n
[4].f
, n
[5].f
, n
[6].f
);
5294 case OPCODE_CONTINUE
:
5295 n
= (Node
*) n
[1].next
;
5297 case OPCODE_END_OF_LIST
:
5303 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
5304 _mesa_problem(ctx
, msg
);
5309 /* increment n to point to next compiled command */
5310 if (opcode
!=OPCODE_CONTINUE
) {
5311 n
+= InstSize
[opcode
];
5317 if (ctx
->Driver
.EndCallList
)
5318 ctx
->Driver
.EndCallList( ctx
);
5325 /**********************************************************************/
5327 /**********************************************************************/
5333 * Test if a display list number is valid.
5336 _mesa_IsList( GLuint list
)
5338 GET_CURRENT_CONTEXT(ctx
);
5339 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
5340 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
5341 return islist(ctx
, list
);
5346 * Delete a sequence of consecutive display lists.
5349 _mesa_DeleteLists( GLuint list
, GLsizei range
)
5351 GET_CURRENT_CONTEXT(ctx
);
5353 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
5354 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5357 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
5360 for (i
=list
;i
<list
+range
;i
++) {
5361 _mesa_destroy_list( ctx
, i
);
5368 * Return a display list number, n, such that lists n through n+range-1
5372 _mesa_GenLists(GLsizei range
)
5374 GET_CURRENT_CONTEXT(ctx
);
5376 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
5377 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
5380 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
5388 * Make this an atomic operation
5390 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
5392 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
5394 /* reserve the list IDs by with empty/dummy lists */
5396 for (i
=0; i
<range
; i
++) {
5397 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
5401 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
5409 * Begin a new display list.
5412 _mesa_NewList( GLuint list
, GLenum mode
)
5414 GET_CURRENT_CONTEXT(ctx
);
5415 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
5416 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5418 if (MESA_VERBOSE
&VERBOSE_API
)
5419 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
5420 _mesa_lookup_enum_by_nr(mode
));
5423 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
5427 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
5428 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
5432 if (ctx
->CurrentListPtr
) {
5433 /* already compiling a display list */
5434 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
5438 /* Allocate new display list */
5439 ctx
->CurrentListNum
= list
;
5440 ctx
->CurrentBlock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
5441 ctx
->CurrentListPtr
= ctx
->CurrentBlock
;
5442 ctx
->CurrentPos
= 0;
5443 ctx
->CompileFlag
= GL_TRUE
;
5444 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
5446 ctx
->Driver
.NewList( ctx
, list
, mode
);
5448 ctx
->CurrentDispatch
= ctx
->Save
;
5449 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5455 * End definition of current display list. Is the current
5456 * ASSERT_OUTSIDE_BEGIN_END strong enough to really guarentee that
5457 * we are outside begin/end calls?
5460 _mesa_EndList( void )
5462 GET_CURRENT_CONTEXT(ctx
);
5463 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
5464 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
5466 if (MESA_VERBOSE
&VERBOSE_API
)
5467 _mesa_debug(ctx
, "glEndList\n");
5469 /* Check that a list is under construction */
5470 if (!ctx
->CurrentListPtr
) {
5471 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
5475 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
5477 /* Destroy old list, if any */
5478 _mesa_destroy_list(ctx
, ctx
->CurrentListNum
);
5479 /* Install the list */
5480 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->CurrentListNum
, ctx
->CurrentListPtr
);
5483 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
5484 mesa_print_display_list(ctx
->CurrentListNum
);
5486 ctx
->CurrentListNum
= 0;
5487 ctx
->CurrentListPtr
= NULL
;
5488 ctx
->ExecuteFlag
= GL_TRUE
;
5489 ctx
->CompileFlag
= GL_FALSE
;
5491 ctx
->Driver
.EndList( ctx
);
5493 ctx
->CurrentDispatch
= ctx
->Exec
;
5494 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5500 _mesa_CallList( GLuint list
)
5502 GLboolean save_compile_flag
;
5503 GET_CURRENT_CONTEXT(ctx
);
5504 FLUSH_CURRENT(ctx
, 0);
5505 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
5506 /* execute the display list, and restore the CompileFlag. */
5508 if (MESA_VERBOSE
& VERBOSE_API
)
5509 _mesa_debug(ctx
, "glCallList %d\n", list
);
5512 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
5516 /* mesa_print_display_list( list ); */
5518 save_compile_flag
= ctx
->CompileFlag
;
5519 if (save_compile_flag
) {
5520 ctx
->CompileFlag
= GL_FALSE
;
5523 execute_list( ctx
, list
);
5524 ctx
->CompileFlag
= save_compile_flag
;
5526 /* also restore API function pointers to point to "save" versions */
5527 if (save_compile_flag
) {
5528 ctx
->CurrentDispatch
= ctx
->Save
;
5529 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5536 * Execute glCallLists: call multiple display lists.
5539 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
5541 GET_CURRENT_CONTEXT(ctx
);
5544 GLboolean save_compile_flag
;
5546 if (MESA_VERBOSE
& VERBOSE_API
)
5547 _mesa_debug(ctx
, "glCallLists %d\n", n
);
5551 case GL_UNSIGNED_BYTE
:
5553 case GL_UNSIGNED_SHORT
:
5555 case GL_UNSIGNED_INT
:
5563 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5567 /* Save the CompileFlag status, turn it off, execute display list,
5568 * and restore the CompileFlag.
5570 save_compile_flag
= ctx
->CompileFlag
;
5571 ctx
->CompileFlag
= GL_FALSE
;
5574 list
= translate_id( i
, type
, lists
);
5575 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
5578 ctx
->CompileFlag
= save_compile_flag
;
5580 /* also restore API function pointers to point to "save" versions */
5581 if (save_compile_flag
) {
5582 ctx
->CurrentDispatch
= ctx
->Save
;
5583 _glapi_set_dispatch( ctx
->CurrentDispatch
);
5590 * Set the offset added to list numbers in glCallLists.
5593 _mesa_ListBase( GLuint base
)
5595 GET_CURRENT_CONTEXT(ctx
);
5596 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
5597 ASSERT_OUTSIDE_BEGIN_END(ctx
);
5598 ctx
->List
.ListBase
= base
;
5602 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
5604 static void exec_Finish( void )
5606 GET_CURRENT_CONTEXT(ctx
);
5607 FLUSH_VERTICES(ctx
, 0);
5608 ctx
->Exec
->Finish();
5611 static void exec_Flush( void )
5613 GET_CURRENT_CONTEXT(ctx
);
5614 FLUSH_VERTICES(ctx
, 0);
5615 ctx
->Exec
->Flush( );
5618 static void exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
5620 GET_CURRENT_CONTEXT(ctx
);
5621 FLUSH_VERTICES(ctx
, 0);
5622 ctx
->Exec
->GetBooleanv( pname
, params
);
5625 static void exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
5627 GET_CURRENT_CONTEXT(ctx
);
5628 FLUSH_VERTICES(ctx
, 0);
5629 ctx
->Exec
->GetClipPlane( plane
, equation
);
5632 static void exec_GetDoublev( GLenum pname
, GLdouble
*params
)
5634 GET_CURRENT_CONTEXT(ctx
);
5635 FLUSH_VERTICES(ctx
, 0);
5636 ctx
->Exec
->GetDoublev( pname
, params
);
5639 static GLenum
exec_GetError( void )
5641 GET_CURRENT_CONTEXT(ctx
);
5642 FLUSH_VERTICES(ctx
, 0);
5643 return ctx
->Exec
->GetError( );
5646 static void exec_GetFloatv( GLenum pname
, GLfloat
*params
)
5648 GET_CURRENT_CONTEXT(ctx
);
5649 FLUSH_VERTICES(ctx
, 0);
5650 ctx
->Exec
->GetFloatv( pname
, params
);
5653 static void exec_GetIntegerv( GLenum pname
, GLint
*params
)
5655 GET_CURRENT_CONTEXT(ctx
);
5656 FLUSH_VERTICES(ctx
, 0);
5657 ctx
->Exec
->GetIntegerv( pname
, params
);
5660 static void exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
5662 GET_CURRENT_CONTEXT(ctx
);
5663 FLUSH_VERTICES(ctx
, 0);
5664 ctx
->Exec
->GetLightfv( light
, pname
, params
);
5667 static void exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
5669 GET_CURRENT_CONTEXT(ctx
);
5670 FLUSH_VERTICES(ctx
, 0);
5671 ctx
->Exec
->GetLightiv( light
, pname
, params
);
5674 static void exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
5676 GET_CURRENT_CONTEXT(ctx
);
5677 FLUSH_VERTICES(ctx
, 0);
5678 ctx
->Exec
->GetMapdv( target
, query
, v
);
5681 static void exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
5683 GET_CURRENT_CONTEXT(ctx
);
5684 FLUSH_VERTICES(ctx
, 0);
5685 ctx
->Exec
->GetMapfv( target
, query
, v
);
5688 static void exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
5690 GET_CURRENT_CONTEXT(ctx
);
5691 FLUSH_VERTICES(ctx
, 0);
5692 ctx
->Exec
->GetMapiv( target
, query
, v
);
5695 static void exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
5697 GET_CURRENT_CONTEXT(ctx
);
5698 FLUSH_VERTICES(ctx
, 0);
5699 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
5702 static void exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
5704 GET_CURRENT_CONTEXT(ctx
);
5705 FLUSH_VERTICES(ctx
, 0);
5706 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
5709 static void exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
5711 GET_CURRENT_CONTEXT(ctx
);
5712 FLUSH_VERTICES(ctx
, 0);
5713 ctx
->Exec
->GetPixelMapfv( map
, values
);
5716 static void exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
5718 GET_CURRENT_CONTEXT(ctx
);
5719 FLUSH_VERTICES(ctx
, 0);
5720 ctx
->Exec
->GetPixelMapuiv( map
, values
);
5723 static void exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
5725 GET_CURRENT_CONTEXT(ctx
);
5726 FLUSH_VERTICES(ctx
, 0);
5727 ctx
->Exec
->GetPixelMapusv( map
, values
);
5730 static void exec_GetPolygonStipple( GLubyte
*dest
)
5732 GET_CURRENT_CONTEXT(ctx
);
5733 FLUSH_VERTICES(ctx
, 0);
5734 ctx
->Exec
->GetPolygonStipple( dest
);
5737 static const GLubyte
*exec_GetString( GLenum name
)
5739 GET_CURRENT_CONTEXT(ctx
);
5740 FLUSH_VERTICES(ctx
, 0);
5741 return ctx
->Exec
->GetString( name
);
5744 static void exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
5746 GET_CURRENT_CONTEXT(ctx
);
5747 FLUSH_VERTICES(ctx
, 0);
5748 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
5751 static void exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
5753 GET_CURRENT_CONTEXT(ctx
);
5754 FLUSH_VERTICES(ctx
, 0);
5755 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
5758 static void exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
5760 GET_CURRENT_CONTEXT(ctx
);
5761 FLUSH_VERTICES(ctx
, 0);
5762 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
5765 static void exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
5767 GET_CURRENT_CONTEXT(ctx
);
5768 FLUSH_VERTICES(ctx
, 0);
5769 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
5772 static void exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
5774 GET_CURRENT_CONTEXT(ctx
);
5775 FLUSH_VERTICES(ctx
, 0);
5776 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
5779 static void exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
5780 GLenum type
, GLvoid
*pixels
)
5782 GET_CURRENT_CONTEXT(ctx
);
5783 FLUSH_VERTICES(ctx
, 0);
5784 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
5787 static void exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
5788 GLenum pname
, GLfloat
*params
)
5790 GET_CURRENT_CONTEXT(ctx
);
5791 FLUSH_VERTICES(ctx
, 0);
5792 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
5795 static void exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
5796 GLenum pname
, GLint
*params
)
5798 GET_CURRENT_CONTEXT(ctx
);
5799 FLUSH_VERTICES(ctx
, 0);
5800 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
5803 static void exec_GetTexParameterfv( GLenum target
, GLenum pname
,
5806 GET_CURRENT_CONTEXT(ctx
);
5807 FLUSH_VERTICES(ctx
, 0);
5808 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
5811 static void exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
5813 GET_CURRENT_CONTEXT(ctx
);
5814 FLUSH_VERTICES(ctx
, 0);
5815 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
5818 static GLboolean
exec_IsEnabled( GLenum cap
)
5820 GET_CURRENT_CONTEXT(ctx
);
5821 FLUSH_VERTICES(ctx
, 0);
5822 return ctx
->Exec
->IsEnabled( cap
);
5825 static void exec_PixelStoref( GLenum pname
, GLfloat param
)
5827 GET_CURRENT_CONTEXT(ctx
);
5828 FLUSH_VERTICES(ctx
, 0);
5829 ctx
->Exec
->PixelStoref( pname
, param
);
5832 static void exec_PixelStorei( GLenum pname
, GLint param
)
5834 GET_CURRENT_CONTEXT(ctx
);
5835 FLUSH_VERTICES(ctx
, 0);
5836 ctx
->Exec
->PixelStorei( pname
, param
);
5839 static void exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
5840 GLenum format
, GLenum type
, GLvoid
*pixels
)
5842 GET_CURRENT_CONTEXT(ctx
);
5843 FLUSH_VERTICES(ctx
, 0);
5844 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
5847 static GLint
exec_RenderMode( GLenum mode
)
5849 GET_CURRENT_CONTEXT(ctx
);
5850 FLUSH_VERTICES(ctx
, 0);
5851 return ctx
->Exec
->RenderMode( mode
);
5854 static void exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
5856 GET_CURRENT_CONTEXT(ctx
);
5857 FLUSH_VERTICES(ctx
, 0);
5858 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
5861 static void exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
5863 GET_CURRENT_CONTEXT(ctx
);
5864 FLUSH_VERTICES(ctx
, 0);
5865 ctx
->Exec
->SelectBuffer( size
, buffer
);
5868 static GLboolean
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
5869 GLboolean
*residences
)
5871 GET_CURRENT_CONTEXT(ctx
);
5872 FLUSH_VERTICES(ctx
, 0);
5873 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
5876 static void exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
5879 GET_CURRENT_CONTEXT(ctx
);
5880 FLUSH_VERTICES(ctx
, 0);
5881 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
5884 static void exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
5886 GET_CURRENT_CONTEXT(ctx
);
5887 FLUSH_VERTICES(ctx
, 0);
5888 ctx
->Exec
->DeleteTextures( n
, texName
);
5891 static void exec_DisableClientState( GLenum cap
)
5893 GET_CURRENT_CONTEXT(ctx
);
5894 FLUSH_VERTICES(ctx
, 0);
5895 ctx
->Exec
->DisableClientState( cap
);
5898 static void exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
5900 GET_CURRENT_CONTEXT(ctx
);
5901 FLUSH_VERTICES(ctx
, 0);
5902 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
5905 static void exec_EnableClientState( GLenum cap
)
5907 GET_CURRENT_CONTEXT(ctx
);
5908 FLUSH_VERTICES(ctx
, 0);
5909 ctx
->Exec
->EnableClientState( cap
);
5912 static void exec_GenTextures( GLsizei n
, GLuint
*texName
)
5914 GET_CURRENT_CONTEXT(ctx
);
5915 FLUSH_VERTICES(ctx
, 0);
5916 ctx
->Exec
->GenTextures( n
, texName
);
5919 static void exec_GetPointerv( GLenum pname
, GLvoid
**params
)
5921 GET_CURRENT_CONTEXT(ctx
);
5922 FLUSH_VERTICES(ctx
, 0);
5923 ctx
->Exec
->GetPointerv( pname
, params
);
5926 static void exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
5928 GET_CURRENT_CONTEXT(ctx
);
5929 FLUSH_VERTICES(ctx
, 0);
5930 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
5933 static void exec_InterleavedArrays(GLenum format
, GLsizei stride
,
5934 const GLvoid
*pointer
)
5936 GET_CURRENT_CONTEXT(ctx
);
5937 FLUSH_VERTICES(ctx
, 0);
5938 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
5941 static GLboolean
exec_IsTexture( GLuint texture
)
5943 GET_CURRENT_CONTEXT(ctx
);
5944 FLUSH_VERTICES(ctx
, 0);
5945 return ctx
->Exec
->IsTexture( texture
);
5948 static void exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
5950 GET_CURRENT_CONTEXT(ctx
);
5951 FLUSH_VERTICES(ctx
, 0);
5952 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
5955 static void exec_PopClientAttrib(void)
5957 GET_CURRENT_CONTEXT(ctx
);
5958 FLUSH_VERTICES(ctx
, 0);
5959 ctx
->Exec
->PopClientAttrib();
5962 static void exec_PushClientAttrib(GLbitfield mask
)
5964 GET_CURRENT_CONTEXT(ctx
);
5965 FLUSH_VERTICES(ctx
, 0);
5966 ctx
->Exec
->PushClientAttrib( mask
);
5969 static void exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
5972 GET_CURRENT_CONTEXT(ctx
);
5973 FLUSH_VERTICES(ctx
, 0);
5974 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
5977 static void exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
5980 GET_CURRENT_CONTEXT(ctx
);
5981 FLUSH_VERTICES(ctx
, 0);
5982 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
5985 static void exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
5988 GET_CURRENT_CONTEXT(ctx
);
5989 FLUSH_VERTICES(ctx
, 0);
5990 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
5993 static void exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
5994 GLint x
, GLint y
, GLsizei width
)
5996 GET_CURRENT_CONTEXT(ctx
);
5997 FLUSH_VERTICES(ctx
, 0);
5998 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6001 static void exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6002 GLint x
, GLint y
, GLsizei width
,
6005 GET_CURRENT_CONTEXT(ctx
);
6006 FLUSH_VERTICES(ctx
, 0);
6007 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6011 static void exec_GetColorTable( GLenum target
, GLenum format
,
6012 GLenum type
, GLvoid
*data
)
6014 GET_CURRENT_CONTEXT(ctx
);
6015 FLUSH_VERTICES(ctx
, 0);
6016 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6019 static void exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6022 GET_CURRENT_CONTEXT(ctx
);
6023 FLUSH_VERTICES(ctx
, 0);
6024 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6027 static void exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6030 GET_CURRENT_CONTEXT(ctx
);
6031 FLUSH_VERTICES(ctx
, 0);
6032 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6035 static void exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6038 GET_CURRENT_CONTEXT(ctx
);
6039 FLUSH_VERTICES(ctx
, 0);
6040 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6043 static void exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6046 GET_CURRENT_CONTEXT(ctx
);
6047 FLUSH_VERTICES(ctx
, 0);
6048 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6051 static void exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6054 GET_CURRENT_CONTEXT(ctx
);
6055 FLUSH_VERTICES(ctx
, 0);
6056 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6059 static void exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6060 GLenum type
, GLvoid
*values
)
6062 GET_CURRENT_CONTEXT(ctx
);
6063 FLUSH_VERTICES(ctx
, 0);
6064 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6067 static void exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6070 GET_CURRENT_CONTEXT(ctx
);
6071 FLUSH_VERTICES(ctx
, 0);
6072 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6075 static void exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6078 GET_CURRENT_CONTEXT(ctx
);
6079 FLUSH_VERTICES(ctx
, 0);
6080 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6083 static void exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6084 GLenum type
, GLvoid
*values
)
6086 GET_CURRENT_CONTEXT(ctx
);
6087 FLUSH_VERTICES(ctx
, 0);
6088 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6091 static void exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6094 GET_CURRENT_CONTEXT(ctx
);
6095 FLUSH_VERTICES(ctx
, 0);
6096 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6099 static void exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6102 GET_CURRENT_CONTEXT(ctx
);
6103 FLUSH_VERTICES(ctx
, 0);
6104 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6107 static void exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6108 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6110 GET_CURRENT_CONTEXT(ctx
);
6111 FLUSH_VERTICES(ctx
, 0);
6112 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6115 static void exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6116 GLsizei width
, GLsizei height
, GLenum format
,
6117 GLenum type
, const GLvoid
*row
,
6118 const GLvoid
*column
)
6120 GET_CURRENT_CONTEXT(ctx
);
6121 FLUSH_VERTICES(ctx
, 0);
6122 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6126 static void exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6128 GET_CURRENT_CONTEXT(ctx
);
6129 FLUSH_VERTICES(ctx
, 0);
6130 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6133 static void exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6135 GET_CURRENT_CONTEXT(ctx
);
6136 FLUSH_VERTICES(ctx
, 0);
6137 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6140 static void exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6141 GLsizei count
, const GLvoid
*ptr
)
6143 GET_CURRENT_CONTEXT(ctx
);
6144 FLUSH_VERTICES(ctx
, 0);
6145 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6148 static void exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6149 const GLboolean
*ptr
)
6151 GET_CURRENT_CONTEXT(ctx
);
6152 FLUSH_VERTICES(ctx
, 0);
6153 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6156 static void exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6159 GET_CURRENT_CONTEXT(ctx
);
6160 FLUSH_VERTICES(ctx
, 0);
6161 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
6164 static void exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6167 GET_CURRENT_CONTEXT(ctx
);
6168 FLUSH_VERTICES(ctx
, 0);
6169 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
6172 static void exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6173 GLsizei count
, const GLvoid
*ptr
)
6175 GET_CURRENT_CONTEXT(ctx
);
6176 FLUSH_VERTICES(ctx
, 0);
6177 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
6180 static void exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6181 GLsizei count
, const GLvoid
*ptr
)
6183 GET_CURRENT_CONTEXT(ctx
);
6184 FLUSH_VERTICES(ctx
, 0);
6185 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
6188 static void exec_LockArraysEXT(GLint first
, GLsizei count
)
6190 GET_CURRENT_CONTEXT(ctx
);
6191 FLUSH_VERTICES(ctx
, 0);
6192 ctx
->Exec
->LockArraysEXT( first
, count
);
6195 static void exec_UnlockArraysEXT( void )
6197 GET_CURRENT_CONTEXT(ctx
);
6198 FLUSH_VERTICES(ctx
, 0);
6199 ctx
->Exec
->UnlockArraysEXT( );
6202 static void exec_ResizeBuffersMESA( void )
6204 GET_CURRENT_CONTEXT(ctx
);
6205 FLUSH_VERTICES(ctx
, 0);
6206 ctx
->Exec
->ResizeBuffersMESA( );
6210 static void exec_ClientActiveTextureARB( GLenum target
)
6212 GET_CURRENT_CONTEXT(ctx
);
6213 FLUSH_VERTICES(ctx
, 0);
6214 ctx
->Exec
->ClientActiveTextureARB(target
);
6217 static void exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
6218 GLsizei stride
, const GLvoid
*ptr
)
6220 GET_CURRENT_CONTEXT(ctx
);
6221 FLUSH_VERTICES(ctx
, 0);
6222 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
6225 static void exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
6228 GET_CURRENT_CONTEXT(ctx
);
6229 FLUSH_VERTICES(ctx
, 0);
6230 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
6233 /* GL_EXT_multi_draw_arrays */
6234 static void exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
6235 GLsizei
*count
, GLsizei primcount
)
6237 GET_CURRENT_CONTEXT(ctx
);
6238 FLUSH_VERTICES(ctx
, 0);
6239 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
6242 /* GL_EXT_multi_draw_arrays */
6243 static void exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
6244 GLenum type
, const GLvoid
**indices
,
6247 GET_CURRENT_CONTEXT(ctx
);
6248 FLUSH_VERTICES(ctx
, 0);
6249 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
6252 /* GL_IBM_multimode_draw_arrays */
6253 static void exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
6254 const GLsizei
*count
, GLsizei primcount
,
6257 GET_CURRENT_CONTEXT(ctx
);
6258 FLUSH_VERTICES(ctx
, 0);
6259 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
6262 /* GL_IBM_multimode_draw_arrays */
6263 static void exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
6264 const GLsizei
*count
,
6266 const GLvoid
* const *indices
,
6267 GLsizei primcount
, GLint modestride
)
6269 GET_CURRENT_CONTEXT(ctx
);
6270 FLUSH_VERTICES(ctx
, 0);
6271 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
6279 * Setup the given dispatch table to point to Mesa's display list
6280 * building functions.
6282 * This does not include any of the tnl functions - they are
6283 * initialized from _mesa_init_api_defaults and from the active vtxfmt
6287 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
6289 _mesa_init_no_op_table(table
, tableSize
);
6291 _mesa_loopback_init_api_table( table
, GL_TRUE
);
6294 table
->Accum
= save_Accum
;
6295 table
->AlphaFunc
= save_AlphaFunc
;
6296 table
->Bitmap
= save_Bitmap
;
6297 table
->BlendFunc
= save_BlendFunc
;
6298 table
->CallList
= _mesa_save_CallList
;
6299 table
->CallLists
= _mesa_save_CallLists
;
6300 table
->Clear
= save_Clear
;
6301 table
->ClearAccum
= save_ClearAccum
;
6302 table
->ClearColor
= save_ClearColor
;
6303 table
->ClearDepth
= save_ClearDepth
;
6304 table
->ClearIndex
= save_ClearIndex
;
6305 table
->ClearStencil
= save_ClearStencil
;
6306 table
->ClipPlane
= save_ClipPlane
;
6307 table
->ColorMask
= save_ColorMask
;
6308 table
->ColorMaterial
= save_ColorMaterial
;
6309 table
->CopyPixels
= save_CopyPixels
;
6310 table
->CullFace
= save_CullFace
;
6311 table
->DeleteLists
= _mesa_DeleteLists
;
6312 table
->DepthFunc
= save_DepthFunc
;
6313 table
->DepthMask
= save_DepthMask
;
6314 table
->DepthRange
= save_DepthRange
;
6315 table
->Disable
= save_Disable
;
6316 table
->DrawBuffer
= save_DrawBuffer
;
6317 table
->DrawPixels
= save_DrawPixels
;
6318 table
->Enable
= save_Enable
;
6319 table
->EndList
= _mesa_EndList
;
6320 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
6321 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
6322 table
->Finish
= exec_Finish
;
6323 table
->Flush
= exec_Flush
;
6324 table
->Fogf
= save_Fogf
;
6325 table
->Fogfv
= save_Fogfv
;
6326 table
->Fogi
= save_Fogi
;
6327 table
->Fogiv
= save_Fogiv
;
6328 table
->FrontFace
= save_FrontFace
;
6329 table
->Frustum
= save_Frustum
;
6330 table
->GenLists
= _mesa_GenLists
;
6331 table
->GetBooleanv
= exec_GetBooleanv
;
6332 table
->GetClipPlane
= exec_GetClipPlane
;
6333 table
->GetDoublev
= exec_GetDoublev
;
6334 table
->GetError
= exec_GetError
;
6335 table
->GetFloatv
= exec_GetFloatv
;
6336 table
->GetIntegerv
= exec_GetIntegerv
;
6337 table
->GetLightfv
= exec_GetLightfv
;
6338 table
->GetLightiv
= exec_GetLightiv
;
6339 table
->GetMapdv
= exec_GetMapdv
;
6340 table
->GetMapfv
= exec_GetMapfv
;
6341 table
->GetMapiv
= exec_GetMapiv
;
6342 table
->GetMaterialfv
= exec_GetMaterialfv
;
6343 table
->GetMaterialiv
= exec_GetMaterialiv
;
6344 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
6345 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
6346 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
6347 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
6348 table
->GetString
= exec_GetString
;
6349 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
6350 table
->GetTexEnviv
= exec_GetTexEnviv
;
6351 table
->GetTexGendv
= exec_GetTexGendv
;
6352 table
->GetTexGenfv
= exec_GetTexGenfv
;
6353 table
->GetTexGeniv
= exec_GetTexGeniv
;
6354 table
->GetTexImage
= exec_GetTexImage
;
6355 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
6356 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
6357 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
6358 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
6359 table
->Hint
= save_Hint
;
6360 table
->IndexMask
= save_IndexMask
;
6361 table
->InitNames
= save_InitNames
;
6362 table
->IsEnabled
= exec_IsEnabled
;
6363 table
->IsList
= _mesa_IsList
;
6364 table
->LightModelf
= save_LightModelf
;
6365 table
->LightModelfv
= save_LightModelfv
;
6366 table
->LightModeli
= save_LightModeli
;
6367 table
->LightModeliv
= save_LightModeliv
;
6368 table
->Lightf
= save_Lightf
;
6369 table
->Lightfv
= save_Lightfv
;
6370 table
->Lighti
= save_Lighti
;
6371 table
->Lightiv
= save_Lightiv
;
6372 table
->LineStipple
= save_LineStipple
;
6373 table
->LineWidth
= save_LineWidth
;
6374 table
->ListBase
= save_ListBase
;
6375 table
->LoadIdentity
= save_LoadIdentity
;
6376 table
->LoadMatrixd
= save_LoadMatrixd
;
6377 table
->LoadMatrixf
= save_LoadMatrixf
;
6378 table
->LoadName
= save_LoadName
;
6379 table
->LogicOp
= save_LogicOp
;
6380 table
->Map1d
= save_Map1d
;
6381 table
->Map1f
= save_Map1f
;
6382 table
->Map2d
= save_Map2d
;
6383 table
->Map2f
= save_Map2f
;
6384 table
->MapGrid1d
= save_MapGrid1d
;
6385 table
->MapGrid1f
= save_MapGrid1f
;
6386 table
->MapGrid2d
= save_MapGrid2d
;
6387 table
->MapGrid2f
= save_MapGrid2f
;
6388 table
->MatrixMode
= save_MatrixMode
;
6389 table
->MultMatrixd
= save_MultMatrixd
;
6390 table
->MultMatrixf
= save_MultMatrixf
;
6391 table
->NewList
= save_NewList
;
6392 table
->Ortho
= save_Ortho
;
6393 table
->PassThrough
= save_PassThrough
;
6394 table
->PixelMapfv
= save_PixelMapfv
;
6395 table
->PixelMapuiv
= save_PixelMapuiv
;
6396 table
->PixelMapusv
= save_PixelMapusv
;
6397 table
->PixelStoref
= exec_PixelStoref
;
6398 table
->PixelStorei
= exec_PixelStorei
;
6399 table
->PixelTransferf
= save_PixelTransferf
;
6400 table
->PixelTransferi
= save_PixelTransferi
;
6401 table
->PixelZoom
= save_PixelZoom
;
6402 table
->PointSize
= save_PointSize
;
6403 table
->PolygonMode
= save_PolygonMode
;
6404 table
->PolygonOffset
= save_PolygonOffset
;
6405 table
->PolygonStipple
= save_PolygonStipple
;
6406 table
->PopAttrib
= save_PopAttrib
;
6407 table
->PopMatrix
= save_PopMatrix
;
6408 table
->PopName
= save_PopName
;
6409 table
->PushAttrib
= save_PushAttrib
;
6410 table
->PushMatrix
= save_PushMatrix
;
6411 table
->PushName
= save_PushName
;
6412 table
->RasterPos2d
= save_RasterPos2d
;
6413 table
->RasterPos2dv
= save_RasterPos2dv
;
6414 table
->RasterPos2f
= save_RasterPos2f
;
6415 table
->RasterPos2fv
= save_RasterPos2fv
;
6416 table
->RasterPos2i
= save_RasterPos2i
;
6417 table
->RasterPos2iv
= save_RasterPos2iv
;
6418 table
->RasterPos2s
= save_RasterPos2s
;
6419 table
->RasterPos2sv
= save_RasterPos2sv
;
6420 table
->RasterPos3d
= save_RasterPos3d
;
6421 table
->RasterPos3dv
= save_RasterPos3dv
;
6422 table
->RasterPos3f
= save_RasterPos3f
;
6423 table
->RasterPos3fv
= save_RasterPos3fv
;
6424 table
->RasterPos3i
= save_RasterPos3i
;
6425 table
->RasterPos3iv
= save_RasterPos3iv
;
6426 table
->RasterPos3s
= save_RasterPos3s
;
6427 table
->RasterPos3sv
= save_RasterPos3sv
;
6428 table
->RasterPos4d
= save_RasterPos4d
;
6429 table
->RasterPos4dv
= save_RasterPos4dv
;
6430 table
->RasterPos4f
= save_RasterPos4f
;
6431 table
->RasterPos4fv
= save_RasterPos4fv
;
6432 table
->RasterPos4i
= save_RasterPos4i
;
6433 table
->RasterPos4iv
= save_RasterPos4iv
;
6434 table
->RasterPos4s
= save_RasterPos4s
;
6435 table
->RasterPos4sv
= save_RasterPos4sv
;
6436 table
->ReadBuffer
= save_ReadBuffer
;
6437 table
->ReadPixels
= exec_ReadPixels
;
6438 table
->RenderMode
= exec_RenderMode
;
6439 table
->Rotated
= save_Rotated
;
6440 table
->Rotatef
= save_Rotatef
;
6441 table
->Scaled
= save_Scaled
;
6442 table
->Scalef
= save_Scalef
;
6443 table
->Scissor
= save_Scissor
;
6444 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
6445 table
->SelectBuffer
= exec_SelectBuffer
;
6446 table
->ShadeModel
= save_ShadeModel
;
6447 table
->StencilFunc
= save_StencilFunc
;
6448 table
->StencilMask
= save_StencilMask
;
6449 table
->StencilOp
= save_StencilOp
;
6450 table
->TexEnvf
= save_TexEnvf
;
6451 table
->TexEnvfv
= save_TexEnvfv
;
6452 table
->TexEnvi
= save_TexEnvi
;
6453 table
->TexEnviv
= save_TexEnviv
;
6454 table
->TexGend
= save_TexGend
;
6455 table
->TexGendv
= save_TexGendv
;
6456 table
->TexGenf
= save_TexGenf
;
6457 table
->TexGenfv
= save_TexGenfv
;
6458 table
->TexGeni
= save_TexGeni
;
6459 table
->TexGeniv
= save_TexGeniv
;
6460 table
->TexImage1D
= save_TexImage1D
;
6461 table
->TexImage2D
= save_TexImage2D
;
6462 table
->TexParameterf
= save_TexParameterf
;
6463 table
->TexParameterfv
= save_TexParameterfv
;
6464 table
->TexParameteri
= save_TexParameteri
;
6465 table
->TexParameteriv
= save_TexParameteriv
;
6466 table
->Translated
= save_Translated
;
6467 table
->Translatef
= save_Translatef
;
6468 table
->Viewport
= save_Viewport
;
6471 table
->AreTexturesResident
= exec_AreTexturesResident
;
6472 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
6473 table
->BindTexture
= save_BindTexture
;
6474 table
->ColorPointer
= exec_ColorPointer
;
6475 table
->CopyTexImage1D
= save_CopyTexImage1D
;
6476 table
->CopyTexImage2D
= save_CopyTexImage2D
;
6477 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
6478 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
6479 table
->DeleteTextures
= exec_DeleteTextures
;
6480 table
->DisableClientState
= exec_DisableClientState
;
6481 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
6482 table
->EnableClientState
= exec_EnableClientState
;
6483 table
->GenTextures
= exec_GenTextures
;
6484 table
->GenTexturesEXT
= exec_GenTextures
;
6485 table
->GetPointerv
= exec_GetPointerv
;
6486 table
->IndexPointer
= exec_IndexPointer
;
6487 table
->InterleavedArrays
= exec_InterleavedArrays
;
6488 table
->IsTexture
= exec_IsTexture
;
6489 table
->IsTextureEXT
= exec_IsTexture
;
6490 table
->NormalPointer
= exec_NormalPointer
;
6491 table
->PopClientAttrib
= exec_PopClientAttrib
;
6492 table
->PrioritizeTextures
= save_PrioritizeTextures
;
6493 table
->PushClientAttrib
= exec_PushClientAttrib
;
6494 table
->TexCoordPointer
= exec_TexCoordPointer
;
6495 table
->TexSubImage1D
= save_TexSubImage1D
;
6496 table
->TexSubImage2D
= save_TexSubImage2D
;
6497 table
->VertexPointer
= exec_VertexPointer
;
6500 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
6501 table
->TexImage3D
= save_TexImage3D
;
6502 table
->TexSubImage3D
= save_TexSubImage3D
;
6504 /* GL_ARB_imaging */
6505 /* Not all are supported */
6506 table
->BlendColor
= save_BlendColor
;
6507 table
->BlendEquation
= save_BlendEquation
;
6508 table
->ColorSubTable
= save_ColorSubTable
;
6509 table
->ColorTable
= save_ColorTable
;
6510 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
6511 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
6512 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
6513 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
6514 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
6515 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
6516 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
6517 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
6518 table
->CopyColorSubTable
= save_CopyColorSubTable
;
6519 table
->CopyColorTable
= save_CopyColorTable
;
6520 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
6521 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
6522 table
->GetColorTable
= exec_GetColorTable
;
6523 table
->GetColorTableEXT
= exec_GetColorTable
;
6524 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
6525 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
6526 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
6527 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
6528 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
6529 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
6530 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
6531 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
6532 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
6533 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
6534 table
->GetHistogram
= exec_GetHistogram
;
6535 table
->GetHistogramEXT
= exec_GetHistogram
;
6536 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
6537 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
6538 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
6539 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
6540 table
->GetMinmax
= exec_GetMinmax
;
6541 table
->GetMinmaxEXT
= exec_GetMinmax
;
6542 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
6543 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
6544 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
6545 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
6546 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
6547 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
6548 table
->Histogram
= save_Histogram
;
6549 table
->Minmax
= save_Minmax
;
6550 table
->ResetHistogram
= save_ResetHistogram
;
6551 table
->ResetMinmax
= save_ResetMinmax
;
6552 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
6554 /* 2. GL_EXT_blend_color */
6556 table
->BlendColorEXT
= save_BlendColorEXT
;
6559 /* 3. GL_EXT_polygon_offset */
6560 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
6562 /* 6. GL_EXT_texture3d */
6564 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
6565 table
->TexImage3DEXT
= save_TexImage3DEXT
;
6566 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
6569 /* 15. GL_SGIX_pixel_texture */
6570 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
6572 /* 15. GL_SGIS_pixel_texture */
6573 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
6574 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
6575 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
6576 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
6577 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
6578 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
6580 /* 30. GL_EXT_vertex_array */
6581 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
6582 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
6583 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
6584 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
6585 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
6586 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
6588 /* 37. GL_EXT_blend_minmax */
6590 table
->BlendEquationEXT
= save_BlendEquationEXT
;
6593 /* 54. GL_EXT_point_parameters */
6594 table
->PointParameterfEXT
= save_PointParameterfEXT
;
6595 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
6597 /* 78. GL_EXT_paletted_texture */
6599 table
->ColorTableEXT
= save_ColorTable
;
6600 table
->ColorSubTableEXT
= save_ColorSubTable
;
6602 table
->GetColorTableEXT
= exec_GetColorTable
;
6603 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
6604 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
6606 /* 97. GL_EXT_compiled_vertex_array */
6607 table
->LockArraysEXT
= exec_LockArraysEXT
;
6608 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
6610 /* 145. GL_EXT_secondary_color */
6611 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
6613 /* 148. GL_EXT_multi_draw_arrays */
6614 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
6615 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
6617 /* 149. GL_EXT_fog_coord */
6618 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
6620 /* 173. GL_EXT_blend_func_separate */
6621 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
6623 /* 196. GL_MESA_resize_buffers */
6624 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
6626 /* 197. GL_MESA_window_pos */
6627 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
6628 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
6629 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
6630 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
6631 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
6632 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
6633 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
6634 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
6635 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
6636 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
6637 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
6638 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
6639 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
6640 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
6641 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
6642 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
6643 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
6644 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
6645 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
6646 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
6647 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
6648 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
6649 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
6650 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
6652 /* 200. GL_IBM_multimode_draw_arrays */
6653 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
6654 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
6656 #if FEATURE_NV_vertex_program
6657 /* 233. GL_NV_vertex_program */
6658 /* The following commands DO NOT go into display lists:
6659 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
6660 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
6662 table
->BindProgramNV
= save_BindProgramNV
;
6663 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
6664 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
6665 table
->GenProgramsNV
= _mesa_GenPrograms
;
6666 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
6667 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
6668 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
6669 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
6670 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
6671 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
6672 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
6673 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
6674 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
6675 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
6676 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
6677 table
->IsProgramNV
= _mesa_IsProgram
;
6678 table
->LoadProgramNV
= save_LoadProgramNV
;
6679 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
6680 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
6681 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
6682 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
6683 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
6684 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
6685 table
->TrackMatrixNV
= save_TrackMatrixNV
;
6686 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
6689 /* 282. GL_NV_fragment_program */
6690 #if FEATURE_NV_fragment_program
6691 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
6692 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
6693 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
6694 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
6695 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
6696 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
6697 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
6698 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
6699 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
6700 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
6701 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
6702 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
6705 /* 262. GL_NV_point_sprite */
6706 table
->PointParameteriNV
= save_PointParameteriNV
;
6707 table
->PointParameterivNV
= save_PointParameterivNV
;
6709 /* 268. GL_EXT_stencil_two_side */
6710 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
6712 /* ???. GL_EXT_depth_bounds_test */
6713 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
6715 /* ARB 1. GL_ARB_multitexture */
6716 table
->ActiveTextureARB
= save_ActiveTextureARB
;
6717 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
6719 /* ARB 3. GL_ARB_transpose_matrix */
6720 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
6721 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
6722 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
6723 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
6725 /* ARB 5. GL_ARB_multisample */
6726 table
->SampleCoverageARB
= save_SampleCoverageARB
;
6728 /* ARB 12. GL_ARB_texture_compression */
6729 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
6730 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
6731 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
6732 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
6733 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
6734 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
6735 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
6737 /* ARB 14. GL_ARB_point_parameters */
6738 /* aliased with EXT_point_parameters functions */
6740 /* ARB 25. GL_ARB_window_pos */
6741 /* aliased with MESA_window_pos functions */
6743 /* ARB 26. GL_ARB_vertex_program */
6744 /* ARB 27. GL_ARB_fragment_program */
6745 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6746 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
6747 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
6748 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
6749 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
6750 table
->ProgramStringARB
= save_ProgramStringARB
;
6751 table
->BindProgramNV
= _mesa_BindProgram
;
6752 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
6753 table
->GenProgramsNV
= _mesa_GenPrograms
;
6754 table
->IsProgramNV
= _mesa_IsProgram
;
6755 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
6756 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
6757 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
6758 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
6759 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
6760 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
6761 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
6762 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
6763 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
6764 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
6765 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
6766 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
6767 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
6768 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
6769 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
6770 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
6771 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
6772 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
6775 /* ARB 28. GL_ARB_vertex_buffer_object */
6776 #if FEATURE_ARB_vertex_buffer_object
6777 /* None of the extension's functions get compiled */
6778 table
->BindBufferARB
= _mesa_BindBufferARB
;
6779 table
->BufferDataARB
= _mesa_BufferDataARB
;
6780 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
6781 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
6782 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
6783 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
6784 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
6785 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
6786 table
->IsBufferARB
= _mesa_IsBufferARB
;
6787 table
->MapBufferARB
= _mesa_MapBufferARB
;
6788 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
6797 static const char *enum_string( GLenum k
)
6799 return _mesa_lookup_enum_by_nr( k
);
6804 * Print the commands in a display list. For debugging only.
6805 * TODO: many commands aren't handled yet.
6807 static void print_list( GLcontext
*ctx
, GLuint list
)
6812 if (!glIsList(list
)) {
6813 _mesa_printf("%u is not a display list ID\n", list
);
6817 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
6819 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
6821 done
= n
? GL_FALSE
: GL_TRUE
;
6823 OpCode opcode
= n
[0].opcode
;
6824 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
6826 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
6827 ctx
->listext
.opcode
[i
].print(ctx
, &n
[1]);
6828 n
+= ctx
->listext
.opcode
[i
].size
;
6833 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
6836 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
6837 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
6839 case OPCODE_CALL_LIST
:
6840 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
6842 case OPCODE_CALL_LIST_OFFSET
:
6843 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
6844 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
6846 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6847 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
6848 enum_string(n
[1].e
), enum_string(n
[2].e
),
6849 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6851 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6852 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
6853 enum_string(n
[1].e
), enum_string(n
[2].e
),
6854 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
6856 case OPCODE_DISABLE
:
6857 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
6860 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
6862 case OPCODE_FRUSTUM
:
6863 _mesa_printf("Frustum %g %g %g %g %g %g\n",
6864 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6866 case OPCODE_LINE_STIPPLE
:
6867 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
6869 case OPCODE_LOAD_IDENTITY
:
6870 _mesa_printf("LoadIdentity\n");
6872 case OPCODE_LOAD_MATRIX
:
6873 _mesa_printf("LoadMatrix\n");
6874 _mesa_printf(" %8f %8f %8f %8f\n",
6875 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
6876 _mesa_printf(" %8f %8f %8f %8f\n",
6877 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
6878 _mesa_printf(" %8f %8f %8f %8f\n",
6879 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
6880 _mesa_printf(" %8f %8f %8f %8f\n",
6881 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
6883 case OPCODE_MULT_MATRIX
:
6884 _mesa_printf("MultMatrix (or Rotate)\n");
6885 _mesa_printf(" %8f %8f %8f %8f\n",
6886 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
6887 _mesa_printf(" %8f %8f %8f %8f\n",
6888 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
6889 _mesa_printf(" %8f %8f %8f %8f\n",
6890 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
6891 _mesa_printf(" %8f %8f %8f %8f\n",
6892 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
6895 _mesa_printf("Ortho %g %g %g %g %g %g\n",
6896 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
6898 case OPCODE_POP_ATTRIB
:
6899 _mesa_printf("PopAttrib\n");
6901 case OPCODE_POP_MATRIX
:
6902 _mesa_printf("PopMatrix\n");
6904 case OPCODE_POP_NAME
:
6905 _mesa_printf("PopName\n");
6907 case OPCODE_PUSH_ATTRIB
:
6908 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
6910 case OPCODE_PUSH_MATRIX
:
6911 _mesa_printf("PushMatrix\n");
6913 case OPCODE_PUSH_NAME
:
6914 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
6916 case OPCODE_RASTER_POS
:
6917 _mesa_printf("RasterPos %g %g %g %g\n",
6918 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
6921 _mesa_printf("Rotate %g %g %g %g\n",
6922 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6925 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
6927 case OPCODE_TRANSLATE
:
6928 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
6930 case OPCODE_BIND_TEXTURE
:
6931 _mesa_printf("BindTexture %s %d\n",
6932 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
6934 case OPCODE_SHADE_MODEL
:
6935 _mesa_printf("ShadeModel %s\n",
6936 _mesa_lookup_enum_by_nr(n
[1].ui
));
6939 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
6940 _mesa_lookup_enum_by_nr(n
[1].ui
),
6941 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
6944 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
6945 _mesa_lookup_enum_by_nr(n
[1].ui
),
6946 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
6947 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
6949 case OPCODE_MAPGRID1
:
6950 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
6951 n
[1].i
, n
[2].f
, n
[3].f
);
6953 case OPCODE_MAPGRID2
:
6954 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
6955 n
[1].i
, n
[2].f
, n
[3].f
,
6956 n
[4].i
, n
[5].f
, n
[6].f
);
6958 case OPCODE_EVALMESH1
:
6959 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
6961 case OPCODE_EVALMESH2
:
6962 _mesa_printf("EvalMesh2 %d %d %d %d\n",
6963 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
6967 * meta opcodes/commands
6970 _mesa_printf("Error: %s %s\n",
6971 enum_string(n
[1].e
), (const char *)n
[2].data
);
6973 case OPCODE_CONTINUE
:
6974 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
6975 n
= (Node
*) n
[1].next
;
6977 case OPCODE_END_OF_LIST
:
6978 _mesa_printf("END-LIST %u\n", list
);
6982 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
6983 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
6988 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
6991 /* increment n to point to next compiled command */
6992 if (opcode
!=OPCODE_CONTINUE
) {
6993 n
+= InstSize
[opcode
];
7002 * Clients may call this function to help debug display list problems.
7003 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7004 * changed, or break in the future without notice.
7006 void mesa_print_display_list( GLuint list
)
7008 GET_CURRENT_CONTEXT(ctx
);
7009 print_list( ctx
, list
);
7013 /**********************************************************************/
7014 /***** Initialization *****/
7015 /**********************************************************************/
7017 void _mesa_init_display_list( GLcontext
* ctx
)
7021 ctx
->ExecuteFlag
= GL_TRUE
;
7022 ctx
->CompileFlag
= GL_FALSE
;
7023 ctx
->CurrentListPtr
= NULL
;
7024 ctx
->CurrentBlock
= NULL
;
7025 ctx
->CurrentListNum
= 0;
7026 ctx
->CurrentPos
= 0;
7028 /* Display List group */
7029 ctx
->List
.ListBase
= 0;