2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
56 #include "extensions.h"
61 #include "histogram.h"
78 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
79 #include "nvprogram.h"
83 #include "math/m_matrix.h"
84 #include "math/m_xform.h"
90 * \param ctx GL context.
92 * Checks if dd_function_table::SaveNeedFlush is marked to flush
93 * stored (save) vertices, and calls
94 * dd_function_table::SaveFlushVertices if so.
96 #define SAVE_FLUSH_VERTICES(ctx) \
98 if (ctx->Driver.SaveNeedFlush) \
99 ctx->Driver.SaveFlushVertices(ctx); \
104 * Macro to assert that the API call was made outside the
105 * glBegin()/glEnd() pair, with return value.
107 * \param ctx GL context.
108 * \param retval value to return value in case the assertion fails.
110 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
112 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
113 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
114 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
120 * Macro to assert that the API call was made outside the
121 * glBegin()/glEnd() pair.
123 * \param ctx GL context.
125 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
127 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
128 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
129 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
135 * Macro to assert that the API call was made outside the
136 * glBegin()/glEnd() pair and flush the vertices.
138 * \param ctx GL context.
140 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
142 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
143 SAVE_FLUSH_VERTICES(ctx); \
147 * Macro to assert that the API call was made outside the
148 * glBegin()/glEnd() pair and flush the vertices, with return value.
150 * \param ctx GL context.
151 * \param retval value to return value in case the assertion fails.
153 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
155 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
156 SAVE_FLUSH_VERTICES(ctx); \
162 * Display list opcodes.
164 * The fact that these identifiers are assigned consecutive
165 * integer values starting at 0 is very important, see InstSize array usage)
168 OPCODE_INVALID
= -1, /* Force signed enum */
174 OPCODE_BLEND_EQUATION
,
175 OPCODE_BLEND_EQUATION_SEPARATE
,
176 OPCODE_BLEND_FUNC_SEPARATE
,
178 OPCODE_CALL_LIST_OFFSET
,
184 OPCODE_CLEAR_STENCIL
,
187 OPCODE_COLOR_MATERIAL
,
189 OPCODE_COLOR_TABLE_PARAMETER_FV
,
190 OPCODE_COLOR_TABLE_PARAMETER_IV
,
191 OPCODE_COLOR_SUB_TABLE
,
192 OPCODE_CONVOLUTION_FILTER_1D
,
193 OPCODE_CONVOLUTION_FILTER_2D
,
194 OPCODE_CONVOLUTION_PARAMETER_I
,
195 OPCODE_CONVOLUTION_PARAMETER_IV
,
196 OPCODE_CONVOLUTION_PARAMETER_F
,
197 OPCODE_CONVOLUTION_PARAMETER_FV
,
198 OPCODE_COPY_COLOR_SUB_TABLE
,
199 OPCODE_COPY_COLOR_TABLE
,
201 OPCODE_COPY_TEX_IMAGE1D
,
202 OPCODE_COPY_TEX_IMAGE2D
,
203 OPCODE_COPY_TEX_SUB_IMAGE1D
,
204 OPCODE_COPY_TEX_SUB_IMAGE2D
,
205 OPCODE_COPY_TEX_SUB_IMAGE3D
,
228 OPCODE_LOAD_IDENTITY
,
242 OPCODE_PIXEL_TRANSFER
,
245 OPCODE_POINT_PARAMETERS
,
247 OPCODE_POLYGON_STIPPLE
,
248 OPCODE_POLYGON_OFFSET
,
252 OPCODE_PRIORITIZE_TEXTURE
,
258 OPCODE_RESET_HISTOGRAM
,
259 OPCODE_RESET_MIN_MAX
,
263 OPCODE_SELECT_TEXTURE_SGIS
,
264 OPCODE_SELECT_TEXTURE_COORD_SET
,
275 OPCODE_TEX_SUB_IMAGE1D
,
276 OPCODE_TEX_SUB_IMAGE2D
,
277 OPCODE_TEX_SUB_IMAGE3D
,
281 /* GL_ARB_multitexture */
282 OPCODE_ACTIVE_TEXTURE
,
283 /* GL_SGIX/SGIS_pixel_texture */
284 OPCODE_PIXEL_TEXGEN_SGIX
,
285 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
286 /* GL_ARB_texture_compression */
287 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
288 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
289 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
290 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
291 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
292 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
293 /* GL_ARB_multisample */
294 OPCODE_SAMPLE_COVERAGE
,
295 /* GL_ARB_window_pos */
296 OPCODE_WINDOW_POS_ARB
,
297 /* GL_NV_vertex_program */
298 OPCODE_BIND_PROGRAM_NV
,
299 OPCODE_EXECUTE_PROGRAM_NV
,
300 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
301 OPCODE_LOAD_PROGRAM_NV
,
302 OPCODE_PROGRAM_PARAMETER4F_NV
,
303 OPCODE_TRACK_MATRIX_NV
,
304 /* GL_NV_fragment_program */
305 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
306 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
307 /* GL_EXT_stencil_two_side */
308 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
309 /* GL_EXT_depth_bounds_test */
310 OPCODE_DEPTH_BOUNDS_EXT
,
311 /* GL_ARB_vertex/fragment_program */
312 OPCODE_PROGRAM_STRING_ARB
,
313 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
314 /* GL_ARB_occlusion_query */
315 OPCODE_BEGIN_QUERY_ARB
,
316 OPCODE_END_QUERY_ARB
,
318 /* Vertex attributes -- fallback for when optimized display
319 * list build isn't active.
337 /* The following three are meta instructions */
338 OPCODE_ERROR
, /* raise compiled-in error */
349 * Display list instructions are stored as sequences of "nodes". Nodes
350 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
351 * are linked together with a pointer.
353 * Each instruction in the display list is stored as a sequence of
354 * contiguous nodes in memory.
355 * Each node is the union of a variety of data types.
369 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
374 * How many nodes to allocate at a time.
376 * \note Reduced now that we hold vertices etc. elsewhere.
378 #define BLOCK_SIZE 256
383 * Number of nodes of storage needed for each instruction.
384 * Sizes for dynamically allocated opcodes are stored in the context struct.
386 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
388 void mesa_print_display_list( GLuint list
);
391 /**********************************************************************/
392 /***** Private *****/
393 /**********************************************************************/
396 * Make an empty display list. This is used by glGenLists() to
397 * reserver display list IDs.
399 static Node
*make_empty_list( void )
401 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
402 n
[0].opcode
= OPCODE_END_OF_LIST
;
409 * Destroy all nodes in a display list.
410 * \param list - display list number
412 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
420 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
423 done
= block
? GL_FALSE
: GL_TRUE
;
426 /* check for extension opcodes first */
428 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
429 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
430 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
431 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
434 switch (n
[0].opcode
) {
435 /* for some commands, we need to free malloc'd memory */
438 n
+= InstSize
[n
[0].opcode
];
442 n
+= InstSize
[n
[0].opcode
];
444 case OPCODE_DRAW_PIXELS
:
446 n
+= InstSize
[n
[0].opcode
];
450 n
+= InstSize
[n
[0].opcode
];
452 case OPCODE_COLOR_TABLE
:
454 n
+= InstSize
[n
[0].opcode
];
456 case OPCODE_COLOR_SUB_TABLE
:
458 n
+= InstSize
[n
[0].opcode
];
460 case OPCODE_CONVOLUTION_FILTER_1D
:
462 n
+= InstSize
[n
[0].opcode
];
464 case OPCODE_CONVOLUTION_FILTER_2D
:
466 n
+= InstSize
[n
[0].opcode
];
468 case OPCODE_POLYGON_STIPPLE
:
470 n
+= InstSize
[n
[0].opcode
];
472 case OPCODE_TEX_IMAGE1D
:
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_TEX_IMAGE2D
:
478 n
+= InstSize
[n
[0].opcode
];
480 case OPCODE_TEX_IMAGE3D
:
482 n
+= InstSize
[n
[0].opcode
];
484 case OPCODE_TEX_SUB_IMAGE1D
:
486 n
+= InstSize
[n
[0].opcode
];
488 case OPCODE_TEX_SUB_IMAGE2D
:
490 n
+= InstSize
[n
[0].opcode
];
492 case OPCODE_TEX_SUB_IMAGE3D
:
494 n
+= InstSize
[n
[0].opcode
];
496 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
498 n
+= InstSize
[n
[0].opcode
];
500 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
502 n
+= InstSize
[n
[0].opcode
];
504 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
506 n
+= InstSize
[n
[0].opcode
];
508 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
510 n
+= InstSize
[n
[0].opcode
];
512 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
514 n
+= InstSize
[n
[0].opcode
];
516 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
518 n
+= InstSize
[n
[0].opcode
];
520 #if FEATURE_NV_vertex_program
521 case OPCODE_LOAD_PROGRAM_NV
:
522 FREE(n
[4].data
); /* program string */
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
526 FREE(n
[2].data
); /* array of program ids */
527 n
+= InstSize
[n
[0].opcode
];
530 #if FEATURE_NV_fragment_program
531 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
532 FREE(n
[3].data
); /* parameter name */
533 n
+= InstSize
[n
[0].opcode
];
536 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
537 case OPCODE_PROGRAM_STRING_ARB
:
538 FREE(n
[4].data
); /* program string */
539 n
+= InstSize
[n
[0].opcode
];
542 case OPCODE_CONTINUE
:
543 n
= (Node
*) n
[1].next
;
547 case OPCODE_END_OF_LIST
:
552 /* Most frequent case */
553 n
+= InstSize
[n
[0].opcode
];
559 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
565 * Translate the nth element of list from type to GLuint.
567 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
579 bptr
= (GLbyte
*) list
;
580 return (GLuint
) *(bptr
+n
);
581 case GL_UNSIGNED_BYTE
:
582 ubptr
= (GLubyte
*) list
;
583 return (GLuint
) *(ubptr
+n
);
585 sptr
= (GLshort
*) list
;
586 return (GLuint
) *(sptr
+n
);
587 case GL_UNSIGNED_SHORT
:
588 usptr
= (GLushort
*) list
;
589 return (GLuint
) *(usptr
+n
);
591 iptr
= (GLint
*) list
;
592 return (GLuint
) *(iptr
+n
);
593 case GL_UNSIGNED_INT
:
594 uiptr
= (GLuint
*) list
;
595 return (GLuint
) *(uiptr
+n
);
597 fptr
= (GLfloat
*) list
;
598 return (GLuint
) *(fptr
+n
);
600 ubptr
= ((GLubyte
*) list
) + 2*n
;
601 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
603 ubptr
= ((GLubyte
*) list
) + 3*n
;
604 return (GLuint
) *ubptr
* 65536
605 + (GLuint
) *(ubptr
+1) * 256
606 + (GLuint
) *(ubptr
+2);
608 ubptr
= ((GLubyte
*) list
) + 4*n
;
609 return (GLuint
) *ubptr
* 16777216
610 + (GLuint
) *(ubptr
+1) * 65536
611 + (GLuint
) *(ubptr
+2) * 256
612 + (GLuint
) *(ubptr
+3);
621 /**********************************************************************/
623 /**********************************************************************/
626 * Do one-time initialiazations for display lists.
629 _mesa_init_lists( void )
631 static int init_flag
= 0;
634 InstSize
[OPCODE_ACCUM
] = 3;
635 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
636 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
637 InstSize
[OPCODE_BITMAP
] = 8;
638 InstSize
[OPCODE_BLEND_COLOR
] = 5;
639 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
640 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
641 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
642 InstSize
[OPCODE_CALL_LIST
] = 2;
643 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
644 InstSize
[OPCODE_CLEAR
] = 2;
645 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
646 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
647 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
648 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
649 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
650 InstSize
[OPCODE_CLIP_PLANE
] = 6;
651 InstSize
[OPCODE_COLOR_MASK
] = 5;
652 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
653 InstSize
[OPCODE_COLOR_TABLE
] = 7;
654 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
655 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
656 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
657 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
658 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
659 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
660 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
661 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
662 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
663 InstSize
[OPCODE_COPY_PIXELS
] = 6;
664 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
665 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
666 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
667 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
668 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
669 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
670 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
671 InstSize
[OPCODE_CULL_FACE
] = 2;
672 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
673 InstSize
[OPCODE_DEPTH_MASK
] = 2;
674 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
675 InstSize
[OPCODE_DISABLE
] = 2;
676 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
677 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
678 InstSize
[OPCODE_ENABLE
] = 2;
679 InstSize
[OPCODE_EVALMESH1
] = 4;
680 InstSize
[OPCODE_EVALMESH2
] = 6;
681 InstSize
[OPCODE_FOG
] = 6;
682 InstSize
[OPCODE_FRONT_FACE
] = 2;
683 InstSize
[OPCODE_FRUSTUM
] = 7;
684 InstSize
[OPCODE_HINT
] = 3;
685 InstSize
[OPCODE_HISTOGRAM
] = 5;
686 InstSize
[OPCODE_INDEX_MASK
] = 2;
687 InstSize
[OPCODE_INIT_NAMES
] = 1;
688 InstSize
[OPCODE_LIGHT
] = 7;
689 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
690 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
691 InstSize
[OPCODE_LINE_WIDTH
] = 2;
692 InstSize
[OPCODE_LIST_BASE
] = 2;
693 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
694 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
695 InstSize
[OPCODE_LOAD_NAME
] = 2;
696 InstSize
[OPCODE_LOGIC_OP
] = 2;
697 InstSize
[OPCODE_MAP1
] = 7;
698 InstSize
[OPCODE_MAP2
] = 11;
699 InstSize
[OPCODE_MAPGRID1
] = 4;
700 InstSize
[OPCODE_MAPGRID2
] = 7;
701 InstSize
[OPCODE_MATRIX_MODE
] = 2;
702 InstSize
[OPCODE_MIN_MAX
] = 4;
703 InstSize
[OPCODE_MULT_MATRIX
] = 17;
704 InstSize
[OPCODE_ORTHO
] = 7;
705 InstSize
[OPCODE_PASSTHROUGH
] = 2;
706 InstSize
[OPCODE_PIXEL_MAP
] = 4;
707 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
708 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
709 InstSize
[OPCODE_POINT_SIZE
] = 2;
710 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
711 InstSize
[OPCODE_POLYGON_MODE
] = 3;
712 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
713 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
714 InstSize
[OPCODE_POP_ATTRIB
] = 1;
715 InstSize
[OPCODE_POP_MATRIX
] = 1;
716 InstSize
[OPCODE_POP_NAME
] = 1;
717 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
718 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
719 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
720 InstSize
[OPCODE_PUSH_NAME
] = 2;
721 InstSize
[OPCODE_RASTER_POS
] = 5;
722 InstSize
[OPCODE_READ_BUFFER
] = 2;
723 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
724 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
725 InstSize
[OPCODE_ROTATE
] = 5;
726 InstSize
[OPCODE_SCALE
] = 4;
727 InstSize
[OPCODE_SCISSOR
] = 5;
728 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
729 InstSize
[OPCODE_STENCIL_MASK
] = 2;
730 InstSize
[OPCODE_STENCIL_OP
] = 4;
731 InstSize
[OPCODE_SHADE_MODEL
] = 2;
732 InstSize
[OPCODE_TEXENV
] = 7;
733 InstSize
[OPCODE_TEXGEN
] = 7;
734 InstSize
[OPCODE_TEXPARAMETER
] = 7;
735 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
736 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
737 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
738 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
739 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
740 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
741 InstSize
[OPCODE_TRANSLATE
] = 4;
742 InstSize
[OPCODE_VIEWPORT
] = 5;
743 InstSize
[OPCODE_WINDOW_POS
] = 5;
744 InstSize
[OPCODE_CONTINUE
] = 2;
745 InstSize
[OPCODE_ERROR
] = 3;
746 InstSize
[OPCODE_END_OF_LIST
] = 1;
747 /* GL_SGIX/SGIS_pixel_texture */
748 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
749 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
750 /* GL_ARB_texture_compression */
751 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
752 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
753 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
754 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
755 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
756 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
757 /* GL_ARB_multisample */
758 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
759 /* GL_ARB_multitexture */
760 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
761 /* GL_ARB_window_pos */
762 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
763 /* GL_NV_vertex_program */
764 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
765 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
766 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
767 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
768 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
769 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
770 /* GL_NV_fragment_program */
771 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
772 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
773 /* GL_EXT_stencil_two_side */
774 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
775 /* GL_EXT_depth_bounds_test */
776 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
777 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
778 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
779 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
781 #if FEATURE_ARB_occlusion_query
782 InstSize
[OPCODE_BEGIN_QUERY_ARB
] = 3;
783 InstSize
[OPCODE_END_QUERY_ARB
] = 2;
785 InstSize
[OPCODE_ATTR_1F
] = 3;
786 InstSize
[OPCODE_ATTR_2F
] = 4;
787 InstSize
[OPCODE_ATTR_3F
] = 5;
788 InstSize
[OPCODE_ATTR_4F
] = 6;
789 InstSize
[OPCODE_MATERIAL
] = 7;
790 InstSize
[OPCODE_INDEX
] = 2;
791 InstSize
[OPCODE_EDGEFLAG
] = 2;
792 InstSize
[OPCODE_BEGIN
] = 2;
793 InstSize
[OPCODE_END
] = 1;
794 InstSize
[OPCODE_RECTF
] = 5;
795 InstSize
[OPCODE_EVAL_C1
] = 2;
796 InstSize
[OPCODE_EVAL_C2
] = 3;
797 InstSize
[OPCODE_EVAL_P1
] = 2;
798 InstSize
[OPCODE_EVAL_P2
] = 3;
806 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
807 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
810 unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
811 GLenum format
, GLenum type
, const GLvoid
*pixels
,
812 const struct gl_pixelstore_attrib
*unpack
)
814 if (unpack
->BufferObj
->Name
== 0) {
816 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
819 else if (_mesa_validate_pbo_access(unpack
, width
, height
, depth
, format
,
821 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
822 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
831 * Allocate space for a display list instruction.
832 * \param opcode - type of instruction
833 * argcount - size in bytes of data required.
834 * \return pointer to the usable data area (not including the internal
838 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
841 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
844 if (opcode
< (int) OPCODE_EXT_0
) {
845 assert( count
== InstSize
[opcode
] );
849 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
850 /* This block is full. Allocate a new block and chain to it */
851 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
852 n
[0].opcode
= OPCODE_CONTINUE
;
853 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
855 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
858 n
[1].next
= (Node
*) newblock
;
859 ctx
->ListState
.CurrentBlock
= newblock
;
860 ctx
->ListState
.CurrentPos
= 0;
863 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
864 ctx
->ListState
.CurrentPos
+= count
;
866 n
[0].opcode
= (OpCode
) opcode
;
868 return (void *)&n
[1];
873 * This function allows modules and drivers to get their own opcodes
874 * for extending display list functionality.
875 * \param ctx the rendering context
876 * \param size number of bytes for storing the new display list command
877 * \param execute function to execute the new display list command
878 * \param destroy function to destroy the new display list command
879 * \param print function to print the new display list command
880 * \return the new opcode number or -1 if error
883 _mesa_alloc_opcode( GLcontext
*ctx
,
885 void (*execute
)( GLcontext
*, void * ),
886 void (*destroy
)( GLcontext
*, void * ),
887 void (*print
)( GLcontext
*, void * ) )
889 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
890 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
891 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
892 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
893 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
894 ctx
->ListExt
.Opcode
[i
].Print
= print
;
895 return i
+ OPCODE_EXT_0
;
902 /* Mimic the old behaviour of alloc_instruction:
903 * - sz is in units of sizeof(Node)
904 * - return value a pointer to sizeof(Node) before the actual
907 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
908 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
913 * Display List compilation functions
915 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
917 GET_CURRENT_CONTEXT(ctx
);
919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
920 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
925 if (ctx
->ExecuteFlag
) {
926 (*ctx
->Exec
->Accum
)( op
, value
);
931 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
933 GET_CURRENT_CONTEXT(ctx
);
935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
936 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
939 n
[2].f
= (GLfloat
) ref
;
941 if (ctx
->ExecuteFlag
) {
942 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
947 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
949 GET_CURRENT_CONTEXT(ctx
);
951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
952 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
957 if (ctx
->ExecuteFlag
) {
958 (*ctx
->Exec
->BindTexture
)( target
, texture
);
963 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
964 GLfloat xorig
, GLfloat yorig
,
965 GLfloat xmove
, GLfloat ymove
,
966 const GLubyte
*pixels
)
968 GET_CURRENT_CONTEXT(ctx
);
969 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
972 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
974 n
[1].i
= (GLint
) width
;
975 n
[2].i
= (GLint
) height
;
985 if (ctx
->ExecuteFlag
) {
986 (*ctx
->Exec
->Bitmap
)( width
, height
,
987 xorig
, yorig
, xmove
, ymove
, pixels
);
992 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
994 GET_CURRENT_CONTEXT(ctx
);
996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
997 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
1001 if (ctx
->ExecuteFlag
) {
1002 (*ctx
->Exec
->BlendEquation
)( mode
);
1007 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1010 GET_CURRENT_CONTEXT(ctx
);
1012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1013 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1018 if (ctx
->ExecuteFlag
) {
1019 (*ctx
->Exec
->BlendEquationSeparateEXT
)( modeRGB
, modeA
);
1024 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1025 GLenum sfactorA
, GLenum dfactorA
)
1027 GET_CURRENT_CONTEXT(ctx
);
1029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1030 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1032 n
[1].e
= sfactorRGB
;
1033 n
[2].e
= dfactorRGB
;
1037 if (ctx
->ExecuteFlag
) {
1038 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
1039 sfactorA
, dfactorA
);
1044 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1045 GLfloat blue
, GLfloat alpha
)
1047 GET_CURRENT_CONTEXT(ctx
);
1049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1050 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1057 if (ctx
->ExecuteFlag
) {
1058 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1063 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1065 GET_CURRENT_CONTEXT(ctx
);
1067 SAVE_FLUSH_VERTICES(ctx
);
1069 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1074 /* After this, we don't know what begin/end state we're in:
1076 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1078 if (ctx
->ExecuteFlag
) {
1079 (*ctx
->Exec
->CallList
)( list
);
1084 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1086 GET_CURRENT_CONTEXT(ctx
);
1088 GLboolean typeErrorFlag
;
1090 SAVE_FLUSH_VERTICES(ctx
);
1094 case GL_UNSIGNED_BYTE
:
1096 case GL_UNSIGNED_SHORT
:
1098 case GL_UNSIGNED_INT
:
1103 typeErrorFlag
= GL_FALSE
;
1106 typeErrorFlag
= GL_TRUE
;
1110 GLuint list
= translate_id( i
, type
, lists
);
1111 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1114 n
[2].b
= typeErrorFlag
;
1118 /* After this, we don't know what begin/end state we're in:
1120 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1122 if (ctx
->ExecuteFlag
) {
1123 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1128 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1130 GET_CURRENT_CONTEXT(ctx
);
1132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1133 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1137 if (ctx
->ExecuteFlag
) {
1138 (*ctx
->Exec
->Clear
)( mask
);
1143 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1144 GLfloat blue
, GLfloat alpha
)
1146 GET_CURRENT_CONTEXT(ctx
);
1148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1149 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1156 if (ctx
->ExecuteFlag
) {
1157 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1162 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1163 GLclampf blue
, GLclampf alpha
)
1165 GET_CURRENT_CONTEXT(ctx
);
1167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1168 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1175 if (ctx
->ExecuteFlag
) {
1176 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1181 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1183 GET_CURRENT_CONTEXT(ctx
);
1185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1186 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1188 n
[1].f
= (GLfloat
) depth
;
1190 if (ctx
->ExecuteFlag
) {
1191 (*ctx
->Exec
->ClearDepth
)( depth
);
1196 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1198 GET_CURRENT_CONTEXT(ctx
);
1200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1201 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1205 if (ctx
->ExecuteFlag
) {
1206 (*ctx
->Exec
->ClearIndex
)( c
);
1211 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1213 GET_CURRENT_CONTEXT(ctx
);
1215 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1216 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1220 if (ctx
->ExecuteFlag
) {
1221 (*ctx
->Exec
->ClearStencil
)( s
);
1226 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1228 GET_CURRENT_CONTEXT(ctx
);
1230 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1231 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1234 n
[2].f
= (GLfloat
) equ
[0];
1235 n
[3].f
= (GLfloat
) equ
[1];
1236 n
[4].f
= (GLfloat
) equ
[2];
1237 n
[5].f
= (GLfloat
) equ
[3];
1239 if (ctx
->ExecuteFlag
) {
1240 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1246 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1247 GLboolean blue
, GLboolean alpha
)
1249 GET_CURRENT_CONTEXT(ctx
);
1251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1252 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1259 if (ctx
->ExecuteFlag
) {
1260 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1265 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1267 GET_CURRENT_CONTEXT(ctx
);
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1271 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1276 if (ctx
->ExecuteFlag
) {
1277 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1282 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1283 GLsizei width
, GLenum format
, GLenum type
,
1284 const GLvoid
*table
)
1286 GET_CURRENT_CONTEXT(ctx
);
1287 if (target
== GL_PROXY_TEXTURE_1D
||
1288 target
== GL_PROXY_TEXTURE_2D
||
1289 target
== GL_PROXY_TEXTURE_3D
||
1290 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1291 /* execute immediately */
1292 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1293 format
, type
, table
);
1296 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, table
,
1299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1300 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1303 n
[2].e
= internalFormat
;
1312 if (ctx
->ExecuteFlag
) {
1313 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1314 format
, type
, table
);
1321 static void GLAPIENTRY
1322 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1324 GET_CURRENT_CONTEXT(ctx
);
1327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1329 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1334 if (pname
== GL_COLOR_TABLE_SGI
||
1335 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1336 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1337 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1344 if (ctx
->ExecuteFlag
) {
1345 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1350 static void GLAPIENTRY
1351 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1353 GET_CURRENT_CONTEXT(ctx
);
1356 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1358 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1363 if (pname
== GL_COLOR_TABLE_SGI
||
1364 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1365 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1366 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1373 if (ctx
->ExecuteFlag
) {
1374 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1380 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1381 GLenum format
, GLenum type
,
1382 const GLvoid
*table
)
1384 GET_CURRENT_CONTEXT(ctx
);
1385 GLvoid
*image
= unpack_image(count
, 1, 1, format
, type
, table
,
1388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1389 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1401 if (ctx
->ExecuteFlag
) {
1402 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1407 static void GLAPIENTRY
1408 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1409 GLint x
, GLint y
, GLsizei width
)
1411 GET_CURRENT_CONTEXT(ctx
);
1414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1415 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1423 if (ctx
->ExecuteFlag
) {
1424 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1429 static void GLAPIENTRY
1430 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1431 GLint x
, GLint y
, GLsizei width
)
1433 GET_CURRENT_CONTEXT(ctx
);
1436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1437 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1440 n
[2].e
= internalformat
;
1445 if (ctx
->ExecuteFlag
) {
1446 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1451 static void GLAPIENTRY
1452 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1453 GLenum format
, GLenum type
, const GLvoid
*filter
)
1455 GET_CURRENT_CONTEXT(ctx
);
1456 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, filter
,
1459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1460 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1463 n
[2].e
= internalFormat
;
1472 if (ctx
->ExecuteFlag
) {
1473 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1474 format
, type
, filter
);
1479 static void GLAPIENTRY
1480 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1481 GLsizei width
, GLsizei height
, GLenum format
,
1482 GLenum type
, const GLvoid
*filter
)
1484 GET_CURRENT_CONTEXT(ctx
);
1485 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
, filter
,
1488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1489 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1492 n
[2].e
= internalFormat
;
1502 if (ctx
->ExecuteFlag
) {
1503 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1504 format
, type
, filter
);
1509 static void GLAPIENTRY
1510 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1512 GET_CURRENT_CONTEXT(ctx
);
1514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1515 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1521 if (ctx
->ExecuteFlag
) {
1522 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1527 static void GLAPIENTRY
1528 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1530 GET_CURRENT_CONTEXT(ctx
);
1532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1533 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1538 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1539 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1540 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1546 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1549 if (ctx
->ExecuteFlag
) {
1550 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1555 static void GLAPIENTRY
1556 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1558 GET_CURRENT_CONTEXT(ctx
);
1560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1561 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1567 if (ctx
->ExecuteFlag
) {
1568 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1573 static void GLAPIENTRY
1574 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1576 GET_CURRENT_CONTEXT(ctx
);
1578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1584 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1585 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1586 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1592 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1595 if (ctx
->ExecuteFlag
) {
1596 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1601 static void GLAPIENTRY
1602 save_CopyPixels( GLint x
, GLint y
,
1603 GLsizei width
, GLsizei height
, GLenum type
)
1605 GET_CURRENT_CONTEXT(ctx
);
1607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1608 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1612 n
[3].i
= (GLint
) width
;
1613 n
[4].i
= (GLint
) height
;
1616 if (ctx
->ExecuteFlag
) {
1617 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1623 static void GLAPIENTRY
1624 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1625 GLint x
, GLint y
, GLsizei width
, GLint border
)
1627 GET_CURRENT_CONTEXT(ctx
);
1629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1630 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1634 n
[3].e
= internalformat
;
1640 if (ctx
->ExecuteFlag
) {
1641 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1642 x
, y
, width
, border
);
1647 static void GLAPIENTRY
1648 save_CopyTexImage2D( GLenum target
, GLint level
,
1649 GLenum internalformat
,
1650 GLint x
, GLint y
, GLsizei width
,
1651 GLsizei height
, GLint border
)
1653 GET_CURRENT_CONTEXT(ctx
);
1655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1656 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1660 n
[3].e
= internalformat
;
1667 if (ctx
->ExecuteFlag
) {
1668 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1669 x
, y
, width
, height
, border
);
1675 static void GLAPIENTRY
1676 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1677 GLint xoffset
, GLint x
, GLint y
,
1680 GET_CURRENT_CONTEXT(ctx
);
1682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1683 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1692 if (ctx
->ExecuteFlag
) {
1693 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1698 static void GLAPIENTRY
1699 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1700 GLint xoffset
, GLint yoffset
,
1702 GLsizei width
, GLint height
)
1704 GET_CURRENT_CONTEXT(ctx
);
1706 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1707 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1718 if (ctx
->ExecuteFlag
) {
1719 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1720 x
, y
, width
, height
);
1725 static void GLAPIENTRY
1726 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1727 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1729 GLsizei width
, GLint height
)
1731 GET_CURRENT_CONTEXT(ctx
);
1733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1734 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1746 if (ctx
->ExecuteFlag
) {
1747 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1748 xoffset
, yoffset
, zoffset
,
1749 x
, y
, width
, height
);
1754 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1756 GET_CURRENT_CONTEXT(ctx
);
1758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1759 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1763 if (ctx
->ExecuteFlag
) {
1764 (*ctx
->Exec
->CullFace
)( mode
);
1769 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1778 if (ctx
->ExecuteFlag
) {
1779 (*ctx
->Exec
->DepthFunc
)( func
);
1784 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1786 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1793 if (ctx
->ExecuteFlag
) {
1794 (*ctx
->Exec
->DepthMask
)( mask
);
1799 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1801 GET_CURRENT_CONTEXT(ctx
);
1803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1804 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1806 n
[1].f
= (GLfloat
) nearval
;
1807 n
[2].f
= (GLfloat
) farval
;
1809 if (ctx
->ExecuteFlag
) {
1810 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1815 static void GLAPIENTRY
save_Disable( GLenum cap
)
1817 GET_CURRENT_CONTEXT(ctx
);
1819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1820 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1824 if (ctx
->ExecuteFlag
) {
1825 (*ctx
->Exec
->Disable
)( cap
);
1830 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1832 GET_CURRENT_CONTEXT(ctx
);
1834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1835 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1839 if (ctx
->ExecuteFlag
) {
1840 (*ctx
->Exec
->DrawBuffer
)( mode
);
1845 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1846 GLenum format
, GLenum type
,
1847 const GLvoid
*pixels
)
1849 GET_CURRENT_CONTEXT(ctx
);
1850 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
1851 pixels
, &ctx
->Unpack
);
1853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1854 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1865 if (ctx
->ExecuteFlag
) {
1866 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1872 static void GLAPIENTRY
save_Enable( GLenum cap
)
1874 GET_CURRENT_CONTEXT(ctx
);
1876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1877 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1881 if (ctx
->ExecuteFlag
) {
1882 (*ctx
->Exec
->Enable
)( cap
);
1888 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1890 GET_CURRENT_CONTEXT(ctx
);
1892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1893 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1899 if (ctx
->ExecuteFlag
) {
1900 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1905 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1907 GET_CURRENT_CONTEXT(ctx
);
1909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1910 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1918 if (ctx
->ExecuteFlag
) {
1919 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1926 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1928 GET_CURRENT_CONTEXT(ctx
);
1930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1931 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1939 if (ctx
->ExecuteFlag
) {
1940 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1945 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1947 save_Fogfv(pname
, ¶m
);
1951 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1956 case GL_FOG_DENSITY
:
1960 p
[0] = (GLfloat
) *params
;
1963 p
[0] = INT_TO_FLOAT( params
[0] );
1964 p
[1] = INT_TO_FLOAT( params
[1] );
1965 p
[2] = INT_TO_FLOAT( params
[2] );
1966 p
[3] = INT_TO_FLOAT( params
[3] );
1969 /* Error will be caught later in gl_Fogfv */
1972 save_Fogfv(pname
, p
);
1976 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1978 save_Fogiv(pname
, ¶m
);
1982 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1984 GET_CURRENT_CONTEXT(ctx
);
1986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1987 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1991 if (ctx
->ExecuteFlag
) {
1992 (*ctx
->Exec
->FrontFace
)( mode
);
1997 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1998 GLdouble bottom
, GLdouble top
,
1999 GLdouble nearval
, GLdouble farval
)
2001 GET_CURRENT_CONTEXT(ctx
);
2003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2004 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
2006 n
[1].f
= (GLfloat
) left
;
2007 n
[2].f
= (GLfloat
) right
;
2008 n
[3].f
= (GLfloat
) bottom
;
2009 n
[4].f
= (GLfloat
) top
;
2010 n
[5].f
= (GLfloat
) nearval
;
2011 n
[6].f
= (GLfloat
) farval
;
2013 if (ctx
->ExecuteFlag
) {
2014 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
2019 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2021 GET_CURRENT_CONTEXT(ctx
);
2023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2024 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2029 if (ctx
->ExecuteFlag
) {
2030 (*ctx
->Exec
->Hint
)( target
, mode
);
2035 static void GLAPIENTRY
2036 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2038 GET_CURRENT_CONTEXT(ctx
);
2041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2042 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2046 n
[3].e
= internalFormat
;
2049 if (ctx
->ExecuteFlag
) {
2050 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2055 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2057 GET_CURRENT_CONTEXT(ctx
);
2059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2060 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2064 if (ctx
->ExecuteFlag
) {
2065 (*ctx
->Exec
->IndexMask
)( mask
);
2070 static void GLAPIENTRY
save_InitNames( void )
2072 GET_CURRENT_CONTEXT(ctx
);
2073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2074 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2075 if (ctx
->ExecuteFlag
) {
2076 (*ctx
->Exec
->InitNames
)();
2081 static void GLAPIENTRY
save_Lightfv( GLenum light
, 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
, 6 );
2104 case GL_SPOT_DIRECTION
:
2107 case GL_SPOT_EXPONENT
:
2110 case GL_SPOT_CUTOFF
:
2113 case GL_CONSTANT_ATTENUATION
:
2116 case GL_LINEAR_ATTENUATION
:
2119 case GL_QUADRATIC_ATTENUATION
:
2125 for (i
= 0; i
< nParams
; i
++) {
2126 n
[3+i
].f
= params
[i
];
2129 if (ctx
->ExecuteFlag
) {
2130 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2135 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2137 save_Lightfv(light
, pname
, ¶ms
);
2141 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2148 fparam
[0] = INT_TO_FLOAT( params
[0] );
2149 fparam
[1] = INT_TO_FLOAT( params
[1] );
2150 fparam
[2] = INT_TO_FLOAT( params
[2] );
2151 fparam
[3] = INT_TO_FLOAT( params
[3] );
2154 fparam
[0] = (GLfloat
) params
[0];
2155 fparam
[1] = (GLfloat
) params
[1];
2156 fparam
[2] = (GLfloat
) params
[2];
2157 fparam
[3] = (GLfloat
) params
[3];
2159 case GL_SPOT_DIRECTION
:
2160 fparam
[0] = (GLfloat
) params
[0];
2161 fparam
[1] = (GLfloat
) params
[1];
2162 fparam
[2] = (GLfloat
) params
[2];
2164 case GL_SPOT_EXPONENT
:
2165 case GL_SPOT_CUTOFF
:
2166 case GL_CONSTANT_ATTENUATION
:
2167 case GL_LINEAR_ATTENUATION
:
2168 case GL_QUADRATIC_ATTENUATION
:
2169 fparam
[0] = (GLfloat
) params
[0];
2172 /* error will be caught later in gl_Lightfv */
2175 save_Lightfv( light
, pname
, fparam
);
2179 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2181 save_Lightiv( light
, pname
, ¶m
);
2185 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2187 GET_CURRENT_CONTEXT(ctx
);
2189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2190 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2198 if (ctx
->ExecuteFlag
) {
2199 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2204 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2206 save_LightModelfv(pname
, ¶m
);
2210 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2214 case GL_LIGHT_MODEL_AMBIENT
:
2215 fparam
[0] = INT_TO_FLOAT( params
[0] );
2216 fparam
[1] = INT_TO_FLOAT( params
[1] );
2217 fparam
[2] = INT_TO_FLOAT( params
[2] );
2218 fparam
[3] = INT_TO_FLOAT( params
[3] );
2220 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2221 case GL_LIGHT_MODEL_TWO_SIDE
:
2222 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2223 fparam
[0] = (GLfloat
) params
[0];
2226 /* Error will be caught later in gl_LightModelfv */
2229 save_LightModelfv(pname
, fparam
);
2233 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2235 save_LightModeliv(pname
, ¶m
);
2239 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2241 GET_CURRENT_CONTEXT(ctx
);
2243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2244 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2249 if (ctx
->ExecuteFlag
) {
2250 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2255 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2257 GET_CURRENT_CONTEXT(ctx
);
2259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2260 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2264 if (ctx
->ExecuteFlag
) {
2265 (*ctx
->Exec
->LineWidth
)( width
);
2270 static void GLAPIENTRY
save_ListBase( GLuint base
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2279 if (ctx
->ExecuteFlag
) {
2280 (*ctx
->Exec
->ListBase
)( base
);
2285 static void GLAPIENTRY
save_LoadIdentity( void )
2287 GET_CURRENT_CONTEXT(ctx
);
2288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2289 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2290 if (ctx
->ExecuteFlag
) {
2291 (*ctx
->Exec
->LoadIdentity
)();
2296 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2298 GET_CURRENT_CONTEXT(ctx
);
2300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2301 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2304 for (i
=0;i
<16;i
++) {
2308 if (ctx
->ExecuteFlag
) {
2309 (*ctx
->Exec
->LoadMatrixf
)( m
);
2314 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2318 for (i
= 0; i
< 16; i
++) {
2319 f
[i
] = (GLfloat
) m
[i
];
2321 save_LoadMatrixf(f
);
2325 static void GLAPIENTRY
save_LoadName( GLuint name
)
2327 GET_CURRENT_CONTEXT(ctx
);
2329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2334 if (ctx
->ExecuteFlag
) {
2335 (*ctx
->Exec
->LoadName
)( name
);
2340 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2342 GET_CURRENT_CONTEXT(ctx
);
2344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2345 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2349 if (ctx
->ExecuteFlag
) {
2350 (*ctx
->Exec
->LogicOp
)( opcode
);
2355 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2356 GLint order
, const GLdouble
*points
)
2358 GET_CURRENT_CONTEXT(ctx
);
2360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2361 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2363 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2365 n
[2].f
= (GLfloat
) u1
;
2366 n
[3].f
= (GLfloat
) u2
;
2367 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2369 n
[6].data
= (void *) pnts
;
2371 if (ctx
->ExecuteFlag
) {
2372 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2376 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2377 GLint order
, const GLfloat
*points
)
2379 GET_CURRENT_CONTEXT(ctx
);
2381 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2382 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2384 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2388 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2390 n
[6].data
= (void *) pnts
;
2392 if (ctx
->ExecuteFlag
) {
2393 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2398 static void GLAPIENTRY
save_Map2d( GLenum target
,
2399 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2400 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2401 const GLdouble
*points
)
2403 GET_CURRENT_CONTEXT(ctx
);
2405 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2406 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2408 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2409 vstride
, vorder
, points
);
2411 n
[2].f
= (GLfloat
) u1
;
2412 n
[3].f
= (GLfloat
) u2
;
2413 n
[4].f
= (GLfloat
) v1
;
2414 n
[5].f
= (GLfloat
) v2
;
2415 /* XXX verify these strides are correct */
2416 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2417 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2420 n
[10].data
= (void *) pnts
;
2422 if (ctx
->ExecuteFlag
) {
2423 (*ctx
->Exec
->Map2d
)( target
,
2424 u1
, u2
, ustride
, uorder
,
2425 v1
, v2
, vstride
, vorder
, points
);
2430 static void GLAPIENTRY
save_Map2f( GLenum target
,
2431 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2432 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2433 const GLfloat
*points
)
2435 GET_CURRENT_CONTEXT(ctx
);
2437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2438 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2440 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2441 vstride
, vorder
, points
);
2447 /* XXX verify these strides are correct */
2448 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2449 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2452 n
[10].data
= (void *) pnts
;
2454 if (ctx
->ExecuteFlag
) {
2455 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2456 v1
, v2
, vstride
, vorder
, points
);
2461 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2463 GET_CURRENT_CONTEXT(ctx
);
2465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2466 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2472 if (ctx
->ExecuteFlag
) {
2473 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2478 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2480 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2484 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2485 GLint vn
, GLfloat v1
, GLfloat v2
)
2487 GET_CURRENT_CONTEXT(ctx
);
2489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2490 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2499 if (ctx
->ExecuteFlag
) {
2500 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2506 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2507 GLint vn
, GLdouble v1
, GLdouble v2
)
2509 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2510 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2514 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2516 GET_CURRENT_CONTEXT(ctx
);
2518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2519 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2523 if (ctx
->ExecuteFlag
) {
2524 (*ctx
->Exec
->MatrixMode
)( mode
);
2529 static void GLAPIENTRY
2530 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2532 GET_CURRENT_CONTEXT(ctx
);
2535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2536 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2539 n
[2].e
= internalFormat
;
2542 if (ctx
->ExecuteFlag
) {
2543 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2548 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2550 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2556 for (i
=0;i
<16;i
++) {
2560 if (ctx
->ExecuteFlag
) {
2561 (*ctx
->Exec
->MultMatrixf
)( m
);
2566 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2570 for (i
= 0; i
< 16; i
++) {
2571 f
[i
] = (GLfloat
) m
[i
];
2573 save_MultMatrixf(f
);
2577 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2579 GET_CURRENT_CONTEXT(ctx
);
2580 /* It's an error to call this function while building a display list */
2581 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2588 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2589 GLdouble bottom
, GLdouble top
,
2590 GLdouble nearval
, GLdouble farval
)
2592 GET_CURRENT_CONTEXT(ctx
);
2594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2595 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2597 n
[1].f
= (GLfloat
) left
;
2598 n
[2].f
= (GLfloat
) right
;
2599 n
[3].f
= (GLfloat
) bottom
;
2600 n
[4].f
= (GLfloat
) top
;
2601 n
[5].f
= (GLfloat
) nearval
;
2602 n
[6].f
= (GLfloat
) farval
;
2604 if (ctx
->ExecuteFlag
) {
2605 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2610 static void GLAPIENTRY
2611 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2613 GET_CURRENT_CONTEXT(ctx
);
2615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2616 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2620 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2621 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2623 if (ctx
->ExecuteFlag
) {
2624 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2629 static void GLAPIENTRY
2630 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2632 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2634 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2635 for (i
=0;i
<mapsize
;i
++) {
2636 fvalues
[i
] = (GLfloat
) values
[i
];
2640 for (i
=0;i
<mapsize
;i
++) {
2641 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2644 save_PixelMapfv(map
, mapsize
, fvalues
);
2648 static void GLAPIENTRY
2649 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2651 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2653 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2654 for (i
=0;i
<mapsize
;i
++) {
2655 fvalues
[i
] = (GLfloat
) values
[i
];
2659 for (i
=0;i
<mapsize
;i
++) {
2660 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2663 save_PixelMapfv(map
, mapsize
, fvalues
);
2667 static void GLAPIENTRY
2668 save_PixelTransferf( GLenum pname
, GLfloat param
)
2670 GET_CURRENT_CONTEXT(ctx
);
2672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2673 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2678 if (ctx
->ExecuteFlag
) {
2679 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2684 static void GLAPIENTRY
2685 save_PixelTransferi( GLenum pname
, GLint param
)
2687 save_PixelTransferf( pname
, (GLfloat
) param
);
2691 static void GLAPIENTRY
2692 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2694 GET_CURRENT_CONTEXT(ctx
);
2696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2697 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2702 if (ctx
->ExecuteFlag
) {
2703 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2708 static void GLAPIENTRY
2709 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2711 GET_CURRENT_CONTEXT(ctx
);
2713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2714 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2721 if (ctx
->ExecuteFlag
) {
2722 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2727 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2729 save_PointParameterfvEXT(pname
, ¶m
);
2732 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2734 GLfloat p
= (GLfloat
) param
;
2735 save_PointParameterfvEXT(pname
, &p
);
2738 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2740 GLfloat p
= (GLfloat
) param
[0];
2741 save_PointParameterfvEXT(pname
, &p
);
2745 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2747 GET_CURRENT_CONTEXT(ctx
);
2749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2750 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2754 if (ctx
->ExecuteFlag
) {
2755 (*ctx
->Exec
->PointSize
)( size
);
2760 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2762 GET_CURRENT_CONTEXT(ctx
);
2764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2765 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2770 if (ctx
->ExecuteFlag
) {
2771 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2777 * Polygon stipple must have been upacked already!
2779 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2781 GET_CURRENT_CONTEXT(ctx
);
2783 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2784 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2787 n
[1].data
= MALLOC( 32 * 4 );
2788 data
= n
[1].data
; /* This needed for Acorn compiler */
2789 MEMCPY( data
, pattern
, 32 * 4 );
2791 if (ctx
->ExecuteFlag
) {
2792 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2797 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2799 GET_CURRENT_CONTEXT(ctx
);
2801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2802 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2807 if (ctx
->ExecuteFlag
) {
2808 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2813 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2815 GET_CURRENT_CONTEXT(ctx
);
2816 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2820 static void GLAPIENTRY
save_PopAttrib( void )
2822 GET_CURRENT_CONTEXT(ctx
);
2823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2824 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2825 if (ctx
->ExecuteFlag
) {
2826 (*ctx
->Exec
->PopAttrib
)();
2831 static void GLAPIENTRY
save_PopMatrix( void )
2833 GET_CURRENT_CONTEXT(ctx
);
2834 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2835 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2836 if (ctx
->ExecuteFlag
) {
2837 (*ctx
->Exec
->PopMatrix
)();
2842 static void GLAPIENTRY
save_PopName( void )
2844 GET_CURRENT_CONTEXT(ctx
);
2845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2846 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2847 if (ctx
->ExecuteFlag
) {
2848 (*ctx
->Exec
->PopName
)();
2853 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2854 const GLclampf
*priorities
)
2856 GET_CURRENT_CONTEXT(ctx
);
2858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2860 for (i
=0;i
<num
;i
++) {
2862 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2864 n
[1].ui
= textures
[i
];
2865 n
[2].f
= priorities
[i
];
2868 if (ctx
->ExecuteFlag
) {
2869 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2874 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2876 GET_CURRENT_CONTEXT(ctx
);
2878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2879 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2883 if (ctx
->ExecuteFlag
) {
2884 (*ctx
->Exec
->PushAttrib
)( mask
);
2889 static void GLAPIENTRY
save_PushMatrix( void )
2891 GET_CURRENT_CONTEXT(ctx
);
2892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2893 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2894 if (ctx
->ExecuteFlag
) {
2895 (*ctx
->Exec
->PushMatrix
)();
2900 static void GLAPIENTRY
save_PushName( GLuint name
)
2902 GET_CURRENT_CONTEXT(ctx
);
2904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2905 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2909 if (ctx
->ExecuteFlag
) {
2910 (*ctx
->Exec
->PushName
)( name
);
2915 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2917 GET_CURRENT_CONTEXT(ctx
);
2919 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2920 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2927 if (ctx
->ExecuteFlag
) {
2928 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2932 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2934 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2937 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2939 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2942 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2944 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2947 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2949 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2952 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2954 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2957 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2959 save_RasterPos4f(x
, y
, z
, 1.0F
);
2962 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2964 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2967 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2969 save_RasterPos4f(x
, y
, z
, 1.0F
);
2972 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2974 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2977 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2979 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2982 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2984 save_RasterPos4f(x
, y
, z
, w
);
2987 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2989 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2992 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2994 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2997 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2999 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3002 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
3004 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3007 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3009 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3012 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3014 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3017 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3019 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3022 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3024 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3027 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3029 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3030 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3033 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3035 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3038 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3040 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3041 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3044 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3046 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3050 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3052 GET_CURRENT_CONTEXT(ctx
);
3054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3055 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3059 if (ctx
->ExecuteFlag
) {
3060 (*ctx
->Exec
->PassThrough
)( token
);
3065 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3067 GET_CURRENT_CONTEXT(ctx
);
3069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3070 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3074 if (ctx
->ExecuteFlag
) {
3075 (*ctx
->Exec
->ReadBuffer
)( mode
);
3080 static void GLAPIENTRY
3081 save_ResetHistogram(GLenum target
)
3083 GET_CURRENT_CONTEXT(ctx
);
3085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3086 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3090 if (ctx
->ExecuteFlag
) {
3091 (*ctx
->Exec
->ResetHistogram
)( target
);
3096 static void GLAPIENTRY
3097 save_ResetMinmax(GLenum target
)
3099 GET_CURRENT_CONTEXT(ctx
);
3101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3102 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3106 if (ctx
->ExecuteFlag
) {
3107 (*ctx
->Exec
->ResetMinmax
)( target
);
3112 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3114 GET_CURRENT_CONTEXT(ctx
);
3116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3117 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3124 if (ctx
->ExecuteFlag
) {
3125 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3130 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3132 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3136 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3138 GET_CURRENT_CONTEXT(ctx
);
3140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3141 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3147 if (ctx
->ExecuteFlag
) {
3148 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3153 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3155 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3159 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3161 GET_CURRENT_CONTEXT(ctx
);
3163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3164 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3171 if (ctx
->ExecuteFlag
) {
3172 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3177 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3179 GET_CURRENT_CONTEXT(ctx
);
3181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3182 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3186 if (ctx
->ExecuteFlag
) {
3187 (*ctx
->Exec
->ShadeModel
)( mode
);
3192 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3194 GET_CURRENT_CONTEXT(ctx
);
3196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3197 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3203 if (ctx
->ExecuteFlag
) {
3204 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3209 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3211 GET_CURRENT_CONTEXT(ctx
);
3213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3214 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3218 if (ctx
->ExecuteFlag
) {
3219 (*ctx
->Exec
->StencilMask
)( mask
);
3224 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3226 GET_CURRENT_CONTEXT(ctx
);
3228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3229 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3235 if (ctx
->ExecuteFlag
) {
3236 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3241 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3243 GET_CURRENT_CONTEXT(ctx
);
3245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3246 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3250 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3258 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3261 if (ctx
->ExecuteFlag
) {
3262 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3267 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3269 save_TexEnvfv( target
, pname
, ¶m
);
3273 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3276 p
[0] = (GLfloat
) param
;
3277 p
[1] = p
[2] = p
[3] = 0.0;
3278 save_TexEnvfv( target
, pname
, p
);
3282 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3285 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3286 p
[0] = INT_TO_FLOAT( param
[0] );
3287 p
[1] = INT_TO_FLOAT( param
[1] );
3288 p
[2] = INT_TO_FLOAT( param
[2] );
3289 p
[3] = INT_TO_FLOAT( param
[3] );
3292 p
[0] = (GLfloat
) param
[0];
3293 p
[1] = p
[2] = p
[3] = 0.0F
;
3295 save_TexEnvfv( target
, pname
, p
);
3299 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3301 GET_CURRENT_CONTEXT(ctx
);
3303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3304 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3313 if (ctx
->ExecuteFlag
) {
3314 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3319 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3322 p
[0] = (GLfloat
) params
[0];
3323 p
[1] = (GLfloat
) params
[1];
3324 p
[2] = (GLfloat
) params
[2];
3325 p
[3] = (GLfloat
) params
[3];
3326 save_TexGenfv(coord
, pname
, p
);
3330 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3332 GLfloat p
= (GLfloat
) param
;
3333 save_TexGenfv( coord
, pname
, &p
);
3337 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3340 p
[0] = (GLfloat
) params
[0];
3341 p
[1] = (GLfloat
) params
[1];
3342 p
[2] = (GLfloat
) params
[2];
3343 p
[3] = (GLfloat
) params
[3];
3344 save_TexGenfv( coord
, pname
, p
);
3348 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3350 save_TexGenfv(coord
, pname
, ¶m
);
3354 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3356 save_TexGeniv( coord
, pname
, ¶m
);
3360 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3361 GLenum pname
, const GLfloat
*params
)
3363 GET_CURRENT_CONTEXT(ctx
);
3365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3366 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3375 if (ctx
->ExecuteFlag
) {
3376 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3381 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3383 save_TexParameterfv(target
, pname
, ¶m
);
3387 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3390 fparam
[0] = (GLfloat
) param
;
3391 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3392 save_TexParameterfv(target
, pname
, fparam
);
3396 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3399 fparam
[0] = (GLfloat
) params
[0];
3400 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3401 save_TexParameterfv(target
, pname
, fparam
);
3405 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3406 GLint level
, GLint components
,
3407 GLsizei width
, GLint border
,
3408 GLenum format
, GLenum type
,
3409 const GLvoid
*pixels
)
3411 GET_CURRENT_CONTEXT(ctx
);
3412 if (target
== GL_PROXY_TEXTURE_1D
) {
3413 /* don't compile, execute immediately */
3414 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3415 border
, format
, type
, pixels
);
3418 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3419 pixels
, &ctx
->Unpack
);
3421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3422 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3426 n
[3].i
= components
;
3427 n
[4].i
= (GLint
) width
;
3436 if (ctx
->ExecuteFlag
) {
3437 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3438 border
, format
, type
, pixels
);
3444 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3445 GLint level
, GLint components
,
3446 GLsizei width
, GLsizei height
, GLint border
,
3447 GLenum format
, GLenum type
,
3448 const GLvoid
*pixels
)
3450 GET_CURRENT_CONTEXT(ctx
);
3451 if (target
== GL_PROXY_TEXTURE_2D
) {
3452 /* don't compile, execute immediately */
3453 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3454 height
, border
, format
, type
, pixels
);
3457 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3458 pixels
, &ctx
->Unpack
);
3460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3461 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3465 n
[3].i
= components
;
3466 n
[4].i
= (GLint
) width
;
3467 n
[5].i
= (GLint
) height
;
3476 if (ctx
->ExecuteFlag
) {
3477 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3478 height
, border
, format
, type
, pixels
);
3484 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3485 GLint level
, GLint internalFormat
,
3486 GLsizei width
, GLsizei height
, GLsizei depth
,
3488 GLenum format
, GLenum type
,
3489 const GLvoid
*pixels
)
3491 GET_CURRENT_CONTEXT(ctx
);
3492 if (target
== GL_PROXY_TEXTURE_3D
) {
3493 /* don't compile, execute immediately */
3494 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3495 height
, depth
, border
, format
, type
, pixels
);
3499 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3500 pixels
, &ctx
->Unpack
);
3501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3502 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3506 n
[3].i
= (GLint
) internalFormat
;
3507 n
[4].i
= (GLint
) width
;
3508 n
[5].i
= (GLint
) height
;
3509 n
[6].i
= (GLint
) depth
;
3518 if (ctx
->ExecuteFlag
) {
3519 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3520 height
, depth
, border
, format
, type
, pixels
);
3526 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3527 GLsizei width
, GLenum format
, GLenum type
,
3528 const GLvoid
*pixels
)
3530 GET_CURRENT_CONTEXT(ctx
);
3532 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3533 pixels
, &ctx
->Unpack
);
3534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3535 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3540 n
[4].i
= (GLint
) width
;
3548 if (ctx
->ExecuteFlag
) {
3549 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3550 format
, type
, pixels
);
3555 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3556 GLint xoffset
, GLint yoffset
,
3557 GLsizei width
, GLsizei height
,
3558 GLenum format
, GLenum type
,
3559 const GLvoid
*pixels
)
3561 GET_CURRENT_CONTEXT(ctx
);
3563 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3564 pixels
, &ctx
->Unpack
);
3565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3566 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3572 n
[5].i
= (GLint
) width
;
3573 n
[6].i
= (GLint
) height
;
3581 if (ctx
->ExecuteFlag
) {
3582 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3583 width
, height
, format
, type
, pixels
);
3588 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3589 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3590 GLsizei width
, GLsizei height
, GLsizei depth
,
3591 GLenum format
, GLenum type
,
3592 const GLvoid
*pixels
)
3594 GET_CURRENT_CONTEXT(ctx
);
3596 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3597 pixels
, &ctx
->Unpack
);
3598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3599 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3606 n
[6].i
= (GLint
) width
;
3607 n
[7].i
= (GLint
) height
;
3608 n
[8].i
= (GLint
) depth
;
3616 if (ctx
->ExecuteFlag
) {
3617 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3618 xoffset
, yoffset
, zoffset
,
3619 width
, height
, depth
, format
, type
, pixels
);
3624 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3626 GET_CURRENT_CONTEXT(ctx
);
3628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3629 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3635 if (ctx
->ExecuteFlag
) {
3636 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3641 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3643 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3648 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3650 GET_CURRENT_CONTEXT(ctx
);
3652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3653 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3657 n
[3].i
= (GLint
) width
;
3658 n
[4].i
= (GLint
) height
;
3660 if (ctx
->ExecuteFlag
) {
3661 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3666 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3668 GET_CURRENT_CONTEXT(ctx
);
3670 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3671 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3678 if (ctx
->ExecuteFlag
) {
3679 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3683 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3685 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3688 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3690 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3693 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3695 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3698 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3700 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3703 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3705 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3708 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3710 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3713 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3715 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3718 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3720 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3723 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3725 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3728 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3730 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3733 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3735 save_WindowPos4fMESA(x
, y
, z
, w
);
3738 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3740 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3743 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3745 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3748 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3750 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3753 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3755 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3758 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3760 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3763 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3765 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3768 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3770 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3773 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3775 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3778 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3780 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3781 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3784 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3786 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3789 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3791 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3792 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3795 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3797 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3802 /* GL_ARB_multitexture */
3803 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3805 GET_CURRENT_CONTEXT(ctx
);
3807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3808 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3812 if (ctx
->ExecuteFlag
) {
3813 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3818 /* GL_ARB_transpose_matrix */
3820 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3823 _math_transposefd(tm
, m
);
3824 save_LoadMatrixf(tm
);
3828 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3831 _math_transposef(tm
, m
);
3832 save_LoadMatrixf(tm
);
3836 static void GLAPIENTRY
3837 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3840 _math_transposefd(tm
, m
);
3841 save_MultMatrixf(tm
);
3845 static void GLAPIENTRY
3846 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3849 _math_transposef(tm
, m
);
3850 save_MultMatrixf(tm
);
3854 static void GLAPIENTRY
3855 save_PixelTexGenSGIX(GLenum mode
)
3857 GET_CURRENT_CONTEXT(ctx
);
3859 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3860 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3864 if (ctx
->ExecuteFlag
) {
3865 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3870 /* GL_ARB_texture_compression */
3871 static void GLAPIENTRY
3872 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3873 GLenum internalFormat
, GLsizei width
,
3874 GLint border
, GLsizei imageSize
,
3877 GET_CURRENT_CONTEXT(ctx
);
3878 if (target
== GL_PROXY_TEXTURE_1D
) {
3879 /* don't compile, execute immediately */
3880 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3881 width
, border
, imageSize
, data
);
3886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3887 /* make copy of image */
3888 image
= MALLOC(imageSize
);
3890 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3893 MEMCPY(image
, data
, imageSize
);
3894 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3898 n
[3].e
= internalFormat
;
3899 n
[4].i
= (GLint
) width
;
3907 if (ctx
->ExecuteFlag
) {
3908 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3909 width
, border
, imageSize
, data
);
3915 static void GLAPIENTRY
3916 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3917 GLenum internalFormat
, GLsizei width
,
3918 GLsizei height
, GLint border
, GLsizei imageSize
,
3921 GET_CURRENT_CONTEXT(ctx
);
3922 if (target
== GL_PROXY_TEXTURE_2D
) {
3923 /* don't compile, execute immediately */
3924 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3925 width
, height
, border
, imageSize
, data
);
3930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3931 /* make copy of image */
3932 image
= MALLOC(imageSize
);
3934 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3937 MEMCPY(image
, data
, imageSize
);
3938 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3942 n
[3].e
= internalFormat
;
3943 n
[4].i
= (GLint
) width
;
3944 n
[5].i
= (GLint
) height
;
3952 if (ctx
->ExecuteFlag
) {
3953 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3954 width
, height
, border
, imageSize
, data
);
3960 static void GLAPIENTRY
3961 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3962 GLenum internalFormat
, GLsizei width
,
3963 GLsizei height
, GLsizei depth
, GLint border
,
3964 GLsizei imageSize
, const GLvoid
*data
)
3966 GET_CURRENT_CONTEXT(ctx
);
3967 if (target
== GL_PROXY_TEXTURE_3D
) {
3968 /* don't compile, execute immediately */
3969 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3970 width
, height
, depth
, border
, imageSize
, data
);
3975 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3976 /* make copy of image */
3977 image
= MALLOC(imageSize
);
3979 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3982 MEMCPY(image
, data
, imageSize
);
3983 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3987 n
[3].e
= internalFormat
;
3988 n
[4].i
= (GLint
) width
;
3989 n
[5].i
= (GLint
) height
;
3990 n
[6].i
= (GLint
) depth
;
3998 if (ctx
->ExecuteFlag
) {
3999 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
4000 width
, height
, depth
, border
, imageSize
, data
);
4006 static void GLAPIENTRY
4007 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4008 GLsizei width
, GLenum format
,
4009 GLsizei imageSize
, const GLvoid
*data
)
4014 GET_CURRENT_CONTEXT(ctx
);
4015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4017 /* make copy of image */
4018 image
= MALLOC(imageSize
);
4020 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4023 MEMCPY(image
, data
, imageSize
);
4024 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4029 n
[4].i
= (GLint
) width
;
4037 if (ctx
->ExecuteFlag
) {
4038 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
4039 width
, format
, imageSize
, data
);
4044 static void GLAPIENTRY
4045 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4046 GLint yoffset
, GLsizei width
, GLsizei height
,
4047 GLenum format
, GLsizei imageSize
,
4053 GET_CURRENT_CONTEXT(ctx
);
4054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4056 /* make copy of image */
4057 image
= MALLOC(imageSize
);
4059 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4062 MEMCPY(image
, data
, imageSize
);
4063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4069 n
[5].i
= (GLint
) width
;
4070 n
[6].i
= (GLint
) height
;
4078 if (ctx
->ExecuteFlag
) {
4079 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4080 width
, height
, format
, imageSize
, data
);
4085 static void GLAPIENTRY
4086 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4087 GLint yoffset
, GLint zoffset
, GLsizei width
,
4088 GLsizei height
, GLsizei depth
, GLenum format
,
4089 GLsizei imageSize
, const GLvoid
*data
)
4094 GET_CURRENT_CONTEXT(ctx
);
4095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4097 /* make copy of image */
4098 image
= MALLOC(imageSize
);
4100 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4103 MEMCPY(image
, data
, imageSize
);
4104 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4111 n
[6].i
= (GLint
) width
;
4112 n
[7].i
= (GLint
) height
;
4113 n
[8].i
= (GLint
) depth
;
4115 n
[10].i
= imageSize
;
4121 if (ctx
->ExecuteFlag
) {
4122 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4123 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4128 /* GL_ARB_multisample */
4129 static void GLAPIENTRY
4130 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4132 GET_CURRENT_CONTEXT(ctx
);
4134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4135 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4140 if (ctx
->ExecuteFlag
) {
4141 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4146 /* GL_SGIS_pixel_texture */
4148 static void GLAPIENTRY
4149 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4151 GET_CURRENT_CONTEXT(ctx
);
4153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4154 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4159 if (ctx
->ExecuteFlag
) {
4160 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4165 static void GLAPIENTRY
4166 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4168 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4172 static void GLAPIENTRY
4173 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4175 save_PixelTexGenParameteriSGIS(target
, *value
);
4179 static void GLAPIENTRY
4180 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4182 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4187 * GL_NV_vertex_program
4189 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4190 static void GLAPIENTRY
4191 save_BindProgramNV(GLenum target
, GLuint id
)
4193 GET_CURRENT_CONTEXT(ctx
);
4195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4196 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4201 if (ctx
->ExecuteFlag
) {
4202 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4205 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4207 #if FEATURE_NV_vertex_program
4208 static void GLAPIENTRY
4209 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4211 GET_CURRENT_CONTEXT(ctx
);
4213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4214 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4223 if (ctx
->ExecuteFlag
) {
4224 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4229 static void GLAPIENTRY
4230 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4231 GLfloat x
, GLfloat y
,
4232 GLfloat z
, GLfloat w
)
4234 GET_CURRENT_CONTEXT(ctx
);
4236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4237 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4246 if (ctx
->ExecuteFlag
) {
4247 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4252 static void GLAPIENTRY
4253 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4255 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4256 params
[2], params
[3]);
4260 static void GLAPIENTRY
4261 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4262 GLdouble x
, GLdouble y
,
4263 GLdouble z
, GLdouble w
)
4265 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4266 (GLfloat
) z
, (GLfloat
) w
);
4270 static void GLAPIENTRY
4271 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4272 const GLdouble
*params
)
4274 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4275 (GLfloat
) params
[1], (GLfloat
) params
[2],
4276 (GLfloat
) params
[3]);
4280 static void GLAPIENTRY
4281 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4282 GLuint num
, const GLdouble
*params
)
4285 for (i
= 0; i
< num
; i
++) {
4286 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4291 static void GLAPIENTRY
4292 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4293 GLuint num
, const GLfloat
*params
)
4296 for (i
= 0; i
< num
; i
++) {
4297 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4302 static void GLAPIENTRY
4303 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4304 const GLubyte
*program
)
4306 GET_CURRENT_CONTEXT(ctx
);
4308 GLubyte
*programCopy
;
4310 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4312 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4315 _mesa_memcpy(programCopy
, program
, len
);
4317 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4318 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4323 n
[4].data
= programCopy
;
4325 if (ctx
->ExecuteFlag
) {
4326 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4331 static void GLAPIENTRY
4332 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4334 GET_CURRENT_CONTEXT(ctx
);
4336 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4338 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4341 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4343 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4348 if (ctx
->ExecuteFlag
) {
4349 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4354 static void GLAPIENTRY
4355 save_TrackMatrixNV(GLenum target
, GLuint address
,
4356 GLenum matrix
, GLenum transform
)
4358 GET_CURRENT_CONTEXT(ctx
);
4360 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4361 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4368 if (ctx
->ExecuteFlag
) {
4369 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4372 #endif /* FEATURE_NV_vertex_program */
4376 * GL_NV_fragment_program
4378 #if FEATURE_NV_fragment_program
4379 static void GLAPIENTRY
4380 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4381 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4383 GET_CURRENT_CONTEXT(ctx
);
4385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4386 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4395 if (ctx
->ExecuteFlag
) {
4396 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4401 static void GLAPIENTRY
4402 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4403 const GLfloat
*params
)
4405 GET_CURRENT_CONTEXT(ctx
);
4407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4408 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4417 if (ctx
->ExecuteFlag
) {
4418 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4423 static void GLAPIENTRY
4424 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4425 GLdouble x
, GLdouble y
,
4426 GLdouble z
, GLdouble w
)
4428 GET_CURRENT_CONTEXT(ctx
);
4430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4431 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4435 n
[3].f
= (GLfloat
) x
;
4436 n
[4].f
= (GLfloat
) y
;
4437 n
[5].f
= (GLfloat
) z
;
4438 n
[6].f
= (GLfloat
) w
;
4440 if (ctx
->ExecuteFlag
) {
4441 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4446 static void GLAPIENTRY
4447 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4448 const GLdouble
*params
)
4450 GET_CURRENT_CONTEXT(ctx
);
4452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4453 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4457 n
[3].f
= (GLfloat
) params
[0];
4458 n
[4].f
= (GLfloat
) params
[1];
4459 n
[5].f
= (GLfloat
) params
[2];
4460 n
[6].f
= (GLfloat
) params
[3];
4462 if (ctx
->ExecuteFlag
) {
4463 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4467 static void GLAPIENTRY
4468 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4469 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4471 GET_CURRENT_CONTEXT(ctx
);
4473 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4475 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4478 _mesa_memcpy(nameCopy
, name
, len
);
4480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4481 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4485 n
[3].data
= nameCopy
;
4491 if (ctx
->ExecuteFlag
) {
4492 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4497 static void GLAPIENTRY
4498 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4501 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4505 static void GLAPIENTRY
4506 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4507 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4509 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4510 (GLfloat
) z
,(GLfloat
) w
);
4514 static void GLAPIENTRY
4515 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4518 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4519 (GLfloat
) v
[1], (GLfloat
) v
[2],
4523 #endif /* FEATURE_NV_fragment_program */
4527 /* GL_EXT_stencil_two_side */
4528 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4530 GET_CURRENT_CONTEXT(ctx
);
4532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4533 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4537 if (ctx
->ExecuteFlag
) {
4538 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4543 /* GL_EXT_depth_bounds_test */
4544 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4546 GET_CURRENT_CONTEXT(ctx
);
4548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4549 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4551 n
[1].f
= (GLfloat
) zmin
;
4552 n
[2].f
= (GLfloat
) zmax
;
4554 if (ctx
->ExecuteFlag
) {
4555 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4561 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4563 static void GLAPIENTRY
4564 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4565 const GLvoid
*string
)
4567 GET_CURRENT_CONTEXT(ctx
);
4569 GLubyte
*programCopy
;
4571 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4573 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4576 _mesa_memcpy(programCopy
, string
, len
);
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4584 n
[4].data
= programCopy
;
4586 if (ctx
->ExecuteFlag
) {
4587 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4592 static void GLAPIENTRY
4593 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4594 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4596 GET_CURRENT_CONTEXT(ctx
);
4598 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4599 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4608 if (ctx
->ExecuteFlag
) {
4609 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4614 static void GLAPIENTRY
4615 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4616 const GLfloat
*params
)
4618 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4619 params
[2], params
[3]);
4623 static void GLAPIENTRY
4624 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4625 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4627 save_ProgramEnvParameter4fARB(target
, index
,
4635 static void GLAPIENTRY
4636 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4637 const GLdouble
*params
)
4639 save_ProgramEnvParameter4fARB(target
, index
,
4640 (GLfloat
) params
[0],
4641 (GLfloat
) params
[1],
4642 (GLfloat
) params
[2],
4643 (GLfloat
) params
[3]);
4646 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4649 #ifdef FEATURE_ARB_occlusion_query
4651 static void GLAPIENTRY
4652 save_BeginQueryARB(GLenum target
, GLuint id
)
4654 GET_CURRENT_CONTEXT(ctx
);
4656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4657 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN_QUERY_ARB
, 2 );
4662 if (ctx
->ExecuteFlag
) {
4663 (*ctx
->Exec
->BeginQueryARB
)( target
, id
);
4668 static void GLAPIENTRY
4669 save_EndQueryARB(GLenum target
)
4671 GET_CURRENT_CONTEXT(ctx
);
4673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4674 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_END_QUERY_ARB
, 1 );
4678 if (ctx
->ExecuteFlag
) {
4679 (*ctx
->Exec
->EndQueryARB
)( target
);
4683 #endif /* FEATURE_ARB_occlusion_query */
4687 static void save_Attr1f( GLenum attr
, GLfloat x
)
4689 GET_CURRENT_CONTEXT(ctx
);
4691 SAVE_FLUSH_VERTICES( ctx
);
4692 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4698 ASSERT(attr
< VERT_ATTRIB_MAX
);
4699 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4700 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4702 if (ctx
->ExecuteFlag
) {
4703 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4707 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4709 GET_CURRENT_CONTEXT(ctx
);
4711 SAVE_FLUSH_VERTICES( ctx
);
4712 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4719 ASSERT(attr
< VERT_ATTRIB_MAX
);
4720 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4721 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4723 if (ctx
->ExecuteFlag
) {
4724 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4728 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4730 GET_CURRENT_CONTEXT(ctx
);
4732 SAVE_FLUSH_VERTICES( ctx
);
4733 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4741 ASSERT(attr
< VERT_ATTRIB_MAX
);
4742 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4743 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4745 if (ctx
->ExecuteFlag
) {
4746 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4750 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4753 GET_CURRENT_CONTEXT(ctx
);
4755 SAVE_FLUSH_VERTICES( ctx
);
4756 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4765 ASSERT(attr
< VERT_ATTRIB_MAX
);
4766 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4767 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4769 if (ctx
->ExecuteFlag
) {
4770 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4774 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4776 GET_CURRENT_CONTEXT(ctx
);
4778 SAVE_FLUSH_VERTICES( ctx
);
4779 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4783 if (ctx
->ExecuteFlag
) {
4784 (*ctx
->Exec
->EvalCoord1f
)( x
);
4788 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4790 save_EvalCoord1f( v
[0] );
4793 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4795 GET_CURRENT_CONTEXT(ctx
);
4797 SAVE_FLUSH_VERTICES( ctx
);
4798 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4803 if (ctx
->ExecuteFlag
) {
4804 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4808 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4810 save_EvalCoord2f( v
[0], v
[1] );
4814 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4816 GET_CURRENT_CONTEXT(ctx
);
4818 SAVE_FLUSH_VERTICES( ctx
);
4819 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4823 if (ctx
->ExecuteFlag
) {
4824 (*ctx
->Exec
->EvalPoint1
)( x
);
4828 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4830 GET_CURRENT_CONTEXT(ctx
);
4832 SAVE_FLUSH_VERTICES( ctx
);
4833 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4838 if (ctx
->ExecuteFlag
) {
4839 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4843 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4845 GET_CURRENT_CONTEXT(ctx
);
4847 SAVE_FLUSH_VERTICES( ctx
);
4848 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4853 ctx
->ListState
.ActiveIndex
= 1;
4854 ctx
->ListState
.CurrentIndex
= x
;
4856 if (ctx
->ExecuteFlag
) {
4857 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4861 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4863 save_Indexf( v
[0] );
4866 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4868 GET_CURRENT_CONTEXT(ctx
);
4870 SAVE_FLUSH_VERTICES( ctx
);
4871 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4876 ctx
->ListState
.ActiveEdgeFlag
= 1;
4877 ctx
->ListState
.CurrentEdgeFlag
= x
;
4879 if (ctx
->ExecuteFlag
) {
4880 (*ctx
->Exec
->EdgeFlag
)( x
);
4884 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4886 save_EdgeFlag( v
[0] );
4889 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4891 GET_CURRENT_CONTEXT(ctx
);
4895 SAVE_FLUSH_VERTICES( ctx
);
4900 case GL_FRONT_AND_BACK
:
4903 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4912 case GL_AMBIENT_AND_DIFFUSE
:
4918 case GL_COLOR_INDEXES
:
4922 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4926 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4930 for (i
= 0 ; i
< args
; i
++)
4931 n
[3+i
].f
= param
[i
];
4935 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4936 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4937 if (bitmask
& (1<<i
)) {
4938 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4939 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4943 if (ctx
->ExecuteFlag
) {
4944 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4948 static void GLAPIENTRY
save_Begin( GLenum mode
)
4950 GET_CURRENT_CONTEXT(ctx
);
4952 GLboolean error
= GL_FALSE
;
4954 if (/*mode < GL_POINTS ||*/ mode
> GL_POLYGON
) {
4955 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4958 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4959 /* Typically the first begin. This may raise an error on
4960 * playback, depending on whether CallList is issued from inside
4961 * a begin/end or not.
4963 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4965 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4966 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4969 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4974 /* Give the driver an opportunity to hook in an optimized
4975 * display list compiler.
4977 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4980 SAVE_FLUSH_VERTICES( ctx
);
4981 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4987 if (ctx
->ExecuteFlag
) {
4988 (*ctx
->Exec
->Begin
)( mode
);
4992 static void GLAPIENTRY
save_End( void )
4994 GET_CURRENT_CONTEXT(ctx
);
4995 SAVE_FLUSH_VERTICES( ctx
);
4996 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4997 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4998 if (ctx
->ExecuteFlag
) {
4999 (*ctx
->Exec
->End
)( );
5003 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
5004 GLfloat c
, GLfloat d
)
5006 GET_CURRENT_CONTEXT(ctx
);
5008 SAVE_FLUSH_VERTICES( ctx
);
5009 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
5016 if (ctx
->ExecuteFlag
) {
5017 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
5023 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
5025 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
5028 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
5030 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
5033 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
5035 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
5038 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
5040 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
5043 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5045 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
5048 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
5050 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
5053 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
5055 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
5058 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5060 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
5063 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5065 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
5068 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5070 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5073 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5075 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
5078 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5080 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5083 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5085 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5088 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5090 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5093 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5095 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5098 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5100 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5103 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5105 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5108 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5110 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5113 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5115 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5118 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5120 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5123 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5125 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5128 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5130 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5133 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5135 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5138 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5140 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5144 /* Just call the respective ATTR for texcoord
5146 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5148 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5149 save_Attr1f( attr
, x
);
5152 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5154 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5155 save_Attr1f( attr
, v
[0] );
5158 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5160 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5161 save_Attr2f( attr
, x
, y
);
5164 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5166 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5167 save_Attr2f( attr
, v
[0], v
[1] );
5170 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5173 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5174 save_Attr3f( attr
, x
, y
, z
);
5177 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5179 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5180 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5183 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5184 GLfloat z
, GLfloat w
)
5186 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5187 save_Attr4f( attr
, x
, y
, z
, w
);
5190 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5192 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5193 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5197 static void enum_error( void )
5199 GET_CURRENT_CONTEXT( ctx
);
5200 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5203 /* First level for NV_vertex_program:
5205 * Check for errors at compile time?.
5207 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5209 if (index
< VERT_ATTRIB_MAX
)
5210 save_Attr1f( index
, x
);
5215 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5217 if (index
< VERT_ATTRIB_MAX
)
5218 save_Attr1f( index
, v
[0] );
5223 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5225 if (index
< VERT_ATTRIB_MAX
)
5226 save_Attr2f( index
, x
, y
);
5231 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5233 if (index
< VERT_ATTRIB_MAX
)
5234 save_Attr2f( index
, v
[0], v
[1] );
5239 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5242 if (index
< VERT_ATTRIB_MAX
)
5243 save_Attr3f( index
, x
, y
, z
);
5248 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5250 if (index
< VERT_ATTRIB_MAX
)
5251 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5256 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5257 GLfloat z
, GLfloat w
)
5259 if (index
< VERT_ATTRIB_MAX
)
5260 save_Attr4f( index
, x
, y
, z
, w
);
5265 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5267 if (index
< VERT_ATTRIB_MAX
)
5268 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5277 /* KW: Compile commands
5279 * Will appear in the list before the vertex buffer containing the
5280 * command that provoked the error. I don't see this as a problem.
5283 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5286 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5289 n
[2].data
= (void *) s
;
5291 /* execute already done */
5296 * Compile an error into current display list.
5299 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5301 if (ctx
->CompileFlag
)
5302 _mesa_save_error( ctx
, error
, s
);
5304 if (ctx
->ExecuteFlag
)
5305 _mesa_error( ctx
, error
, s
);
5311 islist(GLcontext
*ctx
, GLuint list
)
5313 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5323 /**********************************************************************/
5324 /* Display list execution */
5325 /**********************************************************************/
5329 * Execute a display list. Note that the ListBase offset must have already
5330 * been added before calling this function. I.e. the list argument is
5331 * the absolute list number, not relative to ListBase.
5332 * \param list - display list number
5334 static void GLAPIENTRY
5335 execute_list( GLcontext
*ctx
, GLuint list
)
5340 if (list
== 0 || !islist(ctx
,list
))
5343 if (ctx
->Driver
.BeginCallList
)
5344 ctx
->Driver
.BeginCallList( ctx
, list
);
5346 ctx
->ListState
.CallDepth
++;
5348 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5352 OpCode opcode
= n
[0].opcode
;
5353 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5355 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5356 /* this is a driver-extended opcode */
5357 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5358 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5363 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5366 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5368 case OPCODE_ALPHA_FUNC
:
5369 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5371 case OPCODE_BIND_TEXTURE
:
5372 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5376 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5377 ctx
->Unpack
= ctx
->DefaultPacking
;
5378 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5379 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5380 ctx
->Unpack
= save
; /* restore */
5383 case OPCODE_BLEND_COLOR
:
5384 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5386 case OPCODE_BLEND_EQUATION
:
5387 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5389 case OPCODE_BLEND_EQUATION_SEPARATE
:
5390 (*ctx
->Exec
->BlendEquationSeparateEXT
)( n
[1].e
, n
[2].e
);
5392 case OPCODE_BLEND_FUNC_SEPARATE
:
5393 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5395 case OPCODE_CALL_LIST
:
5396 /* Generated by glCallList(), don't add ListBase */
5397 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5398 execute_list( ctx
, n
[1].ui
);
5401 case OPCODE_CALL_LIST_OFFSET
:
5402 /* Generated by glCallLists() so we must add ListBase */
5404 /* user specified a bad data type at compile time */
5405 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5407 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5408 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5412 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5414 case OPCODE_CLEAR_COLOR
:
5415 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5417 case OPCODE_CLEAR_ACCUM
:
5418 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5420 case OPCODE_CLEAR_DEPTH
:
5421 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5423 case OPCODE_CLEAR_INDEX
:
5424 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5426 case OPCODE_CLEAR_STENCIL
:
5427 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5429 case OPCODE_CLIP_PLANE
:
5436 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5439 case OPCODE_COLOR_MASK
:
5440 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5442 case OPCODE_COLOR_MATERIAL
:
5443 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5445 case OPCODE_COLOR_TABLE
:
5447 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5448 ctx
->Unpack
= ctx
->DefaultPacking
;
5449 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5450 n
[5].e
, n
[6].data
);
5451 ctx
->Unpack
= save
; /* restore */
5454 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5461 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5464 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5471 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5474 case OPCODE_COLOR_SUB_TABLE
:
5476 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5477 ctx
->Unpack
= ctx
->DefaultPacking
;
5478 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5479 n
[4].e
, n
[5].e
, n
[6].data
);
5480 ctx
->Unpack
= save
; /* restore */
5483 case OPCODE_CONVOLUTION_FILTER_1D
:
5485 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5486 ctx
->Unpack
= ctx
->DefaultPacking
;
5487 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5488 n
[4].e
, n
[5].e
, n
[6].data
);
5489 ctx
->Unpack
= save
; /* restore */
5492 case OPCODE_CONVOLUTION_FILTER_2D
:
5494 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5495 ctx
->Unpack
= ctx
->DefaultPacking
;
5496 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5497 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5498 ctx
->Unpack
= save
; /* restore */
5501 case OPCODE_CONVOLUTION_PARAMETER_I
:
5502 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5504 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5511 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5514 case OPCODE_CONVOLUTION_PARAMETER_F
:
5515 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5517 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5524 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5527 case OPCODE_COPY_COLOR_SUB_TABLE
:
5528 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5529 n
[3].i
, n
[4].i
, n
[5].i
);
5531 case OPCODE_COPY_COLOR_TABLE
:
5532 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5533 n
[3].i
, n
[4].i
, n
[5].i
);
5535 case OPCODE_COPY_PIXELS
:
5536 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5537 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5539 case OPCODE_COPY_TEX_IMAGE1D
:
5540 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5541 n
[5].i
, n
[6].i
, n
[7].i
);
5543 case OPCODE_COPY_TEX_IMAGE2D
:
5544 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5545 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5547 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5548 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5549 n
[4].i
, n
[5].i
, n
[6].i
);
5551 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5552 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5553 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5555 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5556 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5557 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5559 case OPCODE_CULL_FACE
:
5560 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5562 case OPCODE_DEPTH_FUNC
:
5563 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5565 case OPCODE_DEPTH_MASK
:
5566 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5568 case OPCODE_DEPTH_RANGE
:
5569 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5571 case OPCODE_DISABLE
:
5572 (*ctx
->Exec
->Disable
)( n
[1].e
);
5574 case OPCODE_DRAW_BUFFER
:
5575 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5577 case OPCODE_DRAW_PIXELS
:
5579 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5580 ctx
->Unpack
= ctx
->DefaultPacking
;
5581 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5583 ctx
->Unpack
= save
; /* restore */
5587 (*ctx
->Exec
->Enable
)( n
[1].e
);
5589 case OPCODE_EVALMESH1
:
5590 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5592 case OPCODE_EVALMESH2
:
5593 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5602 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5605 case OPCODE_FRONT_FACE
:
5606 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5608 case OPCODE_FRUSTUM
:
5609 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5612 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5614 case OPCODE_HISTOGRAM
:
5615 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5617 case OPCODE_INDEX_MASK
:
5618 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5620 case OPCODE_INIT_NAMES
:
5621 (*ctx
->Exec
->InitNames
)();
5630 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5633 case OPCODE_LIGHT_MODEL
:
5640 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5643 case OPCODE_LINE_STIPPLE
:
5644 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5646 case OPCODE_LINE_WIDTH
:
5647 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5649 case OPCODE_LIST_BASE
:
5650 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5652 case OPCODE_LOAD_IDENTITY
:
5653 (*ctx
->Exec
->LoadIdentity
)();
5655 case OPCODE_LOAD_MATRIX
:
5656 if (sizeof(Node
)==sizeof(GLfloat
)) {
5657 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5662 for (i
=0;i
<16;i
++) {
5665 (*ctx
->Exec
->LoadMatrixf
)( m
);
5668 case OPCODE_LOAD_NAME
:
5669 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5671 case OPCODE_LOGIC_OP
:
5672 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5676 GLenum target
= n
[1].e
;
5677 GLint ustride
= _mesa_evaluator_components(target
);
5678 GLint uorder
= n
[5].i
;
5679 GLfloat u1
= n
[2].f
;
5680 GLfloat u2
= n
[3].f
;
5681 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5682 (GLfloat
*) n
[6].data
);
5687 GLenum target
= n
[1].e
;
5688 GLfloat u1
= n
[2].f
;
5689 GLfloat u2
= n
[3].f
;
5690 GLfloat v1
= n
[4].f
;
5691 GLfloat v2
= n
[5].f
;
5692 GLint ustride
= n
[6].i
;
5693 GLint vstride
= n
[7].i
;
5694 GLint uorder
= n
[8].i
;
5695 GLint vorder
= n
[9].i
;
5696 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5697 v1
, v2
, vstride
, vorder
,
5698 (GLfloat
*) n
[10].data
);
5701 case OPCODE_MAPGRID1
:
5702 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5704 case OPCODE_MAPGRID2
:
5705 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5707 case OPCODE_MATRIX_MODE
:
5708 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5710 case OPCODE_MIN_MAX
:
5711 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5713 case OPCODE_MULT_MATRIX
:
5714 if (sizeof(Node
)==sizeof(GLfloat
)) {
5715 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5720 for (i
=0;i
<16;i
++) {
5723 (*ctx
->Exec
->MultMatrixf
)( m
);
5727 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5729 case OPCODE_PASSTHROUGH
:
5730 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5732 case OPCODE_PIXEL_MAP
:
5733 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5735 case OPCODE_PIXEL_TRANSFER
:
5736 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5738 case OPCODE_PIXEL_ZOOM
:
5739 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5741 case OPCODE_POINT_SIZE
:
5742 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5744 case OPCODE_POINT_PARAMETERS
:
5750 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5753 case OPCODE_POLYGON_MODE
:
5754 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5756 case OPCODE_POLYGON_STIPPLE
:
5757 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5759 case OPCODE_POLYGON_OFFSET
:
5760 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5762 case OPCODE_POP_ATTRIB
:
5763 (*ctx
->Exec
->PopAttrib
)();
5765 case OPCODE_POP_MATRIX
:
5766 (*ctx
->Exec
->PopMatrix
)();
5768 case OPCODE_POP_NAME
:
5769 (*ctx
->Exec
->PopName
)();
5771 case OPCODE_PRIORITIZE_TEXTURE
:
5772 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5774 case OPCODE_PUSH_ATTRIB
:
5775 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5777 case OPCODE_PUSH_MATRIX
:
5778 (*ctx
->Exec
->PushMatrix
)();
5780 case OPCODE_PUSH_NAME
:
5781 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5783 case OPCODE_RASTER_POS
:
5784 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5786 case OPCODE_READ_BUFFER
:
5787 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5789 case OPCODE_RESET_HISTOGRAM
:
5790 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5792 case OPCODE_RESET_MIN_MAX
:
5793 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5796 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5799 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5801 case OPCODE_SCISSOR
:
5802 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5804 case OPCODE_SHADE_MODEL
:
5805 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5807 case OPCODE_STENCIL_FUNC
:
5808 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5810 case OPCODE_STENCIL_MASK
:
5811 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5813 case OPCODE_STENCIL_OP
:
5814 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5823 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5833 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5836 case OPCODE_TEXPARAMETER
:
5843 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5846 case OPCODE_TEX_IMAGE1D
:
5848 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5849 ctx
->Unpack
= ctx
->DefaultPacking
;
5850 (*ctx
->Exec
->TexImage1D
)(
5851 n
[1].e
, /* target */
5853 n
[3].i
, /* components */
5855 n
[5].e
, /* border */
5856 n
[6].e
, /* format */
5859 ctx
->Unpack
= save
; /* restore */
5862 case OPCODE_TEX_IMAGE2D
:
5864 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5865 ctx
->Unpack
= ctx
->DefaultPacking
;
5866 (*ctx
->Exec
->TexImage2D
)(
5867 n
[1].e
, /* target */
5869 n
[3].i
, /* components */
5871 n
[5].i
, /* height */
5872 n
[6].e
, /* border */
5873 n
[7].e
, /* format */
5876 ctx
->Unpack
= save
; /* restore */
5879 case OPCODE_TEX_IMAGE3D
:
5881 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5882 ctx
->Unpack
= ctx
->DefaultPacking
;
5883 (*ctx
->Exec
->TexImage3D
)(
5884 n
[1].e
, /* target */
5886 n
[3].i
, /* components */
5888 n
[5].i
, /* height */
5890 n
[7].e
, /* border */
5891 n
[8].e
, /* format */
5894 ctx
->Unpack
= save
; /* restore */
5897 case OPCODE_TEX_SUB_IMAGE1D
:
5899 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5900 ctx
->Unpack
= ctx
->DefaultPacking
;
5901 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5903 n
[6].e
, n
[7].data
);
5904 ctx
->Unpack
= save
; /* restore */
5907 case OPCODE_TEX_SUB_IMAGE2D
:
5909 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5910 ctx
->Unpack
= ctx
->DefaultPacking
;
5911 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5913 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5914 ctx
->Unpack
= save
; /* restore */
5917 case OPCODE_TEX_SUB_IMAGE3D
:
5919 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5920 ctx
->Unpack
= ctx
->DefaultPacking
;
5921 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5922 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5923 n
[8].i
, n
[9].e
, n
[10].e
,
5925 ctx
->Unpack
= save
; /* restore */
5928 case OPCODE_TRANSLATE
:
5929 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5931 case OPCODE_VIEWPORT
:
5932 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5933 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5935 case OPCODE_WINDOW_POS
:
5936 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5938 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5939 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5941 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5942 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5944 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5945 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5947 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5948 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5949 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5951 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5952 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5953 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5955 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5956 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5957 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5959 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5960 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5961 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5963 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5964 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5965 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5967 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5968 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5969 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5970 n
[9].e
, n
[10].i
, n
[11].data
);
5972 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5973 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5975 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5976 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5978 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5979 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5980 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5983 #if FEATURE_NV_vertex_program
5984 case OPCODE_EXECUTE_PROGRAM_NV
:
5991 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5994 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5995 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5996 (GLuint
*) n
[2].data
);
5998 case OPCODE_LOAD_PROGRAM_NV
:
5999 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
6000 (const GLubyte
*) n
[4].data
);
6002 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6003 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6004 n
[4].f
, n
[5].f
, n
[6].f
);
6006 case OPCODE_TRACK_MATRIX_NV
:
6007 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
6011 #if FEATURE_NV_fragment_program
6012 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6013 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6014 n
[4].f
, n
[5].f
, n
[6].f
);
6016 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6017 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
6018 (const GLubyte
*) n
[3].data
,
6019 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
6023 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6024 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
6026 case OPCODE_DEPTH_BOUNDS_EXT
:
6027 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
6029 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6030 case OPCODE_PROGRAM_STRING_ARB
:
6031 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
6033 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6034 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6035 n
[4].f
, n
[5].f
, n
[6].f
);
6038 #if FEATURE_ARB_occlusion_query
6039 case OPCODE_BEGIN_QUERY_ARB
:
6040 ctx
->Exec
->BeginQueryARB(n
[1].e
, n
[2].ui
);
6042 case OPCODE_END_QUERY_ARB
:
6043 ctx
->Exec
->EndQueryARB(n
[1].e
);
6046 case OPCODE_ATTR_1F
:
6047 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
6049 case OPCODE_ATTR_2F
:
6050 /* Really shouldn't have to do this - the Node structure
6051 * is convenient, but it would be better to store the data
6052 * packed appropriately so that it can be sent directly
6053 * on. With x86_64 becoming common, this will start to
6056 if (sizeof(Node
)==sizeof(GLfloat
))
6057 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
6059 (*ctx
->Exec
->VertexAttrib2fNV
)(n
[1].e
, n
[2].f
, n
[3].f
);
6061 case OPCODE_ATTR_3F
:
6062 if (sizeof(Node
)==sizeof(GLfloat
))
6063 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
6065 (*ctx
->Exec
->VertexAttrib3fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6068 case OPCODE_ATTR_4F
:
6069 if (sizeof(Node
)==sizeof(GLfloat
))
6070 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
6072 (*ctx
->Exec
->VertexAttrib4fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6075 case OPCODE_MATERIAL
:
6076 if (sizeof(Node
)==sizeof(GLfloat
))
6077 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
6084 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, f
);
6088 (*ctx
->Exec
->Indexi
)(n
[1].i
);
6090 case OPCODE_EDGEFLAG
:
6091 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
6094 (*ctx
->Exec
->Begin
)(n
[1].e
);
6097 (*ctx
->Exec
->End
)();
6100 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6102 case OPCODE_EVAL_C1
:
6103 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
6105 case OPCODE_EVAL_C2
:
6106 (*ctx
->Exec
->EvalCoord2f
)(n
[1].f
, n
[2].f
);
6108 case OPCODE_EVAL_P1
:
6109 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
6111 case OPCODE_EVAL_P2
:
6112 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
6118 case OPCODE_CONTINUE
:
6119 n
= (Node
*) n
[1].next
;
6121 case OPCODE_END_OF_LIST
:
6127 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6128 _mesa_problem(ctx
, msg
);
6133 /* increment n to point to next compiled command */
6134 if (opcode
!=OPCODE_CONTINUE
) {
6135 n
+= InstSize
[opcode
];
6139 ctx
->ListState
.CallDepth
--;
6141 if (ctx
->Driver
.EndCallList
)
6142 ctx
->Driver
.EndCallList( ctx
);
6149 /**********************************************************************/
6151 /**********************************************************************/
6157 * Test if a display list number is valid.
6159 GLboolean GLAPIENTRY
6160 _mesa_IsList( GLuint list
)
6162 GET_CURRENT_CONTEXT(ctx
);
6163 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6164 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6165 return islist(ctx
, list
);
6170 * Delete a sequence of consecutive display lists.
6173 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6175 GET_CURRENT_CONTEXT(ctx
);
6177 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6178 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6181 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6184 for (i
=list
;i
<list
+range
;i
++) {
6185 _mesa_destroy_list( ctx
, i
);
6192 * Return a display list number, n, such that lists n through n+range-1
6196 _mesa_GenLists(GLsizei range
)
6198 GET_CURRENT_CONTEXT(ctx
);
6200 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6201 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6204 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6212 * Make this an atomic operation
6214 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6216 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6218 /* reserve the list IDs by with empty/dummy lists */
6220 for (i
=0; i
<range
; i
++) {
6221 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6225 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6233 * Begin a new display list.
6236 _mesa_NewList( GLuint list
, GLenum mode
)
6238 GET_CURRENT_CONTEXT(ctx
);
6241 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6242 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6244 if (MESA_VERBOSE
&VERBOSE_API
)
6245 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6246 _mesa_lookup_enum_by_nr(mode
));
6249 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6253 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6254 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6258 if (ctx
->ListState
.CurrentListPtr
) {
6259 /* already compiling a display list */
6260 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6264 ctx
->CompileFlag
= GL_TRUE
;
6265 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6267 /* Allocate new display list */
6268 ctx
->ListState
.CurrentListNum
= list
;
6269 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6270 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6271 ctx
->ListState
.CurrentPos
= 0;
6273 /* Reset acumulated list state:
6275 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6276 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6278 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6279 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6281 ctx
->ListState
.ActiveIndex
= 0;
6282 ctx
->ListState
.ActiveEdgeFlag
= 0;
6284 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6285 ctx
->Driver
.NewList( ctx
, list
, mode
);
6287 ctx
->CurrentDispatch
= ctx
->Save
;
6288 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6294 * End definition of current display list.
6297 _mesa_EndList( void )
6299 GET_CURRENT_CONTEXT(ctx
);
6300 SAVE_FLUSH_VERTICES(ctx
);
6301 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6303 if (MESA_VERBOSE
&VERBOSE_API
)
6304 _mesa_debug(ctx
, "glEndList\n");
6306 /* Check that a list is under construction */
6307 if (!ctx
->ListState
.CurrentListPtr
) {
6308 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6312 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6314 /* Destroy old list, if any */
6315 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6316 /* Install the list */
6317 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6320 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6321 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6323 ctx
->ListState
.CurrentListNum
= 0;
6324 ctx
->ListState
.CurrentListPtr
= NULL
;
6325 ctx
->ExecuteFlag
= GL_TRUE
;
6326 ctx
->CompileFlag
= GL_FALSE
;
6328 ctx
->Driver
.EndList( ctx
);
6330 ctx
->CurrentDispatch
= ctx
->Exec
;
6331 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6337 _mesa_CallList( GLuint list
)
6339 GLboolean save_compile_flag
;
6340 GET_CURRENT_CONTEXT(ctx
);
6341 FLUSH_CURRENT(ctx
, 0);
6342 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6343 /* execute the display list, and restore the CompileFlag. */
6345 if (MESA_VERBOSE
& VERBOSE_API
)
6346 _mesa_debug(ctx
, "glCallList %d\n", list
);
6349 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6353 /* mesa_print_display_list( list ); */
6355 save_compile_flag
= ctx
->CompileFlag
;
6356 if (save_compile_flag
) {
6357 ctx
->CompileFlag
= GL_FALSE
;
6360 execute_list( ctx
, list
);
6361 ctx
->CompileFlag
= save_compile_flag
;
6363 /* also restore API function pointers to point to "save" versions */
6364 if (save_compile_flag
) {
6365 ctx
->CurrentDispatch
= ctx
->Save
;
6366 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6373 * Execute glCallLists: call multiple display lists.
6376 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6378 GET_CURRENT_CONTEXT(ctx
);
6381 GLboolean save_compile_flag
;
6383 if (MESA_VERBOSE
& VERBOSE_API
)
6384 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6388 case GL_UNSIGNED_BYTE
:
6390 case GL_UNSIGNED_SHORT
:
6392 case GL_UNSIGNED_INT
:
6400 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6404 /* Save the CompileFlag status, turn it off, execute display list,
6405 * and restore the CompileFlag.
6407 save_compile_flag
= ctx
->CompileFlag
;
6408 ctx
->CompileFlag
= GL_FALSE
;
6411 list
= translate_id( i
, type
, lists
);
6412 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6415 ctx
->CompileFlag
= save_compile_flag
;
6417 /* also restore API function pointers to point to "save" versions */
6418 if (save_compile_flag
) {
6419 ctx
->CurrentDispatch
= ctx
->Save
;
6420 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6427 * Set the offset added to list numbers in glCallLists.
6430 _mesa_ListBase( GLuint base
)
6432 GET_CURRENT_CONTEXT(ctx
);
6433 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6434 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6435 ctx
->List
.ListBase
= base
;
6439 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6441 static void GLAPIENTRY
exec_Finish( void )
6443 GET_CURRENT_CONTEXT(ctx
);
6444 FLUSH_VERTICES(ctx
, 0);
6445 ctx
->Exec
->Finish();
6448 static void GLAPIENTRY
exec_Flush( void )
6450 GET_CURRENT_CONTEXT(ctx
);
6451 FLUSH_VERTICES(ctx
, 0);
6452 ctx
->Exec
->Flush( );
6455 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6457 GET_CURRENT_CONTEXT(ctx
);
6458 FLUSH_VERTICES(ctx
, 0);
6459 ctx
->Exec
->GetBooleanv( pname
, params
);
6462 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6464 GET_CURRENT_CONTEXT(ctx
);
6465 FLUSH_VERTICES(ctx
, 0);
6466 ctx
->Exec
->GetClipPlane( plane
, equation
);
6469 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6471 GET_CURRENT_CONTEXT(ctx
);
6472 FLUSH_VERTICES(ctx
, 0);
6473 ctx
->Exec
->GetDoublev( pname
, params
);
6476 static GLenum GLAPIENTRY
exec_GetError( void )
6478 GET_CURRENT_CONTEXT(ctx
);
6479 FLUSH_VERTICES(ctx
, 0);
6480 return ctx
->Exec
->GetError( );
6483 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6485 GET_CURRENT_CONTEXT(ctx
);
6486 FLUSH_VERTICES(ctx
, 0);
6487 ctx
->Exec
->GetFloatv( pname
, params
);
6490 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6492 GET_CURRENT_CONTEXT(ctx
);
6493 FLUSH_VERTICES(ctx
, 0);
6494 ctx
->Exec
->GetIntegerv( pname
, params
);
6497 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6499 GET_CURRENT_CONTEXT(ctx
);
6500 FLUSH_VERTICES(ctx
, 0);
6501 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6504 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6506 GET_CURRENT_CONTEXT(ctx
);
6507 FLUSH_VERTICES(ctx
, 0);
6508 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6511 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6513 GET_CURRENT_CONTEXT(ctx
);
6514 FLUSH_VERTICES(ctx
, 0);
6515 ctx
->Exec
->GetMapdv( target
, query
, v
);
6518 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6520 GET_CURRENT_CONTEXT(ctx
);
6521 FLUSH_VERTICES(ctx
, 0);
6522 ctx
->Exec
->GetMapfv( target
, query
, v
);
6525 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6527 GET_CURRENT_CONTEXT(ctx
);
6528 FLUSH_VERTICES(ctx
, 0);
6529 ctx
->Exec
->GetMapiv( target
, query
, v
);
6532 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6534 GET_CURRENT_CONTEXT(ctx
);
6535 FLUSH_VERTICES(ctx
, 0);
6536 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6539 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6541 GET_CURRENT_CONTEXT(ctx
);
6542 FLUSH_VERTICES(ctx
, 0);
6543 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6546 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6548 GET_CURRENT_CONTEXT(ctx
);
6549 FLUSH_VERTICES(ctx
, 0);
6550 ctx
->Exec
->GetPixelMapfv( map
, values
);
6553 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6555 GET_CURRENT_CONTEXT(ctx
);
6556 FLUSH_VERTICES(ctx
, 0);
6557 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6560 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6562 GET_CURRENT_CONTEXT(ctx
);
6563 FLUSH_VERTICES(ctx
, 0);
6564 ctx
->Exec
->GetPixelMapusv( map
, values
);
6567 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6569 GET_CURRENT_CONTEXT(ctx
);
6570 FLUSH_VERTICES(ctx
, 0);
6571 ctx
->Exec
->GetPolygonStipple( dest
);
6574 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6576 GET_CURRENT_CONTEXT(ctx
);
6577 FLUSH_VERTICES(ctx
, 0);
6578 return ctx
->Exec
->GetString( name
);
6581 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6583 GET_CURRENT_CONTEXT(ctx
);
6584 FLUSH_VERTICES(ctx
, 0);
6585 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6588 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6590 GET_CURRENT_CONTEXT(ctx
);
6591 FLUSH_VERTICES(ctx
, 0);
6592 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6595 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6597 GET_CURRENT_CONTEXT(ctx
);
6598 FLUSH_VERTICES(ctx
, 0);
6599 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6602 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6604 GET_CURRENT_CONTEXT(ctx
);
6605 FLUSH_VERTICES(ctx
, 0);
6606 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6609 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6611 GET_CURRENT_CONTEXT(ctx
);
6612 FLUSH_VERTICES(ctx
, 0);
6613 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6616 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6617 GLenum type
, GLvoid
*pixels
)
6619 GET_CURRENT_CONTEXT(ctx
);
6620 FLUSH_VERTICES(ctx
, 0);
6621 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6624 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6625 GLenum pname
, GLfloat
*params
)
6627 GET_CURRENT_CONTEXT(ctx
);
6628 FLUSH_VERTICES(ctx
, 0);
6629 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6632 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6633 GLenum pname
, GLint
*params
)
6635 GET_CURRENT_CONTEXT(ctx
);
6636 FLUSH_VERTICES(ctx
, 0);
6637 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6640 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6643 GET_CURRENT_CONTEXT(ctx
);
6644 FLUSH_VERTICES(ctx
, 0);
6645 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6648 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6650 GET_CURRENT_CONTEXT(ctx
);
6651 FLUSH_VERTICES(ctx
, 0);
6652 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6655 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6657 GET_CURRENT_CONTEXT(ctx
);
6658 FLUSH_VERTICES(ctx
, 0);
6659 return ctx
->Exec
->IsEnabled( cap
);
6662 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6664 GET_CURRENT_CONTEXT(ctx
);
6665 FLUSH_VERTICES(ctx
, 0);
6666 ctx
->Exec
->PixelStoref( pname
, param
);
6669 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6671 GET_CURRENT_CONTEXT(ctx
);
6672 FLUSH_VERTICES(ctx
, 0);
6673 ctx
->Exec
->PixelStorei( pname
, param
);
6676 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6677 GLenum format
, GLenum type
, GLvoid
*pixels
)
6679 GET_CURRENT_CONTEXT(ctx
);
6680 FLUSH_VERTICES(ctx
, 0);
6681 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6684 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6686 GET_CURRENT_CONTEXT(ctx
);
6687 FLUSH_VERTICES(ctx
, 0);
6688 return ctx
->Exec
->RenderMode( mode
);
6691 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6693 GET_CURRENT_CONTEXT(ctx
);
6694 FLUSH_VERTICES(ctx
, 0);
6695 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6698 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6700 GET_CURRENT_CONTEXT(ctx
);
6701 FLUSH_VERTICES(ctx
, 0);
6702 ctx
->Exec
->SelectBuffer( size
, buffer
);
6705 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6706 GLboolean
*residences
)
6708 GET_CURRENT_CONTEXT(ctx
);
6709 FLUSH_VERTICES(ctx
, 0);
6710 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6713 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6716 GET_CURRENT_CONTEXT(ctx
);
6717 FLUSH_VERTICES(ctx
, 0);
6718 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6721 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6723 GET_CURRENT_CONTEXT(ctx
);
6724 FLUSH_VERTICES(ctx
, 0);
6725 ctx
->Exec
->DeleteTextures( n
, texName
);
6728 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6730 GET_CURRENT_CONTEXT(ctx
);
6731 FLUSH_VERTICES(ctx
, 0);
6732 ctx
->Exec
->DisableClientState( cap
);
6735 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6737 GET_CURRENT_CONTEXT(ctx
);
6738 FLUSH_VERTICES(ctx
, 0);
6739 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6742 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6744 GET_CURRENT_CONTEXT(ctx
);
6745 FLUSH_VERTICES(ctx
, 0);
6746 ctx
->Exec
->EnableClientState( cap
);
6749 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6751 GET_CURRENT_CONTEXT(ctx
);
6752 FLUSH_VERTICES(ctx
, 0);
6753 ctx
->Exec
->GenTextures( n
, texName
);
6756 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6758 GET_CURRENT_CONTEXT(ctx
);
6759 FLUSH_VERTICES(ctx
, 0);
6760 ctx
->Exec
->GetPointerv( pname
, params
);
6763 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6765 GET_CURRENT_CONTEXT(ctx
);
6766 FLUSH_VERTICES(ctx
, 0);
6767 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6770 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6771 const GLvoid
*pointer
)
6773 GET_CURRENT_CONTEXT(ctx
);
6774 FLUSH_VERTICES(ctx
, 0);
6775 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6778 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6780 GET_CURRENT_CONTEXT(ctx
);
6781 FLUSH_VERTICES(ctx
, 0);
6782 return ctx
->Exec
->IsTexture( texture
);
6785 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6787 GET_CURRENT_CONTEXT(ctx
);
6788 FLUSH_VERTICES(ctx
, 0);
6789 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6792 static void GLAPIENTRY
exec_PopClientAttrib(void)
6794 GET_CURRENT_CONTEXT(ctx
);
6795 FLUSH_VERTICES(ctx
, 0);
6796 ctx
->Exec
->PopClientAttrib();
6799 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6801 GET_CURRENT_CONTEXT(ctx
);
6802 FLUSH_VERTICES(ctx
, 0);
6803 ctx
->Exec
->PushClientAttrib( mask
);
6806 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6809 GET_CURRENT_CONTEXT(ctx
);
6810 FLUSH_VERTICES(ctx
, 0);
6811 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6814 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6817 GET_CURRENT_CONTEXT(ctx
);
6818 FLUSH_VERTICES(ctx
, 0);
6819 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6822 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6825 GET_CURRENT_CONTEXT(ctx
);
6826 FLUSH_VERTICES(ctx
, 0);
6827 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6830 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6831 GLint x
, GLint y
, GLsizei width
)
6833 GET_CURRENT_CONTEXT(ctx
);
6834 FLUSH_VERTICES(ctx
, 0);
6835 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6838 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6839 GLint x
, GLint y
, GLsizei width
,
6842 GET_CURRENT_CONTEXT(ctx
);
6843 FLUSH_VERTICES(ctx
, 0);
6844 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6848 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6849 GLenum type
, GLvoid
*data
)
6851 GET_CURRENT_CONTEXT(ctx
);
6852 FLUSH_VERTICES(ctx
, 0);
6853 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6856 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6859 GET_CURRENT_CONTEXT(ctx
);
6860 FLUSH_VERTICES(ctx
, 0);
6861 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6864 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6867 GET_CURRENT_CONTEXT(ctx
);
6868 FLUSH_VERTICES(ctx
, 0);
6869 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6872 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6875 GET_CURRENT_CONTEXT(ctx
);
6876 FLUSH_VERTICES(ctx
, 0);
6877 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6880 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6883 GET_CURRENT_CONTEXT(ctx
);
6884 FLUSH_VERTICES(ctx
, 0);
6885 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6888 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6891 GET_CURRENT_CONTEXT(ctx
);
6892 FLUSH_VERTICES(ctx
, 0);
6893 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6896 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6897 GLenum type
, GLvoid
*values
)
6899 GET_CURRENT_CONTEXT(ctx
);
6900 FLUSH_VERTICES(ctx
, 0);
6901 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6904 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6907 GET_CURRENT_CONTEXT(ctx
);
6908 FLUSH_VERTICES(ctx
, 0);
6909 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6912 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6915 GET_CURRENT_CONTEXT(ctx
);
6916 FLUSH_VERTICES(ctx
, 0);
6917 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6920 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6921 GLenum type
, GLvoid
*values
)
6923 GET_CURRENT_CONTEXT(ctx
);
6924 FLUSH_VERTICES(ctx
, 0);
6925 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6928 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6931 GET_CURRENT_CONTEXT(ctx
);
6932 FLUSH_VERTICES(ctx
, 0);
6933 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6936 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6939 GET_CURRENT_CONTEXT(ctx
);
6940 FLUSH_VERTICES(ctx
, 0);
6941 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6944 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6945 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6947 GET_CURRENT_CONTEXT(ctx
);
6948 FLUSH_VERTICES(ctx
, 0);
6949 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6952 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6953 GLsizei width
, GLsizei height
, GLenum format
,
6954 GLenum type
, const GLvoid
*row
,
6955 const GLvoid
*column
)
6957 GET_CURRENT_CONTEXT(ctx
);
6958 FLUSH_VERTICES(ctx
, 0);
6959 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6963 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6965 GET_CURRENT_CONTEXT(ctx
);
6966 FLUSH_VERTICES(ctx
, 0);
6967 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6970 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6977 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6978 GLsizei count
, const GLvoid
*ptr
)
6980 GET_CURRENT_CONTEXT(ctx
);
6981 FLUSH_VERTICES(ctx
, 0);
6982 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6985 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6986 const GLboolean
*ptr
)
6988 GET_CURRENT_CONTEXT(ctx
);
6989 FLUSH_VERTICES(ctx
, 0);
6990 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6993 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6996 GET_CURRENT_CONTEXT(ctx
);
6997 FLUSH_VERTICES(ctx
, 0);
6998 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
7001 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7004 GET_CURRENT_CONTEXT(ctx
);
7005 FLUSH_VERTICES(ctx
, 0);
7006 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
7009 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7010 GLsizei count
, const GLvoid
*ptr
)
7012 GET_CURRENT_CONTEXT(ctx
);
7013 FLUSH_VERTICES(ctx
, 0);
7014 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
7017 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7018 GLsizei count
, const GLvoid
*ptr
)
7020 GET_CURRENT_CONTEXT(ctx
);
7021 FLUSH_VERTICES(ctx
, 0);
7022 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
7025 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
7027 GET_CURRENT_CONTEXT(ctx
);
7028 FLUSH_VERTICES(ctx
, 0);
7029 ctx
->Exec
->LockArraysEXT( first
, count
);
7032 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
7034 GET_CURRENT_CONTEXT(ctx
);
7035 FLUSH_VERTICES(ctx
, 0);
7036 ctx
->Exec
->UnlockArraysEXT( );
7039 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
7041 GET_CURRENT_CONTEXT(ctx
);
7042 FLUSH_VERTICES(ctx
, 0);
7043 ctx
->Exec
->ResizeBuffersMESA( );
7047 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
7049 GET_CURRENT_CONTEXT(ctx
);
7050 FLUSH_VERTICES(ctx
, 0);
7051 ctx
->Exec
->ClientActiveTextureARB(target
);
7054 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7055 GLsizei stride
, const GLvoid
*ptr
)
7057 GET_CURRENT_CONTEXT(ctx
);
7058 FLUSH_VERTICES(ctx
, 0);
7059 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
7062 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
7065 GET_CURRENT_CONTEXT(ctx
);
7066 FLUSH_VERTICES(ctx
, 0);
7067 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
7070 /* GL_EXT_multi_draw_arrays */
7071 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
7072 GLsizei
*count
, GLsizei primcount
)
7074 GET_CURRENT_CONTEXT(ctx
);
7075 FLUSH_VERTICES(ctx
, 0);
7076 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
7079 /* GL_EXT_multi_draw_arrays */
7080 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
7081 GLenum type
, const GLvoid
**indices
,
7084 GET_CURRENT_CONTEXT(ctx
);
7085 FLUSH_VERTICES(ctx
, 0);
7086 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
7089 /* GL_IBM_multimode_draw_arrays */
7090 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
7091 const GLsizei
*count
, GLsizei primcount
,
7094 GET_CURRENT_CONTEXT(ctx
);
7095 FLUSH_VERTICES(ctx
, 0);
7096 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
7099 /* GL_IBM_multimode_draw_arrays */
7100 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7101 const GLsizei
*count
,
7103 const GLvoid
* const *indices
,
7104 GLsizei primcount
, GLint modestride
)
7106 GET_CURRENT_CONTEXT(ctx
);
7107 FLUSH_VERTICES(ctx
, 0);
7108 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
7116 * Setup the given dispatch table to point to Mesa's display list
7117 * building functions.
7119 * This does not include any of the tnl functions - they are
7120 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7124 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
7126 _mesa_init_no_op_table(table
, tableSize
);
7128 _mesa_loopback_init_api_table( table
);
7131 table
->Accum
= save_Accum
;
7132 table
->AlphaFunc
= save_AlphaFunc
;
7133 table
->Bitmap
= save_Bitmap
;
7134 table
->BlendFunc
= _mesa_BlendFunc
; /* loops-back to BlendFuncSeparate */
7135 table
->CallList
= _mesa_save_CallList
;
7136 table
->CallLists
= _mesa_save_CallLists
;
7137 table
->Clear
= save_Clear
;
7138 table
->ClearAccum
= save_ClearAccum
;
7139 table
->ClearColor
= save_ClearColor
;
7140 table
->ClearDepth
= save_ClearDepth
;
7141 table
->ClearIndex
= save_ClearIndex
;
7142 table
->ClearStencil
= save_ClearStencil
;
7143 table
->ClipPlane
= save_ClipPlane
;
7144 table
->ColorMask
= save_ColorMask
;
7145 table
->ColorMaterial
= save_ColorMaterial
;
7146 table
->CopyPixels
= save_CopyPixels
;
7147 table
->CullFace
= save_CullFace
;
7148 table
->DeleteLists
= _mesa_DeleteLists
;
7149 table
->DepthFunc
= save_DepthFunc
;
7150 table
->DepthMask
= save_DepthMask
;
7151 table
->DepthRange
= save_DepthRange
;
7152 table
->Disable
= save_Disable
;
7153 table
->DrawBuffer
= save_DrawBuffer
;
7154 table
->DrawPixels
= save_DrawPixels
;
7155 table
->Enable
= save_Enable
;
7156 table
->EndList
= _mesa_EndList
;
7157 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7158 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7159 table
->Finish
= exec_Finish
;
7160 table
->Flush
= exec_Flush
;
7161 table
->Fogf
= save_Fogf
;
7162 table
->Fogfv
= save_Fogfv
;
7163 table
->Fogi
= save_Fogi
;
7164 table
->Fogiv
= save_Fogiv
;
7165 table
->FrontFace
= save_FrontFace
;
7166 table
->Frustum
= save_Frustum
;
7167 table
->GenLists
= _mesa_GenLists
;
7168 table
->GetBooleanv
= exec_GetBooleanv
;
7169 table
->GetClipPlane
= exec_GetClipPlane
;
7170 table
->GetDoublev
= exec_GetDoublev
;
7171 table
->GetError
= exec_GetError
;
7172 table
->GetFloatv
= exec_GetFloatv
;
7173 table
->GetIntegerv
= exec_GetIntegerv
;
7174 table
->GetLightfv
= exec_GetLightfv
;
7175 table
->GetLightiv
= exec_GetLightiv
;
7176 table
->GetMapdv
= exec_GetMapdv
;
7177 table
->GetMapfv
= exec_GetMapfv
;
7178 table
->GetMapiv
= exec_GetMapiv
;
7179 table
->GetMaterialfv
= exec_GetMaterialfv
;
7180 table
->GetMaterialiv
= exec_GetMaterialiv
;
7181 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7182 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7183 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7184 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7185 table
->GetString
= exec_GetString
;
7186 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7187 table
->GetTexEnviv
= exec_GetTexEnviv
;
7188 table
->GetTexGendv
= exec_GetTexGendv
;
7189 table
->GetTexGenfv
= exec_GetTexGenfv
;
7190 table
->GetTexGeniv
= exec_GetTexGeniv
;
7191 table
->GetTexImage
= exec_GetTexImage
;
7192 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7193 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7194 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7195 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7196 table
->Hint
= save_Hint
;
7197 table
->IndexMask
= save_IndexMask
;
7198 table
->InitNames
= save_InitNames
;
7199 table
->IsEnabled
= exec_IsEnabled
;
7200 table
->IsList
= _mesa_IsList
;
7201 table
->LightModelf
= save_LightModelf
;
7202 table
->LightModelfv
= save_LightModelfv
;
7203 table
->LightModeli
= save_LightModeli
;
7204 table
->LightModeliv
= save_LightModeliv
;
7205 table
->Lightf
= save_Lightf
;
7206 table
->Lightfv
= save_Lightfv
;
7207 table
->Lighti
= save_Lighti
;
7208 table
->Lightiv
= save_Lightiv
;
7209 table
->LineStipple
= save_LineStipple
;
7210 table
->LineWidth
= save_LineWidth
;
7211 table
->ListBase
= save_ListBase
;
7212 table
->LoadIdentity
= save_LoadIdentity
;
7213 table
->LoadMatrixd
= save_LoadMatrixd
;
7214 table
->LoadMatrixf
= save_LoadMatrixf
;
7215 table
->LoadName
= save_LoadName
;
7216 table
->LogicOp
= save_LogicOp
;
7217 table
->Map1d
= save_Map1d
;
7218 table
->Map1f
= save_Map1f
;
7219 table
->Map2d
= save_Map2d
;
7220 table
->Map2f
= save_Map2f
;
7221 table
->MapGrid1d
= save_MapGrid1d
;
7222 table
->MapGrid1f
= save_MapGrid1f
;
7223 table
->MapGrid2d
= save_MapGrid2d
;
7224 table
->MapGrid2f
= save_MapGrid2f
;
7225 table
->MatrixMode
= save_MatrixMode
;
7226 table
->MultMatrixd
= save_MultMatrixd
;
7227 table
->MultMatrixf
= save_MultMatrixf
;
7228 table
->NewList
= save_NewList
;
7229 table
->Ortho
= save_Ortho
;
7230 table
->PassThrough
= save_PassThrough
;
7231 table
->PixelMapfv
= save_PixelMapfv
;
7232 table
->PixelMapuiv
= save_PixelMapuiv
;
7233 table
->PixelMapusv
= save_PixelMapusv
;
7234 table
->PixelStoref
= exec_PixelStoref
;
7235 table
->PixelStorei
= exec_PixelStorei
;
7236 table
->PixelTransferf
= save_PixelTransferf
;
7237 table
->PixelTransferi
= save_PixelTransferi
;
7238 table
->PixelZoom
= save_PixelZoom
;
7239 table
->PointSize
= save_PointSize
;
7240 table
->PolygonMode
= save_PolygonMode
;
7241 table
->PolygonOffset
= save_PolygonOffset
;
7242 table
->PolygonStipple
= save_PolygonStipple
;
7243 table
->PopAttrib
= save_PopAttrib
;
7244 table
->PopMatrix
= save_PopMatrix
;
7245 table
->PopName
= save_PopName
;
7246 table
->PushAttrib
= save_PushAttrib
;
7247 table
->PushMatrix
= save_PushMatrix
;
7248 table
->PushName
= save_PushName
;
7249 table
->RasterPos2d
= save_RasterPos2d
;
7250 table
->RasterPos2dv
= save_RasterPos2dv
;
7251 table
->RasterPos2f
= save_RasterPos2f
;
7252 table
->RasterPos2fv
= save_RasterPos2fv
;
7253 table
->RasterPos2i
= save_RasterPos2i
;
7254 table
->RasterPos2iv
= save_RasterPos2iv
;
7255 table
->RasterPos2s
= save_RasterPos2s
;
7256 table
->RasterPos2sv
= save_RasterPos2sv
;
7257 table
->RasterPos3d
= save_RasterPos3d
;
7258 table
->RasterPos3dv
= save_RasterPos3dv
;
7259 table
->RasterPos3f
= save_RasterPos3f
;
7260 table
->RasterPos3fv
= save_RasterPos3fv
;
7261 table
->RasterPos3i
= save_RasterPos3i
;
7262 table
->RasterPos3iv
= save_RasterPos3iv
;
7263 table
->RasterPos3s
= save_RasterPos3s
;
7264 table
->RasterPos3sv
= save_RasterPos3sv
;
7265 table
->RasterPos4d
= save_RasterPos4d
;
7266 table
->RasterPos4dv
= save_RasterPos4dv
;
7267 table
->RasterPos4f
= save_RasterPos4f
;
7268 table
->RasterPos4fv
= save_RasterPos4fv
;
7269 table
->RasterPos4i
= save_RasterPos4i
;
7270 table
->RasterPos4iv
= save_RasterPos4iv
;
7271 table
->RasterPos4s
= save_RasterPos4s
;
7272 table
->RasterPos4sv
= save_RasterPos4sv
;
7273 table
->ReadBuffer
= save_ReadBuffer
;
7274 table
->ReadPixels
= exec_ReadPixels
;
7275 table
->RenderMode
= exec_RenderMode
;
7276 table
->Rotated
= save_Rotated
;
7277 table
->Rotatef
= save_Rotatef
;
7278 table
->Scaled
= save_Scaled
;
7279 table
->Scalef
= save_Scalef
;
7280 table
->Scissor
= save_Scissor
;
7281 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7282 table
->SelectBuffer
= exec_SelectBuffer
;
7283 table
->ShadeModel
= save_ShadeModel
;
7284 table
->StencilFunc
= save_StencilFunc
;
7285 table
->StencilMask
= save_StencilMask
;
7286 table
->StencilOp
= save_StencilOp
;
7287 table
->TexEnvf
= save_TexEnvf
;
7288 table
->TexEnvfv
= save_TexEnvfv
;
7289 table
->TexEnvi
= save_TexEnvi
;
7290 table
->TexEnviv
= save_TexEnviv
;
7291 table
->TexGend
= save_TexGend
;
7292 table
->TexGendv
= save_TexGendv
;
7293 table
->TexGenf
= save_TexGenf
;
7294 table
->TexGenfv
= save_TexGenfv
;
7295 table
->TexGeni
= save_TexGeni
;
7296 table
->TexGeniv
= save_TexGeniv
;
7297 table
->TexImage1D
= save_TexImage1D
;
7298 table
->TexImage2D
= save_TexImage2D
;
7299 table
->TexParameterf
= save_TexParameterf
;
7300 table
->TexParameterfv
= save_TexParameterfv
;
7301 table
->TexParameteri
= save_TexParameteri
;
7302 table
->TexParameteriv
= save_TexParameteriv
;
7303 table
->Translated
= save_Translated
;
7304 table
->Translatef
= save_Translatef
;
7305 table
->Viewport
= save_Viewport
;
7308 table
->AreTexturesResident
= exec_AreTexturesResident
;
7309 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7310 table
->BindTexture
= save_BindTexture
;
7311 table
->ColorPointer
= exec_ColorPointer
;
7312 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7313 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7314 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7315 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7316 table
->DeleteTextures
= exec_DeleteTextures
;
7317 table
->DisableClientState
= exec_DisableClientState
;
7318 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7319 table
->EnableClientState
= exec_EnableClientState
;
7320 table
->GenTextures
= exec_GenTextures
;
7321 table
->GenTexturesEXT
= exec_GenTextures
;
7322 table
->GetPointerv
= exec_GetPointerv
;
7323 table
->IndexPointer
= exec_IndexPointer
;
7324 table
->InterleavedArrays
= exec_InterleavedArrays
;
7325 table
->IsTexture
= exec_IsTexture
;
7326 table
->IsTextureEXT
= exec_IsTexture
;
7327 table
->NormalPointer
= exec_NormalPointer
;
7328 table
->PopClientAttrib
= exec_PopClientAttrib
;
7329 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7330 table
->PushClientAttrib
= exec_PushClientAttrib
;
7331 table
->TexCoordPointer
= exec_TexCoordPointer
;
7332 table
->TexSubImage1D
= save_TexSubImage1D
;
7333 table
->TexSubImage2D
= save_TexSubImage2D
;
7334 table
->VertexPointer
= exec_VertexPointer
;
7337 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7338 table
->TexImage3D
= save_TexImage3D
;
7339 table
->TexSubImage3D
= save_TexSubImage3D
;
7341 /* GL_ARB_imaging */
7342 /* Not all are supported */
7343 table
->BlendColor
= save_BlendColor
;
7344 table
->BlendEquation
= save_BlendEquation
;
7345 table
->ColorSubTable
= save_ColorSubTable
;
7346 table
->ColorTable
= save_ColorTable
;
7347 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7348 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7349 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7350 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7351 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7352 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7353 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7354 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7355 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7356 table
->CopyColorTable
= save_CopyColorTable
;
7357 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7358 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7359 table
->GetColorTable
= exec_GetColorTable
;
7360 table
->GetColorTableEXT
= exec_GetColorTable
;
7361 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7362 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7363 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7364 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7365 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7366 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7367 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7368 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7369 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7370 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7371 table
->GetHistogram
= exec_GetHistogram
;
7372 table
->GetHistogramEXT
= exec_GetHistogram
;
7373 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7374 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7375 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7376 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7377 table
->GetMinmax
= exec_GetMinmax
;
7378 table
->GetMinmaxEXT
= exec_GetMinmax
;
7379 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7380 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7381 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7382 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7383 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7384 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7385 table
->Histogram
= save_Histogram
;
7386 table
->Minmax
= save_Minmax
;
7387 table
->ResetHistogram
= save_ResetHistogram
;
7388 table
->ResetMinmax
= save_ResetMinmax
;
7389 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7391 /* 2. GL_EXT_blend_color */
7393 table
->BlendColorEXT
= save_BlendColorEXT
;
7396 /* 3. GL_EXT_polygon_offset */
7397 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7399 /* 6. GL_EXT_texture3d */
7401 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7402 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7403 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7406 /* 15. GL_SGIX_pixel_texture */
7407 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7409 /* 15. GL_SGIS_pixel_texture */
7410 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7411 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7412 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7413 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7414 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7415 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7417 /* 30. GL_EXT_vertex_array */
7418 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7419 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7420 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7421 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7422 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7423 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7425 /* 37. GL_EXT_blend_minmax */
7427 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7430 /* 54. GL_EXT_point_parameters */
7431 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7432 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7434 /* 78. GL_EXT_paletted_texture */
7436 table
->ColorTableEXT
= save_ColorTable
;
7437 table
->ColorSubTableEXT
= save_ColorSubTable
;
7439 table
->GetColorTableEXT
= exec_GetColorTable
;
7440 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7441 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7443 /* 97. GL_EXT_compiled_vertex_array */
7444 table
->LockArraysEXT
= exec_LockArraysEXT
;
7445 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7447 /* 145. GL_EXT_secondary_color */
7448 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7450 /* 148. GL_EXT_multi_draw_arrays */
7451 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7452 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7454 /* 149. GL_EXT_fog_coord */
7455 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7457 /* 173. GL_EXT_blend_func_separate */
7458 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7460 /* 196. GL_MESA_resize_buffers */
7461 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7463 /* 197. GL_MESA_window_pos */
7464 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7465 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7466 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7467 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7468 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7469 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7470 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7471 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7472 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7473 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7474 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7475 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7476 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7477 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7478 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7479 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7480 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7481 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7482 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7483 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7484 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7485 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7486 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7487 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7489 /* 200. GL_IBM_multimode_draw_arrays */
7490 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7491 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7493 #if FEATURE_NV_vertex_program
7494 /* 233. GL_NV_vertex_program */
7495 /* The following commands DO NOT go into display lists:
7496 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7497 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7499 table
->BindProgramNV
= save_BindProgramNV
;
7500 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7501 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7502 table
->GenProgramsNV
= _mesa_GenPrograms
;
7503 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7504 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7505 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7506 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7507 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7508 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7509 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7510 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7511 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7512 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7513 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7514 table
->IsProgramNV
= _mesa_IsProgram
;
7515 table
->LoadProgramNV
= save_LoadProgramNV
;
7516 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7517 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7518 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7519 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7520 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7521 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7522 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7523 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7526 /* 282. GL_NV_fragment_program */
7527 #if FEATURE_NV_fragment_program
7528 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7529 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7530 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7531 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7532 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7533 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7534 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7535 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7536 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7537 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7538 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7539 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7542 /* 262. GL_NV_point_sprite */
7543 table
->PointParameteriNV
= save_PointParameteriNV
;
7544 table
->PointParameterivNV
= save_PointParameterivNV
;
7546 /* 268. GL_EXT_stencil_two_side */
7547 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7549 /* ???. GL_EXT_depth_bounds_test */
7550 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7552 /* ARB 1. GL_ARB_multitexture */
7553 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7554 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7556 /* ARB 3. GL_ARB_transpose_matrix */
7557 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7558 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7559 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7560 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7562 /* ARB 5. GL_ARB_multisample */
7563 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7565 /* ARB 12. GL_ARB_texture_compression */
7566 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7567 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7568 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7569 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7570 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7571 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7572 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7574 /* ARB 14. GL_ARB_point_parameters */
7575 /* aliased with EXT_point_parameters functions */
7577 /* ARB 25. GL_ARB_window_pos */
7578 /* aliased with MESA_window_pos functions */
7580 /* ARB 26. GL_ARB_vertex_program */
7581 /* ARB 27. GL_ARB_fragment_program */
7582 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7583 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7584 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7585 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7586 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7587 table
->ProgramStringARB
= save_ProgramStringARB
;
7588 table
->BindProgramNV
= save_BindProgramNV
;
7589 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7590 table
->GenProgramsNV
= _mesa_GenPrograms
;
7591 table
->IsProgramNV
= _mesa_IsProgram
;
7592 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7593 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7594 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7595 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7596 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7597 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7598 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7599 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7600 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7601 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7602 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7603 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7604 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7605 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7606 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7607 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7608 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7609 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7612 /* ARB 28. GL_ARB_vertex_buffer_object */
7613 #if FEATURE_ARB_vertex_buffer_object
7614 /* None of the extension's functions get compiled */
7615 table
->BindBufferARB
= _mesa_BindBufferARB
;
7616 table
->BufferDataARB
= _mesa_BufferDataARB
;
7617 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7618 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7619 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7620 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7621 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7622 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7623 table
->IsBufferARB
= _mesa_IsBufferARB
;
7624 table
->MapBufferARB
= _mesa_MapBufferARB
;
7625 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7628 #if FEATURE_ARB_occlusion_query
7629 table
->BeginQueryARB
= save_BeginQueryARB
;
7630 table
->EndQueryARB
= save_EndQueryARB
;
7631 table
->GenQueriesARB
= _mesa_GenQueriesARB
;
7632 table
->DeleteQueriesARB
= _mesa_DeleteQueriesARB
;
7633 table
->IsQueryARB
= _mesa_IsQueryARB
;
7634 table
->GetQueryivARB
= _mesa_GetQueryivARB
;
7635 table
->GetQueryObjectivARB
= _mesa_GetQueryObjectivARB
;
7636 table
->GetQueryObjectuivARB
= _mesa_GetQueryObjectuivARB
;
7639 /* 299. GL_EXT_blend_equation_separate */
7640 table
->BlendEquationSeparateEXT
= save_BlendEquationSeparateEXT
;
7648 static const char *enum_string( GLenum k
)
7650 return _mesa_lookup_enum_by_nr( k
);
7655 * Print the commands in a display list. For debugging only.
7656 * TODO: many commands aren't handled yet.
7658 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7663 if (!glIsList(list
)) {
7664 _mesa_printf("%u is not a display list ID\n", list
);
7668 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7670 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7672 done
= n
? GL_FALSE
: GL_TRUE
;
7674 OpCode opcode
= n
[0].opcode
;
7675 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
7677 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
7678 /* this is a driver-extended opcode */
7679 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
7680 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
7685 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7688 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7689 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7691 case OPCODE_CALL_LIST
:
7692 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7694 case OPCODE_CALL_LIST_OFFSET
:
7695 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7696 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7698 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7699 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7700 enum_string(n
[1].e
), enum_string(n
[2].e
),
7701 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7703 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7704 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7705 enum_string(n
[1].e
), enum_string(n
[2].e
),
7706 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7708 case OPCODE_DISABLE
:
7709 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7712 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7714 case OPCODE_FRUSTUM
:
7715 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7716 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7718 case OPCODE_LINE_STIPPLE
:
7719 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7721 case OPCODE_LOAD_IDENTITY
:
7722 _mesa_printf("LoadIdentity\n");
7724 case OPCODE_LOAD_MATRIX
:
7725 _mesa_printf("LoadMatrix\n");
7726 _mesa_printf(" %8f %8f %8f %8f\n",
7727 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7728 _mesa_printf(" %8f %8f %8f %8f\n",
7729 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7730 _mesa_printf(" %8f %8f %8f %8f\n",
7731 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7732 _mesa_printf(" %8f %8f %8f %8f\n",
7733 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7735 case OPCODE_MULT_MATRIX
:
7736 _mesa_printf("MultMatrix (or Rotate)\n");
7737 _mesa_printf(" %8f %8f %8f %8f\n",
7738 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7739 _mesa_printf(" %8f %8f %8f %8f\n",
7740 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7741 _mesa_printf(" %8f %8f %8f %8f\n",
7742 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7743 _mesa_printf(" %8f %8f %8f %8f\n",
7744 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7747 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7748 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7750 case OPCODE_POP_ATTRIB
:
7751 _mesa_printf("PopAttrib\n");
7753 case OPCODE_POP_MATRIX
:
7754 _mesa_printf("PopMatrix\n");
7756 case OPCODE_POP_NAME
:
7757 _mesa_printf("PopName\n");
7759 case OPCODE_PUSH_ATTRIB
:
7760 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7762 case OPCODE_PUSH_MATRIX
:
7763 _mesa_printf("PushMatrix\n");
7765 case OPCODE_PUSH_NAME
:
7766 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7768 case OPCODE_RASTER_POS
:
7769 _mesa_printf("RasterPos %g %g %g %g\n",
7770 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7773 _mesa_printf("Rotate %g %g %g %g\n",
7774 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7777 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7779 case OPCODE_TRANSLATE
:
7780 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7782 case OPCODE_BIND_TEXTURE
:
7783 _mesa_printf("BindTexture %s %d\n",
7784 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7786 case OPCODE_SHADE_MODEL
:
7787 _mesa_printf("ShadeModel %s\n",
7788 _mesa_lookup_enum_by_nr(n
[1].ui
));
7791 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7792 _mesa_lookup_enum_by_nr(n
[1].ui
),
7793 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7796 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7797 _mesa_lookup_enum_by_nr(n
[1].ui
),
7798 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7799 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7801 case OPCODE_MAPGRID1
:
7802 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7803 n
[1].i
, n
[2].f
, n
[3].f
);
7805 case OPCODE_MAPGRID2
:
7806 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7807 n
[1].i
, n
[2].f
, n
[3].f
,
7808 n
[4].i
, n
[5].f
, n
[6].f
);
7810 case OPCODE_EVALMESH1
:
7811 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7813 case OPCODE_EVALMESH2
:
7814 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7815 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7820 case OPCODE_ATTR_1F
:
7821 _mesa_printf("ATTR_1F attr %d: %f\n",
7824 case OPCODE_ATTR_2F
:
7825 _mesa_printf("ATTR_2F attr %d: %f %f\n",
7826 n
[1].i
, n
[2].f
, n
[3].f
);
7828 case OPCODE_ATTR_3F
:
7829 _mesa_printf("ATTR_3F attr %d: %f %f %f\n",
7830 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
7832 case OPCODE_ATTR_4F
:
7833 _mesa_printf("ATTR_4F attr %d: %f %f %f %f\n",
7834 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
7836 case OPCODE_MATERIAL
:
7837 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
7838 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7841 _mesa_printf("INDEX: %f\n", n
[1].f
);
7843 case OPCODE_EDGEFLAG
:
7844 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
7847 _mesa_printf("BEGIN %x\n", n
[1].i
);
7850 _mesa_printf("END\n");
7853 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7855 case OPCODE_EVAL_C1
:
7856 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
7858 case OPCODE_EVAL_C2
:
7859 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
7861 case OPCODE_EVAL_P1
:
7862 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
7864 case OPCODE_EVAL_P2
:
7865 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
7871 * meta opcodes/commands
7874 _mesa_printf("Error: %s %s\n",
7875 enum_string(n
[1].e
), (const char *)n
[2].data
);
7877 case OPCODE_CONTINUE
:
7878 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7879 n
= (Node
*) n
[1].next
;
7881 case OPCODE_END_OF_LIST
:
7882 _mesa_printf("END-LIST %u\n", list
);
7886 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7887 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7892 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7895 /* increment n to point to next compiled command */
7896 if (opcode
!=OPCODE_CONTINUE
) {
7897 n
+= InstSize
[opcode
];
7906 * Clients may call this function to help debug display list problems.
7907 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7908 * changed, or break in the future without notice.
7910 void mesa_print_display_list( GLuint list
)
7912 GET_CURRENT_CONTEXT(ctx
);
7913 print_list( ctx
, list
);
7917 /**********************************************************************/
7918 /***** Initialization *****/
7919 /**********************************************************************/
7922 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7924 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7925 vfmt
->Begin
= save_Begin
;
7926 vfmt
->CallList
= _mesa_save_CallList
;
7927 vfmt
->CallLists
= _mesa_save_CallLists
;
7928 vfmt
->Color3f
= save_Color3f
;
7929 vfmt
->Color3fv
= save_Color3fv
;
7930 vfmt
->Color4f
= save_Color4f
;
7931 vfmt
->Color4fv
= save_Color4fv
;
7932 vfmt
->EdgeFlag
= save_EdgeFlag
;
7933 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7934 vfmt
->End
= save_End
;
7935 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7936 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7937 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7938 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7939 vfmt
->EvalPoint1
= save_EvalPoint1
;
7940 vfmt
->EvalPoint2
= save_EvalPoint2
;
7941 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7942 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7943 vfmt
->Indexf
= save_Indexf
;
7944 vfmt
->Indexfv
= save_Indexfv
;
7945 vfmt
->Materialfv
= save_Materialfv
;
7946 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7947 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7948 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7949 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7950 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7951 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7952 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7953 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7954 vfmt
->Normal3f
= save_Normal3f
;
7955 vfmt
->Normal3fv
= save_Normal3fv
;
7956 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7957 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7958 vfmt
->TexCoord1f
= save_TexCoord1f
;
7959 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7960 vfmt
->TexCoord2f
= save_TexCoord2f
;
7961 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7962 vfmt
->TexCoord3f
= save_TexCoord3f
;
7963 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7964 vfmt
->TexCoord4f
= save_TexCoord4f
;
7965 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7966 vfmt
->Vertex2f
= save_Vertex2f
;
7967 vfmt
->Vertex2fv
= save_Vertex2fv
;
7968 vfmt
->Vertex3f
= save_Vertex3f
;
7969 vfmt
->Vertex3fv
= save_Vertex3fv
;
7970 vfmt
->Vertex4f
= save_Vertex4f
;
7971 vfmt
->Vertex4fv
= save_Vertex4fv
;
7972 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7973 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7974 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7975 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7976 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7977 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7978 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7979 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7981 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7982 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7983 vfmt
->Rectf
= save_Rectf
;
7985 /* The driver is required to implement these as
7986 * 1) They can probably do a better job.
7987 * 2) A lot of new mechanisms would have to be added to this module
7988 * to support it. That code would probably never get used,
7992 vfmt
->DrawArrays
= 0;
7993 vfmt
->DrawElements
= 0;
7994 vfmt
->DrawRangeElements
= 0;
8000 void _mesa_init_display_list( GLcontext
* ctx
)
8003 ctx
->ListState
.CallDepth
= 0;
8004 ctx
->ExecuteFlag
= GL_TRUE
;
8005 ctx
->CompileFlag
= GL_FALSE
;
8006 ctx
->ListState
.CurrentListPtr
= NULL
;
8007 ctx
->ListState
.CurrentBlock
= NULL
;
8008 ctx
->ListState
.CurrentListNum
= 0;
8009 ctx
->ListState
.CurrentPos
= 0;
8011 /* Display List group */
8012 ctx
->List
.ListBase
= 0;
8014 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);