2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
56 #include "extensions.h"
61 #include "histogram.h"
78 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
79 #include "nvprogram.h"
83 #include "math/m_matrix.h"
84 #include "math/m_xform.h"
90 * \param ctx GL context.
92 * Checks if dd_function_table::SaveNeedFlush is marked to flush
93 * stored (save) vertices, and calls
94 * dd_function_table::SaveFlushVertices if so.
96 #define SAVE_FLUSH_VERTICES(ctx) \
98 if (ctx->Driver.SaveNeedFlush) \
99 ctx->Driver.SaveFlushVertices(ctx); \
104 * Macro to assert that the API call was made outside the
105 * glBegin()/glEnd() pair, with return value.
107 * \param ctx GL context.
108 * \param retval value to return value in case the assertion fails.
110 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
112 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
113 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
114 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
120 * Macro to assert that the API call was made outside the
121 * glBegin()/glEnd() pair.
123 * \param ctx GL context.
125 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
127 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
128 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
129 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
135 * Macro to assert that the API call was made outside the
136 * glBegin()/glEnd() pair and flush the vertices.
138 * \param ctx GL context.
140 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
142 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
143 SAVE_FLUSH_VERTICES(ctx); \
147 * Macro to assert that the API call was made outside the
148 * glBegin()/glEnd() pair and flush the vertices, with return value.
150 * \param ctx GL context.
151 * \param retval value to return value in case the assertion fails.
153 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
155 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
156 SAVE_FLUSH_VERTICES(ctx); \
162 * Display list opcodes.
164 * The fact that these identifiers are assigned consecutive
165 * integer values starting at 0 is very important, see InstSize array usage)
168 OPCODE_INVALID
= -1, /* Force signed enum */
174 OPCODE_BLEND_EQUATION
,
175 OPCODE_BLEND_EQUATION_SEPARATE
,
176 OPCODE_BLEND_FUNC_SEPARATE
,
178 OPCODE_CALL_LIST_OFFSET
,
184 OPCODE_CLEAR_STENCIL
,
187 OPCODE_COLOR_MATERIAL
,
189 OPCODE_COLOR_TABLE_PARAMETER_FV
,
190 OPCODE_COLOR_TABLE_PARAMETER_IV
,
191 OPCODE_COLOR_SUB_TABLE
,
192 OPCODE_CONVOLUTION_FILTER_1D
,
193 OPCODE_CONVOLUTION_FILTER_2D
,
194 OPCODE_CONVOLUTION_PARAMETER_I
,
195 OPCODE_CONVOLUTION_PARAMETER_IV
,
196 OPCODE_CONVOLUTION_PARAMETER_F
,
197 OPCODE_CONVOLUTION_PARAMETER_FV
,
198 OPCODE_COPY_COLOR_SUB_TABLE
,
199 OPCODE_COPY_COLOR_TABLE
,
201 OPCODE_COPY_TEX_IMAGE1D
,
202 OPCODE_COPY_TEX_IMAGE2D
,
203 OPCODE_COPY_TEX_SUB_IMAGE1D
,
204 OPCODE_COPY_TEX_SUB_IMAGE2D
,
205 OPCODE_COPY_TEX_SUB_IMAGE3D
,
228 OPCODE_LOAD_IDENTITY
,
242 OPCODE_PIXEL_TRANSFER
,
245 OPCODE_POINT_PARAMETERS
,
247 OPCODE_POLYGON_STIPPLE
,
248 OPCODE_POLYGON_OFFSET
,
252 OPCODE_PRIORITIZE_TEXTURE
,
258 OPCODE_RESET_HISTOGRAM
,
259 OPCODE_RESET_MIN_MAX
,
263 OPCODE_SELECT_TEXTURE_SGIS
,
264 OPCODE_SELECT_TEXTURE_COORD_SET
,
275 OPCODE_TEX_SUB_IMAGE1D
,
276 OPCODE_TEX_SUB_IMAGE2D
,
277 OPCODE_TEX_SUB_IMAGE3D
,
281 /* GL_ARB_multitexture */
282 OPCODE_ACTIVE_TEXTURE
,
283 /* GL_SGIX/SGIS_pixel_texture */
284 OPCODE_PIXEL_TEXGEN_SGIX
,
285 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
286 /* GL_ARB_texture_compression */
287 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
288 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
289 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
290 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
291 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
292 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
293 /* GL_ARB_multisample */
294 OPCODE_SAMPLE_COVERAGE
,
295 /* GL_ARB_window_pos */
296 OPCODE_WINDOW_POS_ARB
,
297 /* GL_NV_vertex_program */
298 OPCODE_BIND_PROGRAM_NV
,
299 OPCODE_EXECUTE_PROGRAM_NV
,
300 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
301 OPCODE_LOAD_PROGRAM_NV
,
302 OPCODE_PROGRAM_PARAMETER4F_NV
,
303 OPCODE_TRACK_MATRIX_NV
,
304 /* GL_NV_fragment_program */
305 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
306 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
307 /* GL_EXT_stencil_two_side */
308 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
309 /* GL_EXT_depth_bounds_test */
310 OPCODE_DEPTH_BOUNDS_EXT
,
311 /* GL_ARB_vertex/fragment_program */
312 OPCODE_PROGRAM_STRING_ARB
,
313 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
314 /* GL_ARB_occlusion_query */
315 OPCODE_BEGIN_QUERY_ARB
,
316 OPCODE_END_QUERY_ARB
,
317 /* GL_ARB_draw_buffers */
318 OPCODE_DRAW_BUFFERS_ARB
,
320 /* Vertex attributes -- fallback for when optimized display
321 * list build isn't active.
339 /* The following three are meta instructions */
340 OPCODE_ERROR
, /* raise compiled-in error */
351 * Display list instructions are stored as sequences of "nodes". Nodes
352 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
353 * are linked together with a pointer.
355 * Each instruction in the display list is stored as a sequence of
356 * contiguous nodes in memory.
357 * Each node is the union of a variety of data types.
371 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
376 * How many nodes to allocate at a time.
378 * \note Reduced now that we hold vertices etc. elsewhere.
380 #define BLOCK_SIZE 256
385 * Number of nodes of storage needed for each instruction.
386 * Sizes for dynamically allocated opcodes are stored in the context struct.
388 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
390 void mesa_print_display_list( GLuint list
);
393 /**********************************************************************/
394 /***** Private *****/
395 /**********************************************************************/
398 * Make an empty display list. This is used by glGenLists() to
399 * reserver display list IDs.
401 static Node
*make_empty_list( void )
403 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
404 n
[0].opcode
= OPCODE_END_OF_LIST
;
411 * Destroy all nodes in a display list.
412 * \param list - display list number
414 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
422 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
425 done
= block
? GL_FALSE
: GL_TRUE
;
428 /* check for extension opcodes first */
430 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
431 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
432 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
433 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
436 switch (n
[0].opcode
) {
437 /* for some commands, we need to free malloc'd memory */
440 n
+= InstSize
[n
[0].opcode
];
444 n
+= InstSize
[n
[0].opcode
];
446 case OPCODE_DRAW_PIXELS
:
448 n
+= InstSize
[n
[0].opcode
];
452 n
+= InstSize
[n
[0].opcode
];
454 case OPCODE_COLOR_TABLE
:
456 n
+= InstSize
[n
[0].opcode
];
458 case OPCODE_COLOR_SUB_TABLE
:
460 n
+= InstSize
[n
[0].opcode
];
462 case OPCODE_CONVOLUTION_FILTER_1D
:
464 n
+= InstSize
[n
[0].opcode
];
466 case OPCODE_CONVOLUTION_FILTER_2D
:
468 n
+= InstSize
[n
[0].opcode
];
470 case OPCODE_POLYGON_STIPPLE
:
472 n
+= InstSize
[n
[0].opcode
];
474 case OPCODE_TEX_IMAGE1D
:
476 n
+= InstSize
[n
[0].opcode
];
478 case OPCODE_TEX_IMAGE2D
:
480 n
+= InstSize
[n
[0].opcode
];
482 case OPCODE_TEX_IMAGE3D
:
484 n
+= InstSize
[n
[0].opcode
];
486 case OPCODE_TEX_SUB_IMAGE1D
:
488 n
+= InstSize
[n
[0].opcode
];
490 case OPCODE_TEX_SUB_IMAGE2D
:
492 n
+= InstSize
[n
[0].opcode
];
494 case OPCODE_TEX_SUB_IMAGE3D
:
496 n
+= InstSize
[n
[0].opcode
];
498 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
500 n
+= InstSize
[n
[0].opcode
];
502 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
504 n
+= InstSize
[n
[0].opcode
];
506 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
508 n
+= InstSize
[n
[0].opcode
];
510 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
512 n
+= InstSize
[n
[0].opcode
];
514 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
516 n
+= InstSize
[n
[0].opcode
];
518 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
520 n
+= InstSize
[n
[0].opcode
];
522 #if FEATURE_NV_vertex_program
523 case OPCODE_LOAD_PROGRAM_NV
:
524 FREE(n
[4].data
); /* program string */
525 n
+= InstSize
[n
[0].opcode
];
527 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
528 FREE(n
[2].data
); /* array of program ids */
529 n
+= InstSize
[n
[0].opcode
];
532 #if FEATURE_NV_fragment_program
533 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
534 FREE(n
[3].data
); /* parameter name */
535 n
+= InstSize
[n
[0].opcode
];
538 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
539 case OPCODE_PROGRAM_STRING_ARB
:
540 FREE(n
[4].data
); /* program string */
541 n
+= InstSize
[n
[0].opcode
];
544 case OPCODE_CONTINUE
:
545 n
= (Node
*) n
[1].next
;
549 case OPCODE_END_OF_LIST
:
554 /* Most frequent case */
555 n
+= InstSize
[n
[0].opcode
];
561 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
567 * Translate the nth element of list from type to GLuint.
569 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
581 bptr
= (GLbyte
*) list
;
582 return (GLuint
) *(bptr
+n
);
583 case GL_UNSIGNED_BYTE
:
584 ubptr
= (GLubyte
*) list
;
585 return (GLuint
) *(ubptr
+n
);
587 sptr
= (GLshort
*) list
;
588 return (GLuint
) *(sptr
+n
);
589 case GL_UNSIGNED_SHORT
:
590 usptr
= (GLushort
*) list
;
591 return (GLuint
) *(usptr
+n
);
593 iptr
= (GLint
*) list
;
594 return (GLuint
) *(iptr
+n
);
595 case GL_UNSIGNED_INT
:
596 uiptr
= (GLuint
*) list
;
597 return (GLuint
) *(uiptr
+n
);
599 fptr
= (GLfloat
*) list
;
600 return (GLuint
) *(fptr
+n
);
602 ubptr
= ((GLubyte
*) list
) + 2*n
;
603 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
605 ubptr
= ((GLubyte
*) list
) + 3*n
;
606 return (GLuint
) *ubptr
* 65536
607 + (GLuint
) *(ubptr
+1) * 256
608 + (GLuint
) *(ubptr
+2);
610 ubptr
= ((GLubyte
*) list
) + 4*n
;
611 return (GLuint
) *ubptr
* 16777216
612 + (GLuint
) *(ubptr
+1) * 65536
613 + (GLuint
) *(ubptr
+2) * 256
614 + (GLuint
) *(ubptr
+3);
623 /**********************************************************************/
625 /**********************************************************************/
628 * Do one-time initialiazations for display lists.
631 _mesa_init_lists( void )
633 static int init_flag
= 0;
636 InstSize
[OPCODE_ACCUM
] = 3;
637 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
638 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
639 InstSize
[OPCODE_BITMAP
] = 8;
640 InstSize
[OPCODE_BLEND_COLOR
] = 5;
641 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
642 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
643 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
644 InstSize
[OPCODE_CALL_LIST
] = 2;
645 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
646 InstSize
[OPCODE_CLEAR
] = 2;
647 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
648 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
649 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
650 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
651 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
652 InstSize
[OPCODE_CLIP_PLANE
] = 6;
653 InstSize
[OPCODE_COLOR_MASK
] = 5;
654 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
655 InstSize
[OPCODE_COLOR_TABLE
] = 7;
656 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
657 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
658 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
659 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
660 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
661 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
662 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
663 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
664 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
665 InstSize
[OPCODE_COPY_PIXELS
] = 6;
666 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
667 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
668 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
669 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
670 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
671 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
672 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
673 InstSize
[OPCODE_CULL_FACE
] = 2;
674 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
675 InstSize
[OPCODE_DEPTH_MASK
] = 2;
676 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
677 InstSize
[OPCODE_DISABLE
] = 2;
678 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
679 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
680 InstSize
[OPCODE_ENABLE
] = 2;
681 InstSize
[OPCODE_EVALMESH1
] = 4;
682 InstSize
[OPCODE_EVALMESH2
] = 6;
683 InstSize
[OPCODE_FOG
] = 6;
684 InstSize
[OPCODE_FRONT_FACE
] = 2;
685 InstSize
[OPCODE_FRUSTUM
] = 7;
686 InstSize
[OPCODE_HINT
] = 3;
687 InstSize
[OPCODE_HISTOGRAM
] = 5;
688 InstSize
[OPCODE_INDEX_MASK
] = 2;
689 InstSize
[OPCODE_INIT_NAMES
] = 1;
690 InstSize
[OPCODE_LIGHT
] = 7;
691 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
692 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
693 InstSize
[OPCODE_LINE_WIDTH
] = 2;
694 InstSize
[OPCODE_LIST_BASE
] = 2;
695 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
696 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
697 InstSize
[OPCODE_LOAD_NAME
] = 2;
698 InstSize
[OPCODE_LOGIC_OP
] = 2;
699 InstSize
[OPCODE_MAP1
] = 7;
700 InstSize
[OPCODE_MAP2
] = 11;
701 InstSize
[OPCODE_MAPGRID1
] = 4;
702 InstSize
[OPCODE_MAPGRID2
] = 7;
703 InstSize
[OPCODE_MATRIX_MODE
] = 2;
704 InstSize
[OPCODE_MIN_MAX
] = 4;
705 InstSize
[OPCODE_MULT_MATRIX
] = 17;
706 InstSize
[OPCODE_ORTHO
] = 7;
707 InstSize
[OPCODE_PASSTHROUGH
] = 2;
708 InstSize
[OPCODE_PIXEL_MAP
] = 4;
709 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
710 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
711 InstSize
[OPCODE_POINT_SIZE
] = 2;
712 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
713 InstSize
[OPCODE_POLYGON_MODE
] = 3;
714 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
715 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
716 InstSize
[OPCODE_POP_ATTRIB
] = 1;
717 InstSize
[OPCODE_POP_MATRIX
] = 1;
718 InstSize
[OPCODE_POP_NAME
] = 1;
719 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
720 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
721 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
722 InstSize
[OPCODE_PUSH_NAME
] = 2;
723 InstSize
[OPCODE_RASTER_POS
] = 5;
724 InstSize
[OPCODE_READ_BUFFER
] = 2;
725 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
726 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
727 InstSize
[OPCODE_ROTATE
] = 5;
728 InstSize
[OPCODE_SCALE
] = 4;
729 InstSize
[OPCODE_SCISSOR
] = 5;
730 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
731 InstSize
[OPCODE_STENCIL_MASK
] = 2;
732 InstSize
[OPCODE_STENCIL_OP
] = 4;
733 InstSize
[OPCODE_SHADE_MODEL
] = 2;
734 InstSize
[OPCODE_TEXENV
] = 7;
735 InstSize
[OPCODE_TEXGEN
] = 7;
736 InstSize
[OPCODE_TEXPARAMETER
] = 7;
737 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
738 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
739 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
740 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
741 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
742 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
743 InstSize
[OPCODE_TRANSLATE
] = 4;
744 InstSize
[OPCODE_VIEWPORT
] = 5;
745 InstSize
[OPCODE_WINDOW_POS
] = 5;
746 InstSize
[OPCODE_CONTINUE
] = 2;
747 InstSize
[OPCODE_ERROR
] = 3;
748 InstSize
[OPCODE_END_OF_LIST
] = 1;
749 /* GL_SGIX/SGIS_pixel_texture */
750 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
751 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
752 /* GL_ARB_texture_compression */
753 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
754 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
755 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
756 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
757 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
758 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
759 /* GL_ARB_multisample */
760 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
761 /* GL_ARB_multitexture */
762 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
763 /* GL_ARB_window_pos */
764 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
765 /* GL_NV_vertex_program */
766 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
767 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
768 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
769 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
770 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
771 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
772 /* GL_NV_fragment_program */
773 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
774 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
775 /* GL_EXT_stencil_two_side */
776 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
777 /* GL_EXT_depth_bounds_test */
778 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
779 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
780 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
781 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
783 #if FEATURE_ARB_occlusion_query
784 InstSize
[OPCODE_BEGIN_QUERY_ARB
] = 3;
785 InstSize
[OPCODE_END_QUERY_ARB
] = 2;
787 InstSize
[OPCODE_DRAW_BUFFERS_ARB
] = 2 + MAX_DRAW_BUFFERS
;
788 InstSize
[OPCODE_ATTR_1F
] = 3;
789 InstSize
[OPCODE_ATTR_2F
] = 4;
790 InstSize
[OPCODE_ATTR_3F
] = 5;
791 InstSize
[OPCODE_ATTR_4F
] = 6;
792 InstSize
[OPCODE_MATERIAL
] = 7;
793 InstSize
[OPCODE_INDEX
] = 2;
794 InstSize
[OPCODE_EDGEFLAG
] = 2;
795 InstSize
[OPCODE_BEGIN
] = 2;
796 InstSize
[OPCODE_END
] = 1;
797 InstSize
[OPCODE_RECTF
] = 5;
798 InstSize
[OPCODE_EVAL_C1
] = 2;
799 InstSize
[OPCODE_EVAL_C2
] = 3;
800 InstSize
[OPCODE_EVAL_P1
] = 2;
801 InstSize
[OPCODE_EVAL_P2
] = 3;
809 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
810 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
813 unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
814 GLenum format
, GLenum type
, const GLvoid
*pixels
,
815 const struct gl_pixelstore_attrib
*unpack
)
817 if (unpack
->BufferObj
->Name
== 0) {
819 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
822 else if (_mesa_validate_pbo_access(unpack
, width
, height
, depth
, format
,
824 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
825 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
834 * Allocate space for a display list instruction.
835 * \param opcode - type of instruction
836 * argcount - size in bytes of data required.
837 * \return pointer to the usable data area (not including the internal
841 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
844 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
847 if (opcode
< (int) OPCODE_EXT_0
) {
848 assert( count
== InstSize
[opcode
] );
852 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
853 /* This block is full. Allocate a new block and chain to it */
854 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
855 n
[0].opcode
= OPCODE_CONTINUE
;
856 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
858 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
861 n
[1].next
= (Node
*) newblock
;
862 ctx
->ListState
.CurrentBlock
= newblock
;
863 ctx
->ListState
.CurrentPos
= 0;
866 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
867 ctx
->ListState
.CurrentPos
+= count
;
869 n
[0].opcode
= (OpCode
) opcode
;
871 return (void *)&n
[1];
876 * This function allows modules and drivers to get their own opcodes
877 * for extending display list functionality.
878 * \param ctx the rendering context
879 * \param size number of bytes for storing the new display list command
880 * \param execute function to execute the new display list command
881 * \param destroy function to destroy the new display list command
882 * \param print function to print the new display list command
883 * \return the new opcode number or -1 if error
886 _mesa_alloc_opcode( GLcontext
*ctx
,
888 void (*execute
)( GLcontext
*, void * ),
889 void (*destroy
)( GLcontext
*, void * ),
890 void (*print
)( GLcontext
*, void * ) )
892 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
893 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
894 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
895 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
896 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
897 ctx
->ListExt
.Opcode
[i
].Print
= print
;
898 return i
+ OPCODE_EXT_0
;
905 /* Mimic the old behaviour of alloc_instruction:
906 * - sz is in units of sizeof(Node)
907 * - return value a pointer to sizeof(Node) before the actual
910 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
911 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
916 * Display List compilation functions
918 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
920 GET_CURRENT_CONTEXT(ctx
);
922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
923 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
928 if (ctx
->ExecuteFlag
) {
929 (*ctx
->Exec
->Accum
)( op
, value
);
934 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
936 GET_CURRENT_CONTEXT(ctx
);
938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
939 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
942 n
[2].f
= (GLfloat
) ref
;
944 if (ctx
->ExecuteFlag
) {
945 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
950 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
952 GET_CURRENT_CONTEXT(ctx
);
954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
955 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
960 if (ctx
->ExecuteFlag
) {
961 (*ctx
->Exec
->BindTexture
)( target
, texture
);
966 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
967 GLfloat xorig
, GLfloat yorig
,
968 GLfloat xmove
, GLfloat ymove
,
969 const GLubyte
*pixels
)
971 GET_CURRENT_CONTEXT(ctx
);
972 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
975 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
977 n
[1].i
= (GLint
) width
;
978 n
[2].i
= (GLint
) height
;
988 if (ctx
->ExecuteFlag
) {
989 (*ctx
->Exec
->Bitmap
)( width
, height
,
990 xorig
, yorig
, xmove
, ymove
, pixels
);
995 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
997 GET_CURRENT_CONTEXT(ctx
);
999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1000 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
1004 if (ctx
->ExecuteFlag
) {
1005 (*ctx
->Exec
->BlendEquation
)( mode
);
1010 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1013 GET_CURRENT_CONTEXT(ctx
);
1015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1016 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1021 if (ctx
->ExecuteFlag
) {
1022 (*ctx
->Exec
->BlendEquationSeparateEXT
)( modeRGB
, modeA
);
1027 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1028 GLenum sfactorA
, GLenum dfactorA
)
1030 GET_CURRENT_CONTEXT(ctx
);
1032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1033 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1035 n
[1].e
= sfactorRGB
;
1036 n
[2].e
= dfactorRGB
;
1040 if (ctx
->ExecuteFlag
) {
1041 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
1042 sfactorA
, dfactorA
);
1047 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1048 GLfloat blue
, GLfloat alpha
)
1050 GET_CURRENT_CONTEXT(ctx
);
1052 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1053 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1060 if (ctx
->ExecuteFlag
) {
1061 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1066 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1068 GET_CURRENT_CONTEXT(ctx
);
1070 SAVE_FLUSH_VERTICES(ctx
);
1072 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1077 /* After this, we don't know what begin/end state we're in:
1079 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1081 if (ctx
->ExecuteFlag
) {
1082 (*ctx
->Exec
->CallList
)( list
);
1087 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1089 GET_CURRENT_CONTEXT(ctx
);
1091 GLboolean typeErrorFlag
;
1093 SAVE_FLUSH_VERTICES(ctx
);
1097 case GL_UNSIGNED_BYTE
:
1099 case GL_UNSIGNED_SHORT
:
1101 case GL_UNSIGNED_INT
:
1106 typeErrorFlag
= GL_FALSE
;
1109 typeErrorFlag
= GL_TRUE
;
1113 GLuint list
= translate_id( i
, type
, lists
);
1114 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1117 n
[2].b
= typeErrorFlag
;
1121 /* After this, we don't know what begin/end state we're in:
1123 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1125 if (ctx
->ExecuteFlag
) {
1126 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1131 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1133 GET_CURRENT_CONTEXT(ctx
);
1135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1136 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1140 if (ctx
->ExecuteFlag
) {
1141 (*ctx
->Exec
->Clear
)( mask
);
1146 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1147 GLfloat blue
, GLfloat alpha
)
1149 GET_CURRENT_CONTEXT(ctx
);
1151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1152 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1159 if (ctx
->ExecuteFlag
) {
1160 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1165 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1166 GLclampf blue
, GLclampf alpha
)
1168 GET_CURRENT_CONTEXT(ctx
);
1170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1171 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1178 if (ctx
->ExecuteFlag
) {
1179 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1184 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1186 GET_CURRENT_CONTEXT(ctx
);
1188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1189 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1191 n
[1].f
= (GLfloat
) depth
;
1193 if (ctx
->ExecuteFlag
) {
1194 (*ctx
->Exec
->ClearDepth
)( depth
);
1199 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1201 GET_CURRENT_CONTEXT(ctx
);
1203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1204 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1208 if (ctx
->ExecuteFlag
) {
1209 (*ctx
->Exec
->ClearIndex
)( c
);
1214 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1216 GET_CURRENT_CONTEXT(ctx
);
1218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1219 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1223 if (ctx
->ExecuteFlag
) {
1224 (*ctx
->Exec
->ClearStencil
)( s
);
1229 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1231 GET_CURRENT_CONTEXT(ctx
);
1233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1234 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1237 n
[2].f
= (GLfloat
) equ
[0];
1238 n
[3].f
= (GLfloat
) equ
[1];
1239 n
[4].f
= (GLfloat
) equ
[2];
1240 n
[5].f
= (GLfloat
) equ
[3];
1242 if (ctx
->ExecuteFlag
) {
1243 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1249 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1250 GLboolean blue
, GLboolean alpha
)
1252 GET_CURRENT_CONTEXT(ctx
);
1254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1255 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1262 if (ctx
->ExecuteFlag
) {
1263 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1268 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1270 GET_CURRENT_CONTEXT(ctx
);
1272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1274 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1279 if (ctx
->ExecuteFlag
) {
1280 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1285 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1286 GLsizei width
, GLenum format
, GLenum type
,
1287 const GLvoid
*table
)
1289 GET_CURRENT_CONTEXT(ctx
);
1290 if (target
== GL_PROXY_TEXTURE_1D
||
1291 target
== GL_PROXY_TEXTURE_2D
||
1292 target
== GL_PROXY_TEXTURE_3D
||
1293 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1294 /* execute immediately */
1295 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1296 format
, type
, table
);
1299 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, table
,
1302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1303 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1306 n
[2].e
= internalFormat
;
1315 if (ctx
->ExecuteFlag
) {
1316 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1317 format
, type
, table
);
1324 static void GLAPIENTRY
1325 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1327 GET_CURRENT_CONTEXT(ctx
);
1330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1332 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1337 if (pname
== GL_COLOR_TABLE_SGI
||
1338 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1339 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1340 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1347 if (ctx
->ExecuteFlag
) {
1348 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1353 static void GLAPIENTRY
1354 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1356 GET_CURRENT_CONTEXT(ctx
);
1359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1361 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1366 if (pname
== GL_COLOR_TABLE_SGI
||
1367 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1368 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1369 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1376 if (ctx
->ExecuteFlag
) {
1377 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1383 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1384 GLenum format
, GLenum type
,
1385 const GLvoid
*table
)
1387 GET_CURRENT_CONTEXT(ctx
);
1388 GLvoid
*image
= unpack_image(count
, 1, 1, format
, type
, table
,
1391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1392 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1404 if (ctx
->ExecuteFlag
) {
1405 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1410 static void GLAPIENTRY
1411 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1412 GLint x
, GLint y
, GLsizei width
)
1414 GET_CURRENT_CONTEXT(ctx
);
1417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1418 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1426 if (ctx
->ExecuteFlag
) {
1427 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1432 static void GLAPIENTRY
1433 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1434 GLint x
, GLint y
, GLsizei width
)
1436 GET_CURRENT_CONTEXT(ctx
);
1439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1440 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1443 n
[2].e
= internalformat
;
1448 if (ctx
->ExecuteFlag
) {
1449 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1454 static void GLAPIENTRY
1455 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1456 GLenum format
, GLenum type
, const GLvoid
*filter
)
1458 GET_CURRENT_CONTEXT(ctx
);
1459 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, filter
,
1462 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1463 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1466 n
[2].e
= internalFormat
;
1475 if (ctx
->ExecuteFlag
) {
1476 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1477 format
, type
, filter
);
1482 static void GLAPIENTRY
1483 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1484 GLsizei width
, GLsizei height
, GLenum format
,
1485 GLenum type
, const GLvoid
*filter
)
1487 GET_CURRENT_CONTEXT(ctx
);
1488 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
, filter
,
1491 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1492 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1495 n
[2].e
= internalFormat
;
1505 if (ctx
->ExecuteFlag
) {
1506 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1507 format
, type
, filter
);
1512 static void GLAPIENTRY
1513 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1515 GET_CURRENT_CONTEXT(ctx
);
1517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1518 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1524 if (ctx
->ExecuteFlag
) {
1525 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1530 static void GLAPIENTRY
1531 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1533 GET_CURRENT_CONTEXT(ctx
);
1535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1536 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1541 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1542 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1543 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1549 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1552 if (ctx
->ExecuteFlag
) {
1553 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1558 static void GLAPIENTRY
1559 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1561 GET_CURRENT_CONTEXT(ctx
);
1563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1564 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1570 if (ctx
->ExecuteFlag
) {
1571 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1576 static void GLAPIENTRY
1577 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1579 GET_CURRENT_CONTEXT(ctx
);
1581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1582 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1587 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1588 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1589 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1595 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1598 if (ctx
->ExecuteFlag
) {
1599 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1604 static void GLAPIENTRY
1605 save_CopyPixels( GLint x
, GLint y
,
1606 GLsizei width
, GLsizei height
, GLenum type
)
1608 GET_CURRENT_CONTEXT(ctx
);
1610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1611 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1615 n
[3].i
= (GLint
) width
;
1616 n
[4].i
= (GLint
) height
;
1619 if (ctx
->ExecuteFlag
) {
1620 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1626 static void GLAPIENTRY
1627 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1628 GLint x
, GLint y
, GLsizei width
, GLint border
)
1630 GET_CURRENT_CONTEXT(ctx
);
1632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1633 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1637 n
[3].e
= internalformat
;
1643 if (ctx
->ExecuteFlag
) {
1644 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1645 x
, y
, width
, border
);
1650 static void GLAPIENTRY
1651 save_CopyTexImage2D( GLenum target
, GLint level
,
1652 GLenum internalformat
,
1653 GLint x
, GLint y
, GLsizei width
,
1654 GLsizei height
, GLint border
)
1656 GET_CURRENT_CONTEXT(ctx
);
1658 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1659 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1663 n
[3].e
= internalformat
;
1670 if (ctx
->ExecuteFlag
) {
1671 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1672 x
, y
, width
, height
, border
);
1678 static void GLAPIENTRY
1679 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1680 GLint xoffset
, GLint x
, GLint y
,
1683 GET_CURRENT_CONTEXT(ctx
);
1685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1686 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1695 if (ctx
->ExecuteFlag
) {
1696 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1701 static void GLAPIENTRY
1702 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1703 GLint xoffset
, GLint yoffset
,
1705 GLsizei width
, GLint height
)
1707 GET_CURRENT_CONTEXT(ctx
);
1709 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1710 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1721 if (ctx
->ExecuteFlag
) {
1722 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1723 x
, y
, width
, height
);
1728 static void GLAPIENTRY
1729 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1730 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1732 GLsizei width
, GLint height
)
1734 GET_CURRENT_CONTEXT(ctx
);
1736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1737 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1749 if (ctx
->ExecuteFlag
) {
1750 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1751 xoffset
, yoffset
, zoffset
,
1752 x
, y
, width
, height
);
1757 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1759 GET_CURRENT_CONTEXT(ctx
);
1761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1762 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1766 if (ctx
->ExecuteFlag
) {
1767 (*ctx
->Exec
->CullFace
)( mode
);
1772 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1774 GET_CURRENT_CONTEXT(ctx
);
1776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1777 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1781 if (ctx
->ExecuteFlag
) {
1782 (*ctx
->Exec
->DepthFunc
)( func
);
1787 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1789 GET_CURRENT_CONTEXT(ctx
);
1791 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1792 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1796 if (ctx
->ExecuteFlag
) {
1797 (*ctx
->Exec
->DepthMask
)( mask
);
1802 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1804 GET_CURRENT_CONTEXT(ctx
);
1806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1807 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1809 n
[1].f
= (GLfloat
) nearval
;
1810 n
[2].f
= (GLfloat
) farval
;
1812 if (ctx
->ExecuteFlag
) {
1813 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1818 static void GLAPIENTRY
save_Disable( GLenum cap
)
1820 GET_CURRENT_CONTEXT(ctx
);
1822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1823 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1827 if (ctx
->ExecuteFlag
) {
1828 (*ctx
->Exec
->Disable
)( cap
);
1833 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1835 GET_CURRENT_CONTEXT(ctx
);
1837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1838 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1842 if (ctx
->ExecuteFlag
) {
1843 (*ctx
->Exec
->DrawBuffer
)( mode
);
1848 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1849 GLenum format
, GLenum type
,
1850 const GLvoid
*pixels
)
1852 GET_CURRENT_CONTEXT(ctx
);
1853 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
1854 pixels
, &ctx
->Unpack
);
1856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1857 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1868 if (ctx
->ExecuteFlag
) {
1869 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1875 static void GLAPIENTRY
save_Enable( GLenum cap
)
1877 GET_CURRENT_CONTEXT(ctx
);
1879 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1880 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1884 if (ctx
->ExecuteFlag
) {
1885 (*ctx
->Exec
->Enable
)( cap
);
1891 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1893 GET_CURRENT_CONTEXT(ctx
);
1895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1896 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1902 if (ctx
->ExecuteFlag
) {
1903 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1908 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1910 GET_CURRENT_CONTEXT(ctx
);
1912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1913 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1921 if (ctx
->ExecuteFlag
) {
1922 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1929 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1931 GET_CURRENT_CONTEXT(ctx
);
1933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1934 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1942 if (ctx
->ExecuteFlag
) {
1943 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1948 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1950 save_Fogfv(pname
, ¶m
);
1954 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1959 case GL_FOG_DENSITY
:
1963 p
[0] = (GLfloat
) *params
;
1966 p
[0] = INT_TO_FLOAT( params
[0] );
1967 p
[1] = INT_TO_FLOAT( params
[1] );
1968 p
[2] = INT_TO_FLOAT( params
[2] );
1969 p
[3] = INT_TO_FLOAT( params
[3] );
1972 /* Error will be caught later in gl_Fogfv */
1975 save_Fogfv(pname
, p
);
1979 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1981 save_Fogiv(pname
, ¶m
);
1985 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1987 GET_CURRENT_CONTEXT(ctx
);
1989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1990 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1994 if (ctx
->ExecuteFlag
) {
1995 (*ctx
->Exec
->FrontFace
)( mode
);
2000 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
2001 GLdouble bottom
, GLdouble top
,
2002 GLdouble nearval
, GLdouble farval
)
2004 GET_CURRENT_CONTEXT(ctx
);
2006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2007 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
2009 n
[1].f
= (GLfloat
) left
;
2010 n
[2].f
= (GLfloat
) right
;
2011 n
[3].f
= (GLfloat
) bottom
;
2012 n
[4].f
= (GLfloat
) top
;
2013 n
[5].f
= (GLfloat
) nearval
;
2014 n
[6].f
= (GLfloat
) farval
;
2016 if (ctx
->ExecuteFlag
) {
2017 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
2022 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2024 GET_CURRENT_CONTEXT(ctx
);
2026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2027 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2032 if (ctx
->ExecuteFlag
) {
2033 (*ctx
->Exec
->Hint
)( target
, mode
);
2038 static void GLAPIENTRY
2039 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2041 GET_CURRENT_CONTEXT(ctx
);
2044 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2045 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2049 n
[3].e
= internalFormat
;
2052 if (ctx
->ExecuteFlag
) {
2053 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2058 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2060 GET_CURRENT_CONTEXT(ctx
);
2062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2067 if (ctx
->ExecuteFlag
) {
2068 (*ctx
->Exec
->IndexMask
)( mask
);
2073 static void GLAPIENTRY
save_InitNames( void )
2075 GET_CURRENT_CONTEXT(ctx
);
2076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2077 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2078 if (ctx
->ExecuteFlag
) {
2079 (*ctx
->Exec
->InitNames
)();
2084 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2086 GET_CURRENT_CONTEXT(ctx
);
2088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2089 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2107 case GL_SPOT_DIRECTION
:
2110 case GL_SPOT_EXPONENT
:
2113 case GL_SPOT_CUTOFF
:
2116 case GL_CONSTANT_ATTENUATION
:
2119 case GL_LINEAR_ATTENUATION
:
2122 case GL_QUADRATIC_ATTENUATION
:
2128 for (i
= 0; i
< nParams
; i
++) {
2129 n
[3+i
].f
= params
[i
];
2132 if (ctx
->ExecuteFlag
) {
2133 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2138 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2140 save_Lightfv(light
, pname
, ¶ms
);
2144 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2151 fparam
[0] = INT_TO_FLOAT( params
[0] );
2152 fparam
[1] = INT_TO_FLOAT( params
[1] );
2153 fparam
[2] = INT_TO_FLOAT( params
[2] );
2154 fparam
[3] = INT_TO_FLOAT( params
[3] );
2157 fparam
[0] = (GLfloat
) params
[0];
2158 fparam
[1] = (GLfloat
) params
[1];
2159 fparam
[2] = (GLfloat
) params
[2];
2160 fparam
[3] = (GLfloat
) params
[3];
2162 case GL_SPOT_DIRECTION
:
2163 fparam
[0] = (GLfloat
) params
[0];
2164 fparam
[1] = (GLfloat
) params
[1];
2165 fparam
[2] = (GLfloat
) params
[2];
2167 case GL_SPOT_EXPONENT
:
2168 case GL_SPOT_CUTOFF
:
2169 case GL_CONSTANT_ATTENUATION
:
2170 case GL_LINEAR_ATTENUATION
:
2171 case GL_QUADRATIC_ATTENUATION
:
2172 fparam
[0] = (GLfloat
) params
[0];
2175 /* error will be caught later in gl_Lightfv */
2178 save_Lightfv( light
, pname
, fparam
);
2182 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2184 save_Lightiv( light
, pname
, ¶m
);
2188 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2190 GET_CURRENT_CONTEXT(ctx
);
2192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2193 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2201 if (ctx
->ExecuteFlag
) {
2202 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2207 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2209 save_LightModelfv(pname
, ¶m
);
2213 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2217 case GL_LIGHT_MODEL_AMBIENT
:
2218 fparam
[0] = INT_TO_FLOAT( params
[0] );
2219 fparam
[1] = INT_TO_FLOAT( params
[1] );
2220 fparam
[2] = INT_TO_FLOAT( params
[2] );
2221 fparam
[3] = INT_TO_FLOAT( params
[3] );
2223 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2224 case GL_LIGHT_MODEL_TWO_SIDE
:
2225 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2226 fparam
[0] = (GLfloat
) params
[0];
2229 /* Error will be caught later in gl_LightModelfv */
2232 save_LightModelfv(pname
, fparam
);
2236 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2238 save_LightModeliv(pname
, ¶m
);
2242 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2244 GET_CURRENT_CONTEXT(ctx
);
2246 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2247 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2252 if (ctx
->ExecuteFlag
) {
2253 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2258 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2260 GET_CURRENT_CONTEXT(ctx
);
2262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2263 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2267 if (ctx
->ExecuteFlag
) {
2268 (*ctx
->Exec
->LineWidth
)( width
);
2273 static void GLAPIENTRY
save_ListBase( GLuint base
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2282 if (ctx
->ExecuteFlag
) {
2283 (*ctx
->Exec
->ListBase
)( base
);
2288 static void GLAPIENTRY
save_LoadIdentity( void )
2290 GET_CURRENT_CONTEXT(ctx
);
2291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2292 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2293 if (ctx
->ExecuteFlag
) {
2294 (*ctx
->Exec
->LoadIdentity
)();
2299 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2301 GET_CURRENT_CONTEXT(ctx
);
2303 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2304 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2307 for (i
=0;i
<16;i
++) {
2311 if (ctx
->ExecuteFlag
) {
2312 (*ctx
->Exec
->LoadMatrixf
)( m
);
2317 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2321 for (i
= 0; i
< 16; i
++) {
2322 f
[i
] = (GLfloat
) m
[i
];
2324 save_LoadMatrixf(f
);
2328 static void GLAPIENTRY
save_LoadName( GLuint name
)
2330 GET_CURRENT_CONTEXT(ctx
);
2332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2333 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2337 if (ctx
->ExecuteFlag
) {
2338 (*ctx
->Exec
->LoadName
)( name
);
2343 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2345 GET_CURRENT_CONTEXT(ctx
);
2347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2348 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2352 if (ctx
->ExecuteFlag
) {
2353 (*ctx
->Exec
->LogicOp
)( opcode
);
2358 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2359 GLint order
, const GLdouble
*points
)
2361 GET_CURRENT_CONTEXT(ctx
);
2363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2364 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2366 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2368 n
[2].f
= (GLfloat
) u1
;
2369 n
[3].f
= (GLfloat
) u2
;
2370 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2372 n
[6].data
= (void *) pnts
;
2374 if (ctx
->ExecuteFlag
) {
2375 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2379 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2380 GLint order
, const GLfloat
*points
)
2382 GET_CURRENT_CONTEXT(ctx
);
2384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2385 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2387 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2391 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2393 n
[6].data
= (void *) pnts
;
2395 if (ctx
->ExecuteFlag
) {
2396 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2401 static void GLAPIENTRY
save_Map2d( GLenum target
,
2402 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2403 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2404 const GLdouble
*points
)
2406 GET_CURRENT_CONTEXT(ctx
);
2408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2409 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2411 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2412 vstride
, vorder
, points
);
2414 n
[2].f
= (GLfloat
) u1
;
2415 n
[3].f
= (GLfloat
) u2
;
2416 n
[4].f
= (GLfloat
) v1
;
2417 n
[5].f
= (GLfloat
) v2
;
2418 /* XXX verify these strides are correct */
2419 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2420 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2423 n
[10].data
= (void *) pnts
;
2425 if (ctx
->ExecuteFlag
) {
2426 (*ctx
->Exec
->Map2d
)( target
,
2427 u1
, u2
, ustride
, uorder
,
2428 v1
, v2
, vstride
, vorder
, points
);
2433 static void GLAPIENTRY
save_Map2f( GLenum target
,
2434 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2435 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2436 const GLfloat
*points
)
2438 GET_CURRENT_CONTEXT(ctx
);
2440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2441 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2443 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2444 vstride
, vorder
, points
);
2450 /* XXX verify these strides are correct */
2451 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2452 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2455 n
[10].data
= (void *) pnts
;
2457 if (ctx
->ExecuteFlag
) {
2458 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2459 v1
, v2
, vstride
, vorder
, points
);
2464 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2466 GET_CURRENT_CONTEXT(ctx
);
2468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2469 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2475 if (ctx
->ExecuteFlag
) {
2476 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2481 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2483 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2487 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2488 GLint vn
, GLfloat v1
, GLfloat v2
)
2490 GET_CURRENT_CONTEXT(ctx
);
2492 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2493 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2502 if (ctx
->ExecuteFlag
) {
2503 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2509 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2510 GLint vn
, GLdouble v1
, GLdouble v2
)
2512 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2513 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2517 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2519 GET_CURRENT_CONTEXT(ctx
);
2521 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2522 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2526 if (ctx
->ExecuteFlag
) {
2527 (*ctx
->Exec
->MatrixMode
)( mode
);
2532 static void GLAPIENTRY
2533 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2535 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2542 n
[2].e
= internalFormat
;
2545 if (ctx
->ExecuteFlag
) {
2546 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2551 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2553 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2559 for (i
=0;i
<16;i
++) {
2563 if (ctx
->ExecuteFlag
) {
2564 (*ctx
->Exec
->MultMatrixf
)( m
);
2569 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2573 for (i
= 0; i
< 16; i
++) {
2574 f
[i
] = (GLfloat
) m
[i
];
2576 save_MultMatrixf(f
);
2580 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2582 GET_CURRENT_CONTEXT(ctx
);
2583 /* It's an error to call this function while building a display list */
2584 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2591 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2592 GLdouble bottom
, GLdouble top
,
2593 GLdouble nearval
, GLdouble farval
)
2595 GET_CURRENT_CONTEXT(ctx
);
2597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2598 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2600 n
[1].f
= (GLfloat
) left
;
2601 n
[2].f
= (GLfloat
) right
;
2602 n
[3].f
= (GLfloat
) bottom
;
2603 n
[4].f
= (GLfloat
) top
;
2604 n
[5].f
= (GLfloat
) nearval
;
2605 n
[6].f
= (GLfloat
) farval
;
2607 if (ctx
->ExecuteFlag
) {
2608 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2613 static void GLAPIENTRY
2614 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2616 GET_CURRENT_CONTEXT(ctx
);
2618 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2619 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2623 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2624 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2626 if (ctx
->ExecuteFlag
) {
2627 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2632 static void GLAPIENTRY
2633 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2635 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2637 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2638 for (i
=0;i
<mapsize
;i
++) {
2639 fvalues
[i
] = (GLfloat
) values
[i
];
2643 for (i
=0;i
<mapsize
;i
++) {
2644 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2647 save_PixelMapfv(map
, mapsize
, fvalues
);
2651 static void GLAPIENTRY
2652 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2654 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2656 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2657 for (i
=0;i
<mapsize
;i
++) {
2658 fvalues
[i
] = (GLfloat
) values
[i
];
2662 for (i
=0;i
<mapsize
;i
++) {
2663 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2666 save_PixelMapfv(map
, mapsize
, fvalues
);
2670 static void GLAPIENTRY
2671 save_PixelTransferf( GLenum pname
, GLfloat param
)
2673 GET_CURRENT_CONTEXT(ctx
);
2675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2676 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2681 if (ctx
->ExecuteFlag
) {
2682 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2687 static void GLAPIENTRY
2688 save_PixelTransferi( GLenum pname
, GLint param
)
2690 save_PixelTransferf( pname
, (GLfloat
) param
);
2694 static void GLAPIENTRY
2695 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2697 GET_CURRENT_CONTEXT(ctx
);
2699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2700 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2705 if (ctx
->ExecuteFlag
) {
2706 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2711 static void GLAPIENTRY
2712 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2714 GET_CURRENT_CONTEXT(ctx
);
2716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2717 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2724 if (ctx
->ExecuteFlag
) {
2725 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2730 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2732 save_PointParameterfvEXT(pname
, ¶m
);
2735 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2737 GLfloat p
= (GLfloat
) param
;
2738 save_PointParameterfvEXT(pname
, &p
);
2741 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2743 GLfloat p
= (GLfloat
) param
[0];
2744 save_PointParameterfvEXT(pname
, &p
);
2748 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2750 GET_CURRENT_CONTEXT(ctx
);
2752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2753 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2757 if (ctx
->ExecuteFlag
) {
2758 (*ctx
->Exec
->PointSize
)( size
);
2763 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2765 GET_CURRENT_CONTEXT(ctx
);
2767 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2768 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2773 if (ctx
->ExecuteFlag
) {
2774 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2780 * Polygon stipple must have been upacked already!
2782 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2784 GET_CURRENT_CONTEXT(ctx
);
2786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2787 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2790 n
[1].data
= MALLOC( 32 * 4 );
2791 data
= n
[1].data
; /* This needed for Acorn compiler */
2792 MEMCPY( data
, pattern
, 32 * 4 );
2794 if (ctx
->ExecuteFlag
) {
2795 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2800 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2802 GET_CURRENT_CONTEXT(ctx
);
2804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2805 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2810 if (ctx
->ExecuteFlag
) {
2811 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2816 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2818 GET_CURRENT_CONTEXT(ctx
);
2819 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2823 static void GLAPIENTRY
save_PopAttrib( void )
2825 GET_CURRENT_CONTEXT(ctx
);
2826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2827 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2828 if (ctx
->ExecuteFlag
) {
2829 (*ctx
->Exec
->PopAttrib
)();
2834 static void GLAPIENTRY
save_PopMatrix( void )
2836 GET_CURRENT_CONTEXT(ctx
);
2837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2838 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2839 if (ctx
->ExecuteFlag
) {
2840 (*ctx
->Exec
->PopMatrix
)();
2845 static void GLAPIENTRY
save_PopName( void )
2847 GET_CURRENT_CONTEXT(ctx
);
2848 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2849 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2850 if (ctx
->ExecuteFlag
) {
2851 (*ctx
->Exec
->PopName
)();
2856 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2857 const GLclampf
*priorities
)
2859 GET_CURRENT_CONTEXT(ctx
);
2861 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2863 for (i
=0;i
<num
;i
++) {
2865 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2867 n
[1].ui
= textures
[i
];
2868 n
[2].f
= priorities
[i
];
2871 if (ctx
->ExecuteFlag
) {
2872 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2877 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2879 GET_CURRENT_CONTEXT(ctx
);
2881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2882 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2886 if (ctx
->ExecuteFlag
) {
2887 (*ctx
->Exec
->PushAttrib
)( mask
);
2892 static void GLAPIENTRY
save_PushMatrix( void )
2894 GET_CURRENT_CONTEXT(ctx
);
2895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2896 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2897 if (ctx
->ExecuteFlag
) {
2898 (*ctx
->Exec
->PushMatrix
)();
2903 static void GLAPIENTRY
save_PushName( GLuint name
)
2905 GET_CURRENT_CONTEXT(ctx
);
2907 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2908 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2912 if (ctx
->ExecuteFlag
) {
2913 (*ctx
->Exec
->PushName
)( name
);
2918 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2920 GET_CURRENT_CONTEXT(ctx
);
2922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2923 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2930 if (ctx
->ExecuteFlag
) {
2931 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2935 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2937 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2940 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2942 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2945 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2947 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2950 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2952 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2955 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2957 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2960 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2962 save_RasterPos4f(x
, y
, z
, 1.0F
);
2965 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2967 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2970 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2972 save_RasterPos4f(x
, y
, z
, 1.0F
);
2975 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2977 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2980 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2982 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2985 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2987 save_RasterPos4f(x
, y
, z
, w
);
2990 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2992 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2995 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2997 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3000 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
3002 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3005 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
3007 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3010 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3012 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3015 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3017 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3020 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3022 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3025 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3027 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3030 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3032 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3033 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3036 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3038 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3041 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3043 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3044 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3047 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3049 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3053 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3055 GET_CURRENT_CONTEXT(ctx
);
3057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3058 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3062 if (ctx
->ExecuteFlag
) {
3063 (*ctx
->Exec
->PassThrough
)( token
);
3068 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3070 GET_CURRENT_CONTEXT(ctx
);
3072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3073 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3077 if (ctx
->ExecuteFlag
) {
3078 (*ctx
->Exec
->ReadBuffer
)( mode
);
3083 static void GLAPIENTRY
3084 save_ResetHistogram(GLenum target
)
3086 GET_CURRENT_CONTEXT(ctx
);
3088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3089 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3093 if (ctx
->ExecuteFlag
) {
3094 (*ctx
->Exec
->ResetHistogram
)( target
);
3099 static void GLAPIENTRY
3100 save_ResetMinmax(GLenum target
)
3102 GET_CURRENT_CONTEXT(ctx
);
3104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3105 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3109 if (ctx
->ExecuteFlag
) {
3110 (*ctx
->Exec
->ResetMinmax
)( target
);
3115 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3117 GET_CURRENT_CONTEXT(ctx
);
3119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3120 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3127 if (ctx
->ExecuteFlag
) {
3128 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3133 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3135 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3139 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3141 GET_CURRENT_CONTEXT(ctx
);
3143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3144 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3150 if (ctx
->ExecuteFlag
) {
3151 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3156 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3158 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3162 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3164 GET_CURRENT_CONTEXT(ctx
);
3166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3174 if (ctx
->ExecuteFlag
) {
3175 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3180 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3182 GET_CURRENT_CONTEXT(ctx
);
3184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3185 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3189 if (ctx
->ExecuteFlag
) {
3190 (*ctx
->Exec
->ShadeModel
)( mode
);
3195 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3206 if (ctx
->ExecuteFlag
) {
3207 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3212 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3214 GET_CURRENT_CONTEXT(ctx
);
3216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3217 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3221 if (ctx
->ExecuteFlag
) {
3222 (*ctx
->Exec
->StencilMask
)( mask
);
3227 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3229 GET_CURRENT_CONTEXT(ctx
);
3231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3232 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3238 if (ctx
->ExecuteFlag
) {
3239 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3244 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3246 GET_CURRENT_CONTEXT(ctx
);
3248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3249 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3253 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3261 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3264 if (ctx
->ExecuteFlag
) {
3265 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3270 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3272 save_TexEnvfv( target
, pname
, ¶m
);
3276 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3279 p
[0] = (GLfloat
) param
;
3280 p
[1] = p
[2] = p
[3] = 0.0;
3281 save_TexEnvfv( target
, pname
, p
);
3285 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3288 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3289 p
[0] = INT_TO_FLOAT( param
[0] );
3290 p
[1] = INT_TO_FLOAT( param
[1] );
3291 p
[2] = INT_TO_FLOAT( param
[2] );
3292 p
[3] = INT_TO_FLOAT( param
[3] );
3295 p
[0] = (GLfloat
) param
[0];
3296 p
[1] = p
[2] = p
[3] = 0.0F
;
3298 save_TexEnvfv( target
, pname
, p
);
3302 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3304 GET_CURRENT_CONTEXT(ctx
);
3306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3307 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3316 if (ctx
->ExecuteFlag
) {
3317 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3322 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3325 p
[0] = (GLfloat
) params
[0];
3326 p
[1] = (GLfloat
) params
[1];
3327 p
[2] = (GLfloat
) params
[2];
3328 p
[3] = (GLfloat
) params
[3];
3329 save_TexGenfv(coord
, pname
, p
);
3333 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3335 GLfloat p
= (GLfloat
) param
;
3336 save_TexGenfv( coord
, pname
, &p
);
3340 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3343 p
[0] = (GLfloat
) params
[0];
3344 p
[1] = (GLfloat
) params
[1];
3345 p
[2] = (GLfloat
) params
[2];
3346 p
[3] = (GLfloat
) params
[3];
3347 save_TexGenfv( coord
, pname
, p
);
3351 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3353 save_TexGenfv(coord
, pname
, ¶m
);
3357 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3359 save_TexGeniv( coord
, pname
, ¶m
);
3363 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3364 GLenum pname
, const GLfloat
*params
)
3366 GET_CURRENT_CONTEXT(ctx
);
3368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3369 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3378 if (ctx
->ExecuteFlag
) {
3379 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3384 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3386 save_TexParameterfv(target
, pname
, ¶m
);
3390 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3393 fparam
[0] = (GLfloat
) param
;
3394 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3395 save_TexParameterfv(target
, pname
, fparam
);
3399 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3402 fparam
[0] = (GLfloat
) params
[0];
3403 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3404 save_TexParameterfv(target
, pname
, fparam
);
3408 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3409 GLint level
, GLint components
,
3410 GLsizei width
, GLint border
,
3411 GLenum format
, GLenum type
,
3412 const GLvoid
*pixels
)
3414 GET_CURRENT_CONTEXT(ctx
);
3415 if (target
== GL_PROXY_TEXTURE_1D
) {
3416 /* don't compile, execute immediately */
3417 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3418 border
, format
, type
, pixels
);
3421 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3422 pixels
, &ctx
->Unpack
);
3424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3425 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3429 n
[3].i
= components
;
3430 n
[4].i
= (GLint
) width
;
3439 if (ctx
->ExecuteFlag
) {
3440 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3441 border
, format
, type
, pixels
);
3447 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3448 GLint level
, GLint components
,
3449 GLsizei width
, GLsizei height
, GLint border
,
3450 GLenum format
, GLenum type
,
3451 const GLvoid
*pixels
)
3453 GET_CURRENT_CONTEXT(ctx
);
3454 if (target
== GL_PROXY_TEXTURE_2D
) {
3455 /* don't compile, execute immediately */
3456 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3457 height
, border
, format
, type
, pixels
);
3460 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3461 pixels
, &ctx
->Unpack
);
3463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3464 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3468 n
[3].i
= components
;
3469 n
[4].i
= (GLint
) width
;
3470 n
[5].i
= (GLint
) height
;
3479 if (ctx
->ExecuteFlag
) {
3480 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3481 height
, border
, format
, type
, pixels
);
3487 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3488 GLint level
, GLint internalFormat
,
3489 GLsizei width
, GLsizei height
, GLsizei depth
,
3491 GLenum format
, GLenum type
,
3492 const GLvoid
*pixels
)
3494 GET_CURRENT_CONTEXT(ctx
);
3495 if (target
== GL_PROXY_TEXTURE_3D
) {
3496 /* don't compile, execute immediately */
3497 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3498 height
, depth
, border
, format
, type
, pixels
);
3502 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3503 pixels
, &ctx
->Unpack
);
3504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3505 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3509 n
[3].i
= (GLint
) internalFormat
;
3510 n
[4].i
= (GLint
) width
;
3511 n
[5].i
= (GLint
) height
;
3512 n
[6].i
= (GLint
) depth
;
3521 if (ctx
->ExecuteFlag
) {
3522 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3523 height
, depth
, border
, format
, type
, pixels
);
3529 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3530 GLsizei width
, GLenum format
, GLenum type
,
3531 const GLvoid
*pixels
)
3533 GET_CURRENT_CONTEXT(ctx
);
3535 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3536 pixels
, &ctx
->Unpack
);
3537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3538 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3543 n
[4].i
= (GLint
) width
;
3551 if (ctx
->ExecuteFlag
) {
3552 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3553 format
, type
, pixels
);
3558 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3559 GLint xoffset
, GLint yoffset
,
3560 GLsizei width
, GLsizei height
,
3561 GLenum format
, GLenum type
,
3562 const GLvoid
*pixels
)
3564 GET_CURRENT_CONTEXT(ctx
);
3566 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3567 pixels
, &ctx
->Unpack
);
3568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3569 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3575 n
[5].i
= (GLint
) width
;
3576 n
[6].i
= (GLint
) height
;
3584 if (ctx
->ExecuteFlag
) {
3585 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3586 width
, height
, format
, type
, pixels
);
3591 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3592 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3593 GLsizei width
, GLsizei height
, GLsizei depth
,
3594 GLenum format
, GLenum type
,
3595 const GLvoid
*pixels
)
3597 GET_CURRENT_CONTEXT(ctx
);
3599 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3600 pixels
, &ctx
->Unpack
);
3601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3602 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3609 n
[6].i
= (GLint
) width
;
3610 n
[7].i
= (GLint
) height
;
3611 n
[8].i
= (GLint
) depth
;
3619 if (ctx
->ExecuteFlag
) {
3620 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3621 xoffset
, yoffset
, zoffset
,
3622 width
, height
, depth
, format
, type
, pixels
);
3627 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3629 GET_CURRENT_CONTEXT(ctx
);
3631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3632 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3638 if (ctx
->ExecuteFlag
) {
3639 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3644 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3646 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3651 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3653 GET_CURRENT_CONTEXT(ctx
);
3655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3656 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3660 n
[3].i
= (GLint
) width
;
3661 n
[4].i
= (GLint
) height
;
3663 if (ctx
->ExecuteFlag
) {
3664 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3669 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3671 GET_CURRENT_CONTEXT(ctx
);
3673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3674 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3681 if (ctx
->ExecuteFlag
) {
3682 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3686 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3688 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3691 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3693 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3696 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3698 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3701 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3703 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3706 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3708 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3711 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3713 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3716 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3718 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3721 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3723 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3726 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3728 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3731 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3733 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3736 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3738 save_WindowPos4fMESA(x
, y
, z
, w
);
3741 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3743 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3746 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3748 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3751 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3753 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3756 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3758 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3761 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3763 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3766 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3768 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3771 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3773 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3776 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3778 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3781 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3783 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3784 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3787 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3789 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3792 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3794 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3795 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3798 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3800 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3805 /* GL_ARB_multitexture */
3806 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3808 GET_CURRENT_CONTEXT(ctx
);
3810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3811 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3815 if (ctx
->ExecuteFlag
) {
3816 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3821 /* GL_ARB_transpose_matrix */
3823 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3826 _math_transposefd(tm
, m
);
3827 save_LoadMatrixf(tm
);
3831 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3834 _math_transposef(tm
, m
);
3835 save_LoadMatrixf(tm
);
3839 static void GLAPIENTRY
3840 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3843 _math_transposefd(tm
, m
);
3844 save_MultMatrixf(tm
);
3848 static void GLAPIENTRY
3849 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3852 _math_transposef(tm
, m
);
3853 save_MultMatrixf(tm
);
3857 static void GLAPIENTRY
3858 save_PixelTexGenSGIX(GLenum mode
)
3860 GET_CURRENT_CONTEXT(ctx
);
3862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3863 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3867 if (ctx
->ExecuteFlag
) {
3868 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3873 /* GL_ARB_texture_compression */
3874 static void GLAPIENTRY
3875 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3876 GLenum internalFormat
, GLsizei width
,
3877 GLint border
, GLsizei imageSize
,
3880 GET_CURRENT_CONTEXT(ctx
);
3881 if (target
== GL_PROXY_TEXTURE_1D
) {
3882 /* don't compile, execute immediately */
3883 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3884 width
, border
, imageSize
, data
);
3889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3890 /* make copy of image */
3891 image
= MALLOC(imageSize
);
3893 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3896 MEMCPY(image
, data
, imageSize
);
3897 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3901 n
[3].e
= internalFormat
;
3902 n
[4].i
= (GLint
) width
;
3910 if (ctx
->ExecuteFlag
) {
3911 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3912 width
, border
, imageSize
, data
);
3918 static void GLAPIENTRY
3919 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3920 GLenum internalFormat
, GLsizei width
,
3921 GLsizei height
, GLint border
, GLsizei imageSize
,
3924 GET_CURRENT_CONTEXT(ctx
);
3925 if (target
== GL_PROXY_TEXTURE_2D
) {
3926 /* don't compile, execute immediately */
3927 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3928 width
, height
, border
, imageSize
, data
);
3933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3934 /* make copy of image */
3935 image
= MALLOC(imageSize
);
3937 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3940 MEMCPY(image
, data
, imageSize
);
3941 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3945 n
[3].e
= internalFormat
;
3946 n
[4].i
= (GLint
) width
;
3947 n
[5].i
= (GLint
) height
;
3955 if (ctx
->ExecuteFlag
) {
3956 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3957 width
, height
, border
, imageSize
, data
);
3963 static void GLAPIENTRY
3964 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3965 GLenum internalFormat
, GLsizei width
,
3966 GLsizei height
, GLsizei depth
, GLint border
,
3967 GLsizei imageSize
, const GLvoid
*data
)
3969 GET_CURRENT_CONTEXT(ctx
);
3970 if (target
== GL_PROXY_TEXTURE_3D
) {
3971 /* don't compile, execute immediately */
3972 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3973 width
, height
, depth
, border
, imageSize
, data
);
3978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3979 /* make copy of image */
3980 image
= MALLOC(imageSize
);
3982 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3985 MEMCPY(image
, data
, imageSize
);
3986 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3990 n
[3].e
= internalFormat
;
3991 n
[4].i
= (GLint
) width
;
3992 n
[5].i
= (GLint
) height
;
3993 n
[6].i
= (GLint
) depth
;
4001 if (ctx
->ExecuteFlag
) {
4002 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
4003 width
, height
, depth
, border
, imageSize
, data
);
4009 static void GLAPIENTRY
4010 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4011 GLsizei width
, GLenum format
,
4012 GLsizei imageSize
, const GLvoid
*data
)
4017 GET_CURRENT_CONTEXT(ctx
);
4018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4020 /* make copy of image */
4021 image
= MALLOC(imageSize
);
4023 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4026 MEMCPY(image
, data
, imageSize
);
4027 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4032 n
[4].i
= (GLint
) width
;
4040 if (ctx
->ExecuteFlag
) {
4041 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
4042 width
, format
, imageSize
, data
);
4047 static void GLAPIENTRY
4048 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4049 GLint yoffset
, GLsizei width
, GLsizei height
,
4050 GLenum format
, GLsizei imageSize
,
4056 GET_CURRENT_CONTEXT(ctx
);
4057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4059 /* make copy of image */
4060 image
= MALLOC(imageSize
);
4062 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4065 MEMCPY(image
, data
, imageSize
);
4066 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4072 n
[5].i
= (GLint
) width
;
4073 n
[6].i
= (GLint
) height
;
4081 if (ctx
->ExecuteFlag
) {
4082 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4083 width
, height
, format
, imageSize
, data
);
4088 static void GLAPIENTRY
4089 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4090 GLint yoffset
, GLint zoffset
, GLsizei width
,
4091 GLsizei height
, GLsizei depth
, GLenum format
,
4092 GLsizei imageSize
, const GLvoid
*data
)
4097 GET_CURRENT_CONTEXT(ctx
);
4098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4100 /* make copy of image */
4101 image
= MALLOC(imageSize
);
4103 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4106 MEMCPY(image
, data
, imageSize
);
4107 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4114 n
[6].i
= (GLint
) width
;
4115 n
[7].i
= (GLint
) height
;
4116 n
[8].i
= (GLint
) depth
;
4118 n
[10].i
= imageSize
;
4124 if (ctx
->ExecuteFlag
) {
4125 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4126 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4131 /* GL_ARB_multisample */
4132 static void GLAPIENTRY
4133 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4135 GET_CURRENT_CONTEXT(ctx
);
4137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4138 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4143 if (ctx
->ExecuteFlag
) {
4144 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4149 /* GL_SGIS_pixel_texture */
4151 static void GLAPIENTRY
4152 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4154 GET_CURRENT_CONTEXT(ctx
);
4156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4157 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4162 if (ctx
->ExecuteFlag
) {
4163 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4168 static void GLAPIENTRY
4169 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4171 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4175 static void GLAPIENTRY
4176 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4178 save_PixelTexGenParameteriSGIS(target
, *value
);
4182 static void GLAPIENTRY
4183 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4185 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4190 * GL_NV_vertex_program
4192 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4193 static void GLAPIENTRY
4194 save_BindProgramNV(GLenum target
, GLuint id
)
4196 GET_CURRENT_CONTEXT(ctx
);
4198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4199 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4204 if (ctx
->ExecuteFlag
) {
4205 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4208 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4210 #if FEATURE_NV_vertex_program
4211 static void GLAPIENTRY
4212 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4214 GET_CURRENT_CONTEXT(ctx
);
4216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4217 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4226 if (ctx
->ExecuteFlag
) {
4227 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4232 static void GLAPIENTRY
4233 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4234 GLfloat x
, GLfloat y
,
4235 GLfloat z
, GLfloat w
)
4237 GET_CURRENT_CONTEXT(ctx
);
4239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4240 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4249 if (ctx
->ExecuteFlag
) {
4250 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4255 static void GLAPIENTRY
4256 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4258 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4259 params
[2], params
[3]);
4263 static void GLAPIENTRY
4264 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4265 GLdouble x
, GLdouble y
,
4266 GLdouble z
, GLdouble w
)
4268 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4269 (GLfloat
) z
, (GLfloat
) w
);
4273 static void GLAPIENTRY
4274 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4275 const GLdouble
*params
)
4277 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4278 (GLfloat
) params
[1], (GLfloat
) params
[2],
4279 (GLfloat
) params
[3]);
4283 static void GLAPIENTRY
4284 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4285 GLuint num
, const GLdouble
*params
)
4288 for (i
= 0; i
< num
; i
++) {
4289 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4294 static void GLAPIENTRY
4295 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4296 GLuint num
, const GLfloat
*params
)
4299 for (i
= 0; i
< num
; i
++) {
4300 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4305 static void GLAPIENTRY
4306 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4307 const GLubyte
*program
)
4309 GET_CURRENT_CONTEXT(ctx
);
4311 GLubyte
*programCopy
;
4313 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4315 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4318 _mesa_memcpy(programCopy
, program
, len
);
4320 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4321 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4326 n
[4].data
= programCopy
;
4328 if (ctx
->ExecuteFlag
) {
4329 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4334 static void GLAPIENTRY
4335 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4337 GET_CURRENT_CONTEXT(ctx
);
4339 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4341 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4344 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4346 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4351 if (ctx
->ExecuteFlag
) {
4352 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4357 static void GLAPIENTRY
4358 save_TrackMatrixNV(GLenum target
, GLuint address
,
4359 GLenum matrix
, GLenum transform
)
4361 GET_CURRENT_CONTEXT(ctx
);
4363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4364 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4371 if (ctx
->ExecuteFlag
) {
4372 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4375 #endif /* FEATURE_NV_vertex_program */
4379 * GL_NV_fragment_program
4381 #if FEATURE_NV_fragment_program
4382 static void GLAPIENTRY
4383 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4384 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4386 GET_CURRENT_CONTEXT(ctx
);
4388 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4389 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4398 if (ctx
->ExecuteFlag
) {
4399 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4404 static void GLAPIENTRY
4405 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4406 const GLfloat
*params
)
4408 GET_CURRENT_CONTEXT(ctx
);
4410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4411 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4420 if (ctx
->ExecuteFlag
) {
4421 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4426 static void GLAPIENTRY
4427 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4428 GLdouble x
, GLdouble y
,
4429 GLdouble z
, GLdouble w
)
4431 GET_CURRENT_CONTEXT(ctx
);
4433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4434 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4438 n
[3].f
= (GLfloat
) x
;
4439 n
[4].f
= (GLfloat
) y
;
4440 n
[5].f
= (GLfloat
) z
;
4441 n
[6].f
= (GLfloat
) w
;
4443 if (ctx
->ExecuteFlag
) {
4444 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4449 static void GLAPIENTRY
4450 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4451 const GLdouble
*params
)
4453 GET_CURRENT_CONTEXT(ctx
);
4455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4456 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4460 n
[3].f
= (GLfloat
) params
[0];
4461 n
[4].f
= (GLfloat
) params
[1];
4462 n
[5].f
= (GLfloat
) params
[2];
4463 n
[6].f
= (GLfloat
) params
[3];
4465 if (ctx
->ExecuteFlag
) {
4466 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4470 static void GLAPIENTRY
4471 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4472 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4474 GET_CURRENT_CONTEXT(ctx
);
4476 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4478 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4481 _mesa_memcpy(nameCopy
, name
, len
);
4483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4484 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4488 n
[3].data
= nameCopy
;
4494 if (ctx
->ExecuteFlag
) {
4495 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4500 static void GLAPIENTRY
4501 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4504 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4508 static void GLAPIENTRY
4509 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4510 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4512 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4513 (GLfloat
) z
,(GLfloat
) w
);
4517 static void GLAPIENTRY
4518 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4521 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4522 (GLfloat
) v
[1], (GLfloat
) v
[2],
4526 #endif /* FEATURE_NV_fragment_program */
4530 /* GL_EXT_stencil_two_side */
4531 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4533 GET_CURRENT_CONTEXT(ctx
);
4535 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4536 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4540 if (ctx
->ExecuteFlag
) {
4541 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4546 /* GL_EXT_depth_bounds_test */
4547 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4549 GET_CURRENT_CONTEXT(ctx
);
4551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4552 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4554 n
[1].f
= (GLfloat
) zmin
;
4555 n
[2].f
= (GLfloat
) zmax
;
4557 if (ctx
->ExecuteFlag
) {
4558 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4564 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4566 static void GLAPIENTRY
4567 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4568 const GLvoid
*string
)
4570 GET_CURRENT_CONTEXT(ctx
);
4572 GLubyte
*programCopy
;
4574 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4576 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4579 _mesa_memcpy(programCopy
, string
, len
);
4581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4582 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4587 n
[4].data
= programCopy
;
4589 if (ctx
->ExecuteFlag
) {
4590 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4595 static void GLAPIENTRY
4596 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4597 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4599 GET_CURRENT_CONTEXT(ctx
);
4601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4602 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4611 if (ctx
->ExecuteFlag
) {
4612 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4617 static void GLAPIENTRY
4618 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4619 const GLfloat
*params
)
4621 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4622 params
[2], params
[3]);
4626 static void GLAPIENTRY
4627 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4628 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4630 save_ProgramEnvParameter4fARB(target
, index
,
4638 static void GLAPIENTRY
4639 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4640 const GLdouble
*params
)
4642 save_ProgramEnvParameter4fARB(target
, index
,
4643 (GLfloat
) params
[0],
4644 (GLfloat
) params
[1],
4645 (GLfloat
) params
[2],
4646 (GLfloat
) params
[3]);
4649 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4652 #ifdef FEATURE_ARB_occlusion_query
4654 static void GLAPIENTRY
4655 save_BeginQueryARB(GLenum target
, GLuint id
)
4657 GET_CURRENT_CONTEXT(ctx
);
4659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN_QUERY_ARB
, 2 );
4665 if (ctx
->ExecuteFlag
) {
4666 (*ctx
->Exec
->BeginQueryARB
)( target
, id
);
4671 static void GLAPIENTRY
4672 save_EndQueryARB(GLenum target
)
4674 GET_CURRENT_CONTEXT(ctx
);
4676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4677 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_END_QUERY_ARB
, 1 );
4681 if (ctx
->ExecuteFlag
) {
4682 (*ctx
->Exec
->EndQueryARB
)( target
);
4686 #endif /* FEATURE_ARB_occlusion_query */
4689 static void GLAPIENTRY
4690 save_DrawBuffersARB(GLsizei count
, const GLenum
*buffers
)
4692 GET_CURRENT_CONTEXT(ctx
);
4694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4695 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4699 if (count
> MAX_DRAW_BUFFERS
)
4700 count
= MAX_DRAW_BUFFERS
;
4701 for (i
= 0; i
< count
; i
++) {
4702 n
[2 + i
].e
= buffers
[i
];
4705 if (ctx
->ExecuteFlag
) {
4706 (*ctx
->Exec
->DrawBuffersARB
)(count
, buffers
);
4711 static void save_Attr1f( GLenum attr
, GLfloat x
)
4713 GET_CURRENT_CONTEXT(ctx
);
4715 SAVE_FLUSH_VERTICES( ctx
);
4716 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4722 ASSERT(attr
< VERT_ATTRIB_MAX
);
4723 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4724 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4726 if (ctx
->ExecuteFlag
) {
4727 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4731 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4733 GET_CURRENT_CONTEXT(ctx
);
4735 SAVE_FLUSH_VERTICES( ctx
);
4736 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4743 ASSERT(attr
< VERT_ATTRIB_MAX
);
4744 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4745 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4747 if (ctx
->ExecuteFlag
) {
4748 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4752 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4754 GET_CURRENT_CONTEXT(ctx
);
4756 SAVE_FLUSH_VERTICES( ctx
);
4757 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4765 ASSERT(attr
< VERT_ATTRIB_MAX
);
4766 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4767 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4769 if (ctx
->ExecuteFlag
) {
4770 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4774 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4777 GET_CURRENT_CONTEXT(ctx
);
4779 SAVE_FLUSH_VERTICES( ctx
);
4780 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4789 ASSERT(attr
< VERT_ATTRIB_MAX
);
4790 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4791 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4793 if (ctx
->ExecuteFlag
) {
4794 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4798 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4800 GET_CURRENT_CONTEXT(ctx
);
4802 SAVE_FLUSH_VERTICES( ctx
);
4803 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4807 if (ctx
->ExecuteFlag
) {
4808 (*ctx
->Exec
->EvalCoord1f
)( x
);
4812 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4814 save_EvalCoord1f( v
[0] );
4817 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4819 GET_CURRENT_CONTEXT(ctx
);
4821 SAVE_FLUSH_VERTICES( ctx
);
4822 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4827 if (ctx
->ExecuteFlag
) {
4828 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4832 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4834 save_EvalCoord2f( v
[0], v
[1] );
4838 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4840 GET_CURRENT_CONTEXT(ctx
);
4842 SAVE_FLUSH_VERTICES( ctx
);
4843 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4847 if (ctx
->ExecuteFlag
) {
4848 (*ctx
->Exec
->EvalPoint1
)( x
);
4852 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4854 GET_CURRENT_CONTEXT(ctx
);
4856 SAVE_FLUSH_VERTICES( ctx
);
4857 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4862 if (ctx
->ExecuteFlag
) {
4863 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4867 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4869 GET_CURRENT_CONTEXT(ctx
);
4871 SAVE_FLUSH_VERTICES( ctx
);
4872 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4877 ctx
->ListState
.ActiveIndex
= 1;
4878 ctx
->ListState
.CurrentIndex
= x
;
4880 if (ctx
->ExecuteFlag
) {
4881 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4885 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4887 save_Indexf( v
[0] );
4890 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4892 GET_CURRENT_CONTEXT(ctx
);
4894 SAVE_FLUSH_VERTICES( ctx
);
4895 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4900 ctx
->ListState
.ActiveEdgeFlag
= 1;
4901 ctx
->ListState
.CurrentEdgeFlag
= x
;
4903 if (ctx
->ExecuteFlag
) {
4904 (*ctx
->Exec
->EdgeFlag
)( x
);
4908 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4910 save_EdgeFlag( v
[0] );
4913 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4915 GET_CURRENT_CONTEXT(ctx
);
4919 SAVE_FLUSH_VERTICES( ctx
);
4924 case GL_FRONT_AND_BACK
:
4927 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4936 case GL_AMBIENT_AND_DIFFUSE
:
4942 case GL_COLOR_INDEXES
:
4946 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4950 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4954 for (i
= 0 ; i
< args
; i
++)
4955 n
[3+i
].f
= param
[i
];
4959 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4960 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4961 if (bitmask
& (1<<i
)) {
4962 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4963 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4967 if (ctx
->ExecuteFlag
) {
4968 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4972 static void GLAPIENTRY
save_Begin( GLenum mode
)
4974 GET_CURRENT_CONTEXT(ctx
);
4976 GLboolean error
= GL_FALSE
;
4978 if (/*mode < GL_POINTS ||*/ mode
> GL_POLYGON
) {
4979 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4982 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4983 /* Typically the first begin. This may raise an error on
4984 * playback, depending on whether CallList is issued from inside
4985 * a begin/end or not.
4987 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4989 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4990 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4993 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4998 /* Give the driver an opportunity to hook in an optimized
4999 * display list compiler.
5001 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
5004 SAVE_FLUSH_VERTICES( ctx
);
5005 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
5011 if (ctx
->ExecuteFlag
) {
5012 (*ctx
->Exec
->Begin
)( mode
);
5016 static void GLAPIENTRY
save_End( void )
5018 GET_CURRENT_CONTEXT(ctx
);
5019 SAVE_FLUSH_VERTICES( ctx
);
5020 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
5021 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5022 if (ctx
->ExecuteFlag
) {
5023 (*ctx
->Exec
->End
)( );
5027 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
5028 GLfloat c
, GLfloat d
)
5030 GET_CURRENT_CONTEXT(ctx
);
5032 SAVE_FLUSH_VERTICES( ctx
);
5033 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
5040 if (ctx
->ExecuteFlag
) {
5041 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
5047 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
5049 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
5052 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
5054 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
5057 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
5059 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
5062 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
5064 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
5067 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5069 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
5072 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
5074 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
5077 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
5079 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
5082 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5084 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
5087 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5089 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
5092 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5094 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5097 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5099 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
5102 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5104 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5107 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5109 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5112 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5114 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5117 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5119 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5122 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5124 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5127 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5129 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5132 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5134 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5137 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5139 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5142 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5144 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5147 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5149 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5152 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5154 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5157 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5159 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5162 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5164 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5168 /* Just call the respective ATTR for texcoord
5170 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5172 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5173 save_Attr1f( attr
, x
);
5176 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5178 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5179 save_Attr1f( attr
, v
[0] );
5182 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5184 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5185 save_Attr2f( attr
, x
, y
);
5188 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5190 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5191 save_Attr2f( attr
, v
[0], v
[1] );
5194 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5197 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5198 save_Attr3f( attr
, x
, y
, z
);
5201 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5203 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5204 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5207 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5208 GLfloat z
, GLfloat w
)
5210 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5211 save_Attr4f( attr
, x
, y
, z
, w
);
5214 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5216 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5217 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5221 static void enum_error( void )
5223 GET_CURRENT_CONTEXT( ctx
);
5224 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5227 /* First level for NV_vertex_program:
5229 * Check for errors at compile time?.
5231 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5233 if (index
< VERT_ATTRIB_MAX
)
5234 save_Attr1f( index
, x
);
5239 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5241 if (index
< VERT_ATTRIB_MAX
)
5242 save_Attr1f( index
, v
[0] );
5247 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5249 if (index
< VERT_ATTRIB_MAX
)
5250 save_Attr2f( index
, x
, y
);
5255 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5257 if (index
< VERT_ATTRIB_MAX
)
5258 save_Attr2f( index
, v
[0], v
[1] );
5263 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5266 if (index
< VERT_ATTRIB_MAX
)
5267 save_Attr3f( index
, x
, y
, z
);
5272 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5274 if (index
< VERT_ATTRIB_MAX
)
5275 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5280 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5281 GLfloat z
, GLfloat w
)
5283 if (index
< VERT_ATTRIB_MAX
)
5284 save_Attr4f( index
, x
, y
, z
, w
);
5289 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5291 if (index
< VERT_ATTRIB_MAX
)
5292 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5301 /* KW: Compile commands
5303 * Will appear in the list before the vertex buffer containing the
5304 * command that provoked the error. I don't see this as a problem.
5307 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5310 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5313 n
[2].data
= (void *) s
;
5315 /* execute already done */
5320 * Compile an error into current display list.
5323 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5325 if (ctx
->CompileFlag
)
5326 _mesa_save_error( ctx
, error
, s
);
5328 if (ctx
->ExecuteFlag
)
5329 _mesa_error( ctx
, error
, s
);
5335 islist(GLcontext
*ctx
, GLuint list
)
5337 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5347 /**********************************************************************/
5348 /* Display list execution */
5349 /**********************************************************************/
5353 * Execute a display list. Note that the ListBase offset must have already
5354 * been added before calling this function. I.e. the list argument is
5355 * the absolute list number, not relative to ListBase.
5356 * \param list - display list number
5358 static void GLAPIENTRY
5359 execute_list( GLcontext
*ctx
, GLuint list
)
5364 if (list
== 0 || !islist(ctx
,list
))
5367 if (ctx
->Driver
.BeginCallList
)
5368 ctx
->Driver
.BeginCallList( ctx
, list
);
5370 ctx
->ListState
.CallDepth
++;
5372 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5376 OpCode opcode
= n
[0].opcode
;
5377 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5379 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5380 /* this is a driver-extended opcode */
5381 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5382 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5387 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5390 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5392 case OPCODE_ALPHA_FUNC
:
5393 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5395 case OPCODE_BIND_TEXTURE
:
5396 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5400 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5401 ctx
->Unpack
= ctx
->DefaultPacking
;
5402 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5403 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5404 ctx
->Unpack
= save
; /* restore */
5407 case OPCODE_BLEND_COLOR
:
5408 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5410 case OPCODE_BLEND_EQUATION
:
5411 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5413 case OPCODE_BLEND_EQUATION_SEPARATE
:
5414 (*ctx
->Exec
->BlendEquationSeparateEXT
)( n
[1].e
, n
[2].e
);
5416 case OPCODE_BLEND_FUNC_SEPARATE
:
5417 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5419 case OPCODE_CALL_LIST
:
5420 /* Generated by glCallList(), don't add ListBase */
5421 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5422 execute_list( ctx
, n
[1].ui
);
5425 case OPCODE_CALL_LIST_OFFSET
:
5426 /* Generated by glCallLists() so we must add ListBase */
5428 /* user specified a bad data type at compile time */
5429 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5431 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5432 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5436 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5438 case OPCODE_CLEAR_COLOR
:
5439 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5441 case OPCODE_CLEAR_ACCUM
:
5442 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5444 case OPCODE_CLEAR_DEPTH
:
5445 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5447 case OPCODE_CLEAR_INDEX
:
5448 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5450 case OPCODE_CLEAR_STENCIL
:
5451 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5453 case OPCODE_CLIP_PLANE
:
5460 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5463 case OPCODE_COLOR_MASK
:
5464 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5466 case OPCODE_COLOR_MATERIAL
:
5467 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5469 case OPCODE_COLOR_TABLE
:
5471 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5472 ctx
->Unpack
= ctx
->DefaultPacking
;
5473 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5474 n
[5].e
, n
[6].data
);
5475 ctx
->Unpack
= save
; /* restore */
5478 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5485 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5488 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5495 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5498 case OPCODE_COLOR_SUB_TABLE
:
5500 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5501 ctx
->Unpack
= ctx
->DefaultPacking
;
5502 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5503 n
[4].e
, n
[5].e
, n
[6].data
);
5504 ctx
->Unpack
= save
; /* restore */
5507 case OPCODE_CONVOLUTION_FILTER_1D
:
5509 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5510 ctx
->Unpack
= ctx
->DefaultPacking
;
5511 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5512 n
[4].e
, n
[5].e
, n
[6].data
);
5513 ctx
->Unpack
= save
; /* restore */
5516 case OPCODE_CONVOLUTION_FILTER_2D
:
5518 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5519 ctx
->Unpack
= ctx
->DefaultPacking
;
5520 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5521 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5522 ctx
->Unpack
= save
; /* restore */
5525 case OPCODE_CONVOLUTION_PARAMETER_I
:
5526 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5528 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5535 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5538 case OPCODE_CONVOLUTION_PARAMETER_F
:
5539 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5541 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5548 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5551 case OPCODE_COPY_COLOR_SUB_TABLE
:
5552 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5553 n
[3].i
, n
[4].i
, n
[5].i
);
5555 case OPCODE_COPY_COLOR_TABLE
:
5556 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5557 n
[3].i
, n
[4].i
, n
[5].i
);
5559 case OPCODE_COPY_PIXELS
:
5560 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5561 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5563 case OPCODE_COPY_TEX_IMAGE1D
:
5564 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5565 n
[5].i
, n
[6].i
, n
[7].i
);
5567 case OPCODE_COPY_TEX_IMAGE2D
:
5568 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5569 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5571 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5572 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5573 n
[4].i
, n
[5].i
, n
[6].i
);
5575 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5576 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5577 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5579 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5580 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5581 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5583 case OPCODE_CULL_FACE
:
5584 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5586 case OPCODE_DEPTH_FUNC
:
5587 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5589 case OPCODE_DEPTH_MASK
:
5590 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5592 case OPCODE_DEPTH_RANGE
:
5593 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5595 case OPCODE_DISABLE
:
5596 (*ctx
->Exec
->Disable
)( n
[1].e
);
5598 case OPCODE_DRAW_BUFFER
:
5599 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5601 case OPCODE_DRAW_PIXELS
:
5603 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5604 ctx
->Unpack
= ctx
->DefaultPacking
;
5605 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5607 ctx
->Unpack
= save
; /* restore */
5611 (*ctx
->Exec
->Enable
)( n
[1].e
);
5613 case OPCODE_EVALMESH1
:
5614 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5616 case OPCODE_EVALMESH2
:
5617 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5626 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5629 case OPCODE_FRONT_FACE
:
5630 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5632 case OPCODE_FRUSTUM
:
5633 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5636 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5638 case OPCODE_HISTOGRAM
:
5639 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5641 case OPCODE_INDEX_MASK
:
5642 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5644 case OPCODE_INIT_NAMES
:
5645 (*ctx
->Exec
->InitNames
)();
5654 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5657 case OPCODE_LIGHT_MODEL
:
5664 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5667 case OPCODE_LINE_STIPPLE
:
5668 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5670 case OPCODE_LINE_WIDTH
:
5671 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5673 case OPCODE_LIST_BASE
:
5674 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5676 case OPCODE_LOAD_IDENTITY
:
5677 (*ctx
->Exec
->LoadIdentity
)();
5679 case OPCODE_LOAD_MATRIX
:
5680 if (sizeof(Node
)==sizeof(GLfloat
)) {
5681 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5686 for (i
=0;i
<16;i
++) {
5689 (*ctx
->Exec
->LoadMatrixf
)( m
);
5692 case OPCODE_LOAD_NAME
:
5693 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5695 case OPCODE_LOGIC_OP
:
5696 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5700 GLenum target
= n
[1].e
;
5701 GLint ustride
= _mesa_evaluator_components(target
);
5702 GLint uorder
= n
[5].i
;
5703 GLfloat u1
= n
[2].f
;
5704 GLfloat u2
= n
[3].f
;
5705 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5706 (GLfloat
*) n
[6].data
);
5711 GLenum target
= n
[1].e
;
5712 GLfloat u1
= n
[2].f
;
5713 GLfloat u2
= n
[3].f
;
5714 GLfloat v1
= n
[4].f
;
5715 GLfloat v2
= n
[5].f
;
5716 GLint ustride
= n
[6].i
;
5717 GLint vstride
= n
[7].i
;
5718 GLint uorder
= n
[8].i
;
5719 GLint vorder
= n
[9].i
;
5720 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5721 v1
, v2
, vstride
, vorder
,
5722 (GLfloat
*) n
[10].data
);
5725 case OPCODE_MAPGRID1
:
5726 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5728 case OPCODE_MAPGRID2
:
5729 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5731 case OPCODE_MATRIX_MODE
:
5732 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5734 case OPCODE_MIN_MAX
:
5735 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5737 case OPCODE_MULT_MATRIX
:
5738 if (sizeof(Node
)==sizeof(GLfloat
)) {
5739 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5744 for (i
=0;i
<16;i
++) {
5747 (*ctx
->Exec
->MultMatrixf
)( m
);
5751 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5753 case OPCODE_PASSTHROUGH
:
5754 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5756 case OPCODE_PIXEL_MAP
:
5757 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5759 case OPCODE_PIXEL_TRANSFER
:
5760 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5762 case OPCODE_PIXEL_ZOOM
:
5763 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5765 case OPCODE_POINT_SIZE
:
5766 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5768 case OPCODE_POINT_PARAMETERS
:
5774 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5777 case OPCODE_POLYGON_MODE
:
5778 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5780 case OPCODE_POLYGON_STIPPLE
:
5781 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5783 case OPCODE_POLYGON_OFFSET
:
5784 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5786 case OPCODE_POP_ATTRIB
:
5787 (*ctx
->Exec
->PopAttrib
)();
5789 case OPCODE_POP_MATRIX
:
5790 (*ctx
->Exec
->PopMatrix
)();
5792 case OPCODE_POP_NAME
:
5793 (*ctx
->Exec
->PopName
)();
5795 case OPCODE_PRIORITIZE_TEXTURE
:
5796 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5798 case OPCODE_PUSH_ATTRIB
:
5799 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5801 case OPCODE_PUSH_MATRIX
:
5802 (*ctx
->Exec
->PushMatrix
)();
5804 case OPCODE_PUSH_NAME
:
5805 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5807 case OPCODE_RASTER_POS
:
5808 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5810 case OPCODE_READ_BUFFER
:
5811 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5813 case OPCODE_RESET_HISTOGRAM
:
5814 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5816 case OPCODE_RESET_MIN_MAX
:
5817 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5820 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5823 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5825 case OPCODE_SCISSOR
:
5826 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5828 case OPCODE_SHADE_MODEL
:
5829 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5831 case OPCODE_STENCIL_FUNC
:
5832 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5834 case OPCODE_STENCIL_MASK
:
5835 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5837 case OPCODE_STENCIL_OP
:
5838 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5847 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5857 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5860 case OPCODE_TEXPARAMETER
:
5867 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5870 case OPCODE_TEX_IMAGE1D
:
5872 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5873 ctx
->Unpack
= ctx
->DefaultPacking
;
5874 (*ctx
->Exec
->TexImage1D
)(
5875 n
[1].e
, /* target */
5877 n
[3].i
, /* components */
5879 n
[5].e
, /* border */
5880 n
[6].e
, /* format */
5883 ctx
->Unpack
= save
; /* restore */
5886 case OPCODE_TEX_IMAGE2D
:
5888 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5889 ctx
->Unpack
= ctx
->DefaultPacking
;
5890 (*ctx
->Exec
->TexImage2D
)(
5891 n
[1].e
, /* target */
5893 n
[3].i
, /* components */
5895 n
[5].i
, /* height */
5896 n
[6].e
, /* border */
5897 n
[7].e
, /* format */
5900 ctx
->Unpack
= save
; /* restore */
5903 case OPCODE_TEX_IMAGE3D
:
5905 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5906 ctx
->Unpack
= ctx
->DefaultPacking
;
5907 (*ctx
->Exec
->TexImage3D
)(
5908 n
[1].e
, /* target */
5910 n
[3].i
, /* components */
5912 n
[5].i
, /* height */
5914 n
[7].e
, /* border */
5915 n
[8].e
, /* format */
5918 ctx
->Unpack
= save
; /* restore */
5921 case OPCODE_TEX_SUB_IMAGE1D
:
5923 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5924 ctx
->Unpack
= ctx
->DefaultPacking
;
5925 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5927 n
[6].e
, n
[7].data
);
5928 ctx
->Unpack
= save
; /* restore */
5931 case OPCODE_TEX_SUB_IMAGE2D
:
5933 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5934 ctx
->Unpack
= ctx
->DefaultPacking
;
5935 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5937 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5938 ctx
->Unpack
= save
; /* restore */
5941 case OPCODE_TEX_SUB_IMAGE3D
:
5943 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5944 ctx
->Unpack
= ctx
->DefaultPacking
;
5945 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5946 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5947 n
[8].i
, n
[9].e
, n
[10].e
,
5949 ctx
->Unpack
= save
; /* restore */
5952 case OPCODE_TRANSLATE
:
5953 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5955 case OPCODE_VIEWPORT
:
5956 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5957 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5959 case OPCODE_WINDOW_POS
:
5960 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5962 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5963 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5965 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5966 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5968 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5969 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5971 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5972 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5973 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5975 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5976 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5977 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5979 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5980 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5981 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5983 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5984 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5985 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5987 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5988 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5989 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5991 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5992 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5993 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5994 n
[9].e
, n
[10].i
, n
[11].data
);
5996 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5997 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5999 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6000 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
6002 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6003 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6004 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
6007 #if FEATURE_NV_vertex_program
6008 case OPCODE_EXECUTE_PROGRAM_NV
:
6015 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
6018 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6019 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
6020 (GLuint
*) n
[2].data
);
6022 case OPCODE_LOAD_PROGRAM_NV
:
6023 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
6024 (const GLubyte
*) n
[4].data
);
6026 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6027 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6028 n
[4].f
, n
[5].f
, n
[6].f
);
6030 case OPCODE_TRACK_MATRIX_NV
:
6031 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
6035 #if FEATURE_NV_fragment_program
6036 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6037 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6038 n
[4].f
, n
[5].f
, n
[6].f
);
6040 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6041 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
6042 (const GLubyte
*) n
[3].data
,
6043 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
6047 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6048 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
6050 case OPCODE_DEPTH_BOUNDS_EXT
:
6051 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
6053 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6054 case OPCODE_PROGRAM_STRING_ARB
:
6055 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
6057 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6058 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
6059 n
[4].f
, n
[5].f
, n
[6].f
);
6062 #if FEATURE_ARB_occlusion_query
6063 case OPCODE_BEGIN_QUERY_ARB
:
6064 ctx
->Exec
->BeginQueryARB(n
[1].e
, n
[2].ui
);
6066 case OPCODE_END_QUERY_ARB
:
6067 ctx
->Exec
->EndQueryARB(n
[1].e
);
6070 case OPCODE_DRAW_BUFFERS_ARB
:
6072 GLenum buffers
[MAX_DRAW_BUFFERS
];
6073 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6074 for (i
= 0; i
< count
; i
++)
6075 buffers
[i
] = n
[2 + i
].e
;
6076 ctx
->Exec
->DrawBuffersARB(n
[1].i
, buffers
);
6079 case OPCODE_ATTR_1F
:
6080 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
6082 case OPCODE_ATTR_2F
:
6083 /* Really shouldn't have to do this - the Node structure
6084 * is convenient, but it would be better to store the data
6085 * packed appropriately so that it can be sent directly
6086 * on. With x86_64 becoming common, this will start to
6089 if (sizeof(Node
)==sizeof(GLfloat
))
6090 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
6092 (*ctx
->Exec
->VertexAttrib2fNV
)(n
[1].e
, n
[2].f
, n
[3].f
);
6094 case OPCODE_ATTR_3F
:
6095 if (sizeof(Node
)==sizeof(GLfloat
))
6096 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
6098 (*ctx
->Exec
->VertexAttrib3fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6101 case OPCODE_ATTR_4F
:
6102 if (sizeof(Node
)==sizeof(GLfloat
))
6103 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
6105 (*ctx
->Exec
->VertexAttrib4fNV
)(n
[1].e
, n
[2].f
, n
[3].f
,
6108 case OPCODE_MATERIAL
:
6109 if (sizeof(Node
)==sizeof(GLfloat
))
6110 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
6117 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, f
);
6121 (*ctx
->Exec
->Indexi
)(n
[1].i
);
6123 case OPCODE_EDGEFLAG
:
6124 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
6127 (*ctx
->Exec
->Begin
)(n
[1].e
);
6130 (*ctx
->Exec
->End
)();
6133 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6135 case OPCODE_EVAL_C1
:
6136 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
6138 case OPCODE_EVAL_C2
:
6139 (*ctx
->Exec
->EvalCoord2f
)(n
[1].f
, n
[2].f
);
6141 case OPCODE_EVAL_P1
:
6142 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
6144 case OPCODE_EVAL_P2
:
6145 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
6151 case OPCODE_CONTINUE
:
6152 n
= (Node
*) n
[1].next
;
6154 case OPCODE_END_OF_LIST
:
6160 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6161 _mesa_problem(ctx
, msg
);
6166 /* increment n to point to next compiled command */
6167 if (opcode
!=OPCODE_CONTINUE
) {
6168 n
+= InstSize
[opcode
];
6172 ctx
->ListState
.CallDepth
--;
6174 if (ctx
->Driver
.EndCallList
)
6175 ctx
->Driver
.EndCallList( ctx
);
6182 /**********************************************************************/
6184 /**********************************************************************/
6190 * Test if a display list number is valid.
6192 GLboolean GLAPIENTRY
6193 _mesa_IsList( GLuint list
)
6195 GET_CURRENT_CONTEXT(ctx
);
6196 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6197 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6198 return islist(ctx
, list
);
6203 * Delete a sequence of consecutive display lists.
6206 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6208 GET_CURRENT_CONTEXT(ctx
);
6210 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6211 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6214 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6217 for (i
=list
;i
<list
+range
;i
++) {
6218 _mesa_destroy_list( ctx
, i
);
6225 * Return a display list number, n, such that lists n through n+range-1
6229 _mesa_GenLists(GLsizei range
)
6231 GET_CURRENT_CONTEXT(ctx
);
6233 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6234 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6237 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6245 * Make this an atomic operation
6247 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6249 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6251 /* reserve the list IDs by with empty/dummy lists */
6253 for (i
=0; i
<range
; i
++) {
6254 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6258 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6266 * Begin a new display list.
6269 _mesa_NewList( GLuint list
, GLenum mode
)
6271 GET_CURRENT_CONTEXT(ctx
);
6274 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6275 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6277 if (MESA_VERBOSE
&VERBOSE_API
)
6278 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6279 _mesa_lookup_enum_by_nr(mode
));
6282 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6286 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6287 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6291 if (ctx
->ListState
.CurrentListPtr
) {
6292 /* already compiling a display list */
6293 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6297 ctx
->CompileFlag
= GL_TRUE
;
6298 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6300 /* Allocate new display list */
6301 ctx
->ListState
.CurrentListNum
= list
;
6302 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6303 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6304 ctx
->ListState
.CurrentPos
= 0;
6306 /* Reset acumulated list state:
6308 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6309 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6311 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6312 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6314 ctx
->ListState
.ActiveIndex
= 0;
6315 ctx
->ListState
.ActiveEdgeFlag
= 0;
6317 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6318 ctx
->Driver
.NewList( ctx
, list
, mode
);
6320 ctx
->CurrentDispatch
= ctx
->Save
;
6321 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6327 * End definition of current display list.
6330 _mesa_EndList( void )
6332 GET_CURRENT_CONTEXT(ctx
);
6333 SAVE_FLUSH_VERTICES(ctx
);
6334 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6336 if (MESA_VERBOSE
&VERBOSE_API
)
6337 _mesa_debug(ctx
, "glEndList\n");
6339 /* Check that a list is under construction */
6340 if (!ctx
->ListState
.CurrentListPtr
) {
6341 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6345 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6347 /* Destroy old list, if any */
6348 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6349 /* Install the list */
6350 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6353 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6354 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6356 ctx
->ListState
.CurrentListNum
= 0;
6357 ctx
->ListState
.CurrentListPtr
= NULL
;
6358 ctx
->ExecuteFlag
= GL_TRUE
;
6359 ctx
->CompileFlag
= GL_FALSE
;
6361 ctx
->Driver
.EndList( ctx
);
6363 ctx
->CurrentDispatch
= ctx
->Exec
;
6364 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6370 _mesa_CallList( GLuint list
)
6372 GLboolean save_compile_flag
;
6373 GET_CURRENT_CONTEXT(ctx
);
6374 FLUSH_CURRENT(ctx
, 0);
6375 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6376 /* execute the display list, and restore the CompileFlag. */
6378 if (MESA_VERBOSE
& VERBOSE_API
)
6379 _mesa_debug(ctx
, "glCallList %d\n", list
);
6382 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6386 /* mesa_print_display_list( list ); */
6388 save_compile_flag
= ctx
->CompileFlag
;
6389 if (save_compile_flag
) {
6390 ctx
->CompileFlag
= GL_FALSE
;
6393 execute_list( ctx
, list
);
6394 ctx
->CompileFlag
= save_compile_flag
;
6396 /* also restore API function pointers to point to "save" versions */
6397 if (save_compile_flag
) {
6398 ctx
->CurrentDispatch
= ctx
->Save
;
6399 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6406 * Execute glCallLists: call multiple display lists.
6409 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6411 GET_CURRENT_CONTEXT(ctx
);
6414 GLboolean save_compile_flag
;
6416 if (MESA_VERBOSE
& VERBOSE_API
)
6417 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6421 case GL_UNSIGNED_BYTE
:
6423 case GL_UNSIGNED_SHORT
:
6425 case GL_UNSIGNED_INT
:
6433 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6437 /* Save the CompileFlag status, turn it off, execute display list,
6438 * and restore the CompileFlag.
6440 save_compile_flag
= ctx
->CompileFlag
;
6441 ctx
->CompileFlag
= GL_FALSE
;
6444 list
= translate_id( i
, type
, lists
);
6445 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6448 ctx
->CompileFlag
= save_compile_flag
;
6450 /* also restore API function pointers to point to "save" versions */
6451 if (save_compile_flag
) {
6452 ctx
->CurrentDispatch
= ctx
->Save
;
6453 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6460 * Set the offset added to list numbers in glCallLists.
6463 _mesa_ListBase( GLuint base
)
6465 GET_CURRENT_CONTEXT(ctx
);
6466 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6467 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6468 ctx
->List
.ListBase
= base
;
6472 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6474 static void GLAPIENTRY
exec_Finish( void )
6476 GET_CURRENT_CONTEXT(ctx
);
6477 FLUSH_VERTICES(ctx
, 0);
6478 ctx
->Exec
->Finish();
6481 static void GLAPIENTRY
exec_Flush( void )
6483 GET_CURRENT_CONTEXT(ctx
);
6484 FLUSH_VERTICES(ctx
, 0);
6485 ctx
->Exec
->Flush( );
6488 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6490 GET_CURRENT_CONTEXT(ctx
);
6491 FLUSH_VERTICES(ctx
, 0);
6492 ctx
->Exec
->GetBooleanv( pname
, params
);
6495 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6497 GET_CURRENT_CONTEXT(ctx
);
6498 FLUSH_VERTICES(ctx
, 0);
6499 ctx
->Exec
->GetClipPlane( plane
, equation
);
6502 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6504 GET_CURRENT_CONTEXT(ctx
);
6505 FLUSH_VERTICES(ctx
, 0);
6506 ctx
->Exec
->GetDoublev( pname
, params
);
6509 static GLenum GLAPIENTRY
exec_GetError( void )
6511 GET_CURRENT_CONTEXT(ctx
);
6512 FLUSH_VERTICES(ctx
, 0);
6513 return ctx
->Exec
->GetError( );
6516 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6518 GET_CURRENT_CONTEXT(ctx
);
6519 FLUSH_VERTICES(ctx
, 0);
6520 ctx
->Exec
->GetFloatv( pname
, params
);
6523 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6525 GET_CURRENT_CONTEXT(ctx
);
6526 FLUSH_VERTICES(ctx
, 0);
6527 ctx
->Exec
->GetIntegerv( pname
, params
);
6530 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6532 GET_CURRENT_CONTEXT(ctx
);
6533 FLUSH_VERTICES(ctx
, 0);
6534 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6537 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6539 GET_CURRENT_CONTEXT(ctx
);
6540 FLUSH_VERTICES(ctx
, 0);
6541 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6544 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6546 GET_CURRENT_CONTEXT(ctx
);
6547 FLUSH_VERTICES(ctx
, 0);
6548 ctx
->Exec
->GetMapdv( target
, query
, v
);
6551 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6553 GET_CURRENT_CONTEXT(ctx
);
6554 FLUSH_VERTICES(ctx
, 0);
6555 ctx
->Exec
->GetMapfv( target
, query
, v
);
6558 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6560 GET_CURRENT_CONTEXT(ctx
);
6561 FLUSH_VERTICES(ctx
, 0);
6562 ctx
->Exec
->GetMapiv( target
, query
, v
);
6565 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6567 GET_CURRENT_CONTEXT(ctx
);
6568 FLUSH_VERTICES(ctx
, 0);
6569 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6572 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6574 GET_CURRENT_CONTEXT(ctx
);
6575 FLUSH_VERTICES(ctx
, 0);
6576 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6579 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6581 GET_CURRENT_CONTEXT(ctx
);
6582 FLUSH_VERTICES(ctx
, 0);
6583 ctx
->Exec
->GetPixelMapfv( map
, values
);
6586 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6588 GET_CURRENT_CONTEXT(ctx
);
6589 FLUSH_VERTICES(ctx
, 0);
6590 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6593 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6595 GET_CURRENT_CONTEXT(ctx
);
6596 FLUSH_VERTICES(ctx
, 0);
6597 ctx
->Exec
->GetPixelMapusv( map
, values
);
6600 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6602 GET_CURRENT_CONTEXT(ctx
);
6603 FLUSH_VERTICES(ctx
, 0);
6604 ctx
->Exec
->GetPolygonStipple( dest
);
6607 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6609 GET_CURRENT_CONTEXT(ctx
);
6610 FLUSH_VERTICES(ctx
, 0);
6611 return ctx
->Exec
->GetString( name
);
6614 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6616 GET_CURRENT_CONTEXT(ctx
);
6617 FLUSH_VERTICES(ctx
, 0);
6618 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6621 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6623 GET_CURRENT_CONTEXT(ctx
);
6624 FLUSH_VERTICES(ctx
, 0);
6625 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6628 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6630 GET_CURRENT_CONTEXT(ctx
);
6631 FLUSH_VERTICES(ctx
, 0);
6632 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6635 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6637 GET_CURRENT_CONTEXT(ctx
);
6638 FLUSH_VERTICES(ctx
, 0);
6639 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6642 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6644 GET_CURRENT_CONTEXT(ctx
);
6645 FLUSH_VERTICES(ctx
, 0);
6646 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6649 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6650 GLenum type
, GLvoid
*pixels
)
6652 GET_CURRENT_CONTEXT(ctx
);
6653 FLUSH_VERTICES(ctx
, 0);
6654 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6657 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6658 GLenum pname
, GLfloat
*params
)
6660 GET_CURRENT_CONTEXT(ctx
);
6661 FLUSH_VERTICES(ctx
, 0);
6662 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6665 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6666 GLenum pname
, GLint
*params
)
6668 GET_CURRENT_CONTEXT(ctx
);
6669 FLUSH_VERTICES(ctx
, 0);
6670 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6673 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6676 GET_CURRENT_CONTEXT(ctx
);
6677 FLUSH_VERTICES(ctx
, 0);
6678 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6681 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6683 GET_CURRENT_CONTEXT(ctx
);
6684 FLUSH_VERTICES(ctx
, 0);
6685 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6688 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6690 GET_CURRENT_CONTEXT(ctx
);
6691 FLUSH_VERTICES(ctx
, 0);
6692 return ctx
->Exec
->IsEnabled( cap
);
6695 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6697 GET_CURRENT_CONTEXT(ctx
);
6698 FLUSH_VERTICES(ctx
, 0);
6699 ctx
->Exec
->PixelStoref( pname
, param
);
6702 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6704 GET_CURRENT_CONTEXT(ctx
);
6705 FLUSH_VERTICES(ctx
, 0);
6706 ctx
->Exec
->PixelStorei( pname
, param
);
6709 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6710 GLenum format
, GLenum type
, GLvoid
*pixels
)
6712 GET_CURRENT_CONTEXT(ctx
);
6713 FLUSH_VERTICES(ctx
, 0);
6714 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6717 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6719 GET_CURRENT_CONTEXT(ctx
);
6720 FLUSH_VERTICES(ctx
, 0);
6721 return ctx
->Exec
->RenderMode( mode
);
6724 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6726 GET_CURRENT_CONTEXT(ctx
);
6727 FLUSH_VERTICES(ctx
, 0);
6728 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6731 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6733 GET_CURRENT_CONTEXT(ctx
);
6734 FLUSH_VERTICES(ctx
, 0);
6735 ctx
->Exec
->SelectBuffer( size
, buffer
);
6738 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6739 GLboolean
*residences
)
6741 GET_CURRENT_CONTEXT(ctx
);
6742 FLUSH_VERTICES(ctx
, 0);
6743 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6746 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6749 GET_CURRENT_CONTEXT(ctx
);
6750 FLUSH_VERTICES(ctx
, 0);
6751 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6754 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6756 GET_CURRENT_CONTEXT(ctx
);
6757 FLUSH_VERTICES(ctx
, 0);
6758 ctx
->Exec
->DeleteTextures( n
, texName
);
6761 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6763 GET_CURRENT_CONTEXT(ctx
);
6764 FLUSH_VERTICES(ctx
, 0);
6765 ctx
->Exec
->DisableClientState( cap
);
6768 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6770 GET_CURRENT_CONTEXT(ctx
);
6771 FLUSH_VERTICES(ctx
, 0);
6772 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6775 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6777 GET_CURRENT_CONTEXT(ctx
);
6778 FLUSH_VERTICES(ctx
, 0);
6779 ctx
->Exec
->EnableClientState( cap
);
6782 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6784 GET_CURRENT_CONTEXT(ctx
);
6785 FLUSH_VERTICES(ctx
, 0);
6786 ctx
->Exec
->GenTextures( n
, texName
);
6789 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6791 GET_CURRENT_CONTEXT(ctx
);
6792 FLUSH_VERTICES(ctx
, 0);
6793 ctx
->Exec
->GetPointerv( pname
, params
);
6796 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6798 GET_CURRENT_CONTEXT(ctx
);
6799 FLUSH_VERTICES(ctx
, 0);
6800 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6803 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6804 const GLvoid
*pointer
)
6806 GET_CURRENT_CONTEXT(ctx
);
6807 FLUSH_VERTICES(ctx
, 0);
6808 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6811 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6813 GET_CURRENT_CONTEXT(ctx
);
6814 FLUSH_VERTICES(ctx
, 0);
6815 return ctx
->Exec
->IsTexture( texture
);
6818 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6820 GET_CURRENT_CONTEXT(ctx
);
6821 FLUSH_VERTICES(ctx
, 0);
6822 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6825 static void GLAPIENTRY
exec_PopClientAttrib(void)
6827 GET_CURRENT_CONTEXT(ctx
);
6828 FLUSH_VERTICES(ctx
, 0);
6829 ctx
->Exec
->PopClientAttrib();
6832 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6834 GET_CURRENT_CONTEXT(ctx
);
6835 FLUSH_VERTICES(ctx
, 0);
6836 ctx
->Exec
->PushClientAttrib( mask
);
6839 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6842 GET_CURRENT_CONTEXT(ctx
);
6843 FLUSH_VERTICES(ctx
, 0);
6844 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6847 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6850 GET_CURRENT_CONTEXT(ctx
);
6851 FLUSH_VERTICES(ctx
, 0);
6852 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6855 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6858 GET_CURRENT_CONTEXT(ctx
);
6859 FLUSH_VERTICES(ctx
, 0);
6860 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6863 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6864 GLint x
, GLint y
, GLsizei width
)
6866 GET_CURRENT_CONTEXT(ctx
);
6867 FLUSH_VERTICES(ctx
, 0);
6868 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6871 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6872 GLint x
, GLint y
, GLsizei width
,
6875 GET_CURRENT_CONTEXT(ctx
);
6876 FLUSH_VERTICES(ctx
, 0);
6877 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6881 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6882 GLenum type
, GLvoid
*data
)
6884 GET_CURRENT_CONTEXT(ctx
);
6885 FLUSH_VERTICES(ctx
, 0);
6886 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6889 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6892 GET_CURRENT_CONTEXT(ctx
);
6893 FLUSH_VERTICES(ctx
, 0);
6894 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6897 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6900 GET_CURRENT_CONTEXT(ctx
);
6901 FLUSH_VERTICES(ctx
, 0);
6902 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6905 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6908 GET_CURRENT_CONTEXT(ctx
);
6909 FLUSH_VERTICES(ctx
, 0);
6910 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6913 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6916 GET_CURRENT_CONTEXT(ctx
);
6917 FLUSH_VERTICES(ctx
, 0);
6918 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6921 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6924 GET_CURRENT_CONTEXT(ctx
);
6925 FLUSH_VERTICES(ctx
, 0);
6926 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6929 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6930 GLenum type
, GLvoid
*values
)
6932 GET_CURRENT_CONTEXT(ctx
);
6933 FLUSH_VERTICES(ctx
, 0);
6934 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6937 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6940 GET_CURRENT_CONTEXT(ctx
);
6941 FLUSH_VERTICES(ctx
, 0);
6942 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6945 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6953 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6954 GLenum type
, GLvoid
*values
)
6956 GET_CURRENT_CONTEXT(ctx
);
6957 FLUSH_VERTICES(ctx
, 0);
6958 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6961 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6964 GET_CURRENT_CONTEXT(ctx
);
6965 FLUSH_VERTICES(ctx
, 0);
6966 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6969 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6977 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6978 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6980 GET_CURRENT_CONTEXT(ctx
);
6981 FLUSH_VERTICES(ctx
, 0);
6982 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6985 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6986 GLsizei width
, GLsizei height
, GLenum format
,
6987 GLenum type
, const GLvoid
*row
,
6988 const GLvoid
*column
)
6990 GET_CURRENT_CONTEXT(ctx
);
6991 FLUSH_VERTICES(ctx
, 0);
6992 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6996 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6998 GET_CURRENT_CONTEXT(ctx
);
6999 FLUSH_VERTICES(ctx
, 0);
7000 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
7003 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
7005 GET_CURRENT_CONTEXT(ctx
);
7006 FLUSH_VERTICES(ctx
, 0);
7007 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
7010 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7011 GLsizei count
, const GLvoid
*ptr
)
7013 GET_CURRENT_CONTEXT(ctx
);
7014 FLUSH_VERTICES(ctx
, 0);
7015 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
7018 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
7019 const GLboolean
*ptr
)
7021 GET_CURRENT_CONTEXT(ctx
);
7022 FLUSH_VERTICES(ctx
, 0);
7023 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
7026 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7029 GET_CURRENT_CONTEXT(ctx
);
7030 FLUSH_VERTICES(ctx
, 0);
7031 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
7034 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7037 GET_CURRENT_CONTEXT(ctx
);
7038 FLUSH_VERTICES(ctx
, 0);
7039 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
7042 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7043 GLsizei count
, const GLvoid
*ptr
)
7045 GET_CURRENT_CONTEXT(ctx
);
7046 FLUSH_VERTICES(ctx
, 0);
7047 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
7050 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7051 GLsizei count
, const GLvoid
*ptr
)
7053 GET_CURRENT_CONTEXT(ctx
);
7054 FLUSH_VERTICES(ctx
, 0);
7055 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
7058 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
7060 GET_CURRENT_CONTEXT(ctx
);
7061 FLUSH_VERTICES(ctx
, 0);
7062 ctx
->Exec
->LockArraysEXT( first
, count
);
7065 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
7067 GET_CURRENT_CONTEXT(ctx
);
7068 FLUSH_VERTICES(ctx
, 0);
7069 ctx
->Exec
->UnlockArraysEXT( );
7072 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
7074 GET_CURRENT_CONTEXT(ctx
);
7075 FLUSH_VERTICES(ctx
, 0);
7076 ctx
->Exec
->ResizeBuffersMESA( );
7080 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
7082 GET_CURRENT_CONTEXT(ctx
);
7083 FLUSH_VERTICES(ctx
, 0);
7084 ctx
->Exec
->ClientActiveTextureARB(target
);
7087 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7088 GLsizei stride
, const GLvoid
*ptr
)
7090 GET_CURRENT_CONTEXT(ctx
);
7091 FLUSH_VERTICES(ctx
, 0);
7092 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
7095 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
7098 GET_CURRENT_CONTEXT(ctx
);
7099 FLUSH_VERTICES(ctx
, 0);
7100 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
7103 /* GL_EXT_multi_draw_arrays */
7104 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
7105 GLsizei
*count
, GLsizei primcount
)
7107 GET_CURRENT_CONTEXT(ctx
);
7108 FLUSH_VERTICES(ctx
, 0);
7109 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
7112 /* GL_EXT_multi_draw_arrays */
7113 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
7114 GLenum type
, const GLvoid
**indices
,
7117 GET_CURRENT_CONTEXT(ctx
);
7118 FLUSH_VERTICES(ctx
, 0);
7119 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
7122 /* GL_IBM_multimode_draw_arrays */
7123 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
7124 const GLsizei
*count
, GLsizei primcount
,
7127 GET_CURRENT_CONTEXT(ctx
);
7128 FLUSH_VERTICES(ctx
, 0);
7129 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
7132 /* GL_IBM_multimode_draw_arrays */
7133 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7134 const GLsizei
*count
,
7136 const GLvoid
* const *indices
,
7137 GLsizei primcount
, GLint modestride
)
7139 GET_CURRENT_CONTEXT(ctx
);
7140 FLUSH_VERTICES(ctx
, 0);
7141 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
7149 * Setup the given dispatch table to point to Mesa's display list
7150 * building functions.
7152 * This does not include any of the tnl functions - they are
7153 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7157 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
7159 _mesa_init_no_op_table(table
, tableSize
);
7161 _mesa_loopback_init_api_table( table
);
7164 table
->Accum
= save_Accum
;
7165 table
->AlphaFunc
= save_AlphaFunc
;
7166 table
->Bitmap
= save_Bitmap
;
7167 table
->BlendFunc
= _mesa_BlendFunc
; /* loops-back to BlendFuncSeparate */
7168 table
->CallList
= _mesa_save_CallList
;
7169 table
->CallLists
= _mesa_save_CallLists
;
7170 table
->Clear
= save_Clear
;
7171 table
->ClearAccum
= save_ClearAccum
;
7172 table
->ClearColor
= save_ClearColor
;
7173 table
->ClearDepth
= save_ClearDepth
;
7174 table
->ClearIndex
= save_ClearIndex
;
7175 table
->ClearStencil
= save_ClearStencil
;
7176 table
->ClipPlane
= save_ClipPlane
;
7177 table
->ColorMask
= save_ColorMask
;
7178 table
->ColorMaterial
= save_ColorMaterial
;
7179 table
->CopyPixels
= save_CopyPixels
;
7180 table
->CullFace
= save_CullFace
;
7181 table
->DeleteLists
= _mesa_DeleteLists
;
7182 table
->DepthFunc
= save_DepthFunc
;
7183 table
->DepthMask
= save_DepthMask
;
7184 table
->DepthRange
= save_DepthRange
;
7185 table
->Disable
= save_Disable
;
7186 table
->DrawBuffer
= save_DrawBuffer
;
7187 table
->DrawPixels
= save_DrawPixels
;
7188 table
->Enable
= save_Enable
;
7189 table
->EndList
= _mesa_EndList
;
7190 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7191 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7192 table
->Finish
= exec_Finish
;
7193 table
->Flush
= exec_Flush
;
7194 table
->Fogf
= save_Fogf
;
7195 table
->Fogfv
= save_Fogfv
;
7196 table
->Fogi
= save_Fogi
;
7197 table
->Fogiv
= save_Fogiv
;
7198 table
->FrontFace
= save_FrontFace
;
7199 table
->Frustum
= save_Frustum
;
7200 table
->GenLists
= _mesa_GenLists
;
7201 table
->GetBooleanv
= exec_GetBooleanv
;
7202 table
->GetClipPlane
= exec_GetClipPlane
;
7203 table
->GetDoublev
= exec_GetDoublev
;
7204 table
->GetError
= exec_GetError
;
7205 table
->GetFloatv
= exec_GetFloatv
;
7206 table
->GetIntegerv
= exec_GetIntegerv
;
7207 table
->GetLightfv
= exec_GetLightfv
;
7208 table
->GetLightiv
= exec_GetLightiv
;
7209 table
->GetMapdv
= exec_GetMapdv
;
7210 table
->GetMapfv
= exec_GetMapfv
;
7211 table
->GetMapiv
= exec_GetMapiv
;
7212 table
->GetMaterialfv
= exec_GetMaterialfv
;
7213 table
->GetMaterialiv
= exec_GetMaterialiv
;
7214 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7215 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7216 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7217 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7218 table
->GetString
= exec_GetString
;
7219 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7220 table
->GetTexEnviv
= exec_GetTexEnviv
;
7221 table
->GetTexGendv
= exec_GetTexGendv
;
7222 table
->GetTexGenfv
= exec_GetTexGenfv
;
7223 table
->GetTexGeniv
= exec_GetTexGeniv
;
7224 table
->GetTexImage
= exec_GetTexImage
;
7225 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7226 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7227 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7228 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7229 table
->Hint
= save_Hint
;
7230 table
->IndexMask
= save_IndexMask
;
7231 table
->InitNames
= save_InitNames
;
7232 table
->IsEnabled
= exec_IsEnabled
;
7233 table
->IsList
= _mesa_IsList
;
7234 table
->LightModelf
= save_LightModelf
;
7235 table
->LightModelfv
= save_LightModelfv
;
7236 table
->LightModeli
= save_LightModeli
;
7237 table
->LightModeliv
= save_LightModeliv
;
7238 table
->Lightf
= save_Lightf
;
7239 table
->Lightfv
= save_Lightfv
;
7240 table
->Lighti
= save_Lighti
;
7241 table
->Lightiv
= save_Lightiv
;
7242 table
->LineStipple
= save_LineStipple
;
7243 table
->LineWidth
= save_LineWidth
;
7244 table
->ListBase
= save_ListBase
;
7245 table
->LoadIdentity
= save_LoadIdentity
;
7246 table
->LoadMatrixd
= save_LoadMatrixd
;
7247 table
->LoadMatrixf
= save_LoadMatrixf
;
7248 table
->LoadName
= save_LoadName
;
7249 table
->LogicOp
= save_LogicOp
;
7250 table
->Map1d
= save_Map1d
;
7251 table
->Map1f
= save_Map1f
;
7252 table
->Map2d
= save_Map2d
;
7253 table
->Map2f
= save_Map2f
;
7254 table
->MapGrid1d
= save_MapGrid1d
;
7255 table
->MapGrid1f
= save_MapGrid1f
;
7256 table
->MapGrid2d
= save_MapGrid2d
;
7257 table
->MapGrid2f
= save_MapGrid2f
;
7258 table
->MatrixMode
= save_MatrixMode
;
7259 table
->MultMatrixd
= save_MultMatrixd
;
7260 table
->MultMatrixf
= save_MultMatrixf
;
7261 table
->NewList
= save_NewList
;
7262 table
->Ortho
= save_Ortho
;
7263 table
->PassThrough
= save_PassThrough
;
7264 table
->PixelMapfv
= save_PixelMapfv
;
7265 table
->PixelMapuiv
= save_PixelMapuiv
;
7266 table
->PixelMapusv
= save_PixelMapusv
;
7267 table
->PixelStoref
= exec_PixelStoref
;
7268 table
->PixelStorei
= exec_PixelStorei
;
7269 table
->PixelTransferf
= save_PixelTransferf
;
7270 table
->PixelTransferi
= save_PixelTransferi
;
7271 table
->PixelZoom
= save_PixelZoom
;
7272 table
->PointSize
= save_PointSize
;
7273 table
->PolygonMode
= save_PolygonMode
;
7274 table
->PolygonOffset
= save_PolygonOffset
;
7275 table
->PolygonStipple
= save_PolygonStipple
;
7276 table
->PopAttrib
= save_PopAttrib
;
7277 table
->PopMatrix
= save_PopMatrix
;
7278 table
->PopName
= save_PopName
;
7279 table
->PushAttrib
= save_PushAttrib
;
7280 table
->PushMatrix
= save_PushMatrix
;
7281 table
->PushName
= save_PushName
;
7282 table
->RasterPos2d
= save_RasterPos2d
;
7283 table
->RasterPos2dv
= save_RasterPos2dv
;
7284 table
->RasterPos2f
= save_RasterPos2f
;
7285 table
->RasterPos2fv
= save_RasterPos2fv
;
7286 table
->RasterPos2i
= save_RasterPos2i
;
7287 table
->RasterPos2iv
= save_RasterPos2iv
;
7288 table
->RasterPos2s
= save_RasterPos2s
;
7289 table
->RasterPos2sv
= save_RasterPos2sv
;
7290 table
->RasterPos3d
= save_RasterPos3d
;
7291 table
->RasterPos3dv
= save_RasterPos3dv
;
7292 table
->RasterPos3f
= save_RasterPos3f
;
7293 table
->RasterPos3fv
= save_RasterPos3fv
;
7294 table
->RasterPos3i
= save_RasterPos3i
;
7295 table
->RasterPos3iv
= save_RasterPos3iv
;
7296 table
->RasterPos3s
= save_RasterPos3s
;
7297 table
->RasterPos3sv
= save_RasterPos3sv
;
7298 table
->RasterPos4d
= save_RasterPos4d
;
7299 table
->RasterPos4dv
= save_RasterPos4dv
;
7300 table
->RasterPos4f
= save_RasterPos4f
;
7301 table
->RasterPos4fv
= save_RasterPos4fv
;
7302 table
->RasterPos4i
= save_RasterPos4i
;
7303 table
->RasterPos4iv
= save_RasterPos4iv
;
7304 table
->RasterPos4s
= save_RasterPos4s
;
7305 table
->RasterPos4sv
= save_RasterPos4sv
;
7306 table
->ReadBuffer
= save_ReadBuffer
;
7307 table
->ReadPixels
= exec_ReadPixels
;
7308 table
->RenderMode
= exec_RenderMode
;
7309 table
->Rotated
= save_Rotated
;
7310 table
->Rotatef
= save_Rotatef
;
7311 table
->Scaled
= save_Scaled
;
7312 table
->Scalef
= save_Scalef
;
7313 table
->Scissor
= save_Scissor
;
7314 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7315 table
->SelectBuffer
= exec_SelectBuffer
;
7316 table
->ShadeModel
= save_ShadeModel
;
7317 table
->StencilFunc
= save_StencilFunc
;
7318 table
->StencilMask
= save_StencilMask
;
7319 table
->StencilOp
= save_StencilOp
;
7320 table
->TexEnvf
= save_TexEnvf
;
7321 table
->TexEnvfv
= save_TexEnvfv
;
7322 table
->TexEnvi
= save_TexEnvi
;
7323 table
->TexEnviv
= save_TexEnviv
;
7324 table
->TexGend
= save_TexGend
;
7325 table
->TexGendv
= save_TexGendv
;
7326 table
->TexGenf
= save_TexGenf
;
7327 table
->TexGenfv
= save_TexGenfv
;
7328 table
->TexGeni
= save_TexGeni
;
7329 table
->TexGeniv
= save_TexGeniv
;
7330 table
->TexImage1D
= save_TexImage1D
;
7331 table
->TexImage2D
= save_TexImage2D
;
7332 table
->TexParameterf
= save_TexParameterf
;
7333 table
->TexParameterfv
= save_TexParameterfv
;
7334 table
->TexParameteri
= save_TexParameteri
;
7335 table
->TexParameteriv
= save_TexParameteriv
;
7336 table
->Translated
= save_Translated
;
7337 table
->Translatef
= save_Translatef
;
7338 table
->Viewport
= save_Viewport
;
7341 table
->AreTexturesResident
= exec_AreTexturesResident
;
7342 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7343 table
->BindTexture
= save_BindTexture
;
7344 table
->ColorPointer
= exec_ColorPointer
;
7345 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7346 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7347 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7348 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7349 table
->DeleteTextures
= exec_DeleteTextures
;
7350 table
->DisableClientState
= exec_DisableClientState
;
7351 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7352 table
->EnableClientState
= exec_EnableClientState
;
7353 table
->GenTextures
= exec_GenTextures
;
7354 table
->GenTexturesEXT
= exec_GenTextures
;
7355 table
->GetPointerv
= exec_GetPointerv
;
7356 table
->IndexPointer
= exec_IndexPointer
;
7357 table
->InterleavedArrays
= exec_InterleavedArrays
;
7358 table
->IsTexture
= exec_IsTexture
;
7359 table
->IsTextureEXT
= exec_IsTexture
;
7360 table
->NormalPointer
= exec_NormalPointer
;
7361 table
->PopClientAttrib
= exec_PopClientAttrib
;
7362 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7363 table
->PushClientAttrib
= exec_PushClientAttrib
;
7364 table
->TexCoordPointer
= exec_TexCoordPointer
;
7365 table
->TexSubImage1D
= save_TexSubImage1D
;
7366 table
->TexSubImage2D
= save_TexSubImage2D
;
7367 table
->VertexPointer
= exec_VertexPointer
;
7370 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7371 table
->TexImage3D
= save_TexImage3D
;
7372 table
->TexSubImage3D
= save_TexSubImage3D
;
7374 /* GL_ARB_imaging */
7375 /* Not all are supported */
7376 table
->BlendColor
= save_BlendColor
;
7377 table
->BlendEquation
= save_BlendEquation
;
7378 table
->ColorSubTable
= save_ColorSubTable
;
7379 table
->ColorTable
= save_ColorTable
;
7380 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7381 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7382 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7383 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7384 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7385 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7386 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7387 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7388 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7389 table
->CopyColorTable
= save_CopyColorTable
;
7390 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7391 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7392 table
->GetColorTable
= exec_GetColorTable
;
7393 table
->GetColorTableEXT
= exec_GetColorTable
;
7394 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7395 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7396 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7397 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7398 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7399 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7400 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7401 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7402 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7403 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7404 table
->GetHistogram
= exec_GetHistogram
;
7405 table
->GetHistogramEXT
= exec_GetHistogram
;
7406 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7407 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7408 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7409 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7410 table
->GetMinmax
= exec_GetMinmax
;
7411 table
->GetMinmaxEXT
= exec_GetMinmax
;
7412 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7413 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7414 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7415 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7416 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7417 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7418 table
->Histogram
= save_Histogram
;
7419 table
->Minmax
= save_Minmax
;
7420 table
->ResetHistogram
= save_ResetHistogram
;
7421 table
->ResetMinmax
= save_ResetMinmax
;
7422 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7424 /* 2. GL_EXT_blend_color */
7426 table
->BlendColorEXT
= save_BlendColorEXT
;
7429 /* 3. GL_EXT_polygon_offset */
7430 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7432 /* 6. GL_EXT_texture3d */
7434 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7435 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7436 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7439 /* 15. GL_SGIX_pixel_texture */
7440 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7442 /* 15. GL_SGIS_pixel_texture */
7443 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7444 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7445 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7446 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7447 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7448 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7450 /* 30. GL_EXT_vertex_array */
7451 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7452 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7453 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7454 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7455 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7456 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7458 /* 37. GL_EXT_blend_minmax */
7460 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7463 /* 54. GL_EXT_point_parameters */
7464 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7465 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7467 /* 78. GL_EXT_paletted_texture */
7469 table
->ColorTableEXT
= save_ColorTable
;
7470 table
->ColorSubTableEXT
= save_ColorSubTable
;
7472 table
->GetColorTableEXT
= exec_GetColorTable
;
7473 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7474 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7476 /* 97. GL_EXT_compiled_vertex_array */
7477 table
->LockArraysEXT
= exec_LockArraysEXT
;
7478 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7480 /* 145. GL_EXT_secondary_color */
7481 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7483 /* 148. GL_EXT_multi_draw_arrays */
7484 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7485 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7487 /* 149. GL_EXT_fog_coord */
7488 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7490 /* 173. GL_EXT_blend_func_separate */
7491 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7493 /* 196. GL_MESA_resize_buffers */
7494 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7496 /* 197. GL_MESA_window_pos */
7497 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7498 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7499 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7500 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7501 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7502 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7503 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7504 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7505 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7506 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7507 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7508 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7509 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7510 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7511 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7512 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7513 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7514 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7515 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7516 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7517 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7518 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7519 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7520 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7522 /* 200. GL_IBM_multimode_draw_arrays */
7523 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7524 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7526 #if FEATURE_NV_vertex_program
7527 /* 233. GL_NV_vertex_program */
7528 /* The following commands DO NOT go into display lists:
7529 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7530 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7532 table
->BindProgramNV
= save_BindProgramNV
;
7533 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7534 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7535 table
->GenProgramsNV
= _mesa_GenPrograms
;
7536 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7537 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7538 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7539 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7540 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7541 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7542 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7543 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7544 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7545 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7546 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7547 table
->IsProgramNV
= _mesa_IsProgram
;
7548 table
->LoadProgramNV
= save_LoadProgramNV
;
7549 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7550 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7551 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7552 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7553 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7554 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7555 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7556 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7559 /* 282. GL_NV_fragment_program */
7560 #if FEATURE_NV_fragment_program
7561 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7562 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7563 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7564 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7565 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7566 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7567 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7568 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7569 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7570 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7571 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7572 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7575 /* 262. GL_NV_point_sprite */
7576 table
->PointParameteriNV
= save_PointParameteriNV
;
7577 table
->PointParameterivNV
= save_PointParameterivNV
;
7579 /* 268. GL_EXT_stencil_two_side */
7580 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7582 /* ???. GL_EXT_depth_bounds_test */
7583 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7585 /* ARB 1. GL_ARB_multitexture */
7586 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7587 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7589 /* ARB 3. GL_ARB_transpose_matrix */
7590 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7591 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7592 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7593 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7595 /* ARB 5. GL_ARB_multisample */
7596 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7598 /* ARB 12. GL_ARB_texture_compression */
7599 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7600 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7601 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7602 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7603 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7604 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7605 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7607 /* ARB 14. GL_ARB_point_parameters */
7608 /* aliased with EXT_point_parameters functions */
7610 /* ARB 25. GL_ARB_window_pos */
7611 /* aliased with MESA_window_pos functions */
7613 /* ARB 26. GL_ARB_vertex_program */
7614 /* ARB 27. GL_ARB_fragment_program */
7615 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7616 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7617 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7618 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7619 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7620 table
->ProgramStringARB
= save_ProgramStringARB
;
7621 table
->BindProgramNV
= save_BindProgramNV
;
7622 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7623 table
->GenProgramsNV
= _mesa_GenPrograms
;
7624 table
->IsProgramNV
= _mesa_IsProgram
;
7625 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7626 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7627 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7628 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7629 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7630 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7631 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7632 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7633 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7634 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7635 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7636 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7637 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7638 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7639 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7640 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7641 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7642 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7645 /* ARB 28. GL_ARB_vertex_buffer_object */
7646 #if FEATURE_ARB_vertex_buffer_object
7647 /* None of the extension's functions get compiled */
7648 table
->BindBufferARB
= _mesa_BindBufferARB
;
7649 table
->BufferDataARB
= _mesa_BufferDataARB
;
7650 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7651 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7652 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7653 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7654 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7655 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7656 table
->IsBufferARB
= _mesa_IsBufferARB
;
7657 table
->MapBufferARB
= _mesa_MapBufferARB
;
7658 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7661 #if FEATURE_ARB_occlusion_query
7662 table
->BeginQueryARB
= save_BeginQueryARB
;
7663 table
->EndQueryARB
= save_EndQueryARB
;
7664 table
->GenQueriesARB
= _mesa_GenQueriesARB
;
7665 table
->DeleteQueriesARB
= _mesa_DeleteQueriesARB
;
7666 table
->IsQueryARB
= _mesa_IsQueryARB
;
7667 table
->GetQueryivARB
= _mesa_GetQueryivARB
;
7668 table
->GetQueryObjectivARB
= _mesa_GetQueryObjectivARB
;
7669 table
->GetQueryObjectuivARB
= _mesa_GetQueryObjectuivARB
;
7671 table
->DrawBuffersARB
= save_DrawBuffersARB
;
7673 /* 299. GL_EXT_blend_equation_separate */
7674 table
->BlendEquationSeparateEXT
= save_BlendEquationSeparateEXT
;
7682 static const char *enum_string( GLenum k
)
7684 return _mesa_lookup_enum_by_nr( k
);
7689 * Print the commands in a display list. For debugging only.
7690 * TODO: many commands aren't handled yet.
7692 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7697 if (!glIsList(list
)) {
7698 _mesa_printf("%u is not a display list ID\n", list
);
7702 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7704 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7706 done
= n
? GL_FALSE
: GL_TRUE
;
7708 OpCode opcode
= n
[0].opcode
;
7709 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
7711 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
7712 /* this is a driver-extended opcode */
7713 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
7714 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
7719 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7722 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7723 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7725 case OPCODE_CALL_LIST
:
7726 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7728 case OPCODE_CALL_LIST_OFFSET
:
7729 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7730 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7732 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7733 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7734 enum_string(n
[1].e
), enum_string(n
[2].e
),
7735 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7737 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7738 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7739 enum_string(n
[1].e
), enum_string(n
[2].e
),
7740 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7742 case OPCODE_DISABLE
:
7743 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7746 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7748 case OPCODE_FRUSTUM
:
7749 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7750 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7752 case OPCODE_LINE_STIPPLE
:
7753 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7755 case OPCODE_LOAD_IDENTITY
:
7756 _mesa_printf("LoadIdentity\n");
7758 case OPCODE_LOAD_MATRIX
:
7759 _mesa_printf("LoadMatrix\n");
7760 _mesa_printf(" %8f %8f %8f %8f\n",
7761 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7762 _mesa_printf(" %8f %8f %8f %8f\n",
7763 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7764 _mesa_printf(" %8f %8f %8f %8f\n",
7765 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7766 _mesa_printf(" %8f %8f %8f %8f\n",
7767 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7769 case OPCODE_MULT_MATRIX
:
7770 _mesa_printf("MultMatrix (or Rotate)\n");
7771 _mesa_printf(" %8f %8f %8f %8f\n",
7772 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7773 _mesa_printf(" %8f %8f %8f %8f\n",
7774 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7775 _mesa_printf(" %8f %8f %8f %8f\n",
7776 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7777 _mesa_printf(" %8f %8f %8f %8f\n",
7778 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7781 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7782 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7784 case OPCODE_POP_ATTRIB
:
7785 _mesa_printf("PopAttrib\n");
7787 case OPCODE_POP_MATRIX
:
7788 _mesa_printf("PopMatrix\n");
7790 case OPCODE_POP_NAME
:
7791 _mesa_printf("PopName\n");
7793 case OPCODE_PUSH_ATTRIB
:
7794 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7796 case OPCODE_PUSH_MATRIX
:
7797 _mesa_printf("PushMatrix\n");
7799 case OPCODE_PUSH_NAME
:
7800 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7802 case OPCODE_RASTER_POS
:
7803 _mesa_printf("RasterPos %g %g %g %g\n",
7804 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7807 _mesa_printf("Rotate %g %g %g %g\n",
7808 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7811 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7813 case OPCODE_TRANSLATE
:
7814 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7816 case OPCODE_BIND_TEXTURE
:
7817 _mesa_printf("BindTexture %s %d\n",
7818 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7820 case OPCODE_SHADE_MODEL
:
7821 _mesa_printf("ShadeModel %s\n",
7822 _mesa_lookup_enum_by_nr(n
[1].ui
));
7825 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7826 _mesa_lookup_enum_by_nr(n
[1].ui
),
7827 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7830 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7831 _mesa_lookup_enum_by_nr(n
[1].ui
),
7832 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7833 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7835 case OPCODE_MAPGRID1
:
7836 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7837 n
[1].i
, n
[2].f
, n
[3].f
);
7839 case OPCODE_MAPGRID2
:
7840 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7841 n
[1].i
, n
[2].f
, n
[3].f
,
7842 n
[4].i
, n
[5].f
, n
[6].f
);
7844 case OPCODE_EVALMESH1
:
7845 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7847 case OPCODE_EVALMESH2
:
7848 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7849 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7854 case OPCODE_ATTR_1F
:
7855 _mesa_printf("ATTR_1F attr %d: %f\n",
7858 case OPCODE_ATTR_2F
:
7859 _mesa_printf("ATTR_2F attr %d: %f %f\n",
7860 n
[1].i
, n
[2].f
, n
[3].f
);
7862 case OPCODE_ATTR_3F
:
7863 _mesa_printf("ATTR_3F attr %d: %f %f %f\n",
7864 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
7866 case OPCODE_ATTR_4F
:
7867 _mesa_printf("ATTR_4F attr %d: %f %f %f %f\n",
7868 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
7870 case OPCODE_MATERIAL
:
7871 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
7872 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7875 _mesa_printf("INDEX: %f\n", n
[1].f
);
7877 case OPCODE_EDGEFLAG
:
7878 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
7881 _mesa_printf("BEGIN %x\n", n
[1].i
);
7884 _mesa_printf("END\n");
7887 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7889 case OPCODE_EVAL_C1
:
7890 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
7892 case OPCODE_EVAL_C2
:
7893 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
7895 case OPCODE_EVAL_P1
:
7896 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
7898 case OPCODE_EVAL_P2
:
7899 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
7905 * meta opcodes/commands
7908 _mesa_printf("Error: %s %s\n",
7909 enum_string(n
[1].e
), (const char *)n
[2].data
);
7911 case OPCODE_CONTINUE
:
7912 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7913 n
= (Node
*) n
[1].next
;
7915 case OPCODE_END_OF_LIST
:
7916 _mesa_printf("END-LIST %u\n", list
);
7920 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7921 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7926 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7929 /* increment n to point to next compiled command */
7930 if (opcode
!=OPCODE_CONTINUE
) {
7931 n
+= InstSize
[opcode
];
7940 * Clients may call this function to help debug display list problems.
7941 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7942 * changed, or break in the future without notice.
7944 void mesa_print_display_list( GLuint list
)
7946 GET_CURRENT_CONTEXT(ctx
);
7947 print_list( ctx
, list
);
7951 /**********************************************************************/
7952 /***** Initialization *****/
7953 /**********************************************************************/
7956 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7958 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7959 vfmt
->Begin
= save_Begin
;
7960 vfmt
->CallList
= _mesa_save_CallList
;
7961 vfmt
->CallLists
= _mesa_save_CallLists
;
7962 vfmt
->Color3f
= save_Color3f
;
7963 vfmt
->Color3fv
= save_Color3fv
;
7964 vfmt
->Color4f
= save_Color4f
;
7965 vfmt
->Color4fv
= save_Color4fv
;
7966 vfmt
->EdgeFlag
= save_EdgeFlag
;
7967 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7968 vfmt
->End
= save_End
;
7969 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7970 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7971 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7972 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7973 vfmt
->EvalPoint1
= save_EvalPoint1
;
7974 vfmt
->EvalPoint2
= save_EvalPoint2
;
7975 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7976 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7977 vfmt
->Indexf
= save_Indexf
;
7978 vfmt
->Indexfv
= save_Indexfv
;
7979 vfmt
->Materialfv
= save_Materialfv
;
7980 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7981 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7982 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7983 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7984 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7985 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7986 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7987 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7988 vfmt
->Normal3f
= save_Normal3f
;
7989 vfmt
->Normal3fv
= save_Normal3fv
;
7990 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7991 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7992 vfmt
->TexCoord1f
= save_TexCoord1f
;
7993 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7994 vfmt
->TexCoord2f
= save_TexCoord2f
;
7995 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7996 vfmt
->TexCoord3f
= save_TexCoord3f
;
7997 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7998 vfmt
->TexCoord4f
= save_TexCoord4f
;
7999 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8000 vfmt
->Vertex2f
= save_Vertex2f
;
8001 vfmt
->Vertex2fv
= save_Vertex2fv
;
8002 vfmt
->Vertex3f
= save_Vertex3f
;
8003 vfmt
->Vertex3fv
= save_Vertex3fv
;
8004 vfmt
->Vertex4f
= save_Vertex4f
;
8005 vfmt
->Vertex4fv
= save_Vertex4fv
;
8006 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8007 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8008 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8009 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8010 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8011 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8012 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8013 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8015 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8016 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8017 vfmt
->Rectf
= save_Rectf
;
8019 /* The driver is required to implement these as
8020 * 1) They can probably do a better job.
8021 * 2) A lot of new mechanisms would have to be added to this module
8022 * to support it. That code would probably never get used,
8026 vfmt
->DrawArrays
= 0;
8027 vfmt
->DrawElements
= 0;
8028 vfmt
->DrawRangeElements
= 0;
8034 void _mesa_init_display_list( GLcontext
* ctx
)
8037 ctx
->ListState
.CallDepth
= 0;
8038 ctx
->ExecuteFlag
= GL_TRUE
;
8039 ctx
->CompileFlag
= GL_FALSE
;
8040 ctx
->ListState
.CurrentListPtr
= NULL
;
8041 ctx
->ListState
.CurrentBlock
= NULL
;
8042 ctx
->ListState
.CurrentListNum
= 0;
8043 ctx
->ListState
.CurrentPos
= 0;
8045 /* Display List group */
8046 ctx
->List
.ListBase
= 0;
8048 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);