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)
173 OPCODE_BLEND_EQUATION
,
174 OPCODE_BLEND_EQUATION_SEPARATE
,
175 OPCODE_BLEND_FUNC_SEPARATE
,
177 OPCODE_CALL_LIST_OFFSET
,
183 OPCODE_CLEAR_STENCIL
,
186 OPCODE_COLOR_MATERIAL
,
188 OPCODE_COLOR_TABLE_PARAMETER_FV
,
189 OPCODE_COLOR_TABLE_PARAMETER_IV
,
190 OPCODE_COLOR_SUB_TABLE
,
191 OPCODE_CONVOLUTION_FILTER_1D
,
192 OPCODE_CONVOLUTION_FILTER_2D
,
193 OPCODE_CONVOLUTION_PARAMETER_I
,
194 OPCODE_CONVOLUTION_PARAMETER_IV
,
195 OPCODE_CONVOLUTION_PARAMETER_F
,
196 OPCODE_CONVOLUTION_PARAMETER_FV
,
197 OPCODE_COPY_COLOR_SUB_TABLE
,
198 OPCODE_COPY_COLOR_TABLE
,
200 OPCODE_COPY_TEX_IMAGE1D
,
201 OPCODE_COPY_TEX_IMAGE2D
,
202 OPCODE_COPY_TEX_SUB_IMAGE1D
,
203 OPCODE_COPY_TEX_SUB_IMAGE2D
,
204 OPCODE_COPY_TEX_SUB_IMAGE3D
,
227 OPCODE_LOAD_IDENTITY
,
241 OPCODE_PIXEL_TRANSFER
,
244 OPCODE_POINT_PARAMETERS
,
246 OPCODE_POLYGON_STIPPLE
,
247 OPCODE_POLYGON_OFFSET
,
251 OPCODE_PRIORITIZE_TEXTURE
,
257 OPCODE_RESET_HISTOGRAM
,
258 OPCODE_RESET_MIN_MAX
,
262 OPCODE_SELECT_TEXTURE_SGIS
,
263 OPCODE_SELECT_TEXTURE_COORD_SET
,
274 OPCODE_TEX_SUB_IMAGE1D
,
275 OPCODE_TEX_SUB_IMAGE2D
,
276 OPCODE_TEX_SUB_IMAGE3D
,
280 /* GL_ARB_multitexture */
281 OPCODE_ACTIVE_TEXTURE
,
282 /* GL_SGIX/SGIS_pixel_texture */
283 OPCODE_PIXEL_TEXGEN_SGIX
,
284 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
285 /* GL_ARB_texture_compression */
286 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
287 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
288 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
289 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
290 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
291 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
292 /* GL_ARB_multisample */
293 OPCODE_SAMPLE_COVERAGE
,
294 /* GL_ARB_window_pos */
295 OPCODE_WINDOW_POS_ARB
,
296 /* GL_NV_vertex_program */
297 OPCODE_BIND_PROGRAM_NV
,
298 OPCODE_EXECUTE_PROGRAM_NV
,
299 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
300 OPCODE_LOAD_PROGRAM_NV
,
301 OPCODE_PROGRAM_PARAMETER4F_NV
,
302 OPCODE_TRACK_MATRIX_NV
,
303 /* GL_NV_fragment_program */
304 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
305 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
306 /* GL_EXT_stencil_two_side */
307 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
308 /* GL_EXT_depth_bounds_test */
309 OPCODE_DEPTH_BOUNDS_EXT
,
310 /* GL_ARB_vertex/fragment_program */
311 OPCODE_PROGRAM_STRING_ARB
,
312 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
313 /* GL_ARB_occlusion_query */
314 OPCODE_BEGIN_QUERY_ARB
,
315 OPCODE_END_QUERY_ARB
,
317 /* Vertex attributes -- fallback for when optimized display
318 * list build isn't active.
336 /* The following three are meta instructions */
337 OPCODE_ERROR
, /* raise compiled-in error */
348 * Display list instructions are stored as sequences of "nodes". Nodes
349 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
350 * are linked together with a pointer.
352 * Each instruction in the display list is stored as a sequence of
353 * contiguous nodes in memory.
354 * Each node is the union of a variety of data types.
368 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
373 * How many nodes to allocate at a time.
375 * \note Reduced now that we hold vertices etc. elsewhere.
377 #define BLOCK_SIZE 256
382 * Number of nodes of storage needed for each instruction.
383 * Sizes for dynamically allocated opcodes are stored in the context struct.
385 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
387 void mesa_print_display_list( GLuint list
);
390 /**********************************************************************/
391 /***** Private *****/
392 /**********************************************************************/
395 * Make an empty display list. This is used by glGenLists() to
396 * reserver display list IDs.
398 static Node
*make_empty_list( void )
400 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
401 n
[0].opcode
= OPCODE_END_OF_LIST
;
408 * Destroy all nodes in a display list.
409 * \param list - display list number
411 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
419 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
422 done
= block
? GL_FALSE
: GL_TRUE
;
425 /* check for extension opcodes first */
427 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
428 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
429 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
430 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
433 switch (n
[0].opcode
) {
434 /* for some commands, we need to free malloc'd memory */
437 n
+= InstSize
[n
[0].opcode
];
441 n
+= InstSize
[n
[0].opcode
];
443 case OPCODE_DRAW_PIXELS
:
445 n
+= InstSize
[n
[0].opcode
];
449 n
+= InstSize
[n
[0].opcode
];
451 case OPCODE_COLOR_TABLE
:
453 n
+= InstSize
[n
[0].opcode
];
455 case OPCODE_COLOR_SUB_TABLE
:
457 n
+= InstSize
[n
[0].opcode
];
459 case OPCODE_CONVOLUTION_FILTER_1D
:
461 n
+= InstSize
[n
[0].opcode
];
463 case OPCODE_CONVOLUTION_FILTER_2D
:
465 n
+= InstSize
[n
[0].opcode
];
467 case OPCODE_POLYGON_STIPPLE
:
469 n
+= InstSize
[n
[0].opcode
];
471 case OPCODE_TEX_IMAGE1D
:
473 n
+= InstSize
[n
[0].opcode
];
475 case OPCODE_TEX_IMAGE2D
:
477 n
+= InstSize
[n
[0].opcode
];
479 case OPCODE_TEX_IMAGE3D
:
481 n
+= InstSize
[n
[0].opcode
];
483 case OPCODE_TEX_SUB_IMAGE1D
:
485 n
+= InstSize
[n
[0].opcode
];
487 case OPCODE_TEX_SUB_IMAGE2D
:
489 n
+= InstSize
[n
[0].opcode
];
491 case OPCODE_TEX_SUB_IMAGE3D
:
493 n
+= InstSize
[n
[0].opcode
];
495 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
497 n
+= InstSize
[n
[0].opcode
];
499 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
501 n
+= InstSize
[n
[0].opcode
];
503 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
505 n
+= InstSize
[n
[0].opcode
];
507 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
509 n
+= InstSize
[n
[0].opcode
];
511 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
513 n
+= InstSize
[n
[0].opcode
];
515 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
517 n
+= InstSize
[n
[0].opcode
];
519 #if FEATURE_NV_vertex_program
520 case OPCODE_LOAD_PROGRAM_NV
:
521 FREE(n
[4].data
); /* program string */
522 n
+= InstSize
[n
[0].opcode
];
524 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
525 FREE(n
[2].data
); /* array of program ids */
526 n
+= InstSize
[n
[0].opcode
];
529 #if FEATURE_NV_fragment_program
530 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
531 FREE(n
[3].data
); /* parameter name */
532 n
+= InstSize
[n
[0].opcode
];
535 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
536 case OPCODE_PROGRAM_STRING_ARB
:
537 FREE(n
[4].data
); /* program string */
538 n
+= InstSize
[n
[0].opcode
];
541 case OPCODE_CONTINUE
:
542 n
= (Node
*) n
[1].next
;
546 case OPCODE_END_OF_LIST
:
551 /* Most frequent case */
552 n
+= InstSize
[n
[0].opcode
];
558 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
564 * Translate the nth element of list from type to GLuint.
566 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
578 bptr
= (GLbyte
*) list
;
579 return (GLuint
) *(bptr
+n
);
580 case GL_UNSIGNED_BYTE
:
581 ubptr
= (GLubyte
*) list
;
582 return (GLuint
) *(ubptr
+n
);
584 sptr
= (GLshort
*) list
;
585 return (GLuint
) *(sptr
+n
);
586 case GL_UNSIGNED_SHORT
:
587 usptr
= (GLushort
*) list
;
588 return (GLuint
) *(usptr
+n
);
590 iptr
= (GLint
*) list
;
591 return (GLuint
) *(iptr
+n
);
592 case GL_UNSIGNED_INT
:
593 uiptr
= (GLuint
*) list
;
594 return (GLuint
) *(uiptr
+n
);
596 fptr
= (GLfloat
*) list
;
597 return (GLuint
) *(fptr
+n
);
599 ubptr
= ((GLubyte
*) list
) + 2*n
;
600 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
602 ubptr
= ((GLubyte
*) list
) + 3*n
;
603 return (GLuint
) *ubptr
* 65536
604 + (GLuint
) *(ubptr
+1) * 256
605 + (GLuint
) *(ubptr
+2);
607 ubptr
= ((GLubyte
*) list
) + 4*n
;
608 return (GLuint
) *ubptr
* 16777216
609 + (GLuint
) *(ubptr
+1) * 65536
610 + (GLuint
) *(ubptr
+2) * 256
611 + (GLuint
) *(ubptr
+3);
620 /**********************************************************************/
622 /**********************************************************************/
625 * Do one-time initialiazations for display lists.
628 _mesa_init_lists( void )
630 static int init_flag
= 0;
633 InstSize
[OPCODE_ACCUM
] = 3;
634 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
635 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
636 InstSize
[OPCODE_BITMAP
] = 8;
637 InstSize
[OPCODE_BLEND_COLOR
] = 5;
638 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
639 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
640 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
641 InstSize
[OPCODE_CALL_LIST
] = 2;
642 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
643 InstSize
[OPCODE_CLEAR
] = 2;
644 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
645 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
646 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
647 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
648 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
649 InstSize
[OPCODE_CLIP_PLANE
] = 6;
650 InstSize
[OPCODE_COLOR_MASK
] = 5;
651 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
652 InstSize
[OPCODE_COLOR_TABLE
] = 7;
653 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
654 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
655 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
656 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
657 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
658 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
659 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
660 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
661 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
662 InstSize
[OPCODE_COPY_PIXELS
] = 6;
663 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
664 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
665 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
666 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
667 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
668 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
669 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
670 InstSize
[OPCODE_CULL_FACE
] = 2;
671 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
672 InstSize
[OPCODE_DEPTH_MASK
] = 2;
673 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
674 InstSize
[OPCODE_DISABLE
] = 2;
675 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
676 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
677 InstSize
[OPCODE_ENABLE
] = 2;
678 InstSize
[OPCODE_EVALMESH1
] = 4;
679 InstSize
[OPCODE_EVALMESH2
] = 6;
680 InstSize
[OPCODE_FOG
] = 6;
681 InstSize
[OPCODE_FRONT_FACE
] = 2;
682 InstSize
[OPCODE_FRUSTUM
] = 7;
683 InstSize
[OPCODE_HINT
] = 3;
684 InstSize
[OPCODE_HISTOGRAM
] = 5;
685 InstSize
[OPCODE_INDEX_MASK
] = 2;
686 InstSize
[OPCODE_INIT_NAMES
] = 1;
687 InstSize
[OPCODE_LIGHT
] = 7;
688 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
689 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
690 InstSize
[OPCODE_LINE_WIDTH
] = 2;
691 InstSize
[OPCODE_LIST_BASE
] = 2;
692 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
693 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
694 InstSize
[OPCODE_LOAD_NAME
] = 2;
695 InstSize
[OPCODE_LOGIC_OP
] = 2;
696 InstSize
[OPCODE_MAP1
] = 7;
697 InstSize
[OPCODE_MAP2
] = 11;
698 InstSize
[OPCODE_MAPGRID1
] = 4;
699 InstSize
[OPCODE_MAPGRID2
] = 7;
700 InstSize
[OPCODE_MATRIX_MODE
] = 2;
701 InstSize
[OPCODE_MIN_MAX
] = 4;
702 InstSize
[OPCODE_MULT_MATRIX
] = 17;
703 InstSize
[OPCODE_ORTHO
] = 7;
704 InstSize
[OPCODE_PASSTHROUGH
] = 2;
705 InstSize
[OPCODE_PIXEL_MAP
] = 4;
706 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
707 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
708 InstSize
[OPCODE_POINT_SIZE
] = 2;
709 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
710 InstSize
[OPCODE_POLYGON_MODE
] = 3;
711 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
712 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
713 InstSize
[OPCODE_POP_ATTRIB
] = 1;
714 InstSize
[OPCODE_POP_MATRIX
] = 1;
715 InstSize
[OPCODE_POP_NAME
] = 1;
716 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
717 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
718 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
719 InstSize
[OPCODE_PUSH_NAME
] = 2;
720 InstSize
[OPCODE_RASTER_POS
] = 5;
721 InstSize
[OPCODE_READ_BUFFER
] = 2;
722 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
723 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
724 InstSize
[OPCODE_ROTATE
] = 5;
725 InstSize
[OPCODE_SCALE
] = 4;
726 InstSize
[OPCODE_SCISSOR
] = 5;
727 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
728 InstSize
[OPCODE_STENCIL_MASK
] = 2;
729 InstSize
[OPCODE_STENCIL_OP
] = 4;
730 InstSize
[OPCODE_SHADE_MODEL
] = 2;
731 InstSize
[OPCODE_TEXENV
] = 7;
732 InstSize
[OPCODE_TEXGEN
] = 7;
733 InstSize
[OPCODE_TEXPARAMETER
] = 7;
734 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
735 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
736 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
737 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
738 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
739 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
740 InstSize
[OPCODE_TRANSLATE
] = 4;
741 InstSize
[OPCODE_VIEWPORT
] = 5;
742 InstSize
[OPCODE_WINDOW_POS
] = 5;
743 InstSize
[OPCODE_CONTINUE
] = 2;
744 InstSize
[OPCODE_ERROR
] = 3;
745 InstSize
[OPCODE_END_OF_LIST
] = 1;
746 /* GL_SGIX/SGIS_pixel_texture */
747 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
748 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
749 /* GL_ARB_texture_compression */
750 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
751 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
752 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
753 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
754 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
755 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
756 /* GL_ARB_multisample */
757 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
758 /* GL_ARB_multitexture */
759 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
760 /* GL_ARB_window_pos */
761 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
762 /* GL_NV_vertex_program */
763 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
764 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
765 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
766 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
767 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
768 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
769 /* GL_NV_fragment_program */
770 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
771 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
772 /* GL_EXT_stencil_two_side */
773 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
774 /* GL_EXT_depth_bounds_test */
775 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
776 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
777 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
778 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
780 #if FEATURE_ARB_occlusion_query
781 InstSize
[OPCODE_BEGIN_QUERY_ARB
] = 3;
782 InstSize
[OPCODE_END_QUERY_ARB
] = 2;
784 InstSize
[OPCODE_ATTR_1F
] = 3;
785 InstSize
[OPCODE_ATTR_2F
] = 4;
786 InstSize
[OPCODE_ATTR_3F
] = 5;
787 InstSize
[OPCODE_ATTR_4F
] = 6;
788 InstSize
[OPCODE_MATERIAL
] = 7;
789 InstSize
[OPCODE_INDEX
] = 2;
790 InstSize
[OPCODE_EDGEFLAG
] = 2;
791 InstSize
[OPCODE_BEGIN
] = 2;
792 InstSize
[OPCODE_END
] = 1;
793 InstSize
[OPCODE_RECTF
] = 5;
794 InstSize
[OPCODE_EVAL_C1
] = 2;
795 InstSize
[OPCODE_EVAL_C2
] = 3;
796 InstSize
[OPCODE_EVAL_P1
] = 2;
797 InstSize
[OPCODE_EVAL_P2
] = 3;
805 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
806 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
809 unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
810 GLenum format
, GLenum type
, const GLvoid
*pixels
,
811 const struct gl_pixelstore_attrib
*unpack
)
813 if (unpack
->BufferObj
->Name
== 0) {
815 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
818 else if (_mesa_validate_pbo_access(unpack
, width
, height
, depth
, format
,
820 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
821 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
830 * Allocate space for a display list instruction.
831 * \param opcode - type of instruction
832 * argcount - size in bytes of data required.
833 * \return pointer to the usable data area (not including the internal
837 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
840 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
843 if (opcode
< (int) OPCODE_EXT_0
) {
844 assert( count
== InstSize
[opcode
] );
848 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
849 /* This block is full. Allocate a new block and chain to it */
850 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
851 n
[0].opcode
= OPCODE_CONTINUE
;
852 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
854 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
857 n
[1].next
= (Node
*) newblock
;
858 ctx
->ListState
.CurrentBlock
= newblock
;
859 ctx
->ListState
.CurrentPos
= 0;
862 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
863 ctx
->ListState
.CurrentPos
+= count
;
865 n
[0].opcode
= (OpCode
) opcode
;
867 return (void *)&n
[1];
872 * This function allows modules and drivers to get their own opcodes
873 * for extending display list functionality.
874 * \param ctx the rendering context
875 * \param size number of bytes for storing the new display list command
876 * \param execute function to execute the new display list command
877 * \param destroy function to destroy the new display list command
878 * \param print function to print the new display list command
879 * \return the new opcode number or -1 if error
882 _mesa_alloc_opcode( GLcontext
*ctx
,
884 void (*execute
)( GLcontext
*, void * ),
885 void (*destroy
)( GLcontext
*, void * ),
886 void (*print
)( GLcontext
*, void * ) )
888 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
889 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
890 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
891 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
892 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
893 ctx
->ListExt
.Opcode
[i
].Print
= print
;
894 return i
+ OPCODE_EXT_0
;
901 /* Mimic the old behaviour of alloc_instruction:
902 * - sz is in units of sizeof(Node)
903 * - return value a pointer to sizeof(Node) before the actual
906 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
907 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
912 * Display List compilation functions
914 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
916 GET_CURRENT_CONTEXT(ctx
);
918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
919 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
924 if (ctx
->ExecuteFlag
) {
925 (*ctx
->Exec
->Accum
)( op
, value
);
930 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
932 GET_CURRENT_CONTEXT(ctx
);
934 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
935 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
938 n
[2].f
= (GLfloat
) ref
;
940 if (ctx
->ExecuteFlag
) {
941 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
946 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
948 GET_CURRENT_CONTEXT(ctx
);
950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
956 if (ctx
->ExecuteFlag
) {
957 (*ctx
->Exec
->BindTexture
)( target
, texture
);
962 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
963 GLfloat xorig
, GLfloat yorig
,
964 GLfloat xmove
, GLfloat ymove
,
965 const GLubyte
*pixels
)
967 GET_CURRENT_CONTEXT(ctx
);
968 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
971 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
973 n
[1].i
= (GLint
) width
;
974 n
[2].i
= (GLint
) height
;
984 if (ctx
->ExecuteFlag
) {
985 (*ctx
->Exec
->Bitmap
)( width
, height
,
986 xorig
, yorig
, xmove
, ymove
, pixels
);
991 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
993 GET_CURRENT_CONTEXT(ctx
);
995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
996 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
1000 if (ctx
->ExecuteFlag
) {
1001 (*ctx
->Exec
->BlendEquation
)( mode
);
1006 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1009 GET_CURRENT_CONTEXT(ctx
);
1011 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1012 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1017 if (ctx
->ExecuteFlag
) {
1018 (*ctx
->Exec
->BlendEquationSeparateEXT
)( modeRGB
, modeA
);
1023 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1024 GLenum sfactorA
, GLenum dfactorA
)
1026 GET_CURRENT_CONTEXT(ctx
);
1028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1029 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1031 n
[1].e
= sfactorRGB
;
1032 n
[2].e
= dfactorRGB
;
1036 if (ctx
->ExecuteFlag
) {
1037 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
1038 sfactorA
, dfactorA
);
1043 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1044 GLfloat blue
, GLfloat alpha
)
1046 GET_CURRENT_CONTEXT(ctx
);
1048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1049 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1056 if (ctx
->ExecuteFlag
) {
1057 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1062 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1064 GET_CURRENT_CONTEXT(ctx
);
1066 SAVE_FLUSH_VERTICES(ctx
);
1068 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1073 /* After this, we don't know what begin/end state we're in:
1075 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1077 if (ctx
->ExecuteFlag
) {
1078 (*ctx
->Exec
->CallList
)( list
);
1083 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1085 GET_CURRENT_CONTEXT(ctx
);
1087 GLboolean typeErrorFlag
;
1089 SAVE_FLUSH_VERTICES(ctx
);
1093 case GL_UNSIGNED_BYTE
:
1095 case GL_UNSIGNED_SHORT
:
1097 case GL_UNSIGNED_INT
:
1102 typeErrorFlag
= GL_FALSE
;
1105 typeErrorFlag
= GL_TRUE
;
1109 GLuint list
= translate_id( i
, type
, lists
);
1110 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1113 n
[2].b
= typeErrorFlag
;
1117 /* After this, we don't know what begin/end state we're in:
1119 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1121 if (ctx
->ExecuteFlag
) {
1122 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1127 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1129 GET_CURRENT_CONTEXT(ctx
);
1131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1132 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1136 if (ctx
->ExecuteFlag
) {
1137 (*ctx
->Exec
->Clear
)( mask
);
1142 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1143 GLfloat blue
, GLfloat alpha
)
1145 GET_CURRENT_CONTEXT(ctx
);
1147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1148 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1155 if (ctx
->ExecuteFlag
) {
1156 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1161 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1162 GLclampf blue
, GLclampf alpha
)
1164 GET_CURRENT_CONTEXT(ctx
);
1166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1174 if (ctx
->ExecuteFlag
) {
1175 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1180 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1182 GET_CURRENT_CONTEXT(ctx
);
1184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1185 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1187 n
[1].f
= (GLfloat
) depth
;
1189 if (ctx
->ExecuteFlag
) {
1190 (*ctx
->Exec
->ClearDepth
)( depth
);
1195 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1197 GET_CURRENT_CONTEXT(ctx
);
1199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1200 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1204 if (ctx
->ExecuteFlag
) {
1205 (*ctx
->Exec
->ClearIndex
)( c
);
1210 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1212 GET_CURRENT_CONTEXT(ctx
);
1214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1215 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1219 if (ctx
->ExecuteFlag
) {
1220 (*ctx
->Exec
->ClearStencil
)( s
);
1225 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1227 GET_CURRENT_CONTEXT(ctx
);
1229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1230 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1233 n
[2].f
= (GLfloat
) equ
[0];
1234 n
[3].f
= (GLfloat
) equ
[1];
1235 n
[4].f
= (GLfloat
) equ
[2];
1236 n
[5].f
= (GLfloat
) equ
[3];
1238 if (ctx
->ExecuteFlag
) {
1239 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1245 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1246 GLboolean blue
, GLboolean alpha
)
1248 GET_CURRENT_CONTEXT(ctx
);
1250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1251 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1258 if (ctx
->ExecuteFlag
) {
1259 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1264 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1266 GET_CURRENT_CONTEXT(ctx
);
1268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1275 if (ctx
->ExecuteFlag
) {
1276 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1281 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1282 GLsizei width
, GLenum format
, GLenum type
,
1283 const GLvoid
*table
)
1285 GET_CURRENT_CONTEXT(ctx
);
1286 if (target
== GL_PROXY_TEXTURE_1D
||
1287 target
== GL_PROXY_TEXTURE_2D
||
1288 target
== GL_PROXY_TEXTURE_3D
||
1289 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1290 /* execute immediately */
1291 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1292 format
, type
, table
);
1295 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, table
,
1298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1299 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1302 n
[2].e
= internalFormat
;
1311 if (ctx
->ExecuteFlag
) {
1312 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1313 format
, type
, table
);
1320 static void GLAPIENTRY
1321 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1323 GET_CURRENT_CONTEXT(ctx
);
1326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1328 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1333 if (pname
== GL_COLOR_TABLE_SGI
||
1334 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1335 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1336 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1343 if (ctx
->ExecuteFlag
) {
1344 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1349 static void GLAPIENTRY
1350 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1352 GET_CURRENT_CONTEXT(ctx
);
1355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1357 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1362 if (pname
== GL_COLOR_TABLE_SGI
||
1363 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1364 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1365 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1372 if (ctx
->ExecuteFlag
) {
1373 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1379 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1380 GLenum format
, GLenum type
,
1381 const GLvoid
*table
)
1383 GET_CURRENT_CONTEXT(ctx
);
1384 GLvoid
*image
= unpack_image(count
, 1, 1, format
, type
, table
,
1387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1388 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1400 if (ctx
->ExecuteFlag
) {
1401 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1406 static void GLAPIENTRY
1407 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1408 GLint x
, GLint y
, GLsizei width
)
1410 GET_CURRENT_CONTEXT(ctx
);
1413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1414 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1422 if (ctx
->ExecuteFlag
) {
1423 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1428 static void GLAPIENTRY
1429 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1430 GLint x
, GLint y
, GLsizei width
)
1432 GET_CURRENT_CONTEXT(ctx
);
1435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1436 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1439 n
[2].e
= internalformat
;
1444 if (ctx
->ExecuteFlag
) {
1445 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1450 static void GLAPIENTRY
1451 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1452 GLenum format
, GLenum type
, const GLvoid
*filter
)
1454 GET_CURRENT_CONTEXT(ctx
);
1455 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, filter
,
1458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1459 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1462 n
[2].e
= internalFormat
;
1471 if (ctx
->ExecuteFlag
) {
1472 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1473 format
, type
, filter
);
1478 static void GLAPIENTRY
1479 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1480 GLsizei width
, GLsizei height
, GLenum format
,
1481 GLenum type
, const GLvoid
*filter
)
1483 GET_CURRENT_CONTEXT(ctx
);
1484 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
, filter
,
1487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1488 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1491 n
[2].e
= internalFormat
;
1501 if (ctx
->ExecuteFlag
) {
1502 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1503 format
, type
, filter
);
1508 static void GLAPIENTRY
1509 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1511 GET_CURRENT_CONTEXT(ctx
);
1513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1514 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1520 if (ctx
->ExecuteFlag
) {
1521 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1526 static void GLAPIENTRY
1527 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1529 GET_CURRENT_CONTEXT(ctx
);
1531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1532 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1537 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1538 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1539 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1545 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1548 if (ctx
->ExecuteFlag
) {
1549 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1554 static void GLAPIENTRY
1555 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1557 GET_CURRENT_CONTEXT(ctx
);
1559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1560 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1566 if (ctx
->ExecuteFlag
) {
1567 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1572 static void GLAPIENTRY
1573 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1575 GET_CURRENT_CONTEXT(ctx
);
1577 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1578 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1583 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1584 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1585 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1591 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1594 if (ctx
->ExecuteFlag
) {
1595 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1600 static void GLAPIENTRY
1601 save_CopyPixels( GLint x
, GLint y
,
1602 GLsizei width
, GLsizei height
, GLenum type
)
1604 GET_CURRENT_CONTEXT(ctx
);
1606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1607 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1611 n
[3].i
= (GLint
) width
;
1612 n
[4].i
= (GLint
) height
;
1615 if (ctx
->ExecuteFlag
) {
1616 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1622 static void GLAPIENTRY
1623 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1624 GLint x
, GLint y
, GLsizei width
, GLint border
)
1626 GET_CURRENT_CONTEXT(ctx
);
1628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1629 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1633 n
[3].e
= internalformat
;
1639 if (ctx
->ExecuteFlag
) {
1640 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1641 x
, y
, width
, border
);
1646 static void GLAPIENTRY
1647 save_CopyTexImage2D( GLenum target
, GLint level
,
1648 GLenum internalformat
,
1649 GLint x
, GLint y
, GLsizei width
,
1650 GLsizei height
, GLint border
)
1652 GET_CURRENT_CONTEXT(ctx
);
1654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1655 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1659 n
[3].e
= internalformat
;
1666 if (ctx
->ExecuteFlag
) {
1667 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1668 x
, y
, width
, height
, border
);
1674 static void GLAPIENTRY
1675 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1676 GLint xoffset
, GLint x
, GLint y
,
1679 GET_CURRENT_CONTEXT(ctx
);
1681 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1682 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1691 if (ctx
->ExecuteFlag
) {
1692 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1697 static void GLAPIENTRY
1698 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1699 GLint xoffset
, GLint yoffset
,
1701 GLsizei width
, GLint height
)
1703 GET_CURRENT_CONTEXT(ctx
);
1705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1706 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1717 if (ctx
->ExecuteFlag
) {
1718 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1719 x
, y
, width
, height
);
1724 static void GLAPIENTRY
1725 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1726 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1728 GLsizei width
, GLint height
)
1730 GET_CURRENT_CONTEXT(ctx
);
1732 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1733 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1745 if (ctx
->ExecuteFlag
) {
1746 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1747 xoffset
, yoffset
, zoffset
,
1748 x
, y
, width
, height
);
1753 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1755 GET_CURRENT_CONTEXT(ctx
);
1757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1758 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1762 if (ctx
->ExecuteFlag
) {
1763 (*ctx
->Exec
->CullFace
)( mode
);
1768 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1770 GET_CURRENT_CONTEXT(ctx
);
1772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1773 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1777 if (ctx
->ExecuteFlag
) {
1778 (*ctx
->Exec
->DepthFunc
)( func
);
1783 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1785 GET_CURRENT_CONTEXT(ctx
);
1787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1788 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1792 if (ctx
->ExecuteFlag
) {
1793 (*ctx
->Exec
->DepthMask
)( mask
);
1798 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1800 GET_CURRENT_CONTEXT(ctx
);
1802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1803 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1805 n
[1].f
= (GLfloat
) nearval
;
1806 n
[2].f
= (GLfloat
) farval
;
1808 if (ctx
->ExecuteFlag
) {
1809 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1814 static void GLAPIENTRY
save_Disable( GLenum cap
)
1816 GET_CURRENT_CONTEXT(ctx
);
1818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1819 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1823 if (ctx
->ExecuteFlag
) {
1824 (*ctx
->Exec
->Disable
)( cap
);
1829 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1831 GET_CURRENT_CONTEXT(ctx
);
1833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1834 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1838 if (ctx
->ExecuteFlag
) {
1839 (*ctx
->Exec
->DrawBuffer
)( mode
);
1844 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1845 GLenum format
, GLenum type
,
1846 const GLvoid
*pixels
)
1848 GET_CURRENT_CONTEXT(ctx
);
1849 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
1850 pixels
, &ctx
->Unpack
);
1852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1853 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1864 if (ctx
->ExecuteFlag
) {
1865 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1871 static void GLAPIENTRY
save_Enable( GLenum cap
)
1873 GET_CURRENT_CONTEXT(ctx
);
1875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1876 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1880 if (ctx
->ExecuteFlag
) {
1881 (*ctx
->Exec
->Enable
)( cap
);
1887 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1889 GET_CURRENT_CONTEXT(ctx
);
1891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1892 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1898 if (ctx
->ExecuteFlag
) {
1899 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1904 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1906 GET_CURRENT_CONTEXT(ctx
);
1908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1909 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1917 if (ctx
->ExecuteFlag
) {
1918 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1925 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1927 GET_CURRENT_CONTEXT(ctx
);
1929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1930 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1938 if (ctx
->ExecuteFlag
) {
1939 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1944 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1946 save_Fogfv(pname
, ¶m
);
1950 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1955 case GL_FOG_DENSITY
:
1959 p
[0] = (GLfloat
) *params
;
1962 p
[0] = INT_TO_FLOAT( params
[0] );
1963 p
[1] = INT_TO_FLOAT( params
[1] );
1964 p
[2] = INT_TO_FLOAT( params
[2] );
1965 p
[3] = INT_TO_FLOAT( params
[3] );
1968 /* Error will be caught later in gl_Fogfv */
1971 save_Fogfv(pname
, p
);
1975 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1977 save_Fogiv(pname
, ¶m
);
1981 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1983 GET_CURRENT_CONTEXT(ctx
);
1985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1986 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1990 if (ctx
->ExecuteFlag
) {
1991 (*ctx
->Exec
->FrontFace
)( mode
);
1996 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1997 GLdouble bottom
, GLdouble top
,
1998 GLdouble nearval
, GLdouble farval
)
2000 GET_CURRENT_CONTEXT(ctx
);
2002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2003 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
2005 n
[1].f
= (GLfloat
) left
;
2006 n
[2].f
= (GLfloat
) right
;
2007 n
[3].f
= (GLfloat
) bottom
;
2008 n
[4].f
= (GLfloat
) top
;
2009 n
[5].f
= (GLfloat
) nearval
;
2010 n
[6].f
= (GLfloat
) farval
;
2012 if (ctx
->ExecuteFlag
) {
2013 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
2018 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2020 GET_CURRENT_CONTEXT(ctx
);
2022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2028 if (ctx
->ExecuteFlag
) {
2029 (*ctx
->Exec
->Hint
)( target
, mode
);
2034 static void GLAPIENTRY
2035 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2037 GET_CURRENT_CONTEXT(ctx
);
2040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2041 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2045 n
[3].e
= internalFormat
;
2048 if (ctx
->ExecuteFlag
) {
2049 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2054 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2056 GET_CURRENT_CONTEXT(ctx
);
2058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2059 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2063 if (ctx
->ExecuteFlag
) {
2064 (*ctx
->Exec
->IndexMask
)( mask
);
2069 static void GLAPIENTRY
save_InitNames( void )
2071 GET_CURRENT_CONTEXT(ctx
);
2072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2073 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2074 if (ctx
->ExecuteFlag
) {
2075 (*ctx
->Exec
->InitNames
)();
2080 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2082 GET_CURRENT_CONTEXT(ctx
);
2084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2085 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2103 case GL_SPOT_DIRECTION
:
2106 case GL_SPOT_EXPONENT
:
2109 case GL_SPOT_CUTOFF
:
2112 case GL_CONSTANT_ATTENUATION
:
2115 case GL_LINEAR_ATTENUATION
:
2118 case GL_QUADRATIC_ATTENUATION
:
2124 for (i
= 0; i
< nParams
; i
++) {
2125 n
[3+i
].f
= params
[i
];
2128 if (ctx
->ExecuteFlag
) {
2129 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2134 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2136 save_Lightfv(light
, pname
, ¶ms
);
2140 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2147 fparam
[0] = INT_TO_FLOAT( params
[0] );
2148 fparam
[1] = INT_TO_FLOAT( params
[1] );
2149 fparam
[2] = INT_TO_FLOAT( params
[2] );
2150 fparam
[3] = INT_TO_FLOAT( params
[3] );
2153 fparam
[0] = (GLfloat
) params
[0];
2154 fparam
[1] = (GLfloat
) params
[1];
2155 fparam
[2] = (GLfloat
) params
[2];
2156 fparam
[3] = (GLfloat
) params
[3];
2158 case GL_SPOT_DIRECTION
:
2159 fparam
[0] = (GLfloat
) params
[0];
2160 fparam
[1] = (GLfloat
) params
[1];
2161 fparam
[2] = (GLfloat
) params
[2];
2163 case GL_SPOT_EXPONENT
:
2164 case GL_SPOT_CUTOFF
:
2165 case GL_CONSTANT_ATTENUATION
:
2166 case GL_LINEAR_ATTENUATION
:
2167 case GL_QUADRATIC_ATTENUATION
:
2168 fparam
[0] = (GLfloat
) params
[0];
2171 /* error will be caught later in gl_Lightfv */
2174 save_Lightfv( light
, pname
, fparam
);
2178 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2180 save_Lightiv( light
, pname
, ¶m
);
2184 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2186 GET_CURRENT_CONTEXT(ctx
);
2188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2189 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2197 if (ctx
->ExecuteFlag
) {
2198 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2203 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2205 save_LightModelfv(pname
, ¶m
);
2209 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2213 case GL_LIGHT_MODEL_AMBIENT
:
2214 fparam
[0] = INT_TO_FLOAT( params
[0] );
2215 fparam
[1] = INT_TO_FLOAT( params
[1] );
2216 fparam
[2] = INT_TO_FLOAT( params
[2] );
2217 fparam
[3] = INT_TO_FLOAT( params
[3] );
2219 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2220 case GL_LIGHT_MODEL_TWO_SIDE
:
2221 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2222 fparam
[0] = (GLfloat
) params
[0];
2225 /* Error will be caught later in gl_LightModelfv */
2228 save_LightModelfv(pname
, fparam
);
2232 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2234 save_LightModeliv(pname
, ¶m
);
2238 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2240 GET_CURRENT_CONTEXT(ctx
);
2242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2243 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2248 if (ctx
->ExecuteFlag
) {
2249 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2254 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2256 GET_CURRENT_CONTEXT(ctx
);
2258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2259 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2263 if (ctx
->ExecuteFlag
) {
2264 (*ctx
->Exec
->LineWidth
)( width
);
2269 static void GLAPIENTRY
save_ListBase( GLuint base
)
2271 GET_CURRENT_CONTEXT(ctx
);
2273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2274 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2278 if (ctx
->ExecuteFlag
) {
2279 (*ctx
->Exec
->ListBase
)( base
);
2284 static void GLAPIENTRY
save_LoadIdentity( void )
2286 GET_CURRENT_CONTEXT(ctx
);
2287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2288 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2289 if (ctx
->ExecuteFlag
) {
2290 (*ctx
->Exec
->LoadIdentity
)();
2295 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2297 GET_CURRENT_CONTEXT(ctx
);
2299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2300 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2303 for (i
=0;i
<16;i
++) {
2307 if (ctx
->ExecuteFlag
) {
2308 (*ctx
->Exec
->LoadMatrixf
)( m
);
2313 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2317 for (i
= 0; i
< 16; i
++) {
2318 f
[i
] = (GLfloat
) m
[i
];
2320 save_LoadMatrixf(f
);
2324 static void GLAPIENTRY
save_LoadName( GLuint name
)
2326 GET_CURRENT_CONTEXT(ctx
);
2328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2329 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2333 if (ctx
->ExecuteFlag
) {
2334 (*ctx
->Exec
->LoadName
)( name
);
2339 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2341 GET_CURRENT_CONTEXT(ctx
);
2343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2344 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2348 if (ctx
->ExecuteFlag
) {
2349 (*ctx
->Exec
->LogicOp
)( opcode
);
2354 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2355 GLint order
, const GLdouble
*points
)
2357 GET_CURRENT_CONTEXT(ctx
);
2359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2360 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2362 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2364 n
[2].f
= (GLfloat
) u1
;
2365 n
[3].f
= (GLfloat
) u2
;
2366 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2368 n
[6].data
= (void *) pnts
;
2370 if (ctx
->ExecuteFlag
) {
2371 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2375 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2376 GLint order
, const GLfloat
*points
)
2378 GET_CURRENT_CONTEXT(ctx
);
2380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2381 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2383 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2387 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2389 n
[6].data
= (void *) pnts
;
2391 if (ctx
->ExecuteFlag
) {
2392 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2397 static void GLAPIENTRY
save_Map2d( GLenum target
,
2398 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2399 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2400 const GLdouble
*points
)
2402 GET_CURRENT_CONTEXT(ctx
);
2404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2405 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2407 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2408 vstride
, vorder
, points
);
2410 n
[2].f
= (GLfloat
) u1
;
2411 n
[3].f
= (GLfloat
) u2
;
2412 n
[4].f
= (GLfloat
) v1
;
2413 n
[5].f
= (GLfloat
) v2
;
2414 /* XXX verify these strides are correct */
2415 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2416 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2419 n
[10].data
= (void *) pnts
;
2421 if (ctx
->ExecuteFlag
) {
2422 (*ctx
->Exec
->Map2d
)( target
,
2423 u1
, u2
, ustride
, uorder
,
2424 v1
, v2
, vstride
, vorder
, points
);
2429 static void GLAPIENTRY
save_Map2f( GLenum target
,
2430 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2431 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2432 const GLfloat
*points
)
2434 GET_CURRENT_CONTEXT(ctx
);
2436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2437 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2439 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2440 vstride
, vorder
, points
);
2446 /* XXX verify these strides are correct */
2447 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2448 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2451 n
[10].data
= (void *) pnts
;
2453 if (ctx
->ExecuteFlag
) {
2454 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2455 v1
, v2
, vstride
, vorder
, points
);
2460 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2462 GET_CURRENT_CONTEXT(ctx
);
2464 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2465 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2471 if (ctx
->ExecuteFlag
) {
2472 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2477 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2479 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2483 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2484 GLint vn
, GLfloat v1
, GLfloat v2
)
2486 GET_CURRENT_CONTEXT(ctx
);
2488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2489 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2498 if (ctx
->ExecuteFlag
) {
2499 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2505 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2506 GLint vn
, GLdouble v1
, GLdouble v2
)
2508 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2509 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2513 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2515 GET_CURRENT_CONTEXT(ctx
);
2517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2518 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2522 if (ctx
->ExecuteFlag
) {
2523 (*ctx
->Exec
->MatrixMode
)( mode
);
2528 static void GLAPIENTRY
2529 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2531 GET_CURRENT_CONTEXT(ctx
);
2534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2535 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2538 n
[2].e
= internalFormat
;
2541 if (ctx
->ExecuteFlag
) {
2542 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2547 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2549 GET_CURRENT_CONTEXT(ctx
);
2551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2552 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2555 for (i
=0;i
<16;i
++) {
2559 if (ctx
->ExecuteFlag
) {
2560 (*ctx
->Exec
->MultMatrixf
)( m
);
2565 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2569 for (i
= 0; i
< 16; i
++) {
2570 f
[i
] = (GLfloat
) m
[i
];
2572 save_MultMatrixf(f
);
2576 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2578 GET_CURRENT_CONTEXT(ctx
);
2579 /* It's an error to call this function while building a display list */
2580 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2587 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2588 GLdouble bottom
, GLdouble top
,
2589 GLdouble nearval
, GLdouble farval
)
2591 GET_CURRENT_CONTEXT(ctx
);
2593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2594 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2596 n
[1].f
= (GLfloat
) left
;
2597 n
[2].f
= (GLfloat
) right
;
2598 n
[3].f
= (GLfloat
) bottom
;
2599 n
[4].f
= (GLfloat
) top
;
2600 n
[5].f
= (GLfloat
) nearval
;
2601 n
[6].f
= (GLfloat
) farval
;
2603 if (ctx
->ExecuteFlag
) {
2604 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2609 static void GLAPIENTRY
2610 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2612 GET_CURRENT_CONTEXT(ctx
);
2614 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2615 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2619 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2620 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2622 if (ctx
->ExecuteFlag
) {
2623 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2628 static void GLAPIENTRY
2629 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2631 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2633 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2634 for (i
=0;i
<mapsize
;i
++) {
2635 fvalues
[i
] = (GLfloat
) values
[i
];
2639 for (i
=0;i
<mapsize
;i
++) {
2640 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2643 save_PixelMapfv(map
, mapsize
, fvalues
);
2647 static void GLAPIENTRY
2648 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2650 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2652 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2653 for (i
=0;i
<mapsize
;i
++) {
2654 fvalues
[i
] = (GLfloat
) values
[i
];
2658 for (i
=0;i
<mapsize
;i
++) {
2659 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2662 save_PixelMapfv(map
, mapsize
, fvalues
);
2666 static void GLAPIENTRY
2667 save_PixelTransferf( GLenum pname
, GLfloat param
)
2669 GET_CURRENT_CONTEXT(ctx
);
2671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2672 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2677 if (ctx
->ExecuteFlag
) {
2678 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2683 static void GLAPIENTRY
2684 save_PixelTransferi( GLenum pname
, GLint param
)
2686 save_PixelTransferf( pname
, (GLfloat
) param
);
2690 static void GLAPIENTRY
2691 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2693 GET_CURRENT_CONTEXT(ctx
);
2695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2696 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2701 if (ctx
->ExecuteFlag
) {
2702 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2707 static void GLAPIENTRY
2708 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2710 GET_CURRENT_CONTEXT(ctx
);
2712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2713 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2720 if (ctx
->ExecuteFlag
) {
2721 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2726 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2728 save_PointParameterfvEXT(pname
, ¶m
);
2731 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2733 GLfloat p
= (GLfloat
) param
;
2734 save_PointParameterfvEXT(pname
, &p
);
2737 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2739 GLfloat p
= (GLfloat
) param
[0];
2740 save_PointParameterfvEXT(pname
, &p
);
2744 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2746 GET_CURRENT_CONTEXT(ctx
);
2748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2749 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2753 if (ctx
->ExecuteFlag
) {
2754 (*ctx
->Exec
->PointSize
)( size
);
2759 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2761 GET_CURRENT_CONTEXT(ctx
);
2763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2764 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2769 if (ctx
->ExecuteFlag
) {
2770 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2776 * Polygon stipple must have been upacked already!
2778 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2780 GET_CURRENT_CONTEXT(ctx
);
2782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2783 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2786 n
[1].data
= MALLOC( 32 * 4 );
2787 data
= n
[1].data
; /* This needed for Acorn compiler */
2788 MEMCPY( data
, pattern
, 32 * 4 );
2790 if (ctx
->ExecuteFlag
) {
2791 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2796 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2798 GET_CURRENT_CONTEXT(ctx
);
2800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2801 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2806 if (ctx
->ExecuteFlag
) {
2807 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2812 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2814 GET_CURRENT_CONTEXT(ctx
);
2815 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2819 static void GLAPIENTRY
save_PopAttrib( void )
2821 GET_CURRENT_CONTEXT(ctx
);
2822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2823 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2824 if (ctx
->ExecuteFlag
) {
2825 (*ctx
->Exec
->PopAttrib
)();
2830 static void GLAPIENTRY
save_PopMatrix( void )
2832 GET_CURRENT_CONTEXT(ctx
);
2833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2834 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2835 if (ctx
->ExecuteFlag
) {
2836 (*ctx
->Exec
->PopMatrix
)();
2841 static void GLAPIENTRY
save_PopName( void )
2843 GET_CURRENT_CONTEXT(ctx
);
2844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2845 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2846 if (ctx
->ExecuteFlag
) {
2847 (*ctx
->Exec
->PopName
)();
2852 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2853 const GLclampf
*priorities
)
2855 GET_CURRENT_CONTEXT(ctx
);
2857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2859 for (i
=0;i
<num
;i
++) {
2861 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2863 n
[1].ui
= textures
[i
];
2864 n
[2].f
= priorities
[i
];
2867 if (ctx
->ExecuteFlag
) {
2868 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2873 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2875 GET_CURRENT_CONTEXT(ctx
);
2877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2878 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2882 if (ctx
->ExecuteFlag
) {
2883 (*ctx
->Exec
->PushAttrib
)( mask
);
2888 static void GLAPIENTRY
save_PushMatrix( void )
2890 GET_CURRENT_CONTEXT(ctx
);
2891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2892 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2893 if (ctx
->ExecuteFlag
) {
2894 (*ctx
->Exec
->PushMatrix
)();
2899 static void GLAPIENTRY
save_PushName( GLuint name
)
2901 GET_CURRENT_CONTEXT(ctx
);
2903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2904 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2908 if (ctx
->ExecuteFlag
) {
2909 (*ctx
->Exec
->PushName
)( name
);
2914 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2916 GET_CURRENT_CONTEXT(ctx
);
2918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2919 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2926 if (ctx
->ExecuteFlag
) {
2927 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2931 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2933 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2936 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2938 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2941 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2943 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2946 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2948 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2951 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2953 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2956 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2958 save_RasterPos4f(x
, y
, z
, 1.0F
);
2961 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2963 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2966 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2968 save_RasterPos4f(x
, y
, z
, 1.0F
);
2971 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2973 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2976 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2978 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2981 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2983 save_RasterPos4f(x
, y
, z
, w
);
2986 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2988 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2991 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2993 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2996 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2998 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3001 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
3003 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3006 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3008 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3011 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3013 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3016 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3018 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3021 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3023 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3026 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3028 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3029 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3032 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3034 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3037 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3039 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3040 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3043 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3045 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3049 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3051 GET_CURRENT_CONTEXT(ctx
);
3053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3054 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3058 if (ctx
->ExecuteFlag
) {
3059 (*ctx
->Exec
->PassThrough
)( token
);
3064 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3066 GET_CURRENT_CONTEXT(ctx
);
3068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3069 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3073 if (ctx
->ExecuteFlag
) {
3074 (*ctx
->Exec
->ReadBuffer
)( mode
);
3079 static void GLAPIENTRY
3080 save_ResetHistogram(GLenum target
)
3082 GET_CURRENT_CONTEXT(ctx
);
3084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3085 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3089 if (ctx
->ExecuteFlag
) {
3090 (*ctx
->Exec
->ResetHistogram
)( target
);
3095 static void GLAPIENTRY
3096 save_ResetMinmax(GLenum target
)
3098 GET_CURRENT_CONTEXT(ctx
);
3100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3101 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3105 if (ctx
->ExecuteFlag
) {
3106 (*ctx
->Exec
->ResetMinmax
)( target
);
3111 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3113 GET_CURRENT_CONTEXT(ctx
);
3115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3116 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3123 if (ctx
->ExecuteFlag
) {
3124 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3129 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3131 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3135 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3137 GET_CURRENT_CONTEXT(ctx
);
3139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3140 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3146 if (ctx
->ExecuteFlag
) {
3147 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3152 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3154 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3158 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3160 GET_CURRENT_CONTEXT(ctx
);
3162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3163 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3170 if (ctx
->ExecuteFlag
) {
3171 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3176 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3178 GET_CURRENT_CONTEXT(ctx
);
3180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3181 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3185 if (ctx
->ExecuteFlag
) {
3186 (*ctx
->Exec
->ShadeModel
)( mode
);
3191 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3193 GET_CURRENT_CONTEXT(ctx
);
3195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3196 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3202 if (ctx
->ExecuteFlag
) {
3203 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3208 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3210 GET_CURRENT_CONTEXT(ctx
);
3212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3213 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3217 if (ctx
->ExecuteFlag
) {
3218 (*ctx
->Exec
->StencilMask
)( mask
);
3223 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3234 if (ctx
->ExecuteFlag
) {
3235 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3240 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3242 GET_CURRENT_CONTEXT(ctx
);
3244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3245 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3249 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3257 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3260 if (ctx
->ExecuteFlag
) {
3261 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3266 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3268 save_TexEnvfv( target
, pname
, ¶m
);
3272 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3275 p
[0] = (GLfloat
) param
;
3276 p
[1] = p
[2] = p
[3] = 0.0;
3277 save_TexEnvfv( target
, pname
, p
);
3281 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3284 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3285 p
[0] = INT_TO_FLOAT( param
[0] );
3286 p
[1] = INT_TO_FLOAT( param
[1] );
3287 p
[2] = INT_TO_FLOAT( param
[2] );
3288 p
[3] = INT_TO_FLOAT( param
[3] );
3291 p
[0] = (GLfloat
) param
[0];
3292 p
[1] = p
[2] = p
[3] = 0.0F
;
3294 save_TexEnvfv( target
, pname
, p
);
3298 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3300 GET_CURRENT_CONTEXT(ctx
);
3302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3303 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3312 if (ctx
->ExecuteFlag
) {
3313 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3318 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3321 p
[0] = (GLfloat
) params
[0];
3322 p
[1] = (GLfloat
) params
[1];
3323 p
[2] = (GLfloat
) params
[2];
3324 p
[3] = (GLfloat
) params
[3];
3325 save_TexGenfv(coord
, pname
, p
);
3329 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3331 GLfloat p
= (GLfloat
) param
;
3332 save_TexGenfv( coord
, pname
, &p
);
3336 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3339 p
[0] = (GLfloat
) params
[0];
3340 p
[1] = (GLfloat
) params
[1];
3341 p
[2] = (GLfloat
) params
[2];
3342 p
[3] = (GLfloat
) params
[3];
3343 save_TexGenfv( coord
, pname
, p
);
3347 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3349 save_TexGenfv(coord
, pname
, ¶m
);
3353 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3355 save_TexGeniv( coord
, pname
, ¶m
);
3359 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3360 GLenum pname
, const GLfloat
*params
)
3362 GET_CURRENT_CONTEXT(ctx
);
3364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3365 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3374 if (ctx
->ExecuteFlag
) {
3375 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3380 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3382 save_TexParameterfv(target
, pname
, ¶m
);
3386 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3389 fparam
[0] = (GLfloat
) param
;
3390 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3391 save_TexParameterfv(target
, pname
, fparam
);
3395 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3398 fparam
[0] = (GLfloat
) params
[0];
3399 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3400 save_TexParameterfv(target
, pname
, fparam
);
3404 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3405 GLint level
, GLint components
,
3406 GLsizei width
, GLint border
,
3407 GLenum format
, GLenum type
,
3408 const GLvoid
*pixels
)
3410 GET_CURRENT_CONTEXT(ctx
);
3411 if (target
== GL_PROXY_TEXTURE_1D
) {
3412 /* don't compile, execute immediately */
3413 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3414 border
, format
, type
, pixels
);
3417 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3418 pixels
, &ctx
->Unpack
);
3420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3421 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3425 n
[3].i
= components
;
3426 n
[4].i
= (GLint
) width
;
3435 if (ctx
->ExecuteFlag
) {
3436 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3437 border
, format
, type
, pixels
);
3443 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3444 GLint level
, GLint components
,
3445 GLsizei width
, GLsizei height
, GLint border
,
3446 GLenum format
, GLenum type
,
3447 const GLvoid
*pixels
)
3449 GET_CURRENT_CONTEXT(ctx
);
3450 if (target
== GL_PROXY_TEXTURE_2D
) {
3451 /* don't compile, execute immediately */
3452 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3453 height
, border
, format
, type
, pixels
);
3456 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3457 pixels
, &ctx
->Unpack
);
3459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3460 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3464 n
[3].i
= components
;
3465 n
[4].i
= (GLint
) width
;
3466 n
[5].i
= (GLint
) height
;
3475 if (ctx
->ExecuteFlag
) {
3476 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3477 height
, border
, format
, type
, pixels
);
3483 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3484 GLint level
, GLint internalFormat
,
3485 GLsizei width
, GLsizei height
, GLsizei depth
,
3487 GLenum format
, GLenum type
,
3488 const GLvoid
*pixels
)
3490 GET_CURRENT_CONTEXT(ctx
);
3491 if (target
== GL_PROXY_TEXTURE_3D
) {
3492 /* don't compile, execute immediately */
3493 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3494 height
, depth
, border
, format
, type
, pixels
);
3498 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3499 pixels
, &ctx
->Unpack
);
3500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3501 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3505 n
[3].i
= (GLint
) internalFormat
;
3506 n
[4].i
= (GLint
) width
;
3507 n
[5].i
= (GLint
) height
;
3508 n
[6].i
= (GLint
) depth
;
3517 if (ctx
->ExecuteFlag
) {
3518 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3519 height
, depth
, border
, format
, type
, pixels
);
3525 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3526 GLsizei width
, GLenum format
, GLenum type
,
3527 const GLvoid
*pixels
)
3529 GET_CURRENT_CONTEXT(ctx
);
3531 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3532 pixels
, &ctx
->Unpack
);
3533 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3534 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3539 n
[4].i
= (GLint
) width
;
3547 if (ctx
->ExecuteFlag
) {
3548 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3549 format
, type
, pixels
);
3554 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3555 GLint xoffset
, GLint yoffset
,
3556 GLsizei width
, GLsizei height
,
3557 GLenum format
, GLenum type
,
3558 const GLvoid
*pixels
)
3560 GET_CURRENT_CONTEXT(ctx
);
3562 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3563 pixels
, &ctx
->Unpack
);
3564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3565 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3571 n
[5].i
= (GLint
) width
;
3572 n
[6].i
= (GLint
) height
;
3580 if (ctx
->ExecuteFlag
) {
3581 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3582 width
, height
, format
, type
, pixels
);
3587 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3588 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3589 GLsizei width
, GLsizei height
, GLsizei depth
,
3590 GLenum format
, GLenum type
,
3591 const GLvoid
*pixels
)
3593 GET_CURRENT_CONTEXT(ctx
);
3595 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3596 pixels
, &ctx
->Unpack
);
3597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3598 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3605 n
[6].i
= (GLint
) width
;
3606 n
[7].i
= (GLint
) height
;
3607 n
[8].i
= (GLint
) depth
;
3615 if (ctx
->ExecuteFlag
) {
3616 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3617 xoffset
, yoffset
, zoffset
,
3618 width
, height
, depth
, format
, type
, pixels
);
3623 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3625 GET_CURRENT_CONTEXT(ctx
);
3627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3628 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3634 if (ctx
->ExecuteFlag
) {
3635 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3640 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3642 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3647 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3649 GET_CURRENT_CONTEXT(ctx
);
3651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3652 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3656 n
[3].i
= (GLint
) width
;
3657 n
[4].i
= (GLint
) height
;
3659 if (ctx
->ExecuteFlag
) {
3660 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3665 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3667 GET_CURRENT_CONTEXT(ctx
);
3669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3670 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3677 if (ctx
->ExecuteFlag
) {
3678 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3682 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3684 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3687 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3689 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3692 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3694 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3697 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3699 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3702 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3704 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3707 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3709 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3712 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3714 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3717 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3719 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3722 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3724 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3727 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3729 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3732 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3734 save_WindowPos4fMESA(x
, y
, z
, w
);
3737 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3739 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3742 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3744 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3747 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3749 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3752 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3754 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3757 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3759 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3762 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3764 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3767 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3769 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3772 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3774 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3777 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3779 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3780 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3783 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3785 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3788 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3790 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3791 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3794 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3796 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3801 /* GL_ARB_multitexture */
3802 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3804 GET_CURRENT_CONTEXT(ctx
);
3806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3807 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3811 if (ctx
->ExecuteFlag
) {
3812 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3817 /* GL_ARB_transpose_matrix */
3819 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3822 _math_transposefd(tm
, m
);
3823 save_LoadMatrixf(tm
);
3827 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3830 _math_transposef(tm
, m
);
3831 save_LoadMatrixf(tm
);
3835 static void GLAPIENTRY
3836 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3839 _math_transposefd(tm
, m
);
3840 save_MultMatrixf(tm
);
3844 static void GLAPIENTRY
3845 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3848 _math_transposef(tm
, m
);
3849 save_MultMatrixf(tm
);
3853 static void GLAPIENTRY
3854 save_PixelTexGenSGIX(GLenum mode
)
3856 GET_CURRENT_CONTEXT(ctx
);
3858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3859 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3863 if (ctx
->ExecuteFlag
) {
3864 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3869 /* GL_ARB_texture_compression */
3870 static void GLAPIENTRY
3871 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3872 GLenum internalFormat
, GLsizei width
,
3873 GLint border
, GLsizei imageSize
,
3876 GET_CURRENT_CONTEXT(ctx
);
3877 if (target
== GL_PROXY_TEXTURE_1D
) {
3878 /* don't compile, execute immediately */
3879 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3880 width
, border
, imageSize
, data
);
3885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3886 /* make copy of image */
3887 image
= MALLOC(imageSize
);
3889 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3892 MEMCPY(image
, data
, imageSize
);
3893 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3897 n
[3].e
= internalFormat
;
3898 n
[4].i
= (GLint
) width
;
3906 if (ctx
->ExecuteFlag
) {
3907 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3908 width
, border
, imageSize
, data
);
3914 static void GLAPIENTRY
3915 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3916 GLenum internalFormat
, GLsizei width
,
3917 GLsizei height
, GLint border
, GLsizei imageSize
,
3920 GET_CURRENT_CONTEXT(ctx
);
3921 if (target
== GL_PROXY_TEXTURE_2D
) {
3922 /* don't compile, execute immediately */
3923 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3924 width
, height
, border
, imageSize
, data
);
3929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3930 /* make copy of image */
3931 image
= MALLOC(imageSize
);
3933 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3936 MEMCPY(image
, data
, imageSize
);
3937 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3941 n
[3].e
= internalFormat
;
3942 n
[4].i
= (GLint
) width
;
3943 n
[5].i
= (GLint
) height
;
3951 if (ctx
->ExecuteFlag
) {
3952 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3953 width
, height
, border
, imageSize
, data
);
3959 static void GLAPIENTRY
3960 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3961 GLenum internalFormat
, GLsizei width
,
3962 GLsizei height
, GLsizei depth
, GLint border
,
3963 GLsizei imageSize
, const GLvoid
*data
)
3965 GET_CURRENT_CONTEXT(ctx
);
3966 if (target
== GL_PROXY_TEXTURE_3D
) {
3967 /* don't compile, execute immediately */
3968 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3969 width
, height
, depth
, border
, imageSize
, data
);
3974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3975 /* make copy of image */
3976 image
= MALLOC(imageSize
);
3978 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3981 MEMCPY(image
, data
, imageSize
);
3982 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3986 n
[3].e
= internalFormat
;
3987 n
[4].i
= (GLint
) width
;
3988 n
[5].i
= (GLint
) height
;
3989 n
[6].i
= (GLint
) depth
;
3997 if (ctx
->ExecuteFlag
) {
3998 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3999 width
, height
, depth
, border
, imageSize
, data
);
4005 static void GLAPIENTRY
4006 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4007 GLsizei width
, GLenum format
,
4008 GLsizei imageSize
, const GLvoid
*data
)
4013 GET_CURRENT_CONTEXT(ctx
);
4014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4016 /* make copy of image */
4017 image
= MALLOC(imageSize
);
4019 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4022 MEMCPY(image
, data
, imageSize
);
4023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4028 n
[4].i
= (GLint
) width
;
4036 if (ctx
->ExecuteFlag
) {
4037 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
4038 width
, format
, imageSize
, data
);
4043 static void GLAPIENTRY
4044 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4045 GLint yoffset
, GLsizei width
, GLsizei height
,
4046 GLenum format
, GLsizei imageSize
,
4052 GET_CURRENT_CONTEXT(ctx
);
4053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4055 /* make copy of image */
4056 image
= MALLOC(imageSize
);
4058 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4061 MEMCPY(image
, data
, imageSize
);
4062 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4068 n
[5].i
= (GLint
) width
;
4069 n
[6].i
= (GLint
) height
;
4077 if (ctx
->ExecuteFlag
) {
4078 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4079 width
, height
, format
, imageSize
, data
);
4084 static void GLAPIENTRY
4085 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4086 GLint yoffset
, GLint zoffset
, GLsizei width
,
4087 GLsizei height
, GLsizei depth
, GLenum format
,
4088 GLsizei imageSize
, const GLvoid
*data
)
4093 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4096 /* make copy of image */
4097 image
= MALLOC(imageSize
);
4099 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4102 MEMCPY(image
, data
, imageSize
);
4103 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4110 n
[6].i
= (GLint
) width
;
4111 n
[7].i
= (GLint
) height
;
4112 n
[8].i
= (GLint
) depth
;
4114 n
[10].i
= imageSize
;
4120 if (ctx
->ExecuteFlag
) {
4121 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4122 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4127 /* GL_ARB_multisample */
4128 static void GLAPIENTRY
4129 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4131 GET_CURRENT_CONTEXT(ctx
);
4133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4134 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4139 if (ctx
->ExecuteFlag
) {
4140 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4145 /* GL_SGIS_pixel_texture */
4147 static void GLAPIENTRY
4148 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4150 GET_CURRENT_CONTEXT(ctx
);
4152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4153 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4158 if (ctx
->ExecuteFlag
) {
4159 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4164 static void GLAPIENTRY
4165 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4167 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4171 static void GLAPIENTRY
4172 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4174 save_PixelTexGenParameteriSGIS(target
, *value
);
4178 static void GLAPIENTRY
4179 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4181 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4186 * GL_NV_vertex_program
4188 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4189 static void GLAPIENTRY
4190 save_BindProgramNV(GLenum target
, GLuint id
)
4192 GET_CURRENT_CONTEXT(ctx
);
4194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4195 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4200 if (ctx
->ExecuteFlag
) {
4201 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4204 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4206 #if FEATURE_NV_vertex_program
4207 static void GLAPIENTRY
4208 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4210 GET_CURRENT_CONTEXT(ctx
);
4212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4213 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4222 if (ctx
->ExecuteFlag
) {
4223 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4228 static void GLAPIENTRY
4229 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4230 GLfloat x
, GLfloat y
,
4231 GLfloat z
, GLfloat w
)
4233 GET_CURRENT_CONTEXT(ctx
);
4235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4236 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4245 if (ctx
->ExecuteFlag
) {
4246 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4251 static void GLAPIENTRY
4252 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4254 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4255 params
[2], params
[3]);
4259 static void GLAPIENTRY
4260 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4261 GLdouble x
, GLdouble y
,
4262 GLdouble z
, GLdouble w
)
4264 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4265 (GLfloat
) z
, (GLfloat
) w
);
4269 static void GLAPIENTRY
4270 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4271 const GLdouble
*params
)
4273 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4274 (GLfloat
) params
[1], (GLfloat
) params
[2],
4275 (GLfloat
) params
[3]);
4279 static void GLAPIENTRY
4280 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4281 GLuint num
, const GLdouble
*params
)
4284 for (i
= 0; i
< num
; i
++) {
4285 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4290 static void GLAPIENTRY
4291 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4292 GLuint num
, const GLfloat
*params
)
4295 for (i
= 0; i
< num
; i
++) {
4296 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4301 static void GLAPIENTRY
4302 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4303 const GLubyte
*program
)
4305 GET_CURRENT_CONTEXT(ctx
);
4307 GLubyte
*programCopy
;
4309 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4311 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4314 _mesa_memcpy(programCopy
, program
, len
);
4316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4317 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4322 n
[4].data
= programCopy
;
4324 if (ctx
->ExecuteFlag
) {
4325 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4330 static void GLAPIENTRY
4331 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4333 GET_CURRENT_CONTEXT(ctx
);
4335 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4337 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4340 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4342 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4347 if (ctx
->ExecuteFlag
) {
4348 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4353 static void GLAPIENTRY
4354 save_TrackMatrixNV(GLenum target
, GLuint address
,
4355 GLenum matrix
, GLenum transform
)
4357 GET_CURRENT_CONTEXT(ctx
);
4359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4360 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4367 if (ctx
->ExecuteFlag
) {
4368 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4371 #endif /* FEATURE_NV_vertex_program */
4375 * GL_NV_fragment_program
4377 #if FEATURE_NV_fragment_program
4378 static void GLAPIENTRY
4379 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4380 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4382 GET_CURRENT_CONTEXT(ctx
);
4384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4385 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4394 if (ctx
->ExecuteFlag
) {
4395 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4400 static void GLAPIENTRY
4401 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4402 const GLfloat
*params
)
4404 GET_CURRENT_CONTEXT(ctx
);
4406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4407 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4416 if (ctx
->ExecuteFlag
) {
4417 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4422 static void GLAPIENTRY
4423 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4424 GLdouble x
, GLdouble y
,
4425 GLdouble z
, GLdouble w
)
4427 GET_CURRENT_CONTEXT(ctx
);
4429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4430 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4434 n
[3].f
= (GLfloat
) x
;
4435 n
[4].f
= (GLfloat
) y
;
4436 n
[5].f
= (GLfloat
) z
;
4437 n
[6].f
= (GLfloat
) w
;
4439 if (ctx
->ExecuteFlag
) {
4440 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4445 static void GLAPIENTRY
4446 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4447 const GLdouble
*params
)
4449 GET_CURRENT_CONTEXT(ctx
);
4451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4452 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4456 n
[3].f
= (GLfloat
) params
[0];
4457 n
[4].f
= (GLfloat
) params
[1];
4458 n
[5].f
= (GLfloat
) params
[2];
4459 n
[6].f
= (GLfloat
) params
[3];
4461 if (ctx
->ExecuteFlag
) {
4462 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4466 static void GLAPIENTRY
4467 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4468 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4470 GET_CURRENT_CONTEXT(ctx
);
4472 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4474 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4477 _mesa_memcpy(nameCopy
, name
, len
);
4479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4480 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4484 n
[3].data
= nameCopy
;
4490 if (ctx
->ExecuteFlag
) {
4491 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4496 static void GLAPIENTRY
4497 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4500 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4504 static void GLAPIENTRY
4505 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4506 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4508 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4509 (GLfloat
) z
,(GLfloat
) w
);
4513 static void GLAPIENTRY
4514 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4517 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4518 (GLfloat
) v
[1], (GLfloat
) v
[2],
4522 #endif /* FEATURE_NV_fragment_program */
4526 /* GL_EXT_stencil_two_side */
4527 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4529 GET_CURRENT_CONTEXT(ctx
);
4531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4532 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4536 if (ctx
->ExecuteFlag
) {
4537 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4542 /* GL_EXT_depth_bounds_test */
4543 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4545 GET_CURRENT_CONTEXT(ctx
);
4547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4548 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4550 n
[1].f
= (GLfloat
) zmin
;
4551 n
[2].f
= (GLfloat
) zmax
;
4553 if (ctx
->ExecuteFlag
) {
4554 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4560 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4562 static void GLAPIENTRY
4563 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4564 const GLvoid
*string
)
4566 GET_CURRENT_CONTEXT(ctx
);
4568 GLubyte
*programCopy
;
4570 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4572 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4575 _mesa_memcpy(programCopy
, string
, len
);
4577 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4578 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4583 n
[4].data
= programCopy
;
4585 if (ctx
->ExecuteFlag
) {
4586 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4591 static void GLAPIENTRY
4592 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4593 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4595 GET_CURRENT_CONTEXT(ctx
);
4597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4598 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4607 if (ctx
->ExecuteFlag
) {
4608 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4613 static void GLAPIENTRY
4614 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4615 const GLfloat
*params
)
4617 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4618 params
[2], params
[3]);
4622 static void GLAPIENTRY
4623 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4624 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4626 save_ProgramEnvParameter4fARB(target
, index
,
4634 static void GLAPIENTRY
4635 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4636 const GLdouble
*params
)
4638 save_ProgramEnvParameter4fARB(target
, index
,
4639 (GLfloat
) params
[0],
4640 (GLfloat
) params
[1],
4641 (GLfloat
) params
[2],
4642 (GLfloat
) params
[3]);
4645 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4648 #ifdef FEATURE_ARB_occlusion_query
4650 static void GLAPIENTRY
4651 save_BeginQueryARB(GLenum target
, GLuint id
)
4653 GET_CURRENT_CONTEXT(ctx
);
4655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4656 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN_QUERY_ARB
, 2 );
4661 if (ctx
->ExecuteFlag
) {
4662 (*ctx
->Exec
->BeginQueryARB
)( target
, id
);
4667 static void GLAPIENTRY
4668 save_EndQueryARB(GLenum target
)
4670 GET_CURRENT_CONTEXT(ctx
);
4672 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4673 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_END_QUERY_ARB
, 1 );
4677 if (ctx
->ExecuteFlag
) {
4678 (*ctx
->Exec
->EndQueryARB
)( target
);
4682 #endif /* FEATURE_ARB_occlusion_query */
4686 static void save_Attr1f( GLenum attr
, GLfloat x
)
4688 GET_CURRENT_CONTEXT(ctx
);
4690 SAVE_FLUSH_VERTICES( ctx
);
4691 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4697 ASSERT(attr
< VERT_ATTRIB_MAX
);
4698 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4699 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4701 if (ctx
->ExecuteFlag
) {
4702 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4706 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4708 GET_CURRENT_CONTEXT(ctx
);
4710 SAVE_FLUSH_VERTICES( ctx
);
4711 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4718 ASSERT(attr
< VERT_ATTRIB_MAX
);
4719 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4720 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4722 if (ctx
->ExecuteFlag
) {
4723 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4727 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4729 GET_CURRENT_CONTEXT(ctx
);
4731 SAVE_FLUSH_VERTICES( ctx
);
4732 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4740 ASSERT(attr
< VERT_ATTRIB_MAX
);
4741 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4742 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4744 if (ctx
->ExecuteFlag
) {
4745 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4749 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4752 GET_CURRENT_CONTEXT(ctx
);
4754 SAVE_FLUSH_VERTICES( ctx
);
4755 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4764 ASSERT(attr
< VERT_ATTRIB_MAX
);
4765 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4766 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4768 if (ctx
->ExecuteFlag
) {
4769 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4773 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4775 GET_CURRENT_CONTEXT(ctx
);
4777 SAVE_FLUSH_VERTICES( ctx
);
4778 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4782 if (ctx
->ExecuteFlag
) {
4783 (*ctx
->Exec
->EvalCoord1f
)( x
);
4787 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4789 save_EvalCoord1f( v
[0] );
4792 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4794 GET_CURRENT_CONTEXT(ctx
);
4796 SAVE_FLUSH_VERTICES( ctx
);
4797 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4802 if (ctx
->ExecuteFlag
) {
4803 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4807 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4809 save_EvalCoord2f( v
[0], v
[1] );
4813 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4815 GET_CURRENT_CONTEXT(ctx
);
4817 SAVE_FLUSH_VERTICES( ctx
);
4818 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4822 if (ctx
->ExecuteFlag
) {
4823 (*ctx
->Exec
->EvalPoint1
)( x
);
4827 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4829 GET_CURRENT_CONTEXT(ctx
);
4831 SAVE_FLUSH_VERTICES( ctx
);
4832 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4837 if (ctx
->ExecuteFlag
) {
4838 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4842 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4844 GET_CURRENT_CONTEXT(ctx
);
4846 SAVE_FLUSH_VERTICES( ctx
);
4847 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4852 ctx
->ListState
.ActiveIndex
= 1;
4853 ctx
->ListState
.CurrentIndex
= x
;
4855 if (ctx
->ExecuteFlag
) {
4856 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4860 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4862 save_Indexf( v
[0] );
4865 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4867 GET_CURRENT_CONTEXT(ctx
);
4869 SAVE_FLUSH_VERTICES( ctx
);
4870 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4875 ctx
->ListState
.ActiveEdgeFlag
= 1;
4876 ctx
->ListState
.CurrentEdgeFlag
= x
;
4878 if (ctx
->ExecuteFlag
) {
4879 (*ctx
->Exec
->EdgeFlag
)( x
);
4883 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4885 save_EdgeFlag( v
[0] );
4888 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4890 GET_CURRENT_CONTEXT(ctx
);
4894 SAVE_FLUSH_VERTICES( ctx
);
4899 case GL_FRONT_AND_BACK
:
4902 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4911 case GL_AMBIENT_AND_DIFFUSE
:
4917 case GL_COLOR_INDEXES
:
4921 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4925 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4929 for (i
= 0 ; i
< args
; i
++)
4930 n
[3+i
].f
= param
[i
];
4934 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4935 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4936 if (bitmask
& (1<<i
)) {
4937 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4938 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4942 if (ctx
->ExecuteFlag
) {
4943 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4947 static void GLAPIENTRY
save_Begin( GLenum mode
)
4949 GET_CURRENT_CONTEXT(ctx
);
4951 GLboolean error
= GL_FALSE
;
4953 if (/*mode < GL_POINTS ||*/ mode
> GL_POLYGON
) {
4954 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4957 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4958 /* Typically the first begin. This may raise an error on
4959 * playback, depending on whether CallList is issued from inside
4960 * a begin/end or not.
4962 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4964 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4965 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4968 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4973 /* Give the driver an opportunity to hook in an optimized
4974 * display list compiler.
4976 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4979 SAVE_FLUSH_VERTICES( ctx
);
4980 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4986 if (ctx
->ExecuteFlag
) {
4987 (*ctx
->Exec
->Begin
)( mode
);
4991 static void GLAPIENTRY
save_End( void )
4993 GET_CURRENT_CONTEXT(ctx
);
4994 SAVE_FLUSH_VERTICES( ctx
);
4995 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4996 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4997 if (ctx
->ExecuteFlag
) {
4998 (*ctx
->Exec
->End
)( );
5002 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
5003 GLfloat c
, GLfloat d
)
5005 GET_CURRENT_CONTEXT(ctx
);
5007 SAVE_FLUSH_VERTICES( ctx
);
5008 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
5015 if (ctx
->ExecuteFlag
) {
5016 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
5022 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
5024 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
5027 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
5029 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
5032 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
5034 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
5037 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
5039 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
5042 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5044 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
5047 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
5049 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
5052 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
5054 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
5057 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5059 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
5062 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5064 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
5067 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5069 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5072 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5074 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
5077 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5079 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5082 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5084 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5087 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5089 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5092 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5094 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5097 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5099 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5102 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5104 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5107 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5109 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5112 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5114 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5117 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5119 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5122 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5124 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5127 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5129 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5132 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5134 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5137 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5139 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5143 /* Just call the respective ATTR for texcoord
5145 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5147 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5148 save_Attr1f( attr
, x
);
5151 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5153 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5154 save_Attr1f( attr
, v
[0] );
5157 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5159 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5160 save_Attr2f( attr
, x
, y
);
5163 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5165 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5166 save_Attr2f( attr
, v
[0], v
[1] );
5169 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5172 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5173 save_Attr3f( attr
, x
, y
, z
);
5176 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5178 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5179 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5182 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5183 GLfloat z
, GLfloat w
)
5185 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5186 save_Attr4f( attr
, x
, y
, z
, w
);
5189 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5191 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5192 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5196 static void enum_error( void )
5198 GET_CURRENT_CONTEXT( ctx
);
5199 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5202 /* First level for NV_vertex_program:
5204 * Check for errors at compile time?.
5206 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5208 if (index
< VERT_ATTRIB_MAX
)
5209 save_Attr1f( index
, x
);
5214 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5216 if (index
< VERT_ATTRIB_MAX
)
5217 save_Attr1f( index
, v
[0] );
5222 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5224 if (index
< VERT_ATTRIB_MAX
)
5225 save_Attr2f( index
, x
, y
);
5230 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5232 if (index
< VERT_ATTRIB_MAX
)
5233 save_Attr2f( index
, v
[0], v
[1] );
5238 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5241 if (index
< VERT_ATTRIB_MAX
)
5242 save_Attr3f( index
, x
, y
, z
);
5247 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5249 if (index
< VERT_ATTRIB_MAX
)
5250 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5255 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5256 GLfloat z
, GLfloat w
)
5258 if (index
< VERT_ATTRIB_MAX
)
5259 save_Attr4f( index
, x
, y
, z
, w
);
5264 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5266 if (index
< VERT_ATTRIB_MAX
)
5267 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5276 /* KW: Compile commands
5278 * Will appear in the list before the vertex buffer containing the
5279 * command that provoked the error. I don't see this as a problem.
5282 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5285 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5288 n
[2].data
= (void *) s
;
5290 /* execute already done */
5295 * Compile an error into current display list.
5298 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5300 if (ctx
->CompileFlag
)
5301 _mesa_save_error( ctx
, error
, s
);
5303 if (ctx
->ExecuteFlag
)
5304 _mesa_error( ctx
, error
, s
);
5310 islist(GLcontext
*ctx
, GLuint list
)
5312 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5322 /**********************************************************************/
5323 /* Display list execution */
5324 /**********************************************************************/
5328 * Execute a display list. Note that the ListBase offset must have already
5329 * been added before calling this function. I.e. the list argument is
5330 * the absolute list number, not relative to ListBase.
5331 * \param list - display list number
5333 static void GLAPIENTRY
5334 execute_list( GLcontext
*ctx
, GLuint list
)
5339 if (list
== 0 || !islist(ctx
,list
))
5342 if (ctx
->Driver
.BeginCallList
)
5343 ctx
->Driver
.BeginCallList( ctx
, list
);
5345 ctx
->ListState
.CallDepth
++;
5347 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5351 OpCode opcode
= n
[0].opcode
;
5352 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5354 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5355 /* this is a driver-extended opcode */
5356 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5357 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5362 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5365 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5367 case OPCODE_ALPHA_FUNC
:
5368 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5370 case OPCODE_BIND_TEXTURE
:
5371 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5375 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5376 ctx
->Unpack
= ctx
->DefaultPacking
;
5377 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5378 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5379 ctx
->Unpack
= save
; /* restore */
5382 case OPCODE_BLEND_COLOR
:
5383 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5385 case OPCODE_BLEND_EQUATION
:
5386 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5388 case OPCODE_BLEND_EQUATION_SEPARATE
:
5389 (*ctx
->Exec
->BlendEquationSeparateEXT
)( n
[1].e
, n
[2].e
);
5391 case OPCODE_BLEND_FUNC_SEPARATE
:
5392 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5394 case OPCODE_CALL_LIST
:
5395 /* Generated by glCallList(), don't add ListBase */
5396 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5397 execute_list( ctx
, n
[1].ui
);
5400 case OPCODE_CALL_LIST_OFFSET
:
5401 /* Generated by glCallLists() so we must add ListBase */
5403 /* user specified a bad data type at compile time */
5404 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5406 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5407 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5411 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5413 case OPCODE_CLEAR_COLOR
:
5414 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5416 case OPCODE_CLEAR_ACCUM
:
5417 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5419 case OPCODE_CLEAR_DEPTH
:
5420 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5422 case OPCODE_CLEAR_INDEX
:
5423 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5425 case OPCODE_CLEAR_STENCIL
:
5426 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5428 case OPCODE_CLIP_PLANE
:
5435 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5438 case OPCODE_COLOR_MASK
:
5439 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5441 case OPCODE_COLOR_MATERIAL
:
5442 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5444 case OPCODE_COLOR_TABLE
:
5446 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5447 ctx
->Unpack
= ctx
->DefaultPacking
;
5448 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5449 n
[5].e
, n
[6].data
);
5450 ctx
->Unpack
= save
; /* restore */
5453 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5460 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5463 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5470 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5473 case OPCODE_COLOR_SUB_TABLE
:
5475 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5476 ctx
->Unpack
= ctx
->DefaultPacking
;
5477 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5478 n
[4].e
, n
[5].e
, n
[6].data
);
5479 ctx
->Unpack
= save
; /* restore */
5482 case OPCODE_CONVOLUTION_FILTER_1D
:
5484 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5485 ctx
->Unpack
= ctx
->DefaultPacking
;
5486 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5487 n
[4].e
, n
[5].e
, n
[6].data
);
5488 ctx
->Unpack
= save
; /* restore */
5491 case OPCODE_CONVOLUTION_FILTER_2D
:
5493 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5494 ctx
->Unpack
= ctx
->DefaultPacking
;
5495 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5496 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5497 ctx
->Unpack
= save
; /* restore */
5500 case OPCODE_CONVOLUTION_PARAMETER_I
:
5501 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5503 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5510 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5513 case OPCODE_CONVOLUTION_PARAMETER_F
:
5514 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5516 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5523 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5526 case OPCODE_COPY_COLOR_SUB_TABLE
:
5527 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5528 n
[3].i
, n
[4].i
, n
[5].i
);
5530 case OPCODE_COPY_COLOR_TABLE
:
5531 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5532 n
[3].i
, n
[4].i
, n
[5].i
);
5534 case OPCODE_COPY_PIXELS
:
5535 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5536 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5538 case OPCODE_COPY_TEX_IMAGE1D
:
5539 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5540 n
[5].i
, n
[6].i
, n
[7].i
);
5542 case OPCODE_COPY_TEX_IMAGE2D
:
5543 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5544 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5546 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5547 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5548 n
[4].i
, n
[5].i
, n
[6].i
);
5550 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5551 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5552 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5554 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5555 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5556 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5558 case OPCODE_CULL_FACE
:
5559 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5561 case OPCODE_DEPTH_FUNC
:
5562 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5564 case OPCODE_DEPTH_MASK
:
5565 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5567 case OPCODE_DEPTH_RANGE
:
5568 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5570 case OPCODE_DISABLE
:
5571 (*ctx
->Exec
->Disable
)( n
[1].e
);
5573 case OPCODE_DRAW_BUFFER
:
5574 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5576 case OPCODE_DRAW_PIXELS
:
5578 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5579 ctx
->Unpack
= ctx
->DefaultPacking
;
5580 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5582 ctx
->Unpack
= save
; /* restore */
5586 (*ctx
->Exec
->Enable
)( n
[1].e
);
5588 case OPCODE_EVALMESH1
:
5589 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5591 case OPCODE_EVALMESH2
:
5592 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5601 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5604 case OPCODE_FRONT_FACE
:
5605 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5607 case OPCODE_FRUSTUM
:
5608 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5611 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5613 case OPCODE_HISTOGRAM
:
5614 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5616 case OPCODE_INDEX_MASK
:
5617 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5619 case OPCODE_INIT_NAMES
:
5620 (*ctx
->Exec
->InitNames
)();
5629 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5632 case OPCODE_LIGHT_MODEL
:
5639 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5642 case OPCODE_LINE_STIPPLE
:
5643 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5645 case OPCODE_LINE_WIDTH
:
5646 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5648 case OPCODE_LIST_BASE
:
5649 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5651 case OPCODE_LOAD_IDENTITY
:
5652 (*ctx
->Exec
->LoadIdentity
)();
5654 case OPCODE_LOAD_MATRIX
:
5655 if (sizeof(Node
)==sizeof(GLfloat
)) {
5656 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5661 for (i
=0;i
<16;i
++) {
5664 (*ctx
->Exec
->LoadMatrixf
)( m
);
5667 case OPCODE_LOAD_NAME
:
5668 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5670 case OPCODE_LOGIC_OP
:
5671 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5675 GLenum target
= n
[1].e
;
5676 GLint ustride
= _mesa_evaluator_components(target
);
5677 GLint uorder
= n
[5].i
;
5678 GLfloat u1
= n
[2].f
;
5679 GLfloat u2
= n
[3].f
;
5680 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5681 (GLfloat
*) n
[6].data
);
5686 GLenum target
= n
[1].e
;
5687 GLfloat u1
= n
[2].f
;
5688 GLfloat u2
= n
[3].f
;
5689 GLfloat v1
= n
[4].f
;
5690 GLfloat v2
= n
[5].f
;
5691 GLint ustride
= n
[6].i
;
5692 GLint vstride
= n
[7].i
;
5693 GLint uorder
= n
[8].i
;
5694 GLint vorder
= n
[9].i
;
5695 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5696 v1
, v2
, vstride
, vorder
,
5697 (GLfloat
*) n
[10].data
);
5700 case OPCODE_MAPGRID1
:
5701 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5703 case OPCODE_MAPGRID2
:
5704 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5706 case OPCODE_MATRIX_MODE
:
5707 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5709 case OPCODE_MIN_MAX
:
5710 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5712 case OPCODE_MULT_MATRIX
:
5713 if (sizeof(Node
)==sizeof(GLfloat
)) {
5714 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5719 for (i
=0;i
<16;i
++) {
5722 (*ctx
->Exec
->MultMatrixf
)( m
);
5726 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5728 case OPCODE_PASSTHROUGH
:
5729 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5731 case OPCODE_PIXEL_MAP
:
5732 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5734 case OPCODE_PIXEL_TRANSFER
:
5735 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5737 case OPCODE_PIXEL_ZOOM
:
5738 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5740 case OPCODE_POINT_SIZE
:
5741 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5743 case OPCODE_POINT_PARAMETERS
:
5749 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5752 case OPCODE_POLYGON_MODE
:
5753 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5755 case OPCODE_POLYGON_STIPPLE
:
5756 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5758 case OPCODE_POLYGON_OFFSET
:
5759 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5761 case OPCODE_POP_ATTRIB
:
5762 (*ctx
->Exec
->PopAttrib
)();
5764 case OPCODE_POP_MATRIX
:
5765 (*ctx
->Exec
->PopMatrix
)();
5767 case OPCODE_POP_NAME
:
5768 (*ctx
->Exec
->PopName
)();
5770 case OPCODE_PRIORITIZE_TEXTURE
:
5771 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5773 case OPCODE_PUSH_ATTRIB
:
5774 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5776 case OPCODE_PUSH_MATRIX
:
5777 (*ctx
->Exec
->PushMatrix
)();
5779 case OPCODE_PUSH_NAME
:
5780 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5782 case OPCODE_RASTER_POS
:
5783 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5785 case OPCODE_READ_BUFFER
:
5786 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5788 case OPCODE_RESET_HISTOGRAM
:
5789 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5791 case OPCODE_RESET_MIN_MAX
:
5792 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5795 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5798 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5800 case OPCODE_SCISSOR
:
5801 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5803 case OPCODE_SHADE_MODEL
:
5804 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5806 case OPCODE_STENCIL_FUNC
:
5807 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5809 case OPCODE_STENCIL_MASK
:
5810 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5812 case OPCODE_STENCIL_OP
:
5813 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5822 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5832 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5835 case OPCODE_TEXPARAMETER
:
5842 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5845 case OPCODE_TEX_IMAGE1D
:
5847 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5848 ctx
->Unpack
= ctx
->DefaultPacking
;
5849 (*ctx
->Exec
->TexImage1D
)(
5850 n
[1].e
, /* target */
5852 n
[3].i
, /* components */
5854 n
[5].e
, /* border */
5855 n
[6].e
, /* format */
5858 ctx
->Unpack
= save
; /* restore */
5861 case OPCODE_TEX_IMAGE2D
:
5863 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5864 ctx
->Unpack
= ctx
->DefaultPacking
;
5865 (*ctx
->Exec
->TexImage2D
)(
5866 n
[1].e
, /* target */
5868 n
[3].i
, /* components */
5870 n
[5].i
, /* height */
5871 n
[6].e
, /* border */
5872 n
[7].e
, /* format */
5875 ctx
->Unpack
= save
; /* restore */
5878 case OPCODE_TEX_IMAGE3D
:
5880 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5881 ctx
->Unpack
= ctx
->DefaultPacking
;
5882 (*ctx
->Exec
->TexImage3D
)(
5883 n
[1].e
, /* target */
5885 n
[3].i
, /* components */
5887 n
[5].i
, /* height */
5889 n
[7].e
, /* border */
5890 n
[8].e
, /* format */
5893 ctx
->Unpack
= save
; /* restore */
5896 case OPCODE_TEX_SUB_IMAGE1D
:
5898 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5899 ctx
->Unpack
= ctx
->DefaultPacking
;
5900 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5902 n
[6].e
, n
[7].data
);
5903 ctx
->Unpack
= save
; /* restore */
5906 case OPCODE_TEX_SUB_IMAGE2D
:
5908 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5909 ctx
->Unpack
= ctx
->DefaultPacking
;
5910 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5912 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5913 ctx
->Unpack
= save
; /* restore */
5916 case OPCODE_TEX_SUB_IMAGE3D
:
5918 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5919 ctx
->Unpack
= ctx
->DefaultPacking
;
5920 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5921 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5922 n
[8].i
, n
[9].e
, n
[10].e
,
5924 ctx
->Unpack
= save
; /* restore */
5927 case OPCODE_TRANSLATE
:
5928 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5930 case OPCODE_VIEWPORT
:
5931 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5932 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5934 case OPCODE_WINDOW_POS
:
5935 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5937 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5938 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5940 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5941 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5943 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5944 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5946 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5947 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5948 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5950 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5951 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5952 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5954 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5955 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5956 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5958 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5959 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5960 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5962 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5963 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5964 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5966 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5967 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5968 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5969 n
[9].e
, n
[10].i
, n
[11].data
);
5971 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5972 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5974 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5975 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5977 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5978 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5979 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5982 #if FEATURE_NV_vertex_program
5983 case OPCODE_EXECUTE_PROGRAM_NV
:
5990 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5993 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5994 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5995 (GLuint
*) n
[2].data
);
5997 case OPCODE_LOAD_PROGRAM_NV
:
5998 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5999 (const GLubyte
*) n
[4].data
);
6001 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6002 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6003 n
[4].f
, n
[5].f
, n
[6].f
);
6005 case OPCODE_TRACK_MATRIX_NV
:
6006 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
6010 #if FEATURE_NV_fragment_program
6011 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6012 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6013 n
[4].f
, n
[5].f
, n
[6].f
);
6015 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6016 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
6017 (const GLubyte
*) n
[3].data
,
6018 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
6022 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6023 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
6025 case OPCODE_DEPTH_BOUNDS_EXT
:
6026 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
6028 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6029 case OPCODE_PROGRAM_STRING_ARB
:
6030 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
6032 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6033 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6034 n
[4].f
, n
[5].f
, n
[6].f
);
6037 #if FEATURE_ARB_occlusion_query
6038 case OPCODE_BEGIN_QUERY_ARB
:
6039 ctx
->Exec
->BeginQueryARB(n
[1].e
, n
[2].ui
);
6041 case OPCODE_END_QUERY_ARB
:
6042 ctx
->Exec
->EndQueryARB(n
[1].e
);
6045 case OPCODE_ATTR_1F
:
6046 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
6048 case OPCODE_ATTR_2F
:
6049 /* Really shouldn't have to do this - the Node structure
6050 * is convenient, but it would be better to store the data
6051 * packed appropriately so that it can be sent directly
6052 * on. With x86_64 becoming common, this will start to
6055 if (sizeof(Node
)==sizeof(GLfloat
))
6056 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
6058 (*ctx
->Exec
->VertexAttrib2fNV
)(n
[1].e
, n
[2].f
, n
[3].f
);
6060 case OPCODE_ATTR_3F
:
6061 if (sizeof(Node
)==sizeof(GLfloat
))
6062 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
6064 (*ctx
->Exec
->VertexAttrib3fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6067 case OPCODE_ATTR_4F
:
6068 if (sizeof(Node
)==sizeof(GLfloat
))
6069 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
6071 (*ctx
->Exec
->VertexAttrib4fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6074 case OPCODE_MATERIAL
:
6075 if (sizeof(Node
)==sizeof(GLfloat
))
6076 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
6083 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, f
);
6087 (*ctx
->Exec
->Indexi
)(n
[1].i
);
6089 case OPCODE_EDGEFLAG
:
6090 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
6093 (*ctx
->Exec
->Begin
)(n
[1].e
);
6096 (*ctx
->Exec
->End
)();
6099 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6101 case OPCODE_EVAL_C1
:
6102 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
6104 case OPCODE_EVAL_C2
:
6105 (*ctx
->Exec
->EvalCoord2f
)(n
[1].f
, n
[2].f
);
6107 case OPCODE_EVAL_P1
:
6108 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
6110 case OPCODE_EVAL_P2
:
6111 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
6117 case OPCODE_CONTINUE
:
6118 n
= (Node
*) n
[1].next
;
6120 case OPCODE_END_OF_LIST
:
6126 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6127 _mesa_problem(ctx
, msg
);
6132 /* increment n to point to next compiled command */
6133 if (opcode
!=OPCODE_CONTINUE
) {
6134 n
+= InstSize
[opcode
];
6138 ctx
->ListState
.CallDepth
--;
6140 if (ctx
->Driver
.EndCallList
)
6141 ctx
->Driver
.EndCallList( ctx
);
6148 /**********************************************************************/
6150 /**********************************************************************/
6156 * Test if a display list number is valid.
6158 GLboolean GLAPIENTRY
6159 _mesa_IsList( GLuint list
)
6161 GET_CURRENT_CONTEXT(ctx
);
6162 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6163 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6164 return islist(ctx
, list
);
6169 * Delete a sequence of consecutive display lists.
6172 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6174 GET_CURRENT_CONTEXT(ctx
);
6176 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6177 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6180 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6183 for (i
=list
;i
<list
+range
;i
++) {
6184 _mesa_destroy_list( ctx
, i
);
6191 * Return a display list number, n, such that lists n through n+range-1
6195 _mesa_GenLists(GLsizei range
)
6197 GET_CURRENT_CONTEXT(ctx
);
6199 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6200 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6203 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6211 * Make this an atomic operation
6213 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6215 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6217 /* reserve the list IDs by with empty/dummy lists */
6219 for (i
=0; i
<range
; i
++) {
6220 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6224 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6232 * Begin a new display list.
6235 _mesa_NewList( GLuint list
, GLenum mode
)
6237 GET_CURRENT_CONTEXT(ctx
);
6240 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6241 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6243 if (MESA_VERBOSE
&VERBOSE_API
)
6244 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6245 _mesa_lookup_enum_by_nr(mode
));
6248 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6252 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6253 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6257 if (ctx
->ListState
.CurrentListPtr
) {
6258 /* already compiling a display list */
6259 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6263 ctx
->CompileFlag
= GL_TRUE
;
6264 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6266 /* Allocate new display list */
6267 ctx
->ListState
.CurrentListNum
= list
;
6268 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6269 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6270 ctx
->ListState
.CurrentPos
= 0;
6272 /* Reset acumulated list state:
6274 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6275 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6277 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6278 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6280 ctx
->ListState
.ActiveIndex
= 0;
6281 ctx
->ListState
.ActiveEdgeFlag
= 0;
6283 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6284 ctx
->Driver
.NewList( ctx
, list
, mode
);
6286 ctx
->CurrentDispatch
= ctx
->Save
;
6287 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6293 * End definition of current display list.
6296 _mesa_EndList( void )
6298 GET_CURRENT_CONTEXT(ctx
);
6299 SAVE_FLUSH_VERTICES(ctx
);
6300 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6302 if (MESA_VERBOSE
&VERBOSE_API
)
6303 _mesa_debug(ctx
, "glEndList\n");
6305 /* Check that a list is under construction */
6306 if (!ctx
->ListState
.CurrentListPtr
) {
6307 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6311 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6313 /* Destroy old list, if any */
6314 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6315 /* Install the list */
6316 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6319 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6320 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6322 ctx
->ListState
.CurrentListNum
= 0;
6323 ctx
->ListState
.CurrentListPtr
= NULL
;
6324 ctx
->ExecuteFlag
= GL_TRUE
;
6325 ctx
->CompileFlag
= GL_FALSE
;
6327 ctx
->Driver
.EndList( ctx
);
6329 ctx
->CurrentDispatch
= ctx
->Exec
;
6330 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6336 _mesa_CallList( GLuint list
)
6338 GLboolean save_compile_flag
;
6339 GET_CURRENT_CONTEXT(ctx
);
6340 FLUSH_CURRENT(ctx
, 0);
6341 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6342 /* execute the display list, and restore the CompileFlag. */
6344 if (MESA_VERBOSE
& VERBOSE_API
)
6345 _mesa_debug(ctx
, "glCallList %d\n", list
);
6348 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6352 /* mesa_print_display_list( list ); */
6354 save_compile_flag
= ctx
->CompileFlag
;
6355 if (save_compile_flag
) {
6356 ctx
->CompileFlag
= GL_FALSE
;
6359 execute_list( ctx
, list
);
6360 ctx
->CompileFlag
= save_compile_flag
;
6362 /* also restore API function pointers to point to "save" versions */
6363 if (save_compile_flag
) {
6364 ctx
->CurrentDispatch
= ctx
->Save
;
6365 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6372 * Execute glCallLists: call multiple display lists.
6375 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6377 GET_CURRENT_CONTEXT(ctx
);
6380 GLboolean save_compile_flag
;
6382 if (MESA_VERBOSE
& VERBOSE_API
)
6383 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6387 case GL_UNSIGNED_BYTE
:
6389 case GL_UNSIGNED_SHORT
:
6391 case GL_UNSIGNED_INT
:
6399 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6403 /* Save the CompileFlag status, turn it off, execute display list,
6404 * and restore the CompileFlag.
6406 save_compile_flag
= ctx
->CompileFlag
;
6407 ctx
->CompileFlag
= GL_FALSE
;
6410 list
= translate_id( i
, type
, lists
);
6411 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6414 ctx
->CompileFlag
= save_compile_flag
;
6416 /* also restore API function pointers to point to "save" versions */
6417 if (save_compile_flag
) {
6418 ctx
->CurrentDispatch
= ctx
->Save
;
6419 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6426 * Set the offset added to list numbers in glCallLists.
6429 _mesa_ListBase( GLuint base
)
6431 GET_CURRENT_CONTEXT(ctx
);
6432 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6433 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6434 ctx
->List
.ListBase
= base
;
6438 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6440 static void GLAPIENTRY
exec_Finish( void )
6442 GET_CURRENT_CONTEXT(ctx
);
6443 FLUSH_VERTICES(ctx
, 0);
6444 ctx
->Exec
->Finish();
6447 static void GLAPIENTRY
exec_Flush( void )
6449 GET_CURRENT_CONTEXT(ctx
);
6450 FLUSH_VERTICES(ctx
, 0);
6451 ctx
->Exec
->Flush( );
6454 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6456 GET_CURRENT_CONTEXT(ctx
);
6457 FLUSH_VERTICES(ctx
, 0);
6458 ctx
->Exec
->GetBooleanv( pname
, params
);
6461 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6463 GET_CURRENT_CONTEXT(ctx
);
6464 FLUSH_VERTICES(ctx
, 0);
6465 ctx
->Exec
->GetClipPlane( plane
, equation
);
6468 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6470 GET_CURRENT_CONTEXT(ctx
);
6471 FLUSH_VERTICES(ctx
, 0);
6472 ctx
->Exec
->GetDoublev( pname
, params
);
6475 static GLenum GLAPIENTRY
exec_GetError( void )
6477 GET_CURRENT_CONTEXT(ctx
);
6478 FLUSH_VERTICES(ctx
, 0);
6479 return ctx
->Exec
->GetError( );
6482 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6484 GET_CURRENT_CONTEXT(ctx
);
6485 FLUSH_VERTICES(ctx
, 0);
6486 ctx
->Exec
->GetFloatv( pname
, params
);
6489 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6491 GET_CURRENT_CONTEXT(ctx
);
6492 FLUSH_VERTICES(ctx
, 0);
6493 ctx
->Exec
->GetIntegerv( pname
, params
);
6496 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6498 GET_CURRENT_CONTEXT(ctx
);
6499 FLUSH_VERTICES(ctx
, 0);
6500 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6503 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6505 GET_CURRENT_CONTEXT(ctx
);
6506 FLUSH_VERTICES(ctx
, 0);
6507 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6510 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6512 GET_CURRENT_CONTEXT(ctx
);
6513 FLUSH_VERTICES(ctx
, 0);
6514 ctx
->Exec
->GetMapdv( target
, query
, v
);
6517 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6519 GET_CURRENT_CONTEXT(ctx
);
6520 FLUSH_VERTICES(ctx
, 0);
6521 ctx
->Exec
->GetMapfv( target
, query
, v
);
6524 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6526 GET_CURRENT_CONTEXT(ctx
);
6527 FLUSH_VERTICES(ctx
, 0);
6528 ctx
->Exec
->GetMapiv( target
, query
, v
);
6531 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6533 GET_CURRENT_CONTEXT(ctx
);
6534 FLUSH_VERTICES(ctx
, 0);
6535 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6538 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6540 GET_CURRENT_CONTEXT(ctx
);
6541 FLUSH_VERTICES(ctx
, 0);
6542 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6545 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6547 GET_CURRENT_CONTEXT(ctx
);
6548 FLUSH_VERTICES(ctx
, 0);
6549 ctx
->Exec
->GetPixelMapfv( map
, values
);
6552 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6554 GET_CURRENT_CONTEXT(ctx
);
6555 FLUSH_VERTICES(ctx
, 0);
6556 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6559 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6561 GET_CURRENT_CONTEXT(ctx
);
6562 FLUSH_VERTICES(ctx
, 0);
6563 ctx
->Exec
->GetPixelMapusv( map
, values
);
6566 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6568 GET_CURRENT_CONTEXT(ctx
);
6569 FLUSH_VERTICES(ctx
, 0);
6570 ctx
->Exec
->GetPolygonStipple( dest
);
6573 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6575 GET_CURRENT_CONTEXT(ctx
);
6576 FLUSH_VERTICES(ctx
, 0);
6577 return ctx
->Exec
->GetString( name
);
6580 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6582 GET_CURRENT_CONTEXT(ctx
);
6583 FLUSH_VERTICES(ctx
, 0);
6584 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6587 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6589 GET_CURRENT_CONTEXT(ctx
);
6590 FLUSH_VERTICES(ctx
, 0);
6591 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6594 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6596 GET_CURRENT_CONTEXT(ctx
);
6597 FLUSH_VERTICES(ctx
, 0);
6598 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6601 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6603 GET_CURRENT_CONTEXT(ctx
);
6604 FLUSH_VERTICES(ctx
, 0);
6605 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6608 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6610 GET_CURRENT_CONTEXT(ctx
);
6611 FLUSH_VERTICES(ctx
, 0);
6612 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6615 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6616 GLenum type
, GLvoid
*pixels
)
6618 GET_CURRENT_CONTEXT(ctx
);
6619 FLUSH_VERTICES(ctx
, 0);
6620 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6623 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6624 GLenum pname
, GLfloat
*params
)
6626 GET_CURRENT_CONTEXT(ctx
);
6627 FLUSH_VERTICES(ctx
, 0);
6628 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6631 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6632 GLenum pname
, GLint
*params
)
6634 GET_CURRENT_CONTEXT(ctx
);
6635 FLUSH_VERTICES(ctx
, 0);
6636 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6639 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6642 GET_CURRENT_CONTEXT(ctx
);
6643 FLUSH_VERTICES(ctx
, 0);
6644 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6647 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6649 GET_CURRENT_CONTEXT(ctx
);
6650 FLUSH_VERTICES(ctx
, 0);
6651 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6654 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6656 GET_CURRENT_CONTEXT(ctx
);
6657 FLUSH_VERTICES(ctx
, 0);
6658 return ctx
->Exec
->IsEnabled( cap
);
6661 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6663 GET_CURRENT_CONTEXT(ctx
);
6664 FLUSH_VERTICES(ctx
, 0);
6665 ctx
->Exec
->PixelStoref( pname
, param
);
6668 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6670 GET_CURRENT_CONTEXT(ctx
);
6671 FLUSH_VERTICES(ctx
, 0);
6672 ctx
->Exec
->PixelStorei( pname
, param
);
6675 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6676 GLenum format
, GLenum type
, GLvoid
*pixels
)
6678 GET_CURRENT_CONTEXT(ctx
);
6679 FLUSH_VERTICES(ctx
, 0);
6680 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6683 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6685 GET_CURRENT_CONTEXT(ctx
);
6686 FLUSH_VERTICES(ctx
, 0);
6687 return ctx
->Exec
->RenderMode( mode
);
6690 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6692 GET_CURRENT_CONTEXT(ctx
);
6693 FLUSH_VERTICES(ctx
, 0);
6694 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6697 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6699 GET_CURRENT_CONTEXT(ctx
);
6700 FLUSH_VERTICES(ctx
, 0);
6701 ctx
->Exec
->SelectBuffer( size
, buffer
);
6704 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6705 GLboolean
*residences
)
6707 GET_CURRENT_CONTEXT(ctx
);
6708 FLUSH_VERTICES(ctx
, 0);
6709 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6712 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6715 GET_CURRENT_CONTEXT(ctx
);
6716 FLUSH_VERTICES(ctx
, 0);
6717 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6720 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6722 GET_CURRENT_CONTEXT(ctx
);
6723 FLUSH_VERTICES(ctx
, 0);
6724 ctx
->Exec
->DeleteTextures( n
, texName
);
6727 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6729 GET_CURRENT_CONTEXT(ctx
);
6730 FLUSH_VERTICES(ctx
, 0);
6731 ctx
->Exec
->DisableClientState( cap
);
6734 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6736 GET_CURRENT_CONTEXT(ctx
);
6737 FLUSH_VERTICES(ctx
, 0);
6738 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6741 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6743 GET_CURRENT_CONTEXT(ctx
);
6744 FLUSH_VERTICES(ctx
, 0);
6745 ctx
->Exec
->EnableClientState( cap
);
6748 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6750 GET_CURRENT_CONTEXT(ctx
);
6751 FLUSH_VERTICES(ctx
, 0);
6752 ctx
->Exec
->GenTextures( n
, texName
);
6755 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6757 GET_CURRENT_CONTEXT(ctx
);
6758 FLUSH_VERTICES(ctx
, 0);
6759 ctx
->Exec
->GetPointerv( pname
, params
);
6762 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6764 GET_CURRENT_CONTEXT(ctx
);
6765 FLUSH_VERTICES(ctx
, 0);
6766 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6769 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6770 const GLvoid
*pointer
)
6772 GET_CURRENT_CONTEXT(ctx
);
6773 FLUSH_VERTICES(ctx
, 0);
6774 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6777 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6779 GET_CURRENT_CONTEXT(ctx
);
6780 FLUSH_VERTICES(ctx
, 0);
6781 return ctx
->Exec
->IsTexture( texture
);
6784 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6786 GET_CURRENT_CONTEXT(ctx
);
6787 FLUSH_VERTICES(ctx
, 0);
6788 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6791 static void GLAPIENTRY
exec_PopClientAttrib(void)
6793 GET_CURRENT_CONTEXT(ctx
);
6794 FLUSH_VERTICES(ctx
, 0);
6795 ctx
->Exec
->PopClientAttrib();
6798 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6800 GET_CURRENT_CONTEXT(ctx
);
6801 FLUSH_VERTICES(ctx
, 0);
6802 ctx
->Exec
->PushClientAttrib( mask
);
6805 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6808 GET_CURRENT_CONTEXT(ctx
);
6809 FLUSH_VERTICES(ctx
, 0);
6810 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6813 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6816 GET_CURRENT_CONTEXT(ctx
);
6817 FLUSH_VERTICES(ctx
, 0);
6818 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6821 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6824 GET_CURRENT_CONTEXT(ctx
);
6825 FLUSH_VERTICES(ctx
, 0);
6826 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6829 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6830 GLint x
, GLint y
, GLsizei width
)
6832 GET_CURRENT_CONTEXT(ctx
);
6833 FLUSH_VERTICES(ctx
, 0);
6834 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6837 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6838 GLint x
, GLint y
, GLsizei width
,
6841 GET_CURRENT_CONTEXT(ctx
);
6842 FLUSH_VERTICES(ctx
, 0);
6843 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6847 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6848 GLenum type
, GLvoid
*data
)
6850 GET_CURRENT_CONTEXT(ctx
);
6851 FLUSH_VERTICES(ctx
, 0);
6852 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6855 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6858 GET_CURRENT_CONTEXT(ctx
);
6859 FLUSH_VERTICES(ctx
, 0);
6860 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6863 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6866 GET_CURRENT_CONTEXT(ctx
);
6867 FLUSH_VERTICES(ctx
, 0);
6868 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6871 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6874 GET_CURRENT_CONTEXT(ctx
);
6875 FLUSH_VERTICES(ctx
, 0);
6876 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6879 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6882 GET_CURRENT_CONTEXT(ctx
);
6883 FLUSH_VERTICES(ctx
, 0);
6884 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6887 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6890 GET_CURRENT_CONTEXT(ctx
);
6891 FLUSH_VERTICES(ctx
, 0);
6892 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6895 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6896 GLenum type
, GLvoid
*values
)
6898 GET_CURRENT_CONTEXT(ctx
);
6899 FLUSH_VERTICES(ctx
, 0);
6900 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6903 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6906 GET_CURRENT_CONTEXT(ctx
);
6907 FLUSH_VERTICES(ctx
, 0);
6908 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6911 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6914 GET_CURRENT_CONTEXT(ctx
);
6915 FLUSH_VERTICES(ctx
, 0);
6916 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6919 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6920 GLenum type
, GLvoid
*values
)
6922 GET_CURRENT_CONTEXT(ctx
);
6923 FLUSH_VERTICES(ctx
, 0);
6924 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6927 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6930 GET_CURRENT_CONTEXT(ctx
);
6931 FLUSH_VERTICES(ctx
, 0);
6932 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6935 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6938 GET_CURRENT_CONTEXT(ctx
);
6939 FLUSH_VERTICES(ctx
, 0);
6940 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6943 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6944 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6946 GET_CURRENT_CONTEXT(ctx
);
6947 FLUSH_VERTICES(ctx
, 0);
6948 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6951 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6952 GLsizei width
, GLsizei height
, GLenum format
,
6953 GLenum type
, const GLvoid
*row
,
6954 const GLvoid
*column
)
6956 GET_CURRENT_CONTEXT(ctx
);
6957 FLUSH_VERTICES(ctx
, 0);
6958 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6962 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6964 GET_CURRENT_CONTEXT(ctx
);
6965 FLUSH_VERTICES(ctx
, 0);
6966 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6969 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6971 GET_CURRENT_CONTEXT(ctx
);
6972 FLUSH_VERTICES(ctx
, 0);
6973 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6976 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6977 GLsizei count
, const GLvoid
*ptr
)
6979 GET_CURRENT_CONTEXT(ctx
);
6980 FLUSH_VERTICES(ctx
, 0);
6981 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6984 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6985 const GLboolean
*ptr
)
6987 GET_CURRENT_CONTEXT(ctx
);
6988 FLUSH_VERTICES(ctx
, 0);
6989 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6992 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6995 GET_CURRENT_CONTEXT(ctx
);
6996 FLUSH_VERTICES(ctx
, 0);
6997 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
7000 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7003 GET_CURRENT_CONTEXT(ctx
);
7004 FLUSH_VERTICES(ctx
, 0);
7005 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
7008 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7009 GLsizei count
, const GLvoid
*ptr
)
7011 GET_CURRENT_CONTEXT(ctx
);
7012 FLUSH_VERTICES(ctx
, 0);
7013 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
7016 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7017 GLsizei count
, const GLvoid
*ptr
)
7019 GET_CURRENT_CONTEXT(ctx
);
7020 FLUSH_VERTICES(ctx
, 0);
7021 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
7024 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
7026 GET_CURRENT_CONTEXT(ctx
);
7027 FLUSH_VERTICES(ctx
, 0);
7028 ctx
->Exec
->LockArraysEXT( first
, count
);
7031 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
7033 GET_CURRENT_CONTEXT(ctx
);
7034 FLUSH_VERTICES(ctx
, 0);
7035 ctx
->Exec
->UnlockArraysEXT( );
7038 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
7040 GET_CURRENT_CONTEXT(ctx
);
7041 FLUSH_VERTICES(ctx
, 0);
7042 ctx
->Exec
->ResizeBuffersMESA( );
7046 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
7048 GET_CURRENT_CONTEXT(ctx
);
7049 FLUSH_VERTICES(ctx
, 0);
7050 ctx
->Exec
->ClientActiveTextureARB(target
);
7053 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7054 GLsizei stride
, const GLvoid
*ptr
)
7056 GET_CURRENT_CONTEXT(ctx
);
7057 FLUSH_VERTICES(ctx
, 0);
7058 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
7061 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
7064 GET_CURRENT_CONTEXT(ctx
);
7065 FLUSH_VERTICES(ctx
, 0);
7066 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
7069 /* GL_EXT_multi_draw_arrays */
7070 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
7071 GLsizei
*count
, GLsizei primcount
)
7073 GET_CURRENT_CONTEXT(ctx
);
7074 FLUSH_VERTICES(ctx
, 0);
7075 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
7078 /* GL_EXT_multi_draw_arrays */
7079 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
7080 GLenum type
, const GLvoid
**indices
,
7083 GET_CURRENT_CONTEXT(ctx
);
7084 FLUSH_VERTICES(ctx
, 0);
7085 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
7088 /* GL_IBM_multimode_draw_arrays */
7089 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
7090 const GLsizei
*count
, GLsizei primcount
,
7093 GET_CURRENT_CONTEXT(ctx
);
7094 FLUSH_VERTICES(ctx
, 0);
7095 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
7098 /* GL_IBM_multimode_draw_arrays */
7099 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7100 const GLsizei
*count
,
7102 const GLvoid
* const *indices
,
7103 GLsizei primcount
, GLint modestride
)
7105 GET_CURRENT_CONTEXT(ctx
);
7106 FLUSH_VERTICES(ctx
, 0);
7107 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
7115 * Setup the given dispatch table to point to Mesa's display list
7116 * building functions.
7118 * This does not include any of the tnl functions - they are
7119 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7123 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
7125 _mesa_init_no_op_table(table
, tableSize
);
7127 _mesa_loopback_init_api_table( table
);
7130 table
->Accum
= save_Accum
;
7131 table
->AlphaFunc
= save_AlphaFunc
;
7132 table
->Bitmap
= save_Bitmap
;
7133 table
->BlendFunc
= _mesa_BlendFunc
; /* loops-back to BlendFuncSeparate */
7134 table
->CallList
= _mesa_save_CallList
;
7135 table
->CallLists
= _mesa_save_CallLists
;
7136 table
->Clear
= save_Clear
;
7137 table
->ClearAccum
= save_ClearAccum
;
7138 table
->ClearColor
= save_ClearColor
;
7139 table
->ClearDepth
= save_ClearDepth
;
7140 table
->ClearIndex
= save_ClearIndex
;
7141 table
->ClearStencil
= save_ClearStencil
;
7142 table
->ClipPlane
= save_ClipPlane
;
7143 table
->ColorMask
= save_ColorMask
;
7144 table
->ColorMaterial
= save_ColorMaterial
;
7145 table
->CopyPixels
= save_CopyPixels
;
7146 table
->CullFace
= save_CullFace
;
7147 table
->DeleteLists
= _mesa_DeleteLists
;
7148 table
->DepthFunc
= save_DepthFunc
;
7149 table
->DepthMask
= save_DepthMask
;
7150 table
->DepthRange
= save_DepthRange
;
7151 table
->Disable
= save_Disable
;
7152 table
->DrawBuffer
= save_DrawBuffer
;
7153 table
->DrawPixels
= save_DrawPixels
;
7154 table
->Enable
= save_Enable
;
7155 table
->EndList
= _mesa_EndList
;
7156 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7157 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7158 table
->Finish
= exec_Finish
;
7159 table
->Flush
= exec_Flush
;
7160 table
->Fogf
= save_Fogf
;
7161 table
->Fogfv
= save_Fogfv
;
7162 table
->Fogi
= save_Fogi
;
7163 table
->Fogiv
= save_Fogiv
;
7164 table
->FrontFace
= save_FrontFace
;
7165 table
->Frustum
= save_Frustum
;
7166 table
->GenLists
= _mesa_GenLists
;
7167 table
->GetBooleanv
= exec_GetBooleanv
;
7168 table
->GetClipPlane
= exec_GetClipPlane
;
7169 table
->GetDoublev
= exec_GetDoublev
;
7170 table
->GetError
= exec_GetError
;
7171 table
->GetFloatv
= exec_GetFloatv
;
7172 table
->GetIntegerv
= exec_GetIntegerv
;
7173 table
->GetLightfv
= exec_GetLightfv
;
7174 table
->GetLightiv
= exec_GetLightiv
;
7175 table
->GetMapdv
= exec_GetMapdv
;
7176 table
->GetMapfv
= exec_GetMapfv
;
7177 table
->GetMapiv
= exec_GetMapiv
;
7178 table
->GetMaterialfv
= exec_GetMaterialfv
;
7179 table
->GetMaterialiv
= exec_GetMaterialiv
;
7180 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7181 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7182 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7183 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7184 table
->GetString
= exec_GetString
;
7185 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7186 table
->GetTexEnviv
= exec_GetTexEnviv
;
7187 table
->GetTexGendv
= exec_GetTexGendv
;
7188 table
->GetTexGenfv
= exec_GetTexGenfv
;
7189 table
->GetTexGeniv
= exec_GetTexGeniv
;
7190 table
->GetTexImage
= exec_GetTexImage
;
7191 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7192 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7193 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7194 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7195 table
->Hint
= save_Hint
;
7196 table
->IndexMask
= save_IndexMask
;
7197 table
->InitNames
= save_InitNames
;
7198 table
->IsEnabled
= exec_IsEnabled
;
7199 table
->IsList
= _mesa_IsList
;
7200 table
->LightModelf
= save_LightModelf
;
7201 table
->LightModelfv
= save_LightModelfv
;
7202 table
->LightModeli
= save_LightModeli
;
7203 table
->LightModeliv
= save_LightModeliv
;
7204 table
->Lightf
= save_Lightf
;
7205 table
->Lightfv
= save_Lightfv
;
7206 table
->Lighti
= save_Lighti
;
7207 table
->Lightiv
= save_Lightiv
;
7208 table
->LineStipple
= save_LineStipple
;
7209 table
->LineWidth
= save_LineWidth
;
7210 table
->ListBase
= save_ListBase
;
7211 table
->LoadIdentity
= save_LoadIdentity
;
7212 table
->LoadMatrixd
= save_LoadMatrixd
;
7213 table
->LoadMatrixf
= save_LoadMatrixf
;
7214 table
->LoadName
= save_LoadName
;
7215 table
->LogicOp
= save_LogicOp
;
7216 table
->Map1d
= save_Map1d
;
7217 table
->Map1f
= save_Map1f
;
7218 table
->Map2d
= save_Map2d
;
7219 table
->Map2f
= save_Map2f
;
7220 table
->MapGrid1d
= save_MapGrid1d
;
7221 table
->MapGrid1f
= save_MapGrid1f
;
7222 table
->MapGrid2d
= save_MapGrid2d
;
7223 table
->MapGrid2f
= save_MapGrid2f
;
7224 table
->MatrixMode
= save_MatrixMode
;
7225 table
->MultMatrixd
= save_MultMatrixd
;
7226 table
->MultMatrixf
= save_MultMatrixf
;
7227 table
->NewList
= save_NewList
;
7228 table
->Ortho
= save_Ortho
;
7229 table
->PassThrough
= save_PassThrough
;
7230 table
->PixelMapfv
= save_PixelMapfv
;
7231 table
->PixelMapuiv
= save_PixelMapuiv
;
7232 table
->PixelMapusv
= save_PixelMapusv
;
7233 table
->PixelStoref
= exec_PixelStoref
;
7234 table
->PixelStorei
= exec_PixelStorei
;
7235 table
->PixelTransferf
= save_PixelTransferf
;
7236 table
->PixelTransferi
= save_PixelTransferi
;
7237 table
->PixelZoom
= save_PixelZoom
;
7238 table
->PointSize
= save_PointSize
;
7239 table
->PolygonMode
= save_PolygonMode
;
7240 table
->PolygonOffset
= save_PolygonOffset
;
7241 table
->PolygonStipple
= save_PolygonStipple
;
7242 table
->PopAttrib
= save_PopAttrib
;
7243 table
->PopMatrix
= save_PopMatrix
;
7244 table
->PopName
= save_PopName
;
7245 table
->PushAttrib
= save_PushAttrib
;
7246 table
->PushMatrix
= save_PushMatrix
;
7247 table
->PushName
= save_PushName
;
7248 table
->RasterPos2d
= save_RasterPos2d
;
7249 table
->RasterPos2dv
= save_RasterPos2dv
;
7250 table
->RasterPos2f
= save_RasterPos2f
;
7251 table
->RasterPos2fv
= save_RasterPos2fv
;
7252 table
->RasterPos2i
= save_RasterPos2i
;
7253 table
->RasterPos2iv
= save_RasterPos2iv
;
7254 table
->RasterPos2s
= save_RasterPos2s
;
7255 table
->RasterPos2sv
= save_RasterPos2sv
;
7256 table
->RasterPos3d
= save_RasterPos3d
;
7257 table
->RasterPos3dv
= save_RasterPos3dv
;
7258 table
->RasterPos3f
= save_RasterPos3f
;
7259 table
->RasterPos3fv
= save_RasterPos3fv
;
7260 table
->RasterPos3i
= save_RasterPos3i
;
7261 table
->RasterPos3iv
= save_RasterPos3iv
;
7262 table
->RasterPos3s
= save_RasterPos3s
;
7263 table
->RasterPos3sv
= save_RasterPos3sv
;
7264 table
->RasterPos4d
= save_RasterPos4d
;
7265 table
->RasterPos4dv
= save_RasterPos4dv
;
7266 table
->RasterPos4f
= save_RasterPos4f
;
7267 table
->RasterPos4fv
= save_RasterPos4fv
;
7268 table
->RasterPos4i
= save_RasterPos4i
;
7269 table
->RasterPos4iv
= save_RasterPos4iv
;
7270 table
->RasterPos4s
= save_RasterPos4s
;
7271 table
->RasterPos4sv
= save_RasterPos4sv
;
7272 table
->ReadBuffer
= save_ReadBuffer
;
7273 table
->ReadPixels
= exec_ReadPixels
;
7274 table
->RenderMode
= exec_RenderMode
;
7275 table
->Rotated
= save_Rotated
;
7276 table
->Rotatef
= save_Rotatef
;
7277 table
->Scaled
= save_Scaled
;
7278 table
->Scalef
= save_Scalef
;
7279 table
->Scissor
= save_Scissor
;
7280 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7281 table
->SelectBuffer
= exec_SelectBuffer
;
7282 table
->ShadeModel
= save_ShadeModel
;
7283 table
->StencilFunc
= save_StencilFunc
;
7284 table
->StencilMask
= save_StencilMask
;
7285 table
->StencilOp
= save_StencilOp
;
7286 table
->TexEnvf
= save_TexEnvf
;
7287 table
->TexEnvfv
= save_TexEnvfv
;
7288 table
->TexEnvi
= save_TexEnvi
;
7289 table
->TexEnviv
= save_TexEnviv
;
7290 table
->TexGend
= save_TexGend
;
7291 table
->TexGendv
= save_TexGendv
;
7292 table
->TexGenf
= save_TexGenf
;
7293 table
->TexGenfv
= save_TexGenfv
;
7294 table
->TexGeni
= save_TexGeni
;
7295 table
->TexGeniv
= save_TexGeniv
;
7296 table
->TexImage1D
= save_TexImage1D
;
7297 table
->TexImage2D
= save_TexImage2D
;
7298 table
->TexParameterf
= save_TexParameterf
;
7299 table
->TexParameterfv
= save_TexParameterfv
;
7300 table
->TexParameteri
= save_TexParameteri
;
7301 table
->TexParameteriv
= save_TexParameteriv
;
7302 table
->Translated
= save_Translated
;
7303 table
->Translatef
= save_Translatef
;
7304 table
->Viewport
= save_Viewport
;
7307 table
->AreTexturesResident
= exec_AreTexturesResident
;
7308 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7309 table
->BindTexture
= save_BindTexture
;
7310 table
->ColorPointer
= exec_ColorPointer
;
7311 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7312 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7313 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7314 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7315 table
->DeleteTextures
= exec_DeleteTextures
;
7316 table
->DisableClientState
= exec_DisableClientState
;
7317 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7318 table
->EnableClientState
= exec_EnableClientState
;
7319 table
->GenTextures
= exec_GenTextures
;
7320 table
->GenTexturesEXT
= exec_GenTextures
;
7321 table
->GetPointerv
= exec_GetPointerv
;
7322 table
->IndexPointer
= exec_IndexPointer
;
7323 table
->InterleavedArrays
= exec_InterleavedArrays
;
7324 table
->IsTexture
= exec_IsTexture
;
7325 table
->IsTextureEXT
= exec_IsTexture
;
7326 table
->NormalPointer
= exec_NormalPointer
;
7327 table
->PopClientAttrib
= exec_PopClientAttrib
;
7328 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7329 table
->PushClientAttrib
= exec_PushClientAttrib
;
7330 table
->TexCoordPointer
= exec_TexCoordPointer
;
7331 table
->TexSubImage1D
= save_TexSubImage1D
;
7332 table
->TexSubImage2D
= save_TexSubImage2D
;
7333 table
->VertexPointer
= exec_VertexPointer
;
7336 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7337 table
->TexImage3D
= save_TexImage3D
;
7338 table
->TexSubImage3D
= save_TexSubImage3D
;
7340 /* GL_ARB_imaging */
7341 /* Not all are supported */
7342 table
->BlendColor
= save_BlendColor
;
7343 table
->BlendEquation
= save_BlendEquation
;
7344 table
->ColorSubTable
= save_ColorSubTable
;
7345 table
->ColorTable
= save_ColorTable
;
7346 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7347 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7348 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7349 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7350 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7351 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7352 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7353 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7354 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7355 table
->CopyColorTable
= save_CopyColorTable
;
7356 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7357 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7358 table
->GetColorTable
= exec_GetColorTable
;
7359 table
->GetColorTableEXT
= exec_GetColorTable
;
7360 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7361 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7362 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7363 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7364 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7365 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7366 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7367 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7368 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7369 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7370 table
->GetHistogram
= exec_GetHistogram
;
7371 table
->GetHistogramEXT
= exec_GetHistogram
;
7372 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7373 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7374 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7375 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7376 table
->GetMinmax
= exec_GetMinmax
;
7377 table
->GetMinmaxEXT
= exec_GetMinmax
;
7378 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7379 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7380 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7381 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7382 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7383 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7384 table
->Histogram
= save_Histogram
;
7385 table
->Minmax
= save_Minmax
;
7386 table
->ResetHistogram
= save_ResetHistogram
;
7387 table
->ResetMinmax
= save_ResetMinmax
;
7388 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7390 /* 2. GL_EXT_blend_color */
7392 table
->BlendColorEXT
= save_BlendColorEXT
;
7395 /* 3. GL_EXT_polygon_offset */
7396 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7398 /* 6. GL_EXT_texture3d */
7400 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7401 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7402 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7405 /* 15. GL_SGIX_pixel_texture */
7406 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7408 /* 15. GL_SGIS_pixel_texture */
7409 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7410 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7411 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7412 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7413 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7414 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7416 /* 30. GL_EXT_vertex_array */
7417 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7418 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7419 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7420 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7421 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7422 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7424 /* 37. GL_EXT_blend_minmax */
7426 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7429 /* 54. GL_EXT_point_parameters */
7430 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7431 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7433 /* 78. GL_EXT_paletted_texture */
7435 table
->ColorTableEXT
= save_ColorTable
;
7436 table
->ColorSubTableEXT
= save_ColorSubTable
;
7438 table
->GetColorTableEXT
= exec_GetColorTable
;
7439 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7440 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7442 /* 97. GL_EXT_compiled_vertex_array */
7443 table
->LockArraysEXT
= exec_LockArraysEXT
;
7444 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7446 /* 145. GL_EXT_secondary_color */
7447 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7449 /* 148. GL_EXT_multi_draw_arrays */
7450 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7451 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7453 /* 149. GL_EXT_fog_coord */
7454 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7456 /* 173. GL_EXT_blend_func_separate */
7457 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7459 /* 196. GL_MESA_resize_buffers */
7460 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7462 /* 197. GL_MESA_window_pos */
7463 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7464 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7465 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7466 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7467 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7468 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7469 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7470 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7471 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7472 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7473 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7474 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7475 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7476 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7477 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7478 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7479 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7480 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7481 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7482 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7483 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7484 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7485 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7486 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7488 /* 200. GL_IBM_multimode_draw_arrays */
7489 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7490 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7492 #if FEATURE_NV_vertex_program
7493 /* 233. GL_NV_vertex_program */
7494 /* The following commands DO NOT go into display lists:
7495 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7496 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7498 table
->BindProgramNV
= save_BindProgramNV
;
7499 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7500 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7501 table
->GenProgramsNV
= _mesa_GenPrograms
;
7502 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7503 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7504 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7505 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7506 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7507 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7508 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7509 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7510 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7511 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7512 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7513 table
->IsProgramNV
= _mesa_IsProgram
;
7514 table
->LoadProgramNV
= save_LoadProgramNV
;
7515 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7516 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7517 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7518 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7519 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7520 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7521 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7522 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7525 /* 282. GL_NV_fragment_program */
7526 #if FEATURE_NV_fragment_program
7527 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7528 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7529 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7530 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7531 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7532 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7533 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7534 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7535 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7536 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7537 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7538 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7541 /* 262. GL_NV_point_sprite */
7542 table
->PointParameteriNV
= save_PointParameteriNV
;
7543 table
->PointParameterivNV
= save_PointParameterivNV
;
7545 /* 268. GL_EXT_stencil_two_side */
7546 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7548 /* ???. GL_EXT_depth_bounds_test */
7549 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7551 /* ARB 1. GL_ARB_multitexture */
7552 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7553 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7555 /* ARB 3. GL_ARB_transpose_matrix */
7556 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7557 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7558 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7559 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7561 /* ARB 5. GL_ARB_multisample */
7562 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7564 /* ARB 12. GL_ARB_texture_compression */
7565 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7566 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7567 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7568 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7569 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7570 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7571 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7573 /* ARB 14. GL_ARB_point_parameters */
7574 /* aliased with EXT_point_parameters functions */
7576 /* ARB 25. GL_ARB_window_pos */
7577 /* aliased with MESA_window_pos functions */
7579 /* ARB 26. GL_ARB_vertex_program */
7580 /* ARB 27. GL_ARB_fragment_program */
7581 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7582 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7583 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7584 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7585 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7586 table
->ProgramStringARB
= save_ProgramStringARB
;
7587 table
->BindProgramNV
= save_BindProgramNV
;
7588 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7589 table
->GenProgramsNV
= _mesa_GenPrograms
;
7590 table
->IsProgramNV
= _mesa_IsProgram
;
7591 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7592 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7593 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7594 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7595 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7596 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7597 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7598 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7599 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7600 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7601 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7602 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7603 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7604 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7605 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7606 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7607 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7608 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7611 /* ARB 28. GL_ARB_vertex_buffer_object */
7612 #if FEATURE_ARB_vertex_buffer_object
7613 /* None of the extension's functions get compiled */
7614 table
->BindBufferARB
= _mesa_BindBufferARB
;
7615 table
->BufferDataARB
= _mesa_BufferDataARB
;
7616 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7617 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7618 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7619 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7620 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7621 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7622 table
->IsBufferARB
= _mesa_IsBufferARB
;
7623 table
->MapBufferARB
= _mesa_MapBufferARB
;
7624 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7627 #if FEATURE_ARB_occlusion_query
7628 table
->BeginQueryARB
= save_BeginQueryARB
;
7629 table
->EndQueryARB
= save_EndQueryARB
;
7630 table
->GenQueriesARB
= _mesa_GenQueriesARB
;
7631 table
->DeleteQueriesARB
= _mesa_DeleteQueriesARB
;
7632 table
->IsQueryARB
= _mesa_IsQueryARB
;
7633 table
->GetQueryivARB
= _mesa_GetQueryivARB
;
7634 table
->GetQueryObjectivARB
= _mesa_GetQueryObjectivARB
;
7635 table
->GetQueryObjectuivARB
= _mesa_GetQueryObjectuivARB
;
7638 /* 299. GL_EXT_blend_equation_separate */
7639 table
->BlendEquationSeparateEXT
= save_BlendEquationSeparateEXT
;
7647 static const char *enum_string( GLenum k
)
7649 return _mesa_lookup_enum_by_nr( k
);
7654 * Print the commands in a display list. For debugging only.
7655 * TODO: many commands aren't handled yet.
7657 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7662 if (!glIsList(list
)) {
7663 _mesa_printf("%u is not a display list ID\n", list
);
7667 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7669 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7671 done
= n
? GL_FALSE
: GL_TRUE
;
7673 OpCode opcode
= n
[0].opcode
;
7674 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
7676 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
7677 /* this is a driver-extended opcode */
7678 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
7679 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
7684 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7687 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7688 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7690 case OPCODE_CALL_LIST
:
7691 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7693 case OPCODE_CALL_LIST_OFFSET
:
7694 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7695 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7697 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7698 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7699 enum_string(n
[1].e
), enum_string(n
[2].e
),
7700 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7702 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7703 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7704 enum_string(n
[1].e
), enum_string(n
[2].e
),
7705 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7707 case OPCODE_DISABLE
:
7708 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7711 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7713 case OPCODE_FRUSTUM
:
7714 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7715 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7717 case OPCODE_LINE_STIPPLE
:
7718 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7720 case OPCODE_LOAD_IDENTITY
:
7721 _mesa_printf("LoadIdentity\n");
7723 case OPCODE_LOAD_MATRIX
:
7724 _mesa_printf("LoadMatrix\n");
7725 _mesa_printf(" %8f %8f %8f %8f\n",
7726 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7727 _mesa_printf(" %8f %8f %8f %8f\n",
7728 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7729 _mesa_printf(" %8f %8f %8f %8f\n",
7730 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7731 _mesa_printf(" %8f %8f %8f %8f\n",
7732 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7734 case OPCODE_MULT_MATRIX
:
7735 _mesa_printf("MultMatrix (or Rotate)\n");
7736 _mesa_printf(" %8f %8f %8f %8f\n",
7737 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7738 _mesa_printf(" %8f %8f %8f %8f\n",
7739 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7740 _mesa_printf(" %8f %8f %8f %8f\n",
7741 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7742 _mesa_printf(" %8f %8f %8f %8f\n",
7743 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7746 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7747 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7749 case OPCODE_POP_ATTRIB
:
7750 _mesa_printf("PopAttrib\n");
7752 case OPCODE_POP_MATRIX
:
7753 _mesa_printf("PopMatrix\n");
7755 case OPCODE_POP_NAME
:
7756 _mesa_printf("PopName\n");
7758 case OPCODE_PUSH_ATTRIB
:
7759 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7761 case OPCODE_PUSH_MATRIX
:
7762 _mesa_printf("PushMatrix\n");
7764 case OPCODE_PUSH_NAME
:
7765 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7767 case OPCODE_RASTER_POS
:
7768 _mesa_printf("RasterPos %g %g %g %g\n",
7769 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7772 _mesa_printf("Rotate %g %g %g %g\n",
7773 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7776 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7778 case OPCODE_TRANSLATE
:
7779 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7781 case OPCODE_BIND_TEXTURE
:
7782 _mesa_printf("BindTexture %s %d\n",
7783 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7785 case OPCODE_SHADE_MODEL
:
7786 _mesa_printf("ShadeModel %s\n",
7787 _mesa_lookup_enum_by_nr(n
[1].ui
));
7790 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7791 _mesa_lookup_enum_by_nr(n
[1].ui
),
7792 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7795 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7796 _mesa_lookup_enum_by_nr(n
[1].ui
),
7797 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7798 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7800 case OPCODE_MAPGRID1
:
7801 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7802 n
[1].i
, n
[2].f
, n
[3].f
);
7804 case OPCODE_MAPGRID2
:
7805 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7806 n
[1].i
, n
[2].f
, n
[3].f
,
7807 n
[4].i
, n
[5].f
, n
[6].f
);
7809 case OPCODE_EVALMESH1
:
7810 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7812 case OPCODE_EVALMESH2
:
7813 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7814 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7819 case OPCODE_ATTR_1F
:
7820 _mesa_printf("ATTR_1F attr %d: %f\n",
7823 case OPCODE_ATTR_2F
:
7824 _mesa_printf("ATTR_2F attr %d: %f %f\n",
7825 n
[1].i
, n
[2].f
, n
[3].f
);
7827 case OPCODE_ATTR_3F
:
7828 _mesa_printf("ATTR_3F attr %d: %f %f %f\n",
7829 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
7831 case OPCODE_ATTR_4F
:
7832 _mesa_printf("ATTR_4F attr %d: %f %f %f %f\n",
7833 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
7835 case OPCODE_MATERIAL
:
7836 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
7837 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7840 _mesa_printf("INDEX: %f\n", n
[1].f
);
7842 case OPCODE_EDGEFLAG
:
7843 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
7846 _mesa_printf("BEGIN %x\n", n
[1].i
);
7849 _mesa_printf("END\n");
7852 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7854 case OPCODE_EVAL_C1
:
7855 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
7857 case OPCODE_EVAL_C2
:
7858 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
7860 case OPCODE_EVAL_P1
:
7861 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
7863 case OPCODE_EVAL_P2
:
7864 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
7870 * meta opcodes/commands
7873 _mesa_printf("Error: %s %s\n",
7874 enum_string(n
[1].e
), (const char *)n
[2].data
);
7876 case OPCODE_CONTINUE
:
7877 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7878 n
= (Node
*) n
[1].next
;
7880 case OPCODE_END_OF_LIST
:
7881 _mesa_printf("END-LIST %u\n", list
);
7885 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7886 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7891 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7894 /* increment n to point to next compiled command */
7895 if (opcode
!=OPCODE_CONTINUE
) {
7896 n
+= InstSize
[opcode
];
7905 * Clients may call this function to help debug display list problems.
7906 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7907 * changed, or break in the future without notice.
7909 void mesa_print_display_list( GLuint list
)
7911 GET_CURRENT_CONTEXT(ctx
);
7912 print_list( ctx
, list
);
7916 /**********************************************************************/
7917 /***** Initialization *****/
7918 /**********************************************************************/
7921 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7923 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7924 vfmt
->Begin
= save_Begin
;
7925 vfmt
->CallList
= _mesa_save_CallList
;
7926 vfmt
->CallLists
= _mesa_save_CallLists
;
7927 vfmt
->Color3f
= save_Color3f
;
7928 vfmt
->Color3fv
= save_Color3fv
;
7929 vfmt
->Color4f
= save_Color4f
;
7930 vfmt
->Color4fv
= save_Color4fv
;
7931 vfmt
->EdgeFlag
= save_EdgeFlag
;
7932 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7933 vfmt
->End
= save_End
;
7934 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7935 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7936 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7937 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7938 vfmt
->EvalPoint1
= save_EvalPoint1
;
7939 vfmt
->EvalPoint2
= save_EvalPoint2
;
7940 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7941 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7942 vfmt
->Indexf
= save_Indexf
;
7943 vfmt
->Indexfv
= save_Indexfv
;
7944 vfmt
->Materialfv
= save_Materialfv
;
7945 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7946 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7947 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7948 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7949 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7950 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7951 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7952 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7953 vfmt
->Normal3f
= save_Normal3f
;
7954 vfmt
->Normal3fv
= save_Normal3fv
;
7955 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7956 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7957 vfmt
->TexCoord1f
= save_TexCoord1f
;
7958 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7959 vfmt
->TexCoord2f
= save_TexCoord2f
;
7960 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7961 vfmt
->TexCoord3f
= save_TexCoord3f
;
7962 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7963 vfmt
->TexCoord4f
= save_TexCoord4f
;
7964 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7965 vfmt
->Vertex2f
= save_Vertex2f
;
7966 vfmt
->Vertex2fv
= save_Vertex2fv
;
7967 vfmt
->Vertex3f
= save_Vertex3f
;
7968 vfmt
->Vertex3fv
= save_Vertex3fv
;
7969 vfmt
->Vertex4f
= save_Vertex4f
;
7970 vfmt
->Vertex4fv
= save_Vertex4fv
;
7971 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7972 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7973 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7974 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7975 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7976 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7977 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7978 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7980 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7981 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7982 vfmt
->Rectf
= save_Rectf
;
7984 /* The driver is required to implement these as
7985 * 1) They can probably do a better job.
7986 * 2) A lot of new mechanisms would have to be added to this module
7987 * to support it. That code would probably never get used,
7991 vfmt
->DrawArrays
= 0;
7992 vfmt
->DrawElements
= 0;
7993 vfmt
->DrawRangeElements
= 0;
7999 void _mesa_init_display_list( GLcontext
* ctx
)
8002 ctx
->ListState
.CallDepth
= 0;
8003 ctx
->ExecuteFlag
= GL_TRUE
;
8004 ctx
->CompileFlag
= GL_FALSE
;
8005 ctx
->ListState
.CurrentListPtr
= NULL
;
8006 ctx
->ListState
.CurrentBlock
= NULL
;
8007 ctx
->ListState
.CurrentListNum
= 0;
8008 ctx
->ListState
.CurrentPos
= 0;
8010 /* Display List group */
8011 ctx
->List
.ListBase
= 0;
8013 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);