3 * Display lists management functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #include "api_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"
77 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
78 #include "nvprogram.h"
82 #include "math/m_matrix.h"
83 #include "math/m_xform.h"
89 * \param ctx GL context.
91 * Checks if dd_function_table::SaveNeedFlush is marked to flush
92 * stored (save) vertices, and calls
93 * dd_function_table::SaveFlushVertices if so.
95 #define SAVE_FLUSH_VERTICES(ctx) \
97 if (ctx->Driver.SaveNeedFlush) \
98 ctx->Driver.SaveFlushVertices(ctx); \
103 * Macro to assert that the API call was made outside the
104 * glBegin()/glEnd() pair, with return value.
106 * \param ctx GL context.
107 * \param retval value to return value in case the assertion fails.
109 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
111 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
112 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
113 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
119 * Macro to assert that the API call was made outside the
120 * glBegin()/glEnd() pair.
122 * \param ctx GL context.
124 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
126 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
127 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
128 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
134 * Macro to assert that the API call was made outside the
135 * glBegin()/glEnd() pair and flush the vertices.
137 * \param ctx GL context.
139 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
141 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
142 SAVE_FLUSH_VERTICES(ctx); \
146 * Macro to assert that the API call was made outside the
147 * glBegin()/glEnd() pair and flush the vertices, with return value.
149 * \param ctx GL context.
150 * \param retval value to return value in case the assertion fails.
152 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
154 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
155 SAVE_FLUSH_VERTICES(ctx); \
161 * Display list opcodes.
163 * The fact that these identifiers are assigned consecutive
164 * integer values starting at 0 is very important, see InstSize array usage)
172 OPCODE_BLEND_EQUATION
,
173 OPCODE_BLEND_EQUATION_SEPARATE
,
174 OPCODE_BLEND_FUNC_SEPARATE
,
176 OPCODE_CALL_LIST_OFFSET
,
182 OPCODE_CLEAR_STENCIL
,
185 OPCODE_COLOR_MATERIAL
,
187 OPCODE_COLOR_TABLE_PARAMETER_FV
,
188 OPCODE_COLOR_TABLE_PARAMETER_IV
,
189 OPCODE_COLOR_SUB_TABLE
,
190 OPCODE_CONVOLUTION_FILTER_1D
,
191 OPCODE_CONVOLUTION_FILTER_2D
,
192 OPCODE_CONVOLUTION_PARAMETER_I
,
193 OPCODE_CONVOLUTION_PARAMETER_IV
,
194 OPCODE_CONVOLUTION_PARAMETER_F
,
195 OPCODE_CONVOLUTION_PARAMETER_FV
,
196 OPCODE_COPY_COLOR_SUB_TABLE
,
197 OPCODE_COPY_COLOR_TABLE
,
199 OPCODE_COPY_TEX_IMAGE1D
,
200 OPCODE_COPY_TEX_IMAGE2D
,
201 OPCODE_COPY_TEX_SUB_IMAGE1D
,
202 OPCODE_COPY_TEX_SUB_IMAGE2D
,
203 OPCODE_COPY_TEX_SUB_IMAGE3D
,
226 OPCODE_LOAD_IDENTITY
,
240 OPCODE_PIXEL_TRANSFER
,
243 OPCODE_POINT_PARAMETERS
,
245 OPCODE_POLYGON_STIPPLE
,
246 OPCODE_POLYGON_OFFSET
,
250 OPCODE_PRIORITIZE_TEXTURE
,
256 OPCODE_RESET_HISTOGRAM
,
257 OPCODE_RESET_MIN_MAX
,
261 OPCODE_SELECT_TEXTURE_SGIS
,
262 OPCODE_SELECT_TEXTURE_COORD_SET
,
273 OPCODE_TEX_SUB_IMAGE1D
,
274 OPCODE_TEX_SUB_IMAGE2D
,
275 OPCODE_TEX_SUB_IMAGE3D
,
279 /* GL_ARB_multitexture */
280 OPCODE_ACTIVE_TEXTURE
,
281 /* GL_SGIX/SGIS_pixel_texture */
282 OPCODE_PIXEL_TEXGEN_SGIX
,
283 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
284 /* GL_ARB_texture_compression */
285 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
286 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
287 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
288 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
289 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
290 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
291 /* GL_ARB_multisample */
292 OPCODE_SAMPLE_COVERAGE
,
293 /* GL_ARB_window_pos */
294 OPCODE_WINDOW_POS_ARB
,
295 /* GL_NV_vertex_program */
296 OPCODE_BIND_PROGRAM_NV
,
297 OPCODE_EXECUTE_PROGRAM_NV
,
298 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
299 OPCODE_LOAD_PROGRAM_NV
,
300 OPCODE_PROGRAM_PARAMETER4F_NV
,
301 OPCODE_TRACK_MATRIX_NV
,
302 /* GL_NV_fragment_program */
303 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
304 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
305 /* GL_EXT_stencil_two_side */
306 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
307 /* GL_EXT_depth_bounds_test */
308 OPCODE_DEPTH_BOUNDS_EXT
,
309 /* GL_ARB_vertex/fragment_program */
310 OPCODE_PROGRAM_STRING_ARB
,
311 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
314 /* Vertex attributes -- fallback for when optimized display
315 * list build isn't active.
333 /* The following three are meta instructions */
334 OPCODE_ERROR
, /* raise compiled-in error */
345 * Display list instructions are stored as sequences of "nodes". Nodes
346 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
347 * are linked together with a pointer.
349 * Each instruction in the display list is stored as a sequence of
350 * contiguous nodes in memory.
351 * Each node is the union of a variety of data types.
365 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
370 * How many nodes to allocate at a time.
372 * \note Reduced now that we hold vertices etc. elsewhere.
374 #define BLOCK_SIZE 256
379 * Number of nodes of storage needed for each instruction.
380 * Sizes for dynamically allocated opcodes are stored in the context struct.
382 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
384 void mesa_print_display_list( GLuint list
);
387 /**********************************************************************/
388 /***** Private *****/
389 /**********************************************************************/
392 * Make an empty display list. This is used by glGenLists() to
393 * reserver display list IDs.
395 static Node
*make_empty_list( void )
397 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
398 n
[0].opcode
= OPCODE_END_OF_LIST
;
405 * Destroy all nodes in a display list.
406 * \param list - display list number
408 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
416 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
419 done
= block
? GL_FALSE
: GL_TRUE
;
422 /* check for extension opcodes first */
424 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
425 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
426 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
427 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
430 switch (n
[0].opcode
) {
431 /* for some commands, we need to free malloc'd memory */
434 n
+= InstSize
[n
[0].opcode
];
438 n
+= InstSize
[n
[0].opcode
];
440 case OPCODE_DRAW_PIXELS
:
442 n
+= InstSize
[n
[0].opcode
];
446 n
+= InstSize
[n
[0].opcode
];
448 case OPCODE_COLOR_TABLE
:
450 n
+= InstSize
[n
[0].opcode
];
452 case OPCODE_COLOR_SUB_TABLE
:
454 n
+= InstSize
[n
[0].opcode
];
456 case OPCODE_CONVOLUTION_FILTER_1D
:
458 n
+= InstSize
[n
[0].opcode
];
460 case OPCODE_CONVOLUTION_FILTER_2D
:
462 n
+= InstSize
[n
[0].opcode
];
464 case OPCODE_POLYGON_STIPPLE
:
466 n
+= InstSize
[n
[0].opcode
];
468 case OPCODE_TEX_IMAGE1D
:
470 n
+= InstSize
[n
[0].opcode
];
472 case OPCODE_TEX_IMAGE2D
:
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_TEX_IMAGE3D
:
478 n
+= InstSize
[n
[0].opcode
];
480 case OPCODE_TEX_SUB_IMAGE1D
:
482 n
+= InstSize
[n
[0].opcode
];
484 case OPCODE_TEX_SUB_IMAGE2D
:
486 n
+= InstSize
[n
[0].opcode
];
488 case OPCODE_TEX_SUB_IMAGE3D
:
490 n
+= InstSize
[n
[0].opcode
];
492 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
494 n
+= InstSize
[n
[0].opcode
];
496 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
498 n
+= InstSize
[n
[0].opcode
];
500 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
502 n
+= InstSize
[n
[0].opcode
];
504 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
506 n
+= InstSize
[n
[0].opcode
];
508 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
510 n
+= InstSize
[n
[0].opcode
];
512 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
514 n
+= InstSize
[n
[0].opcode
];
516 #if FEATURE_NV_vertex_program
517 case OPCODE_LOAD_PROGRAM_NV
:
518 FREE(n
[4].data
); /* program string */
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
522 FREE(n
[2].data
); /* array of program ids */
523 n
+= InstSize
[n
[0].opcode
];
526 #if FEATURE_NV_fragment_program
527 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
528 FREE(n
[3].data
); /* parameter name */
529 n
+= InstSize
[n
[0].opcode
];
532 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
533 case OPCODE_PROGRAM_STRING_ARB
:
534 FREE(n
[4].data
); /* program string */
535 n
+= InstSize
[n
[0].opcode
];
538 case OPCODE_CONTINUE
:
539 n
= (Node
*) n
[1].next
;
543 case OPCODE_END_OF_LIST
:
548 /* Most frequent case */
549 n
+= InstSize
[n
[0].opcode
];
555 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
561 * Translate the nth element of list from type to GLuint.
563 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
575 bptr
= (GLbyte
*) list
;
576 return (GLuint
) *(bptr
+n
);
577 case GL_UNSIGNED_BYTE
:
578 ubptr
= (GLubyte
*) list
;
579 return (GLuint
) *(ubptr
+n
);
581 sptr
= (GLshort
*) list
;
582 return (GLuint
) *(sptr
+n
);
583 case GL_UNSIGNED_SHORT
:
584 usptr
= (GLushort
*) list
;
585 return (GLuint
) *(usptr
+n
);
587 iptr
= (GLint
*) list
;
588 return (GLuint
) *(iptr
+n
);
589 case GL_UNSIGNED_INT
:
590 uiptr
= (GLuint
*) list
;
591 return (GLuint
) *(uiptr
+n
);
593 fptr
= (GLfloat
*) list
;
594 return (GLuint
) *(fptr
+n
);
596 ubptr
= ((GLubyte
*) list
) + 2*n
;
597 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
599 ubptr
= ((GLubyte
*) list
) + 3*n
;
600 return (GLuint
) *ubptr
* 65536
601 + (GLuint
) *(ubptr
+1) * 256
602 + (GLuint
) *(ubptr
+2);
604 ubptr
= ((GLubyte
*) list
) + 4*n
;
605 return (GLuint
) *ubptr
* 16777216
606 + (GLuint
) *(ubptr
+1) * 65536
607 + (GLuint
) *(ubptr
+2) * 256
608 + (GLuint
) *(ubptr
+3);
617 /**********************************************************************/
619 /**********************************************************************/
622 * Do one-time initialiazations for display lists.
625 _mesa_init_lists( void )
627 static int init_flag
= 0;
630 InstSize
[OPCODE_ACCUM
] = 3;
631 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
632 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
633 InstSize
[OPCODE_BITMAP
] = 8;
634 InstSize
[OPCODE_BLEND_COLOR
] = 5;
635 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
636 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
637 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
638 InstSize
[OPCODE_CALL_LIST
] = 2;
639 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
640 InstSize
[OPCODE_CLEAR
] = 2;
641 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
642 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
643 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
644 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
645 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
646 InstSize
[OPCODE_CLIP_PLANE
] = 6;
647 InstSize
[OPCODE_COLOR_MASK
] = 5;
648 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
649 InstSize
[OPCODE_COLOR_TABLE
] = 7;
650 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
651 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
652 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
653 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
654 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
655 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
656 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
657 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
658 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
659 InstSize
[OPCODE_COPY_PIXELS
] = 6;
660 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
661 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
662 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
663 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
664 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
665 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
666 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
667 InstSize
[OPCODE_CULL_FACE
] = 2;
668 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
669 InstSize
[OPCODE_DEPTH_MASK
] = 2;
670 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
671 InstSize
[OPCODE_DISABLE
] = 2;
672 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
673 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
674 InstSize
[OPCODE_ENABLE
] = 2;
675 InstSize
[OPCODE_EVALMESH1
] = 4;
676 InstSize
[OPCODE_EVALMESH2
] = 6;
677 InstSize
[OPCODE_FOG
] = 6;
678 InstSize
[OPCODE_FRONT_FACE
] = 2;
679 InstSize
[OPCODE_FRUSTUM
] = 7;
680 InstSize
[OPCODE_HINT
] = 3;
681 InstSize
[OPCODE_HISTOGRAM
] = 5;
682 InstSize
[OPCODE_INDEX_MASK
] = 2;
683 InstSize
[OPCODE_INIT_NAMES
] = 1;
684 InstSize
[OPCODE_LIGHT
] = 7;
685 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
686 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
687 InstSize
[OPCODE_LINE_WIDTH
] = 2;
688 InstSize
[OPCODE_LIST_BASE
] = 2;
689 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
690 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
691 InstSize
[OPCODE_LOAD_NAME
] = 2;
692 InstSize
[OPCODE_LOGIC_OP
] = 2;
693 InstSize
[OPCODE_MAP1
] = 7;
694 InstSize
[OPCODE_MAP2
] = 11;
695 InstSize
[OPCODE_MAPGRID1
] = 4;
696 InstSize
[OPCODE_MAPGRID2
] = 7;
697 InstSize
[OPCODE_MATRIX_MODE
] = 2;
698 InstSize
[OPCODE_MIN_MAX
] = 4;
699 InstSize
[OPCODE_MULT_MATRIX
] = 17;
700 InstSize
[OPCODE_ORTHO
] = 7;
701 InstSize
[OPCODE_PASSTHROUGH
] = 2;
702 InstSize
[OPCODE_PIXEL_MAP
] = 4;
703 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
704 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
705 InstSize
[OPCODE_POINT_SIZE
] = 2;
706 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
707 InstSize
[OPCODE_POLYGON_MODE
] = 3;
708 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
709 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
710 InstSize
[OPCODE_POP_ATTRIB
] = 1;
711 InstSize
[OPCODE_POP_MATRIX
] = 1;
712 InstSize
[OPCODE_POP_NAME
] = 1;
713 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
714 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
715 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
716 InstSize
[OPCODE_PUSH_NAME
] = 2;
717 InstSize
[OPCODE_RASTER_POS
] = 5;
718 InstSize
[OPCODE_READ_BUFFER
] = 2;
719 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
720 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
721 InstSize
[OPCODE_ROTATE
] = 5;
722 InstSize
[OPCODE_SCALE
] = 4;
723 InstSize
[OPCODE_SCISSOR
] = 5;
724 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
725 InstSize
[OPCODE_STENCIL_MASK
] = 2;
726 InstSize
[OPCODE_STENCIL_OP
] = 4;
727 InstSize
[OPCODE_SHADE_MODEL
] = 2;
728 InstSize
[OPCODE_TEXENV
] = 7;
729 InstSize
[OPCODE_TEXGEN
] = 7;
730 InstSize
[OPCODE_TEXPARAMETER
] = 7;
731 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
732 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
733 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
734 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
735 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
736 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
737 InstSize
[OPCODE_TRANSLATE
] = 4;
738 InstSize
[OPCODE_VIEWPORT
] = 5;
739 InstSize
[OPCODE_WINDOW_POS
] = 5;
740 InstSize
[OPCODE_CONTINUE
] = 2;
741 InstSize
[OPCODE_ERROR
] = 3;
742 InstSize
[OPCODE_END_OF_LIST
] = 1;
743 /* GL_SGIX/SGIS_pixel_texture */
744 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
745 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
746 /* GL_ARB_texture_compression */
747 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
748 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
749 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
750 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
751 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
752 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
753 /* GL_ARB_multisample */
754 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
755 /* GL_ARB_multitexture */
756 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
757 /* GL_ARB_window_pos */
758 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
759 /* GL_NV_vertex_program */
760 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
761 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
762 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
763 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
764 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
765 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
766 /* GL_NV_fragment_program */
767 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
768 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
769 /* GL_EXT_stencil_two_side */
770 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
771 /* GL_EXT_depth_bounds_test */
772 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
773 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
774 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
775 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
777 InstSize
[OPCODE_ATTR_1F
] = 3;
778 InstSize
[OPCODE_ATTR_2F
] = 4;
779 InstSize
[OPCODE_ATTR_3F
] = 5;
780 InstSize
[OPCODE_ATTR_4F
] = 6;
781 InstSize
[OPCODE_MATERIAL
] = 7;
782 InstSize
[OPCODE_INDEX
] = 2;
783 InstSize
[OPCODE_EDGEFLAG
] = 2;
784 InstSize
[OPCODE_BEGIN
] = 2;
785 InstSize
[OPCODE_END
] = 1;
786 InstSize
[OPCODE_RECTF
] = 5;
787 InstSize
[OPCODE_EVAL_C1
] = 2;
788 InstSize
[OPCODE_EVAL_C2
] = 3;
789 InstSize
[OPCODE_EVAL_P1
] = 2;
790 InstSize
[OPCODE_EVAL_P2
] = 3;
798 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
799 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
802 unpack_image( GLsizei width
, GLsizei height
, GLsizei depth
,
803 GLenum format
, GLenum type
, const GLvoid
*pixels
,
804 const struct gl_pixelstore_attrib
*unpack
)
806 if (unpack
->BufferObj
->Name
== 0) {
808 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
811 else if (_mesa_validate_pbo_access(unpack
, width
, height
, depth
, format
,
813 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
814 return _mesa_unpack_image(width
, height
, depth
, format
, type
,
823 * Allocate space for a display list instruction.
824 * \param opcode - type of instruction
825 * argcount - size in bytes of data required.
826 * \return pointer to the usable data area (not including the internal
830 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
833 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
836 if (opcode
< (int) OPCODE_EXT_0
) {
837 assert( count
== InstSize
[opcode
] );
841 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
842 /* This block is full. Allocate a new block and chain to it */
843 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
844 n
[0].opcode
= OPCODE_CONTINUE
;
845 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
847 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
850 n
[1].next
= (Node
*) newblock
;
851 ctx
->ListState
.CurrentBlock
= newblock
;
852 ctx
->ListState
.CurrentPos
= 0;
855 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
856 ctx
->ListState
.CurrentPos
+= count
;
858 n
[0].opcode
= (OpCode
) opcode
;
860 return (void *)&n
[1];
865 * This function allows modules and drivers to get their own opcodes
866 * for extending display list functionality.
867 * \param ctx the rendering context
868 * \param size number of bytes for storing the new display list command
869 * \param execute function to execute the new display list command
870 * \param destroy function to destroy the new display list command
871 * \param print function to print the new display list command
872 * \return the new opcode number or -1 if error
875 _mesa_alloc_opcode( GLcontext
*ctx
,
877 void (*execute
)( GLcontext
*, void * ),
878 void (*destroy
)( GLcontext
*, void * ),
879 void (*print
)( GLcontext
*, void * ) )
881 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
882 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
883 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
884 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
885 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
886 ctx
->ListExt
.Opcode
[i
].Print
= print
;
887 return i
+ OPCODE_EXT_0
;
894 /* Mimic the old behaviour of alloc_instruction:
895 * - sz is in units of sizeof(Node)
896 * - return value a pointer to sizeof(Node) before the actual
899 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
900 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
905 * Display List compilation functions
907 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
909 GET_CURRENT_CONTEXT(ctx
);
911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
912 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
917 if (ctx
->ExecuteFlag
) {
918 (*ctx
->Exec
->Accum
)( op
, value
);
923 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
925 GET_CURRENT_CONTEXT(ctx
);
927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
928 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
931 n
[2].f
= (GLfloat
) ref
;
933 if (ctx
->ExecuteFlag
) {
934 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
939 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
941 GET_CURRENT_CONTEXT(ctx
);
943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
944 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
949 if (ctx
->ExecuteFlag
) {
950 (*ctx
->Exec
->BindTexture
)( target
, texture
);
955 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
956 GLfloat xorig
, GLfloat yorig
,
957 GLfloat xmove
, GLfloat ymove
,
958 const GLubyte
*pixels
)
960 GET_CURRENT_CONTEXT(ctx
);
961 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
964 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
966 n
[1].i
= (GLint
) width
;
967 n
[2].i
= (GLint
) height
;
977 if (ctx
->ExecuteFlag
) {
978 (*ctx
->Exec
->Bitmap
)( width
, height
,
979 xorig
, yorig
, xmove
, ymove
, pixels
);
984 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
986 GET_CURRENT_CONTEXT(ctx
);
988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
989 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
993 if (ctx
->ExecuteFlag
) {
994 (*ctx
->Exec
->BlendEquation
)( mode
);
999 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1002 GET_CURRENT_CONTEXT(ctx
);
1004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1005 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1010 if (ctx
->ExecuteFlag
) {
1011 (*ctx
->Exec
->BlendEquationSeparateEXT
)( modeRGB
, modeA
);
1016 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1017 GLenum sfactorA
, GLenum dfactorA
)
1019 GET_CURRENT_CONTEXT(ctx
);
1021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1022 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1024 n
[1].e
= sfactorRGB
;
1025 n
[2].e
= dfactorRGB
;
1029 if (ctx
->ExecuteFlag
) {
1030 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
1031 sfactorA
, dfactorA
);
1036 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1037 GLfloat blue
, GLfloat alpha
)
1039 GET_CURRENT_CONTEXT(ctx
);
1041 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1042 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1049 if (ctx
->ExecuteFlag
) {
1050 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1055 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1057 GET_CURRENT_CONTEXT(ctx
);
1059 SAVE_FLUSH_VERTICES(ctx
);
1061 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1066 /* After this, we don't know what begin/end state we're in:
1068 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1070 if (ctx
->ExecuteFlag
) {
1071 (*ctx
->Exec
->CallList
)( list
);
1076 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1078 GET_CURRENT_CONTEXT(ctx
);
1080 GLboolean typeErrorFlag
;
1082 SAVE_FLUSH_VERTICES(ctx
);
1086 case GL_UNSIGNED_BYTE
:
1088 case GL_UNSIGNED_SHORT
:
1090 case GL_UNSIGNED_INT
:
1095 typeErrorFlag
= GL_FALSE
;
1098 typeErrorFlag
= GL_TRUE
;
1102 GLuint list
= translate_id( i
, type
, lists
);
1103 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1106 n
[2].b
= typeErrorFlag
;
1110 /* After this, we don't know what begin/end state we're in:
1112 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1114 if (ctx
->ExecuteFlag
) {
1115 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1120 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1122 GET_CURRENT_CONTEXT(ctx
);
1124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1125 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1129 if (ctx
->ExecuteFlag
) {
1130 (*ctx
->Exec
->Clear
)( mask
);
1135 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1136 GLfloat blue
, GLfloat alpha
)
1138 GET_CURRENT_CONTEXT(ctx
);
1140 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1141 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1148 if (ctx
->ExecuteFlag
) {
1149 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1154 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1155 GLclampf blue
, GLclampf alpha
)
1157 GET_CURRENT_CONTEXT(ctx
);
1159 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1160 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1167 if (ctx
->ExecuteFlag
) {
1168 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1173 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1175 GET_CURRENT_CONTEXT(ctx
);
1177 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1178 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1180 n
[1].f
= (GLfloat
) depth
;
1182 if (ctx
->ExecuteFlag
) {
1183 (*ctx
->Exec
->ClearDepth
)( depth
);
1188 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1190 GET_CURRENT_CONTEXT(ctx
);
1192 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1193 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1197 if (ctx
->ExecuteFlag
) {
1198 (*ctx
->Exec
->ClearIndex
)( c
);
1203 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1205 GET_CURRENT_CONTEXT(ctx
);
1207 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1208 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1212 if (ctx
->ExecuteFlag
) {
1213 (*ctx
->Exec
->ClearStencil
)( s
);
1218 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1220 GET_CURRENT_CONTEXT(ctx
);
1222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1223 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1226 n
[2].f
= (GLfloat
) equ
[0];
1227 n
[3].f
= (GLfloat
) equ
[1];
1228 n
[4].f
= (GLfloat
) equ
[2];
1229 n
[5].f
= (GLfloat
) equ
[3];
1231 if (ctx
->ExecuteFlag
) {
1232 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1238 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1239 GLboolean blue
, GLboolean alpha
)
1241 GET_CURRENT_CONTEXT(ctx
);
1243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1244 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1251 if (ctx
->ExecuteFlag
) {
1252 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1257 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1259 GET_CURRENT_CONTEXT(ctx
);
1261 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1263 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1268 if (ctx
->ExecuteFlag
) {
1269 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1274 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1275 GLsizei width
, GLenum format
, GLenum type
,
1276 const GLvoid
*table
)
1278 GET_CURRENT_CONTEXT(ctx
);
1279 if (target
== GL_PROXY_TEXTURE_1D
||
1280 target
== GL_PROXY_TEXTURE_2D
||
1281 target
== GL_PROXY_TEXTURE_3D
||
1282 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1283 /* execute immediately */
1284 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1285 format
, type
, table
);
1288 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, table
,
1291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1292 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1295 n
[2].e
= internalFormat
;
1304 if (ctx
->ExecuteFlag
) {
1305 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1306 format
, type
, table
);
1313 static void GLAPIENTRY
1314 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1316 GET_CURRENT_CONTEXT(ctx
);
1319 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1321 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1326 if (pname
== GL_COLOR_TABLE_SGI
||
1327 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1328 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1329 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1336 if (ctx
->ExecuteFlag
) {
1337 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1342 static void GLAPIENTRY
1343 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1345 GET_CURRENT_CONTEXT(ctx
);
1348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1355 if (pname
== GL_COLOR_TABLE_SGI
||
1356 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1357 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1358 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1365 if (ctx
->ExecuteFlag
) {
1366 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1372 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1373 GLenum format
, GLenum type
,
1374 const GLvoid
*table
)
1376 GET_CURRENT_CONTEXT(ctx
);
1377 GLvoid
*image
= unpack_image(count
, 1, 1, format
, type
, table
,
1380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1381 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1393 if (ctx
->ExecuteFlag
) {
1394 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1399 static void GLAPIENTRY
1400 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1401 GLint x
, GLint y
, GLsizei width
)
1403 GET_CURRENT_CONTEXT(ctx
);
1406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1407 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1415 if (ctx
->ExecuteFlag
) {
1416 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1421 static void GLAPIENTRY
1422 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1423 GLint x
, GLint y
, GLsizei width
)
1425 GET_CURRENT_CONTEXT(ctx
);
1428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1429 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1432 n
[2].e
= internalformat
;
1437 if (ctx
->ExecuteFlag
) {
1438 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1443 static void GLAPIENTRY
1444 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1445 GLenum format
, GLenum type
, const GLvoid
*filter
)
1447 GET_CURRENT_CONTEXT(ctx
);
1448 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
, filter
,
1451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1452 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1455 n
[2].e
= internalFormat
;
1464 if (ctx
->ExecuteFlag
) {
1465 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1466 format
, type
, filter
);
1471 static void GLAPIENTRY
1472 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1473 GLsizei width
, GLsizei height
, GLenum format
,
1474 GLenum type
, const GLvoid
*filter
)
1476 GET_CURRENT_CONTEXT(ctx
);
1477 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
, filter
,
1480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1481 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1484 n
[2].e
= internalFormat
;
1494 if (ctx
->ExecuteFlag
) {
1495 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1496 format
, type
, filter
);
1501 static void GLAPIENTRY
1502 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1504 GET_CURRENT_CONTEXT(ctx
);
1506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1507 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1513 if (ctx
->ExecuteFlag
) {
1514 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1519 static void GLAPIENTRY
1520 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1522 GET_CURRENT_CONTEXT(ctx
);
1524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1525 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1530 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1531 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1532 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1538 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1541 if (ctx
->ExecuteFlag
) {
1542 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1547 static void GLAPIENTRY
1548 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1550 GET_CURRENT_CONTEXT(ctx
);
1552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1553 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1559 if (ctx
->ExecuteFlag
) {
1560 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1565 static void GLAPIENTRY
1566 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1568 GET_CURRENT_CONTEXT(ctx
);
1570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1571 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1576 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1577 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1578 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1584 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1587 if (ctx
->ExecuteFlag
) {
1588 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1593 static void GLAPIENTRY
1594 save_CopyPixels( GLint x
, GLint y
,
1595 GLsizei width
, GLsizei height
, GLenum type
)
1597 GET_CURRENT_CONTEXT(ctx
);
1599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1600 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1604 n
[3].i
= (GLint
) width
;
1605 n
[4].i
= (GLint
) height
;
1608 if (ctx
->ExecuteFlag
) {
1609 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1615 static void GLAPIENTRY
1616 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1617 GLint x
, GLint y
, GLsizei width
, GLint border
)
1619 GET_CURRENT_CONTEXT(ctx
);
1621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1622 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1626 n
[3].e
= internalformat
;
1632 if (ctx
->ExecuteFlag
) {
1633 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1634 x
, y
, width
, border
);
1639 static void GLAPIENTRY
1640 save_CopyTexImage2D( GLenum target
, GLint level
,
1641 GLenum internalformat
,
1642 GLint x
, GLint y
, GLsizei width
,
1643 GLsizei height
, GLint border
)
1645 GET_CURRENT_CONTEXT(ctx
);
1647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1648 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1652 n
[3].e
= internalformat
;
1659 if (ctx
->ExecuteFlag
) {
1660 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1661 x
, y
, width
, height
, border
);
1667 static void GLAPIENTRY
1668 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1669 GLint xoffset
, GLint x
, GLint y
,
1672 GET_CURRENT_CONTEXT(ctx
);
1674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1675 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1684 if (ctx
->ExecuteFlag
) {
1685 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1690 static void GLAPIENTRY
1691 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1692 GLint xoffset
, GLint yoffset
,
1694 GLsizei width
, GLint height
)
1696 GET_CURRENT_CONTEXT(ctx
);
1698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1699 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1710 if (ctx
->ExecuteFlag
) {
1711 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1712 x
, y
, width
, height
);
1717 static void GLAPIENTRY
1718 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1719 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1721 GLsizei width
, GLint height
)
1723 GET_CURRENT_CONTEXT(ctx
);
1725 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1726 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1738 if (ctx
->ExecuteFlag
) {
1739 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1740 xoffset
, yoffset
, zoffset
,
1741 x
, y
, width
, height
);
1746 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1748 GET_CURRENT_CONTEXT(ctx
);
1750 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1751 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1755 if (ctx
->ExecuteFlag
) {
1756 (*ctx
->Exec
->CullFace
)( mode
);
1761 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1763 GET_CURRENT_CONTEXT(ctx
);
1765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1766 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1770 if (ctx
->ExecuteFlag
) {
1771 (*ctx
->Exec
->DepthFunc
)( func
);
1776 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1778 GET_CURRENT_CONTEXT(ctx
);
1780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1781 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1785 if (ctx
->ExecuteFlag
) {
1786 (*ctx
->Exec
->DepthMask
)( mask
);
1791 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1793 GET_CURRENT_CONTEXT(ctx
);
1795 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1796 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1798 n
[1].f
= (GLfloat
) nearval
;
1799 n
[2].f
= (GLfloat
) farval
;
1801 if (ctx
->ExecuteFlag
) {
1802 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1807 static void GLAPIENTRY
save_Disable( GLenum cap
)
1809 GET_CURRENT_CONTEXT(ctx
);
1811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1812 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1816 if (ctx
->ExecuteFlag
) {
1817 (*ctx
->Exec
->Disable
)( cap
);
1822 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1824 GET_CURRENT_CONTEXT(ctx
);
1826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1827 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1831 if (ctx
->ExecuteFlag
) {
1832 (*ctx
->Exec
->DrawBuffer
)( mode
);
1837 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1838 GLenum format
, GLenum type
,
1839 const GLvoid
*pixels
)
1841 GET_CURRENT_CONTEXT(ctx
);
1842 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
1843 pixels
, &ctx
->Unpack
);
1845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1846 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1857 if (ctx
->ExecuteFlag
) {
1858 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1864 static void GLAPIENTRY
save_Enable( GLenum cap
)
1866 GET_CURRENT_CONTEXT(ctx
);
1868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1869 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1873 if (ctx
->ExecuteFlag
) {
1874 (*ctx
->Exec
->Enable
)( cap
);
1880 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1882 GET_CURRENT_CONTEXT(ctx
);
1884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1885 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1891 if (ctx
->ExecuteFlag
) {
1892 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1897 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1899 GET_CURRENT_CONTEXT(ctx
);
1901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1902 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1910 if (ctx
->ExecuteFlag
) {
1911 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1918 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1920 GET_CURRENT_CONTEXT(ctx
);
1922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1923 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1931 if (ctx
->ExecuteFlag
) {
1932 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1937 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1939 save_Fogfv(pname
, ¶m
);
1943 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1948 case GL_FOG_DENSITY
:
1952 p
[0] = (GLfloat
) *params
;
1955 p
[0] = INT_TO_FLOAT( params
[0] );
1956 p
[1] = INT_TO_FLOAT( params
[1] );
1957 p
[2] = INT_TO_FLOAT( params
[2] );
1958 p
[3] = INT_TO_FLOAT( params
[3] );
1961 /* Error will be caught later in gl_Fogfv */
1964 save_Fogfv(pname
, p
);
1968 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1970 save_Fogiv(pname
, ¶m
);
1974 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1976 GET_CURRENT_CONTEXT(ctx
);
1978 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1979 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1983 if (ctx
->ExecuteFlag
) {
1984 (*ctx
->Exec
->FrontFace
)( mode
);
1989 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1990 GLdouble bottom
, GLdouble top
,
1991 GLdouble nearval
, GLdouble farval
)
1993 GET_CURRENT_CONTEXT(ctx
);
1995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1996 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1998 n
[1].f
= (GLfloat
) left
;
1999 n
[2].f
= (GLfloat
) right
;
2000 n
[3].f
= (GLfloat
) bottom
;
2001 n
[4].f
= (GLfloat
) top
;
2002 n
[5].f
= (GLfloat
) nearval
;
2003 n
[6].f
= (GLfloat
) farval
;
2005 if (ctx
->ExecuteFlag
) {
2006 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
2011 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2013 GET_CURRENT_CONTEXT(ctx
);
2015 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2016 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2021 if (ctx
->ExecuteFlag
) {
2022 (*ctx
->Exec
->Hint
)( target
, mode
);
2027 static void GLAPIENTRY
2028 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2030 GET_CURRENT_CONTEXT(ctx
);
2033 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2034 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2038 n
[3].e
= internalFormat
;
2041 if (ctx
->ExecuteFlag
) {
2042 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2047 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2049 GET_CURRENT_CONTEXT(ctx
);
2051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2052 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2056 if (ctx
->ExecuteFlag
) {
2057 (*ctx
->Exec
->IndexMask
)( mask
);
2062 static void GLAPIENTRY
save_InitNames( void )
2064 GET_CURRENT_CONTEXT(ctx
);
2065 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2066 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2067 if (ctx
->ExecuteFlag
) {
2068 (*ctx
->Exec
->InitNames
)();
2073 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2075 GET_CURRENT_CONTEXT(ctx
);
2077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2078 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2096 case GL_SPOT_DIRECTION
:
2099 case GL_SPOT_EXPONENT
:
2102 case GL_SPOT_CUTOFF
:
2105 case GL_CONSTANT_ATTENUATION
:
2108 case GL_LINEAR_ATTENUATION
:
2111 case GL_QUADRATIC_ATTENUATION
:
2117 for (i
= 0; i
< nParams
; i
++) {
2118 n
[3+i
].f
= params
[i
];
2121 if (ctx
->ExecuteFlag
) {
2122 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2127 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2129 save_Lightfv(light
, pname
, ¶ms
);
2133 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2140 fparam
[0] = INT_TO_FLOAT( params
[0] );
2141 fparam
[1] = INT_TO_FLOAT( params
[1] );
2142 fparam
[2] = INT_TO_FLOAT( params
[2] );
2143 fparam
[3] = INT_TO_FLOAT( params
[3] );
2146 fparam
[0] = (GLfloat
) params
[0];
2147 fparam
[1] = (GLfloat
) params
[1];
2148 fparam
[2] = (GLfloat
) params
[2];
2149 fparam
[3] = (GLfloat
) params
[3];
2151 case GL_SPOT_DIRECTION
:
2152 fparam
[0] = (GLfloat
) params
[0];
2153 fparam
[1] = (GLfloat
) params
[1];
2154 fparam
[2] = (GLfloat
) params
[2];
2156 case GL_SPOT_EXPONENT
:
2157 case GL_SPOT_CUTOFF
:
2158 case GL_CONSTANT_ATTENUATION
:
2159 case GL_LINEAR_ATTENUATION
:
2160 case GL_QUADRATIC_ATTENUATION
:
2161 fparam
[0] = (GLfloat
) params
[0];
2164 /* error will be caught later in gl_Lightfv */
2167 save_Lightfv( light
, pname
, fparam
);
2171 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2173 save_Lightiv( light
, pname
, ¶m
);
2177 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2179 GET_CURRENT_CONTEXT(ctx
);
2181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2182 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2190 if (ctx
->ExecuteFlag
) {
2191 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2196 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2198 save_LightModelfv(pname
, ¶m
);
2202 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2206 case GL_LIGHT_MODEL_AMBIENT
:
2207 fparam
[0] = INT_TO_FLOAT( params
[0] );
2208 fparam
[1] = INT_TO_FLOAT( params
[1] );
2209 fparam
[2] = INT_TO_FLOAT( params
[2] );
2210 fparam
[3] = INT_TO_FLOAT( params
[3] );
2212 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2213 case GL_LIGHT_MODEL_TWO_SIDE
:
2214 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2215 fparam
[0] = (GLfloat
) params
[0];
2218 /* Error will be caught later in gl_LightModelfv */
2221 save_LightModelfv(pname
, fparam
);
2225 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2227 save_LightModeliv(pname
, ¶m
);
2231 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2233 GET_CURRENT_CONTEXT(ctx
);
2235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2236 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2241 if (ctx
->ExecuteFlag
) {
2242 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2247 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2249 GET_CURRENT_CONTEXT(ctx
);
2251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2252 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2256 if (ctx
->ExecuteFlag
) {
2257 (*ctx
->Exec
->LineWidth
)( width
);
2262 static void GLAPIENTRY
save_ListBase( GLuint base
)
2264 GET_CURRENT_CONTEXT(ctx
);
2266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2267 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2271 if (ctx
->ExecuteFlag
) {
2272 (*ctx
->Exec
->ListBase
)( base
);
2277 static void GLAPIENTRY
save_LoadIdentity( void )
2279 GET_CURRENT_CONTEXT(ctx
);
2280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2281 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2282 if (ctx
->ExecuteFlag
) {
2283 (*ctx
->Exec
->LoadIdentity
)();
2288 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2290 GET_CURRENT_CONTEXT(ctx
);
2292 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2293 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2296 for (i
=0;i
<16;i
++) {
2300 if (ctx
->ExecuteFlag
) {
2301 (*ctx
->Exec
->LoadMatrixf
)( m
);
2306 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2310 for (i
= 0; i
< 16; i
++) {
2311 f
[i
] = (GLfloat
) m
[i
];
2313 save_LoadMatrixf(f
);
2317 static void GLAPIENTRY
save_LoadName( GLuint name
)
2319 GET_CURRENT_CONTEXT(ctx
);
2321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2322 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2326 if (ctx
->ExecuteFlag
) {
2327 (*ctx
->Exec
->LoadName
)( name
);
2332 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2334 GET_CURRENT_CONTEXT(ctx
);
2336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2337 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2341 if (ctx
->ExecuteFlag
) {
2342 (*ctx
->Exec
->LogicOp
)( opcode
);
2347 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2348 GLint order
, const GLdouble
*points
)
2350 GET_CURRENT_CONTEXT(ctx
);
2352 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2353 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2355 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2357 n
[2].f
= (GLfloat
) u1
;
2358 n
[3].f
= (GLfloat
) u2
;
2359 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2361 n
[6].data
= (void *) pnts
;
2363 if (ctx
->ExecuteFlag
) {
2364 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2368 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2369 GLint order
, const GLfloat
*points
)
2371 GET_CURRENT_CONTEXT(ctx
);
2373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2374 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2376 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2380 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2382 n
[6].data
= (void *) pnts
;
2384 if (ctx
->ExecuteFlag
) {
2385 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2390 static void GLAPIENTRY
save_Map2d( GLenum target
,
2391 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2392 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2393 const GLdouble
*points
)
2395 GET_CURRENT_CONTEXT(ctx
);
2397 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2398 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2400 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2401 vstride
, vorder
, points
);
2403 n
[2].f
= (GLfloat
) u1
;
2404 n
[3].f
= (GLfloat
) u2
;
2405 n
[4].f
= (GLfloat
) v1
;
2406 n
[5].f
= (GLfloat
) v2
;
2407 /* XXX verify these strides are correct */
2408 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2409 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2412 n
[10].data
= (void *) pnts
;
2414 if (ctx
->ExecuteFlag
) {
2415 (*ctx
->Exec
->Map2d
)( target
,
2416 u1
, u2
, ustride
, uorder
,
2417 v1
, v2
, vstride
, vorder
, points
);
2422 static void GLAPIENTRY
save_Map2f( GLenum target
,
2423 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2424 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2425 const GLfloat
*points
)
2427 GET_CURRENT_CONTEXT(ctx
);
2429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2430 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2432 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2433 vstride
, vorder
, points
);
2439 /* XXX verify these strides are correct */
2440 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2441 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2444 n
[10].data
= (void *) pnts
;
2446 if (ctx
->ExecuteFlag
) {
2447 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2448 v1
, v2
, vstride
, vorder
, points
);
2453 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2455 GET_CURRENT_CONTEXT(ctx
);
2457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2458 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2464 if (ctx
->ExecuteFlag
) {
2465 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2470 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2472 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2476 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2477 GLint vn
, GLfloat v1
, GLfloat v2
)
2479 GET_CURRENT_CONTEXT(ctx
);
2481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2482 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2491 if (ctx
->ExecuteFlag
) {
2492 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2498 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2499 GLint vn
, GLdouble v1
, GLdouble v2
)
2501 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2502 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2506 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2508 GET_CURRENT_CONTEXT(ctx
);
2510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2511 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2515 if (ctx
->ExecuteFlag
) {
2516 (*ctx
->Exec
->MatrixMode
)( mode
);
2521 static void GLAPIENTRY
2522 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2524 GET_CURRENT_CONTEXT(ctx
);
2527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2528 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2531 n
[2].e
= internalFormat
;
2534 if (ctx
->ExecuteFlag
) {
2535 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2540 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2542 GET_CURRENT_CONTEXT(ctx
);
2544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2545 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2548 for (i
=0;i
<16;i
++) {
2552 if (ctx
->ExecuteFlag
) {
2553 (*ctx
->Exec
->MultMatrixf
)( m
);
2558 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2562 for (i
= 0; i
< 16; i
++) {
2563 f
[i
] = (GLfloat
) m
[i
];
2565 save_MultMatrixf(f
);
2569 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2571 GET_CURRENT_CONTEXT(ctx
);
2572 /* It's an error to call this function while building a display list */
2573 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2580 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2581 GLdouble bottom
, GLdouble top
,
2582 GLdouble nearval
, GLdouble farval
)
2584 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2589 n
[1].f
= (GLfloat
) left
;
2590 n
[2].f
= (GLfloat
) right
;
2591 n
[3].f
= (GLfloat
) bottom
;
2592 n
[4].f
= (GLfloat
) top
;
2593 n
[5].f
= (GLfloat
) nearval
;
2594 n
[6].f
= (GLfloat
) farval
;
2596 if (ctx
->ExecuteFlag
) {
2597 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2602 static void GLAPIENTRY
2603 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2605 GET_CURRENT_CONTEXT(ctx
);
2607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2608 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2612 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2613 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2615 if (ctx
->ExecuteFlag
) {
2616 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2621 static void GLAPIENTRY
2622 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2624 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2626 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2627 for (i
=0;i
<mapsize
;i
++) {
2628 fvalues
[i
] = (GLfloat
) values
[i
];
2632 for (i
=0;i
<mapsize
;i
++) {
2633 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2636 save_PixelMapfv(map
, mapsize
, fvalues
);
2640 static void GLAPIENTRY
2641 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2643 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2645 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2646 for (i
=0;i
<mapsize
;i
++) {
2647 fvalues
[i
] = (GLfloat
) values
[i
];
2651 for (i
=0;i
<mapsize
;i
++) {
2652 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2655 save_PixelMapfv(map
, mapsize
, fvalues
);
2659 static void GLAPIENTRY
2660 save_PixelTransferf( GLenum pname
, GLfloat param
)
2662 GET_CURRENT_CONTEXT(ctx
);
2664 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2665 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2670 if (ctx
->ExecuteFlag
) {
2671 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2676 static void GLAPIENTRY
2677 save_PixelTransferi( GLenum pname
, GLint param
)
2679 save_PixelTransferf( pname
, (GLfloat
) param
);
2683 static void GLAPIENTRY
2684 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2686 GET_CURRENT_CONTEXT(ctx
);
2688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2689 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2694 if (ctx
->ExecuteFlag
) {
2695 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2700 static void GLAPIENTRY
2701 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2703 GET_CURRENT_CONTEXT(ctx
);
2705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2706 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2713 if (ctx
->ExecuteFlag
) {
2714 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2719 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2721 save_PointParameterfvEXT(pname
, ¶m
);
2724 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2726 GLfloat p
= (GLfloat
) param
;
2727 save_PointParameterfvEXT(pname
, &p
);
2730 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2732 GLfloat p
= (GLfloat
) param
[0];
2733 save_PointParameterfvEXT(pname
, &p
);
2737 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2739 GET_CURRENT_CONTEXT(ctx
);
2741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2742 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2746 if (ctx
->ExecuteFlag
) {
2747 (*ctx
->Exec
->PointSize
)( size
);
2752 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2754 GET_CURRENT_CONTEXT(ctx
);
2756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2757 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2762 if (ctx
->ExecuteFlag
) {
2763 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2769 * Polygon stipple must have been upacked already!
2771 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2773 GET_CURRENT_CONTEXT(ctx
);
2775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2776 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2779 n
[1].data
= MALLOC( 32 * 4 );
2780 data
= n
[1].data
; /* This needed for Acorn compiler */
2781 MEMCPY( data
, pattern
, 32 * 4 );
2783 if (ctx
->ExecuteFlag
) {
2784 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2789 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2791 GET_CURRENT_CONTEXT(ctx
);
2793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2794 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2799 if (ctx
->ExecuteFlag
) {
2800 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2805 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2807 GET_CURRENT_CONTEXT(ctx
);
2808 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2812 static void GLAPIENTRY
save_PopAttrib( void )
2814 GET_CURRENT_CONTEXT(ctx
);
2815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2816 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2817 if (ctx
->ExecuteFlag
) {
2818 (*ctx
->Exec
->PopAttrib
)();
2823 static void GLAPIENTRY
save_PopMatrix( void )
2825 GET_CURRENT_CONTEXT(ctx
);
2826 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2827 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2828 if (ctx
->ExecuteFlag
) {
2829 (*ctx
->Exec
->PopMatrix
)();
2834 static void GLAPIENTRY
save_PopName( void )
2836 GET_CURRENT_CONTEXT(ctx
);
2837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2838 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2839 if (ctx
->ExecuteFlag
) {
2840 (*ctx
->Exec
->PopName
)();
2845 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2846 const GLclampf
*priorities
)
2848 GET_CURRENT_CONTEXT(ctx
);
2850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2852 for (i
=0;i
<num
;i
++) {
2854 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2856 n
[1].ui
= textures
[i
];
2857 n
[2].f
= priorities
[i
];
2860 if (ctx
->ExecuteFlag
) {
2861 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2866 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2868 GET_CURRENT_CONTEXT(ctx
);
2870 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2871 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2875 if (ctx
->ExecuteFlag
) {
2876 (*ctx
->Exec
->PushAttrib
)( mask
);
2881 static void GLAPIENTRY
save_PushMatrix( void )
2883 GET_CURRENT_CONTEXT(ctx
);
2884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2885 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2886 if (ctx
->ExecuteFlag
) {
2887 (*ctx
->Exec
->PushMatrix
)();
2892 static void GLAPIENTRY
save_PushName( GLuint name
)
2894 GET_CURRENT_CONTEXT(ctx
);
2896 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2897 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2901 if (ctx
->ExecuteFlag
) {
2902 (*ctx
->Exec
->PushName
)( name
);
2907 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2909 GET_CURRENT_CONTEXT(ctx
);
2911 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2912 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2919 if (ctx
->ExecuteFlag
) {
2920 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2924 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2926 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2929 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2931 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2934 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2936 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2939 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2941 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2944 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2946 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2949 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2951 save_RasterPos4f(x
, y
, z
, 1.0F
);
2954 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2956 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2959 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2961 save_RasterPos4f(x
, y
, z
, 1.0F
);
2964 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2966 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2969 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2971 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2974 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2976 save_RasterPos4f(x
, y
, z
, w
);
2979 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2981 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2984 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2986 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2989 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2991 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2994 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
2996 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2999 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3001 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3004 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3006 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3009 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3011 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3014 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3016 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3019 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3021 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3022 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3025 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3027 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3030 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3032 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3033 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3036 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3038 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3042 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3044 GET_CURRENT_CONTEXT(ctx
);
3046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3047 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3051 if (ctx
->ExecuteFlag
) {
3052 (*ctx
->Exec
->PassThrough
)( token
);
3057 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3059 GET_CURRENT_CONTEXT(ctx
);
3061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3062 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3066 if (ctx
->ExecuteFlag
) {
3067 (*ctx
->Exec
->ReadBuffer
)( mode
);
3072 static void GLAPIENTRY
3073 save_ResetHistogram(GLenum target
)
3075 GET_CURRENT_CONTEXT(ctx
);
3077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3078 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3082 if (ctx
->ExecuteFlag
) {
3083 (*ctx
->Exec
->ResetHistogram
)( target
);
3088 static void GLAPIENTRY
3089 save_ResetMinmax(GLenum target
)
3091 GET_CURRENT_CONTEXT(ctx
);
3093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3094 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3098 if (ctx
->ExecuteFlag
) {
3099 (*ctx
->Exec
->ResetMinmax
)( target
);
3104 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3106 GET_CURRENT_CONTEXT(ctx
);
3108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3109 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3116 if (ctx
->ExecuteFlag
) {
3117 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3122 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3124 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3128 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3130 GET_CURRENT_CONTEXT(ctx
);
3132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3133 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3139 if (ctx
->ExecuteFlag
) {
3140 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3145 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3147 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3151 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3153 GET_CURRENT_CONTEXT(ctx
);
3155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3156 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3163 if (ctx
->ExecuteFlag
) {
3164 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3169 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3171 GET_CURRENT_CONTEXT(ctx
);
3173 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3174 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3178 if (ctx
->ExecuteFlag
) {
3179 (*ctx
->Exec
->ShadeModel
)( mode
);
3184 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3186 GET_CURRENT_CONTEXT(ctx
);
3188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3189 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3195 if (ctx
->ExecuteFlag
) {
3196 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3201 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3203 GET_CURRENT_CONTEXT(ctx
);
3205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3206 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3210 if (ctx
->ExecuteFlag
) {
3211 (*ctx
->Exec
->StencilMask
)( mask
);
3216 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3218 GET_CURRENT_CONTEXT(ctx
);
3220 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3221 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3227 if (ctx
->ExecuteFlag
) {
3228 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3233 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3235 GET_CURRENT_CONTEXT(ctx
);
3237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3238 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3247 if (ctx
->ExecuteFlag
) {
3248 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3253 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3255 save_TexEnvfv( target
, pname
, ¶m
);
3259 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3262 p
[0] = (GLfloat
) param
;
3263 p
[1] = p
[2] = p
[3] = 0.0;
3264 save_TexEnvfv( target
, pname
, p
);
3268 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3271 p
[0] = INT_TO_FLOAT( param
[0] );
3272 p
[1] = INT_TO_FLOAT( param
[1] );
3273 p
[2] = INT_TO_FLOAT( param
[2] );
3274 p
[3] = INT_TO_FLOAT( param
[3] );
3275 save_TexEnvfv( target
, pname
, p
);
3279 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3281 GET_CURRENT_CONTEXT(ctx
);
3283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3284 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3293 if (ctx
->ExecuteFlag
) {
3294 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3299 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3302 p
[0] = (GLfloat
) params
[0];
3303 p
[1] = (GLfloat
) params
[1];
3304 p
[2] = (GLfloat
) params
[2];
3305 p
[3] = (GLfloat
) params
[3];
3306 save_TexGenfv(coord
, pname
, p
);
3310 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3312 GLfloat p
= (GLfloat
) param
;
3313 save_TexGenfv( coord
, pname
, &p
);
3317 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3320 p
[0] = (GLfloat
) params
[0];
3321 p
[1] = (GLfloat
) params
[1];
3322 p
[2] = (GLfloat
) params
[2];
3323 p
[3] = (GLfloat
) params
[3];
3324 save_TexGenfv( coord
, pname
, p
);
3328 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3330 save_TexGenfv(coord
, pname
, ¶m
);
3334 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3336 save_TexGeniv( coord
, pname
, ¶m
);
3340 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3341 GLenum pname
, const GLfloat
*params
)
3343 GET_CURRENT_CONTEXT(ctx
);
3345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3346 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3355 if (ctx
->ExecuteFlag
) {
3356 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3361 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3363 save_TexParameterfv(target
, pname
, ¶m
);
3367 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3370 fparam
[0] = (GLfloat
) param
;
3371 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3372 save_TexParameterfv(target
, pname
, fparam
);
3376 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3379 fparam
[0] = (GLfloat
) params
[0];
3380 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3381 save_TexParameterfv(target
, pname
, fparam
);
3385 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3386 GLint level
, GLint components
,
3387 GLsizei width
, GLint border
,
3388 GLenum format
, GLenum type
,
3389 const GLvoid
*pixels
)
3391 GET_CURRENT_CONTEXT(ctx
);
3392 if (target
== GL_PROXY_TEXTURE_1D
) {
3393 /* don't compile, execute immediately */
3394 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3395 border
, format
, type
, pixels
);
3398 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3399 pixels
, &ctx
->Unpack
);
3401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3402 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3406 n
[3].i
= components
;
3407 n
[4].i
= (GLint
) width
;
3416 if (ctx
->ExecuteFlag
) {
3417 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3418 border
, format
, type
, pixels
);
3424 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3425 GLint level
, GLint components
,
3426 GLsizei width
, GLsizei height
, GLint border
,
3427 GLenum format
, GLenum type
,
3428 const GLvoid
*pixels
)
3430 GET_CURRENT_CONTEXT(ctx
);
3431 if (target
== GL_PROXY_TEXTURE_2D
) {
3432 /* don't compile, execute immediately */
3433 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3434 height
, border
, format
, type
, pixels
);
3437 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3438 pixels
, &ctx
->Unpack
);
3440 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3441 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3445 n
[3].i
= components
;
3446 n
[4].i
= (GLint
) width
;
3447 n
[5].i
= (GLint
) height
;
3456 if (ctx
->ExecuteFlag
) {
3457 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3458 height
, border
, format
, type
, pixels
);
3464 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3465 GLint level
, GLint internalFormat
,
3466 GLsizei width
, GLsizei height
, GLsizei depth
,
3468 GLenum format
, GLenum type
,
3469 const GLvoid
*pixels
)
3471 GET_CURRENT_CONTEXT(ctx
);
3472 if (target
== GL_PROXY_TEXTURE_3D
) {
3473 /* don't compile, execute immediately */
3474 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3475 height
, depth
, border
, format
, type
, pixels
);
3479 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3480 pixels
, &ctx
->Unpack
);
3481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3482 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3486 n
[3].i
= (GLint
) internalFormat
;
3487 n
[4].i
= (GLint
) width
;
3488 n
[5].i
= (GLint
) height
;
3489 n
[6].i
= (GLint
) depth
;
3498 if (ctx
->ExecuteFlag
) {
3499 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3500 height
, depth
, border
, format
, type
, pixels
);
3506 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3507 GLsizei width
, GLenum format
, GLenum type
,
3508 const GLvoid
*pixels
)
3510 GET_CURRENT_CONTEXT(ctx
);
3512 GLvoid
*image
= unpack_image(width
, 1, 1, format
, type
,
3513 pixels
, &ctx
->Unpack
);
3514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3515 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3520 n
[4].i
= (GLint
) width
;
3528 if (ctx
->ExecuteFlag
) {
3529 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3530 format
, type
, pixels
);
3535 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3536 GLint xoffset
, GLint yoffset
,
3537 GLsizei width
, GLsizei height
,
3538 GLenum format
, GLenum type
,
3539 const GLvoid
*pixels
)
3541 GET_CURRENT_CONTEXT(ctx
);
3543 GLvoid
*image
= unpack_image(width
, height
, 1, format
, type
,
3544 pixels
, &ctx
->Unpack
);
3545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3546 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3552 n
[5].i
= (GLint
) width
;
3553 n
[6].i
= (GLint
) height
;
3561 if (ctx
->ExecuteFlag
) {
3562 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3563 width
, height
, format
, type
, pixels
);
3568 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3569 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3570 GLsizei width
, GLsizei height
, GLsizei depth
,
3571 GLenum format
, GLenum type
,
3572 const GLvoid
*pixels
)
3574 GET_CURRENT_CONTEXT(ctx
);
3576 GLvoid
*image
= unpack_image(width
, height
, depth
, format
, type
,
3577 pixels
, &ctx
->Unpack
);
3578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3586 n
[6].i
= (GLint
) width
;
3587 n
[7].i
= (GLint
) height
;
3588 n
[8].i
= (GLint
) depth
;
3596 if (ctx
->ExecuteFlag
) {
3597 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3598 xoffset
, yoffset
, zoffset
,
3599 width
, height
, depth
, format
, type
, pixels
);
3604 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3606 GET_CURRENT_CONTEXT(ctx
);
3608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3609 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3615 if (ctx
->ExecuteFlag
) {
3616 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3621 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3623 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3628 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3630 GET_CURRENT_CONTEXT(ctx
);
3632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3633 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3637 n
[3].i
= (GLint
) width
;
3638 n
[4].i
= (GLint
) height
;
3640 if (ctx
->ExecuteFlag
) {
3641 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3646 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3648 GET_CURRENT_CONTEXT(ctx
);
3650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3651 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3658 if (ctx
->ExecuteFlag
) {
3659 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3663 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3665 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3668 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3670 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3673 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3675 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3678 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3680 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3683 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3685 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3688 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3690 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3693 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3695 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3698 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3700 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3703 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3705 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3708 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3710 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3713 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3715 save_WindowPos4fMESA(x
, y
, z
, w
);
3718 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3720 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3723 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3725 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3728 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3730 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3733 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3735 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3738 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3740 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3743 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3745 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3748 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3750 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3753 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3755 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3758 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3760 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3761 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3764 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3766 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3769 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3771 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3772 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3775 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3777 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3782 /* GL_ARB_multitexture */
3783 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3785 GET_CURRENT_CONTEXT(ctx
);
3787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3788 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3792 if (ctx
->ExecuteFlag
) {
3793 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3798 /* GL_ARB_transpose_matrix */
3800 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3803 _math_transposefd(tm
, m
);
3804 save_LoadMatrixf(tm
);
3808 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3811 _math_transposef(tm
, m
);
3812 save_LoadMatrixf(tm
);
3816 static void GLAPIENTRY
3817 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3820 _math_transposefd(tm
, m
);
3821 save_MultMatrixf(tm
);
3825 static void GLAPIENTRY
3826 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3829 _math_transposef(tm
, m
);
3830 save_MultMatrixf(tm
);
3834 static void GLAPIENTRY
3835 save_PixelTexGenSGIX(GLenum mode
)
3837 GET_CURRENT_CONTEXT(ctx
);
3839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3840 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3844 if (ctx
->ExecuteFlag
) {
3845 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3850 /* GL_ARB_texture_compression */
3851 static void GLAPIENTRY
3852 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3853 GLenum internalFormat
, GLsizei width
,
3854 GLint border
, GLsizei imageSize
,
3857 GET_CURRENT_CONTEXT(ctx
);
3858 if (target
== GL_PROXY_TEXTURE_1D
) {
3859 /* don't compile, execute immediately */
3860 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3861 width
, border
, imageSize
, data
);
3866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3867 /* make copy of image */
3868 image
= MALLOC(imageSize
);
3870 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3873 MEMCPY(image
, data
, imageSize
);
3874 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3878 n
[3].e
= internalFormat
;
3879 n
[4].i
= (GLint
) width
;
3887 if (ctx
->ExecuteFlag
) {
3888 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3889 width
, border
, imageSize
, data
);
3895 static void GLAPIENTRY
3896 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3897 GLenum internalFormat
, GLsizei width
,
3898 GLsizei height
, GLint border
, GLsizei imageSize
,
3901 GET_CURRENT_CONTEXT(ctx
);
3902 if (target
== GL_PROXY_TEXTURE_2D
) {
3903 /* don't compile, execute immediately */
3904 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3905 width
, height
, border
, imageSize
, data
);
3910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3911 /* make copy of image */
3912 image
= MALLOC(imageSize
);
3914 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3917 MEMCPY(image
, data
, imageSize
);
3918 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3922 n
[3].e
= internalFormat
;
3923 n
[4].i
= (GLint
) width
;
3924 n
[5].i
= (GLint
) height
;
3932 if (ctx
->ExecuteFlag
) {
3933 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3934 width
, height
, border
, imageSize
, data
);
3940 static void GLAPIENTRY
3941 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3942 GLenum internalFormat
, GLsizei width
,
3943 GLsizei height
, GLsizei depth
, GLint border
,
3944 GLsizei imageSize
, const GLvoid
*data
)
3946 GET_CURRENT_CONTEXT(ctx
);
3947 if (target
== GL_PROXY_TEXTURE_3D
) {
3948 /* don't compile, execute immediately */
3949 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3950 width
, height
, depth
, border
, imageSize
, data
);
3955 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3956 /* make copy of image */
3957 image
= MALLOC(imageSize
);
3959 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3962 MEMCPY(image
, data
, imageSize
);
3963 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3967 n
[3].e
= internalFormat
;
3968 n
[4].i
= (GLint
) width
;
3969 n
[5].i
= (GLint
) height
;
3970 n
[6].i
= (GLint
) depth
;
3978 if (ctx
->ExecuteFlag
) {
3979 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3980 width
, height
, depth
, border
, imageSize
, data
);
3986 static void GLAPIENTRY
3987 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3988 GLsizei width
, GLenum format
,
3989 GLsizei imageSize
, const GLvoid
*data
)
3994 GET_CURRENT_CONTEXT(ctx
);
3995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3997 /* make copy of image */
3998 image
= MALLOC(imageSize
);
4000 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4003 MEMCPY(image
, data
, imageSize
);
4004 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4009 n
[4].i
= (GLint
) width
;
4017 if (ctx
->ExecuteFlag
) {
4018 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
4019 width
, format
, imageSize
, data
);
4024 static void GLAPIENTRY
4025 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4026 GLint yoffset
, GLsizei width
, GLsizei height
,
4027 GLenum format
, GLsizei imageSize
,
4033 GET_CURRENT_CONTEXT(ctx
);
4034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4036 /* make copy of image */
4037 image
= MALLOC(imageSize
);
4039 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4042 MEMCPY(image
, data
, imageSize
);
4043 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4049 n
[5].i
= (GLint
) width
;
4050 n
[6].i
= (GLint
) height
;
4058 if (ctx
->ExecuteFlag
) {
4059 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4060 width
, height
, format
, imageSize
, data
);
4065 static void GLAPIENTRY
4066 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4067 GLint yoffset
, GLint zoffset
, GLsizei width
,
4068 GLsizei height
, GLsizei depth
, GLenum format
,
4069 GLsizei imageSize
, const GLvoid
*data
)
4074 GET_CURRENT_CONTEXT(ctx
);
4075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4077 /* make copy of image */
4078 image
= MALLOC(imageSize
);
4080 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4083 MEMCPY(image
, data
, imageSize
);
4084 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4091 n
[6].i
= (GLint
) width
;
4092 n
[7].i
= (GLint
) height
;
4093 n
[8].i
= (GLint
) depth
;
4095 n
[10].i
= imageSize
;
4101 if (ctx
->ExecuteFlag
) {
4102 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4103 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4108 /* GL_ARB_multisample */
4109 static void GLAPIENTRY
4110 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4112 GET_CURRENT_CONTEXT(ctx
);
4114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4115 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4120 if (ctx
->ExecuteFlag
) {
4121 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4126 /* GL_SGIS_pixel_texture */
4128 static void GLAPIENTRY
4129 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4131 GET_CURRENT_CONTEXT(ctx
);
4133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4134 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4139 if (ctx
->ExecuteFlag
) {
4140 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4145 static void GLAPIENTRY
4146 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4148 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4152 static void GLAPIENTRY
4153 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4155 save_PixelTexGenParameteriSGIS(target
, *value
);
4159 static void GLAPIENTRY
4160 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4162 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4167 * GL_NV_vertex_program
4169 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4170 static void GLAPIENTRY
4171 save_BindProgramNV(GLenum target
, GLuint id
)
4173 GET_CURRENT_CONTEXT(ctx
);
4175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4176 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4181 if (ctx
->ExecuteFlag
) {
4182 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4185 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4187 #if FEATURE_NV_vertex_program
4188 static void GLAPIENTRY
4189 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4191 GET_CURRENT_CONTEXT(ctx
);
4193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4194 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4203 if (ctx
->ExecuteFlag
) {
4204 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4209 static void GLAPIENTRY
4210 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4211 GLfloat x
, GLfloat y
,
4212 GLfloat z
, GLfloat w
)
4214 GET_CURRENT_CONTEXT(ctx
);
4216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4217 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4226 if (ctx
->ExecuteFlag
) {
4227 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4232 static void GLAPIENTRY
4233 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4235 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4236 params
[2], params
[3]);
4240 static void GLAPIENTRY
4241 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4242 GLdouble x
, GLdouble y
,
4243 GLdouble z
, GLdouble w
)
4245 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4246 (GLfloat
) z
, (GLfloat
) w
);
4250 static void GLAPIENTRY
4251 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4252 const GLdouble
*params
)
4254 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4255 (GLfloat
) params
[1], (GLfloat
) params
[2],
4256 (GLfloat
) params
[3]);
4260 static void GLAPIENTRY
4261 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4262 GLuint num
, const GLdouble
*params
)
4265 for (i
= 0; i
< num
; i
++) {
4266 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4271 static void GLAPIENTRY
4272 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4273 GLuint num
, const GLfloat
*params
)
4276 for (i
= 0; i
< num
; i
++) {
4277 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4282 static void GLAPIENTRY
4283 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4284 const GLubyte
*program
)
4286 GET_CURRENT_CONTEXT(ctx
);
4288 GLubyte
*programCopy
;
4290 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4292 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4295 _mesa_memcpy(programCopy
, program
, len
);
4297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4298 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4303 n
[4].data
= programCopy
;
4305 if (ctx
->ExecuteFlag
) {
4306 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4311 static void GLAPIENTRY
4312 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4314 GET_CURRENT_CONTEXT(ctx
);
4316 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4318 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4321 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4323 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4328 if (ctx
->ExecuteFlag
) {
4329 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4334 static void GLAPIENTRY
4335 save_TrackMatrixNV(GLenum target
, GLuint address
,
4336 GLenum matrix
, GLenum transform
)
4338 GET_CURRENT_CONTEXT(ctx
);
4340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4341 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4348 if (ctx
->ExecuteFlag
) {
4349 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4352 #endif /* FEATURE_NV_vertex_program */
4356 * GL_NV_fragment_program
4358 #if FEATURE_NV_fragment_program
4359 static void GLAPIENTRY
4360 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4361 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4363 GET_CURRENT_CONTEXT(ctx
);
4365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4366 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4375 if (ctx
->ExecuteFlag
) {
4376 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4381 static void GLAPIENTRY
4382 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4383 const GLfloat
*params
)
4385 GET_CURRENT_CONTEXT(ctx
);
4387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4388 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4397 if (ctx
->ExecuteFlag
) {
4398 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4403 static void GLAPIENTRY
4404 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4405 GLdouble x
, GLdouble y
,
4406 GLdouble z
, GLdouble w
)
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 );
4415 n
[3].f
= (GLfloat
) x
;
4416 n
[4].f
= (GLfloat
) y
;
4417 n
[5].f
= (GLfloat
) z
;
4418 n
[6].f
= (GLfloat
) w
;
4420 if (ctx
->ExecuteFlag
) {
4421 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4426 static void GLAPIENTRY
4427 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4428 const GLdouble
*params
)
4430 GET_CURRENT_CONTEXT(ctx
);
4432 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4433 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4437 n
[3].f
= (GLfloat
) params
[0];
4438 n
[4].f
= (GLfloat
) params
[1];
4439 n
[5].f
= (GLfloat
) params
[2];
4440 n
[6].f
= (GLfloat
) params
[3];
4442 if (ctx
->ExecuteFlag
) {
4443 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4447 static void GLAPIENTRY
4448 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4449 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4451 GET_CURRENT_CONTEXT(ctx
);
4453 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4455 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4458 _mesa_memcpy(nameCopy
, name
, len
);
4460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4461 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4465 n
[3].data
= nameCopy
;
4471 if (ctx
->ExecuteFlag
) {
4472 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4477 static void GLAPIENTRY
4478 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4481 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4485 static void GLAPIENTRY
4486 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4487 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4489 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4490 (GLfloat
) z
,(GLfloat
) w
);
4494 static void GLAPIENTRY
4495 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4498 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4499 (GLfloat
) v
[1], (GLfloat
) v
[2],
4503 #endif /* FEATURE_NV_fragment_program */
4507 /* GL_EXT_stencil_two_side */
4508 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4510 GET_CURRENT_CONTEXT(ctx
);
4512 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4513 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4517 if (ctx
->ExecuteFlag
) {
4518 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4523 /* GL_EXT_depth_bounds_test */
4524 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4526 GET_CURRENT_CONTEXT(ctx
);
4528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4529 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4531 n
[1].f
= (GLfloat
) zmin
;
4532 n
[2].f
= (GLfloat
) zmax
;
4534 if (ctx
->ExecuteFlag
) {
4535 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4541 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4543 static void GLAPIENTRY
4544 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4545 const GLvoid
*string
)
4547 GET_CURRENT_CONTEXT(ctx
);
4549 GLubyte
*programCopy
;
4551 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4553 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4556 _mesa_memcpy(programCopy
, string
, len
);
4558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4559 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4564 n
[4].data
= programCopy
;
4566 if (ctx
->ExecuteFlag
) {
4567 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4572 static void GLAPIENTRY
4573 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4574 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4576 GET_CURRENT_CONTEXT(ctx
);
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4588 if (ctx
->ExecuteFlag
) {
4589 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4594 static void GLAPIENTRY
4595 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4596 const GLfloat
*params
)
4598 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4599 params
[2], params
[3]);
4603 static void GLAPIENTRY
4604 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4605 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4607 save_ProgramEnvParameter4fARB(target
, index
,
4615 static void GLAPIENTRY
4616 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4617 const GLdouble
*params
)
4619 save_ProgramEnvParameter4fARB(target
, index
,
4620 (GLfloat
) params
[0],
4621 (GLfloat
) params
[1],
4622 (GLfloat
) params
[2],
4623 (GLfloat
) params
[3]);
4626 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4631 static void save_Attr1f( GLenum attr
, GLfloat x
)
4633 GET_CURRENT_CONTEXT(ctx
);
4635 SAVE_FLUSH_VERTICES( ctx
);
4636 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4642 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4643 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4645 if (ctx
->ExecuteFlag
) {
4646 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4650 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4652 GET_CURRENT_CONTEXT(ctx
);
4654 SAVE_FLUSH_VERTICES( ctx
);
4655 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4662 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4663 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4665 if (ctx
->ExecuteFlag
) {
4666 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4670 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4672 GET_CURRENT_CONTEXT(ctx
);
4674 SAVE_FLUSH_VERTICES( ctx
);
4675 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4683 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4684 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4686 if (ctx
->ExecuteFlag
) {
4687 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4691 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4694 GET_CURRENT_CONTEXT(ctx
);
4696 SAVE_FLUSH_VERTICES( ctx
);
4697 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4706 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4707 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4709 if (ctx
->ExecuteFlag
) {
4710 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4714 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4716 GET_CURRENT_CONTEXT(ctx
);
4718 SAVE_FLUSH_VERTICES( ctx
);
4719 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4723 if (ctx
->ExecuteFlag
) {
4724 (*ctx
->Exec
->EvalCoord1f
)( x
);
4728 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4730 save_EvalCoord1f( v
[0] );
4733 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4735 GET_CURRENT_CONTEXT(ctx
);
4737 SAVE_FLUSH_VERTICES( ctx
);
4738 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4743 if (ctx
->ExecuteFlag
) {
4744 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4748 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4750 save_EvalCoord2f( v
[0], v
[1] );
4754 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4756 GET_CURRENT_CONTEXT(ctx
);
4758 SAVE_FLUSH_VERTICES( ctx
);
4759 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4763 if (ctx
->ExecuteFlag
) {
4764 (*ctx
->Exec
->EvalPoint1
)( x
);
4768 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4770 GET_CURRENT_CONTEXT(ctx
);
4772 SAVE_FLUSH_VERTICES( ctx
);
4773 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4778 if (ctx
->ExecuteFlag
) {
4779 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4783 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4785 GET_CURRENT_CONTEXT(ctx
);
4787 SAVE_FLUSH_VERTICES( ctx
);
4788 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4793 ctx
->ListState
.ActiveIndex
= 1;
4794 ctx
->ListState
.CurrentIndex
= x
;
4796 if (ctx
->ExecuteFlag
) {
4797 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4801 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4803 save_Indexf( v
[0] );
4806 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4808 GET_CURRENT_CONTEXT(ctx
);
4810 SAVE_FLUSH_VERTICES( ctx
);
4811 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4816 ctx
->ListState
.ActiveEdgeFlag
= 1;
4817 ctx
->ListState
.CurrentEdgeFlag
= x
;
4819 if (ctx
->ExecuteFlag
) {
4820 (*ctx
->Exec
->EdgeFlag
)( x
);
4824 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4826 save_EdgeFlag( v
[0] );
4829 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4831 GET_CURRENT_CONTEXT(ctx
);
4835 SAVE_FLUSH_VERTICES( ctx
);
4840 case GL_FRONT_AND_BACK
:
4843 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4852 case GL_AMBIENT_AND_DIFFUSE
:
4858 case GL_COLOR_INDEXES
:
4862 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4866 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4870 for (i
= 0 ; i
< args
; i
++)
4871 n
[3+i
].f
= param
[i
];
4875 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4876 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4877 if (bitmask
& (1<<i
)) {
4878 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4879 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4883 if (ctx
->ExecuteFlag
) {
4884 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4888 static void GLAPIENTRY
save_Begin( GLenum mode
)
4890 GET_CURRENT_CONTEXT(ctx
);
4892 GLboolean error
= GL_FALSE
;
4894 if (mode
< GL_POINTS
|| mode
> GL_POLYGON
) {
4895 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4898 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4899 /* Typically the first begin. This may raise an error on
4900 * playback, depending on whether CallList is issued from inside
4901 * a begin/end or not.
4903 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4905 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4906 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4909 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4914 /* Give the driver an opportunity to hook in an optimized
4915 * display list compiler.
4917 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4920 SAVE_FLUSH_VERTICES( ctx
);
4921 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4927 if (ctx
->ExecuteFlag
) {
4928 (*ctx
->Exec
->Begin
)( mode
);
4932 static void GLAPIENTRY
save_End( void )
4934 GET_CURRENT_CONTEXT(ctx
);
4935 SAVE_FLUSH_VERTICES( ctx
);
4936 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4937 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4938 if (ctx
->ExecuteFlag
) {
4939 (*ctx
->Exec
->End
)( );
4943 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
4944 GLfloat c
, GLfloat d
)
4946 GET_CURRENT_CONTEXT(ctx
);
4948 SAVE_FLUSH_VERTICES( ctx
);
4949 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
4956 if (ctx
->ExecuteFlag
) {
4957 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
4963 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
4965 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
4968 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
4970 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
4973 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
4975 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
4978 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
4980 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
4983 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4985 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
4988 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
4990 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
4993 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
4995 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
4998 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5000 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
5003 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5005 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
5008 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5010 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5013 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5015 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
5018 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5020 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5023 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5025 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5028 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5030 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5033 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5035 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5038 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5040 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5043 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5045 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5048 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5050 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5053 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5055 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5058 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5060 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5063 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5065 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5068 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5070 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5073 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5075 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5078 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5080 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5084 /* Just call the respective ATTR for texcoord
5086 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5088 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5089 save_Attr1f( attr
, x
);
5092 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5094 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5095 save_Attr1f( attr
, v
[0] );
5098 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5100 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5101 save_Attr2f( attr
, x
, y
);
5104 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5106 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5107 save_Attr2f( attr
, v
[0], v
[1] );
5110 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5113 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5114 save_Attr3f( attr
, x
, y
, z
);
5117 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5119 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5120 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5123 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5124 GLfloat z
, GLfloat w
)
5126 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5127 save_Attr4f( attr
, x
, y
, z
, w
);
5130 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5132 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5133 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5137 static void enum_error( void )
5139 GET_CURRENT_CONTEXT( ctx
);
5140 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5143 /* First level for NV_vertex_program:
5145 * Check for errors at compile time?.
5147 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5149 if (index
< VERT_ATTRIB_MAX
)
5150 save_Attr1f( index
, x
);
5155 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5157 if (index
< VERT_ATTRIB_MAX
)
5158 save_Attr1f( index
, v
[0] );
5163 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5165 if (index
< VERT_ATTRIB_MAX
)
5166 save_Attr2f( index
, x
, y
);
5171 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5173 if (index
< VERT_ATTRIB_MAX
)
5174 save_Attr2f( index
, v
[0], v
[1] );
5179 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5182 if (index
< VERT_ATTRIB_MAX
)
5183 save_Attr3f( index
, x
, y
, z
);
5188 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5190 if (index
< VERT_ATTRIB_MAX
)
5191 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5196 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5197 GLfloat z
, GLfloat w
)
5199 if (index
< VERT_ATTRIB_MAX
)
5200 save_Attr4f( index
, x
, y
, z
, w
);
5205 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5207 if (index
< VERT_ATTRIB_MAX
)
5208 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5217 /* KW: Compile commands
5219 * Will appear in the list before the vertex buffer containing the
5220 * command that provoked the error. I don't see this as a problem.
5223 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5226 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5229 n
[2].data
= (void *) s
;
5231 /* execute already done */
5236 * Compile an error into current display list.
5239 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5241 if (ctx
->CompileFlag
)
5242 _mesa_save_error( ctx
, error
, s
);
5244 if (ctx
->ExecuteFlag
)
5245 _mesa_error( ctx
, error
, s
);
5251 islist(GLcontext
*ctx
, GLuint list
)
5253 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5263 /**********************************************************************/
5264 /* Display list execution */
5265 /**********************************************************************/
5269 * Execute a display list. Note that the ListBase offset must have already
5270 * been added before calling this function. I.e. the list argument is
5271 * the absolute list number, not relative to ListBase.
5272 * \param list - display list number
5274 static void GLAPIENTRY
5275 execute_list( GLcontext
*ctx
, GLuint list
)
5280 if (list
== 0 || !islist(ctx
,list
))
5283 if (ctx
->Driver
.BeginCallList
)
5284 ctx
->Driver
.BeginCallList( ctx
, list
);
5286 ctx
->ListState
.CallDepth
++;
5288 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5292 OpCode opcode
= n
[0].opcode
;
5293 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5295 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5296 /* this is a driver-extended opcode */
5297 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5298 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5303 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5306 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5308 case OPCODE_ALPHA_FUNC
:
5309 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5311 case OPCODE_BIND_TEXTURE
:
5312 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5316 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5317 ctx
->Unpack
= ctx
->DefaultPacking
;
5318 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5319 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5320 ctx
->Unpack
= save
; /* restore */
5323 case OPCODE_BLEND_COLOR
:
5324 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5326 case OPCODE_BLEND_EQUATION
:
5327 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5329 case OPCODE_BLEND_EQUATION_SEPARATE
:
5330 (*ctx
->Exec
->BlendEquationSeparateEXT
)( n
[1].e
, n
[2].e
);
5332 case OPCODE_BLEND_FUNC_SEPARATE
:
5333 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5335 case OPCODE_CALL_LIST
:
5336 /* Generated by glCallList(), don't add ListBase */
5337 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5338 execute_list( ctx
, n
[1].ui
);
5341 case OPCODE_CALL_LIST_OFFSET
:
5342 /* Generated by glCallLists() so we must add ListBase */
5344 /* user specified a bad data type at compile time */
5345 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5347 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5348 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5352 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5354 case OPCODE_CLEAR_COLOR
:
5355 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5357 case OPCODE_CLEAR_ACCUM
:
5358 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5360 case OPCODE_CLEAR_DEPTH
:
5361 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5363 case OPCODE_CLEAR_INDEX
:
5364 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5366 case OPCODE_CLEAR_STENCIL
:
5367 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5369 case OPCODE_CLIP_PLANE
:
5376 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5379 case OPCODE_COLOR_MASK
:
5380 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5382 case OPCODE_COLOR_MATERIAL
:
5383 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5385 case OPCODE_COLOR_TABLE
:
5387 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5388 ctx
->Unpack
= ctx
->DefaultPacking
;
5389 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5390 n
[5].e
, n
[6].data
);
5391 ctx
->Unpack
= save
; /* restore */
5394 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5401 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5404 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5411 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5414 case OPCODE_COLOR_SUB_TABLE
:
5416 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5417 ctx
->Unpack
= ctx
->DefaultPacking
;
5418 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5419 n
[4].e
, n
[5].e
, n
[6].data
);
5420 ctx
->Unpack
= save
; /* restore */
5423 case OPCODE_CONVOLUTION_FILTER_1D
:
5425 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5426 ctx
->Unpack
= ctx
->DefaultPacking
;
5427 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5428 n
[4].e
, n
[5].e
, n
[6].data
);
5429 ctx
->Unpack
= save
; /* restore */
5432 case OPCODE_CONVOLUTION_FILTER_2D
:
5434 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5435 ctx
->Unpack
= ctx
->DefaultPacking
;
5436 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5437 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5438 ctx
->Unpack
= save
; /* restore */
5441 case OPCODE_CONVOLUTION_PARAMETER_I
:
5442 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5444 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5451 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5454 case OPCODE_CONVOLUTION_PARAMETER_F
:
5455 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5457 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5464 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5467 case OPCODE_COPY_COLOR_SUB_TABLE
:
5468 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5469 n
[3].i
, n
[4].i
, n
[5].i
);
5471 case OPCODE_COPY_COLOR_TABLE
:
5472 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5473 n
[3].i
, n
[4].i
, n
[5].i
);
5475 case OPCODE_COPY_PIXELS
:
5476 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5477 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5479 case OPCODE_COPY_TEX_IMAGE1D
:
5480 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5481 n
[5].i
, n
[6].i
, n
[7].i
);
5483 case OPCODE_COPY_TEX_IMAGE2D
:
5484 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5485 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5487 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5488 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5489 n
[4].i
, n
[5].i
, n
[6].i
);
5491 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5492 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5493 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5495 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5496 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5497 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5499 case OPCODE_CULL_FACE
:
5500 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5502 case OPCODE_DEPTH_FUNC
:
5503 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5505 case OPCODE_DEPTH_MASK
:
5506 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5508 case OPCODE_DEPTH_RANGE
:
5509 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5511 case OPCODE_DISABLE
:
5512 (*ctx
->Exec
->Disable
)( n
[1].e
);
5514 case OPCODE_DRAW_BUFFER
:
5515 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5517 case OPCODE_DRAW_PIXELS
:
5519 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5520 ctx
->Unpack
= ctx
->DefaultPacking
;
5521 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5523 ctx
->Unpack
= save
; /* restore */
5527 (*ctx
->Exec
->Enable
)( n
[1].e
);
5529 case OPCODE_EVALMESH1
:
5530 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5532 case OPCODE_EVALMESH2
:
5533 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5542 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5545 case OPCODE_FRONT_FACE
:
5546 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5548 case OPCODE_FRUSTUM
:
5549 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5552 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5554 case OPCODE_HISTOGRAM
:
5555 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5557 case OPCODE_INDEX_MASK
:
5558 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5560 case OPCODE_INIT_NAMES
:
5561 (*ctx
->Exec
->InitNames
)();
5570 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5573 case OPCODE_LIGHT_MODEL
:
5580 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5583 case OPCODE_LINE_STIPPLE
:
5584 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5586 case OPCODE_LINE_WIDTH
:
5587 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5589 case OPCODE_LIST_BASE
:
5590 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5592 case OPCODE_LOAD_IDENTITY
:
5593 (*ctx
->Exec
->LoadIdentity
)();
5595 case OPCODE_LOAD_MATRIX
:
5596 if (sizeof(Node
)==sizeof(GLfloat
)) {
5597 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5602 for (i
=0;i
<16;i
++) {
5605 (*ctx
->Exec
->LoadMatrixf
)( m
);
5608 case OPCODE_LOAD_NAME
:
5609 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5611 case OPCODE_LOGIC_OP
:
5612 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5616 GLenum target
= n
[1].e
;
5617 GLint ustride
= _mesa_evaluator_components(target
);
5618 GLint uorder
= n
[5].i
;
5619 GLfloat u1
= n
[2].f
;
5620 GLfloat u2
= n
[3].f
;
5621 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5622 (GLfloat
*) n
[6].data
);
5627 GLenum target
= n
[1].e
;
5628 GLfloat u1
= n
[2].f
;
5629 GLfloat u2
= n
[3].f
;
5630 GLfloat v1
= n
[4].f
;
5631 GLfloat v2
= n
[5].f
;
5632 GLint ustride
= n
[6].i
;
5633 GLint vstride
= n
[7].i
;
5634 GLint uorder
= n
[8].i
;
5635 GLint vorder
= n
[9].i
;
5636 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5637 v1
, v2
, vstride
, vorder
,
5638 (GLfloat
*) n
[10].data
);
5641 case OPCODE_MAPGRID1
:
5642 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5644 case OPCODE_MAPGRID2
:
5645 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5647 case OPCODE_MATRIX_MODE
:
5648 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5650 case OPCODE_MIN_MAX
:
5651 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5653 case OPCODE_MULT_MATRIX
:
5654 if (sizeof(Node
)==sizeof(GLfloat
)) {
5655 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5660 for (i
=0;i
<16;i
++) {
5663 (*ctx
->Exec
->MultMatrixf
)( m
);
5667 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5669 case OPCODE_PASSTHROUGH
:
5670 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5672 case OPCODE_PIXEL_MAP
:
5673 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5675 case OPCODE_PIXEL_TRANSFER
:
5676 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5678 case OPCODE_PIXEL_ZOOM
:
5679 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5681 case OPCODE_POINT_SIZE
:
5682 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5684 case OPCODE_POINT_PARAMETERS
:
5690 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5693 case OPCODE_POLYGON_MODE
:
5694 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5696 case OPCODE_POLYGON_STIPPLE
:
5697 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5699 case OPCODE_POLYGON_OFFSET
:
5700 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5702 case OPCODE_POP_ATTRIB
:
5703 (*ctx
->Exec
->PopAttrib
)();
5705 case OPCODE_POP_MATRIX
:
5706 (*ctx
->Exec
->PopMatrix
)();
5708 case OPCODE_POP_NAME
:
5709 (*ctx
->Exec
->PopName
)();
5711 case OPCODE_PRIORITIZE_TEXTURE
:
5712 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5714 case OPCODE_PUSH_ATTRIB
:
5715 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5717 case OPCODE_PUSH_MATRIX
:
5718 (*ctx
->Exec
->PushMatrix
)();
5720 case OPCODE_PUSH_NAME
:
5721 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5723 case OPCODE_RASTER_POS
:
5724 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5726 case OPCODE_READ_BUFFER
:
5727 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5729 case OPCODE_RESET_HISTOGRAM
:
5730 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5732 case OPCODE_RESET_MIN_MAX
:
5733 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5736 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5739 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5741 case OPCODE_SCISSOR
:
5742 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5744 case OPCODE_SHADE_MODEL
:
5745 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5747 case OPCODE_STENCIL_FUNC
:
5748 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5750 case OPCODE_STENCIL_MASK
:
5751 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5753 case OPCODE_STENCIL_OP
:
5754 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5763 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5773 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5776 case OPCODE_TEXPARAMETER
:
5783 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5786 case OPCODE_TEX_IMAGE1D
:
5788 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5789 ctx
->Unpack
= ctx
->DefaultPacking
;
5790 (*ctx
->Exec
->TexImage1D
)(
5791 n
[1].e
, /* target */
5793 n
[3].i
, /* components */
5795 n
[5].e
, /* border */
5796 n
[6].e
, /* format */
5799 ctx
->Unpack
= save
; /* restore */
5802 case OPCODE_TEX_IMAGE2D
:
5804 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5805 ctx
->Unpack
= ctx
->DefaultPacking
;
5806 (*ctx
->Exec
->TexImage2D
)(
5807 n
[1].e
, /* target */
5809 n
[3].i
, /* components */
5811 n
[5].i
, /* height */
5812 n
[6].e
, /* border */
5813 n
[7].e
, /* format */
5816 ctx
->Unpack
= save
; /* restore */
5819 case OPCODE_TEX_IMAGE3D
:
5821 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5822 ctx
->Unpack
= ctx
->DefaultPacking
;
5823 (*ctx
->Exec
->TexImage3D
)(
5824 n
[1].e
, /* target */
5826 n
[3].i
, /* components */
5828 n
[5].i
, /* height */
5830 n
[7].e
, /* border */
5831 n
[8].e
, /* format */
5834 ctx
->Unpack
= save
; /* restore */
5837 case OPCODE_TEX_SUB_IMAGE1D
:
5839 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5840 ctx
->Unpack
= ctx
->DefaultPacking
;
5841 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5843 n
[6].e
, n
[7].data
);
5844 ctx
->Unpack
= save
; /* restore */
5847 case OPCODE_TEX_SUB_IMAGE2D
:
5849 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5850 ctx
->Unpack
= ctx
->DefaultPacking
;
5851 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5853 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5854 ctx
->Unpack
= save
; /* restore */
5857 case OPCODE_TEX_SUB_IMAGE3D
:
5859 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5860 ctx
->Unpack
= ctx
->DefaultPacking
;
5861 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5862 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5863 n
[8].i
, n
[9].e
, n
[10].e
,
5865 ctx
->Unpack
= save
; /* restore */
5868 case OPCODE_TRANSLATE
:
5869 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5871 case OPCODE_VIEWPORT
:
5872 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5873 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5875 case OPCODE_WINDOW_POS
:
5876 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5878 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5879 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5881 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5882 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5884 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5885 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5887 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5888 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5889 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5891 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5892 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5893 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5895 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5896 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5897 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5899 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5900 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5901 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5903 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5904 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5905 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5907 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5908 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5909 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5910 n
[9].e
, n
[10].i
, n
[11].data
);
5912 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5913 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5915 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5916 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5918 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5919 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5920 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5923 #if FEATURE_NV_vertex_program
5924 case OPCODE_EXECUTE_PROGRAM_NV
:
5931 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5934 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5935 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5936 (GLuint
*) n
[2].data
);
5938 case OPCODE_LOAD_PROGRAM_NV
:
5939 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5940 (const GLubyte
*) n
[4].data
);
5942 case OPCODE_PROGRAM_PARAMETER4F_NV
:
5943 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5944 n
[4].f
, n
[5].f
, n
[6].f
);
5946 case OPCODE_TRACK_MATRIX_NV
:
5947 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
5951 #if FEATURE_NV_fragment_program
5952 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
5953 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5954 n
[4].f
, n
[5].f
, n
[6].f
);
5956 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
5957 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
5958 (const GLubyte
*) n
[3].data
,
5959 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
5963 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
5964 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
5966 case OPCODE_DEPTH_BOUNDS_EXT
:
5967 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
5969 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5970 case OPCODE_PROGRAM_STRING_ARB
:
5971 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
5973 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
5974 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5975 n
[4].f
, n
[5].f
, n
[6].f
);
5979 case OPCODE_ATTR_1F
:
5980 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
5982 case OPCODE_ATTR_2F
:
5983 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
5985 case OPCODE_ATTR_3F
:
5986 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
5988 case OPCODE_ATTR_4F
:
5989 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
5991 case OPCODE_MATERIAL
:
5992 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
5995 (*ctx
->Exec
->Indexi
)(n
[1].i
);
5997 case OPCODE_EDGEFLAG
:
5998 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
6001 (*ctx
->Exec
->Begin
)(n
[1].e
);
6004 (*ctx
->Exec
->End
)();
6007 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
6009 case OPCODE_EVAL_C1
:
6010 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
6012 case OPCODE_EVAL_C2
:
6013 (*ctx
->Exec
->EvalCoord2fv
)(&n
[1].f
);
6015 case OPCODE_EVAL_P1
:
6016 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
6018 case OPCODE_EVAL_P2
:
6019 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
6025 case OPCODE_CONTINUE
:
6026 n
= (Node
*) n
[1].next
;
6028 case OPCODE_END_OF_LIST
:
6034 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6035 _mesa_problem(ctx
, msg
);
6040 /* increment n to point to next compiled command */
6041 if (opcode
!=OPCODE_CONTINUE
) {
6042 n
+= InstSize
[opcode
];
6046 ctx
->ListState
.CallDepth
--;
6048 if (ctx
->Driver
.EndCallList
)
6049 ctx
->Driver
.EndCallList( ctx
);
6056 /**********************************************************************/
6058 /**********************************************************************/
6064 * Test if a display list number is valid.
6066 GLboolean GLAPIENTRY
6067 _mesa_IsList( GLuint list
)
6069 GET_CURRENT_CONTEXT(ctx
);
6070 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6071 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6072 return islist(ctx
, list
);
6077 * Delete a sequence of consecutive display lists.
6080 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6082 GET_CURRENT_CONTEXT(ctx
);
6084 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6085 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6088 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6091 for (i
=list
;i
<list
+range
;i
++) {
6092 _mesa_destroy_list( ctx
, i
);
6099 * Return a display list number, n, such that lists n through n+range-1
6103 _mesa_GenLists(GLsizei range
)
6105 GET_CURRENT_CONTEXT(ctx
);
6107 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6108 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6111 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6119 * Make this an atomic operation
6121 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6123 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6125 /* reserve the list IDs by with empty/dummy lists */
6127 for (i
=0; i
<range
; i
++) {
6128 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6132 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6140 * Begin a new display list.
6143 _mesa_NewList( GLuint list
, GLenum mode
)
6145 GET_CURRENT_CONTEXT(ctx
);
6148 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6149 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6151 if (MESA_VERBOSE
&VERBOSE_API
)
6152 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6153 _mesa_lookup_enum_by_nr(mode
));
6156 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6160 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6161 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6165 if (ctx
->ListState
.CurrentListPtr
) {
6166 /* already compiling a display list */
6167 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6171 ctx
->CompileFlag
= GL_TRUE
;
6172 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6174 /* Allocate new display list */
6175 ctx
->ListState
.CurrentListNum
= list
;
6176 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6177 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6178 ctx
->ListState
.CurrentPos
= 0;
6180 /* Reset acumulated list state:
6182 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6183 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6185 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6186 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6188 ctx
->ListState
.ActiveIndex
= 0;
6189 ctx
->ListState
.ActiveEdgeFlag
= 0;
6191 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6192 ctx
->Driver
.NewList( ctx
, list
, mode
);
6194 ctx
->CurrentDispatch
= ctx
->Save
;
6195 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6201 * End definition of current display list.
6204 _mesa_EndList( void )
6206 GET_CURRENT_CONTEXT(ctx
);
6207 SAVE_FLUSH_VERTICES(ctx
);
6208 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6210 if (MESA_VERBOSE
&VERBOSE_API
)
6211 _mesa_debug(ctx
, "glEndList\n");
6213 /* Check that a list is under construction */
6214 if (!ctx
->ListState
.CurrentListPtr
) {
6215 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6219 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6221 /* Destroy old list, if any */
6222 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6223 /* Install the list */
6224 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6227 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6228 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6230 ctx
->ListState
.CurrentListNum
= 0;
6231 ctx
->ListState
.CurrentListPtr
= NULL
;
6232 ctx
->ExecuteFlag
= GL_TRUE
;
6233 ctx
->CompileFlag
= GL_FALSE
;
6235 ctx
->Driver
.EndList( ctx
);
6237 ctx
->CurrentDispatch
= ctx
->Exec
;
6238 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6244 _mesa_CallList( GLuint list
)
6246 GLboolean save_compile_flag
;
6247 GET_CURRENT_CONTEXT(ctx
);
6248 FLUSH_CURRENT(ctx
, 0);
6249 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6250 /* execute the display list, and restore the CompileFlag. */
6252 if (MESA_VERBOSE
& VERBOSE_API
)
6253 _mesa_debug(ctx
, "glCallList %d\n", list
);
6256 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6260 /* mesa_print_display_list( list ); */
6262 save_compile_flag
= ctx
->CompileFlag
;
6263 if (save_compile_flag
) {
6264 ctx
->CompileFlag
= GL_FALSE
;
6267 execute_list( ctx
, list
);
6268 ctx
->CompileFlag
= save_compile_flag
;
6270 /* also restore API function pointers to point to "save" versions */
6271 if (save_compile_flag
) {
6272 ctx
->CurrentDispatch
= ctx
->Save
;
6273 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6280 * Execute glCallLists: call multiple display lists.
6283 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6285 GET_CURRENT_CONTEXT(ctx
);
6288 GLboolean save_compile_flag
;
6290 if (MESA_VERBOSE
& VERBOSE_API
)
6291 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6295 case GL_UNSIGNED_BYTE
:
6297 case GL_UNSIGNED_SHORT
:
6299 case GL_UNSIGNED_INT
:
6307 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6311 /* Save the CompileFlag status, turn it off, execute display list,
6312 * and restore the CompileFlag.
6314 save_compile_flag
= ctx
->CompileFlag
;
6315 ctx
->CompileFlag
= GL_FALSE
;
6318 list
= translate_id( i
, type
, lists
);
6319 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6322 ctx
->CompileFlag
= save_compile_flag
;
6324 /* also restore API function pointers to point to "save" versions */
6325 if (save_compile_flag
) {
6326 ctx
->CurrentDispatch
= ctx
->Save
;
6327 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6334 * Set the offset added to list numbers in glCallLists.
6337 _mesa_ListBase( GLuint base
)
6339 GET_CURRENT_CONTEXT(ctx
);
6340 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6341 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6342 ctx
->List
.ListBase
= base
;
6346 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6348 static void GLAPIENTRY
exec_Finish( void )
6350 GET_CURRENT_CONTEXT(ctx
);
6351 FLUSH_VERTICES(ctx
, 0);
6352 ctx
->Exec
->Finish();
6355 static void GLAPIENTRY
exec_Flush( void )
6357 GET_CURRENT_CONTEXT(ctx
);
6358 FLUSH_VERTICES(ctx
, 0);
6359 ctx
->Exec
->Flush( );
6362 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6364 GET_CURRENT_CONTEXT(ctx
);
6365 FLUSH_VERTICES(ctx
, 0);
6366 ctx
->Exec
->GetBooleanv( pname
, params
);
6369 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6371 GET_CURRENT_CONTEXT(ctx
);
6372 FLUSH_VERTICES(ctx
, 0);
6373 ctx
->Exec
->GetClipPlane( plane
, equation
);
6376 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6378 GET_CURRENT_CONTEXT(ctx
);
6379 FLUSH_VERTICES(ctx
, 0);
6380 ctx
->Exec
->GetDoublev( pname
, params
);
6383 static GLenum GLAPIENTRY
exec_GetError( void )
6385 GET_CURRENT_CONTEXT(ctx
);
6386 FLUSH_VERTICES(ctx
, 0);
6387 return ctx
->Exec
->GetError( );
6390 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6392 GET_CURRENT_CONTEXT(ctx
);
6393 FLUSH_VERTICES(ctx
, 0);
6394 ctx
->Exec
->GetFloatv( pname
, params
);
6397 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6399 GET_CURRENT_CONTEXT(ctx
);
6400 FLUSH_VERTICES(ctx
, 0);
6401 ctx
->Exec
->GetIntegerv( pname
, params
);
6404 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6406 GET_CURRENT_CONTEXT(ctx
);
6407 FLUSH_VERTICES(ctx
, 0);
6408 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6411 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6413 GET_CURRENT_CONTEXT(ctx
);
6414 FLUSH_VERTICES(ctx
, 0);
6415 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6418 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6420 GET_CURRENT_CONTEXT(ctx
);
6421 FLUSH_VERTICES(ctx
, 0);
6422 ctx
->Exec
->GetMapdv( target
, query
, v
);
6425 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6427 GET_CURRENT_CONTEXT(ctx
);
6428 FLUSH_VERTICES(ctx
, 0);
6429 ctx
->Exec
->GetMapfv( target
, query
, v
);
6432 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6434 GET_CURRENT_CONTEXT(ctx
);
6435 FLUSH_VERTICES(ctx
, 0);
6436 ctx
->Exec
->GetMapiv( target
, query
, v
);
6439 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6441 GET_CURRENT_CONTEXT(ctx
);
6442 FLUSH_VERTICES(ctx
, 0);
6443 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6446 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6448 GET_CURRENT_CONTEXT(ctx
);
6449 FLUSH_VERTICES(ctx
, 0);
6450 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6453 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6455 GET_CURRENT_CONTEXT(ctx
);
6456 FLUSH_VERTICES(ctx
, 0);
6457 ctx
->Exec
->GetPixelMapfv( map
, values
);
6460 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6462 GET_CURRENT_CONTEXT(ctx
);
6463 FLUSH_VERTICES(ctx
, 0);
6464 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6467 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6469 GET_CURRENT_CONTEXT(ctx
);
6470 FLUSH_VERTICES(ctx
, 0);
6471 ctx
->Exec
->GetPixelMapusv( map
, values
);
6474 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6476 GET_CURRENT_CONTEXT(ctx
);
6477 FLUSH_VERTICES(ctx
, 0);
6478 ctx
->Exec
->GetPolygonStipple( dest
);
6481 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6483 GET_CURRENT_CONTEXT(ctx
);
6484 FLUSH_VERTICES(ctx
, 0);
6485 return ctx
->Exec
->GetString( name
);
6488 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6490 GET_CURRENT_CONTEXT(ctx
);
6491 FLUSH_VERTICES(ctx
, 0);
6492 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6495 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6497 GET_CURRENT_CONTEXT(ctx
);
6498 FLUSH_VERTICES(ctx
, 0);
6499 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6502 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6504 GET_CURRENT_CONTEXT(ctx
);
6505 FLUSH_VERTICES(ctx
, 0);
6506 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6509 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6511 GET_CURRENT_CONTEXT(ctx
);
6512 FLUSH_VERTICES(ctx
, 0);
6513 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6516 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6518 GET_CURRENT_CONTEXT(ctx
);
6519 FLUSH_VERTICES(ctx
, 0);
6520 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6523 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6524 GLenum type
, GLvoid
*pixels
)
6526 GET_CURRENT_CONTEXT(ctx
);
6527 FLUSH_VERTICES(ctx
, 0);
6528 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6531 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6532 GLenum pname
, GLfloat
*params
)
6534 GET_CURRENT_CONTEXT(ctx
);
6535 FLUSH_VERTICES(ctx
, 0);
6536 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6539 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6540 GLenum pname
, GLint
*params
)
6542 GET_CURRENT_CONTEXT(ctx
);
6543 FLUSH_VERTICES(ctx
, 0);
6544 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6547 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6550 GET_CURRENT_CONTEXT(ctx
);
6551 FLUSH_VERTICES(ctx
, 0);
6552 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6555 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6557 GET_CURRENT_CONTEXT(ctx
);
6558 FLUSH_VERTICES(ctx
, 0);
6559 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6562 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6564 GET_CURRENT_CONTEXT(ctx
);
6565 FLUSH_VERTICES(ctx
, 0);
6566 return ctx
->Exec
->IsEnabled( cap
);
6569 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6571 GET_CURRENT_CONTEXT(ctx
);
6572 FLUSH_VERTICES(ctx
, 0);
6573 ctx
->Exec
->PixelStoref( pname
, param
);
6576 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6578 GET_CURRENT_CONTEXT(ctx
);
6579 FLUSH_VERTICES(ctx
, 0);
6580 ctx
->Exec
->PixelStorei( pname
, param
);
6583 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6584 GLenum format
, GLenum type
, GLvoid
*pixels
)
6586 GET_CURRENT_CONTEXT(ctx
);
6587 FLUSH_VERTICES(ctx
, 0);
6588 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6591 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6593 GET_CURRENT_CONTEXT(ctx
);
6594 FLUSH_VERTICES(ctx
, 0);
6595 return ctx
->Exec
->RenderMode( mode
);
6598 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6600 GET_CURRENT_CONTEXT(ctx
);
6601 FLUSH_VERTICES(ctx
, 0);
6602 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6605 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6607 GET_CURRENT_CONTEXT(ctx
);
6608 FLUSH_VERTICES(ctx
, 0);
6609 ctx
->Exec
->SelectBuffer( size
, buffer
);
6612 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6613 GLboolean
*residences
)
6615 GET_CURRENT_CONTEXT(ctx
);
6616 FLUSH_VERTICES(ctx
, 0);
6617 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6620 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6623 GET_CURRENT_CONTEXT(ctx
);
6624 FLUSH_VERTICES(ctx
, 0);
6625 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6628 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6630 GET_CURRENT_CONTEXT(ctx
);
6631 FLUSH_VERTICES(ctx
, 0);
6632 ctx
->Exec
->DeleteTextures( n
, texName
);
6635 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6637 GET_CURRENT_CONTEXT(ctx
);
6638 FLUSH_VERTICES(ctx
, 0);
6639 ctx
->Exec
->DisableClientState( cap
);
6642 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6644 GET_CURRENT_CONTEXT(ctx
);
6645 FLUSH_VERTICES(ctx
, 0);
6646 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6649 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6651 GET_CURRENT_CONTEXT(ctx
);
6652 FLUSH_VERTICES(ctx
, 0);
6653 ctx
->Exec
->EnableClientState( cap
);
6656 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6658 GET_CURRENT_CONTEXT(ctx
);
6659 FLUSH_VERTICES(ctx
, 0);
6660 ctx
->Exec
->GenTextures( n
, texName
);
6663 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6665 GET_CURRENT_CONTEXT(ctx
);
6666 FLUSH_VERTICES(ctx
, 0);
6667 ctx
->Exec
->GetPointerv( pname
, params
);
6670 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6672 GET_CURRENT_CONTEXT(ctx
);
6673 FLUSH_VERTICES(ctx
, 0);
6674 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6677 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6678 const GLvoid
*pointer
)
6680 GET_CURRENT_CONTEXT(ctx
);
6681 FLUSH_VERTICES(ctx
, 0);
6682 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6685 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6687 GET_CURRENT_CONTEXT(ctx
);
6688 FLUSH_VERTICES(ctx
, 0);
6689 return ctx
->Exec
->IsTexture( texture
);
6692 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6694 GET_CURRENT_CONTEXT(ctx
);
6695 FLUSH_VERTICES(ctx
, 0);
6696 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6699 static void GLAPIENTRY
exec_PopClientAttrib(void)
6701 GET_CURRENT_CONTEXT(ctx
);
6702 FLUSH_VERTICES(ctx
, 0);
6703 ctx
->Exec
->PopClientAttrib();
6706 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6708 GET_CURRENT_CONTEXT(ctx
);
6709 FLUSH_VERTICES(ctx
, 0);
6710 ctx
->Exec
->PushClientAttrib( mask
);
6713 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6716 GET_CURRENT_CONTEXT(ctx
);
6717 FLUSH_VERTICES(ctx
, 0);
6718 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6721 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6724 GET_CURRENT_CONTEXT(ctx
);
6725 FLUSH_VERTICES(ctx
, 0);
6726 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6729 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6732 GET_CURRENT_CONTEXT(ctx
);
6733 FLUSH_VERTICES(ctx
, 0);
6734 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6737 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6738 GLint x
, GLint y
, GLsizei width
)
6740 GET_CURRENT_CONTEXT(ctx
);
6741 FLUSH_VERTICES(ctx
, 0);
6742 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6745 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6746 GLint x
, GLint y
, GLsizei width
,
6749 GET_CURRENT_CONTEXT(ctx
);
6750 FLUSH_VERTICES(ctx
, 0);
6751 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6755 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6756 GLenum type
, GLvoid
*data
)
6758 GET_CURRENT_CONTEXT(ctx
);
6759 FLUSH_VERTICES(ctx
, 0);
6760 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6763 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6766 GET_CURRENT_CONTEXT(ctx
);
6767 FLUSH_VERTICES(ctx
, 0);
6768 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6771 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6774 GET_CURRENT_CONTEXT(ctx
);
6775 FLUSH_VERTICES(ctx
, 0);
6776 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6779 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6782 GET_CURRENT_CONTEXT(ctx
);
6783 FLUSH_VERTICES(ctx
, 0);
6784 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6787 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6790 GET_CURRENT_CONTEXT(ctx
);
6791 FLUSH_VERTICES(ctx
, 0);
6792 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6795 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6798 GET_CURRENT_CONTEXT(ctx
);
6799 FLUSH_VERTICES(ctx
, 0);
6800 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6803 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6804 GLenum type
, GLvoid
*values
)
6806 GET_CURRENT_CONTEXT(ctx
);
6807 FLUSH_VERTICES(ctx
, 0);
6808 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6811 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6814 GET_CURRENT_CONTEXT(ctx
);
6815 FLUSH_VERTICES(ctx
, 0);
6816 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6819 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6822 GET_CURRENT_CONTEXT(ctx
);
6823 FLUSH_VERTICES(ctx
, 0);
6824 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6827 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6828 GLenum type
, GLvoid
*values
)
6830 GET_CURRENT_CONTEXT(ctx
);
6831 FLUSH_VERTICES(ctx
, 0);
6832 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6835 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6838 GET_CURRENT_CONTEXT(ctx
);
6839 FLUSH_VERTICES(ctx
, 0);
6840 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6843 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6846 GET_CURRENT_CONTEXT(ctx
);
6847 FLUSH_VERTICES(ctx
, 0);
6848 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6851 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6852 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6854 GET_CURRENT_CONTEXT(ctx
);
6855 FLUSH_VERTICES(ctx
, 0);
6856 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6859 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6860 GLsizei width
, GLsizei height
, GLenum format
,
6861 GLenum type
, const GLvoid
*row
,
6862 const GLvoid
*column
)
6864 GET_CURRENT_CONTEXT(ctx
);
6865 FLUSH_VERTICES(ctx
, 0);
6866 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6870 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6872 GET_CURRENT_CONTEXT(ctx
);
6873 FLUSH_VERTICES(ctx
, 0);
6874 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6877 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6879 GET_CURRENT_CONTEXT(ctx
);
6880 FLUSH_VERTICES(ctx
, 0);
6881 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6884 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6885 GLsizei count
, const GLvoid
*ptr
)
6887 GET_CURRENT_CONTEXT(ctx
);
6888 FLUSH_VERTICES(ctx
, 0);
6889 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6892 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6893 const GLboolean
*ptr
)
6895 GET_CURRENT_CONTEXT(ctx
);
6896 FLUSH_VERTICES(ctx
, 0);
6897 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6900 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6903 GET_CURRENT_CONTEXT(ctx
);
6904 FLUSH_VERTICES(ctx
, 0);
6905 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
6908 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6911 GET_CURRENT_CONTEXT(ctx
);
6912 FLUSH_VERTICES(ctx
, 0);
6913 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
6916 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6917 GLsizei count
, const GLvoid
*ptr
)
6919 GET_CURRENT_CONTEXT(ctx
);
6920 FLUSH_VERTICES(ctx
, 0);
6921 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
6924 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6925 GLsizei count
, const GLvoid
*ptr
)
6927 GET_CURRENT_CONTEXT(ctx
);
6928 FLUSH_VERTICES(ctx
, 0);
6929 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
6932 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
6934 GET_CURRENT_CONTEXT(ctx
);
6935 FLUSH_VERTICES(ctx
, 0);
6936 ctx
->Exec
->LockArraysEXT( first
, count
);
6939 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
6941 GET_CURRENT_CONTEXT(ctx
);
6942 FLUSH_VERTICES(ctx
, 0);
6943 ctx
->Exec
->UnlockArraysEXT( );
6946 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 ctx
->Exec
->ResizeBuffersMESA( );
6954 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
6956 GET_CURRENT_CONTEXT(ctx
);
6957 FLUSH_VERTICES(ctx
, 0);
6958 ctx
->Exec
->ClientActiveTextureARB(target
);
6961 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
6962 GLsizei stride
, const GLvoid
*ptr
)
6964 GET_CURRENT_CONTEXT(ctx
);
6965 FLUSH_VERTICES(ctx
, 0);
6966 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
6969 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
6977 /* GL_EXT_multi_draw_arrays */
6978 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
6979 GLsizei
*count
, GLsizei primcount
)
6981 GET_CURRENT_CONTEXT(ctx
);
6982 FLUSH_VERTICES(ctx
, 0);
6983 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
6986 /* GL_EXT_multi_draw_arrays */
6987 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
6988 GLenum type
, const GLvoid
**indices
,
6991 GET_CURRENT_CONTEXT(ctx
);
6992 FLUSH_VERTICES(ctx
, 0);
6993 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
6996 /* GL_IBM_multimode_draw_arrays */
6997 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
6998 const GLsizei
*count
, GLsizei primcount
,
7001 GET_CURRENT_CONTEXT(ctx
);
7002 FLUSH_VERTICES(ctx
, 0);
7003 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
7006 /* GL_IBM_multimode_draw_arrays */
7007 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7008 const GLsizei
*count
,
7010 const GLvoid
* const *indices
,
7011 GLsizei primcount
, GLint modestride
)
7013 GET_CURRENT_CONTEXT(ctx
);
7014 FLUSH_VERTICES(ctx
, 0);
7015 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
7023 * Setup the given dispatch table to point to Mesa's display list
7024 * building functions.
7026 * This does not include any of the tnl functions - they are
7027 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7031 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
7033 _mesa_init_no_op_table(table
, tableSize
);
7035 _mesa_loopback_init_api_table( table
);
7038 table
->Accum
= save_Accum
;
7039 table
->AlphaFunc
= save_AlphaFunc
;
7040 table
->Bitmap
= save_Bitmap
;
7041 table
->BlendFunc
= _mesa_BlendFunc
; /* loops-back to BlendFuncSeparate */
7042 table
->CallList
= _mesa_save_CallList
;
7043 table
->CallLists
= _mesa_save_CallLists
;
7044 table
->Clear
= save_Clear
;
7045 table
->ClearAccum
= save_ClearAccum
;
7046 table
->ClearColor
= save_ClearColor
;
7047 table
->ClearDepth
= save_ClearDepth
;
7048 table
->ClearIndex
= save_ClearIndex
;
7049 table
->ClearStencil
= save_ClearStencil
;
7050 table
->ClipPlane
= save_ClipPlane
;
7051 table
->ColorMask
= save_ColorMask
;
7052 table
->ColorMaterial
= save_ColorMaterial
;
7053 table
->CopyPixels
= save_CopyPixels
;
7054 table
->CullFace
= save_CullFace
;
7055 table
->DeleteLists
= _mesa_DeleteLists
;
7056 table
->DepthFunc
= save_DepthFunc
;
7057 table
->DepthMask
= save_DepthMask
;
7058 table
->DepthRange
= save_DepthRange
;
7059 table
->Disable
= save_Disable
;
7060 table
->DrawBuffer
= save_DrawBuffer
;
7061 table
->DrawPixels
= save_DrawPixels
;
7062 table
->Enable
= save_Enable
;
7063 table
->EndList
= _mesa_EndList
;
7064 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7065 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7066 table
->Finish
= exec_Finish
;
7067 table
->Flush
= exec_Flush
;
7068 table
->Fogf
= save_Fogf
;
7069 table
->Fogfv
= save_Fogfv
;
7070 table
->Fogi
= save_Fogi
;
7071 table
->Fogiv
= save_Fogiv
;
7072 table
->FrontFace
= save_FrontFace
;
7073 table
->Frustum
= save_Frustum
;
7074 table
->GenLists
= _mesa_GenLists
;
7075 table
->GetBooleanv
= exec_GetBooleanv
;
7076 table
->GetClipPlane
= exec_GetClipPlane
;
7077 table
->GetDoublev
= exec_GetDoublev
;
7078 table
->GetError
= exec_GetError
;
7079 table
->GetFloatv
= exec_GetFloatv
;
7080 table
->GetIntegerv
= exec_GetIntegerv
;
7081 table
->GetLightfv
= exec_GetLightfv
;
7082 table
->GetLightiv
= exec_GetLightiv
;
7083 table
->GetMapdv
= exec_GetMapdv
;
7084 table
->GetMapfv
= exec_GetMapfv
;
7085 table
->GetMapiv
= exec_GetMapiv
;
7086 table
->GetMaterialfv
= exec_GetMaterialfv
;
7087 table
->GetMaterialiv
= exec_GetMaterialiv
;
7088 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7089 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7090 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7091 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7092 table
->GetString
= exec_GetString
;
7093 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7094 table
->GetTexEnviv
= exec_GetTexEnviv
;
7095 table
->GetTexGendv
= exec_GetTexGendv
;
7096 table
->GetTexGenfv
= exec_GetTexGenfv
;
7097 table
->GetTexGeniv
= exec_GetTexGeniv
;
7098 table
->GetTexImage
= exec_GetTexImage
;
7099 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7100 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7101 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7102 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7103 table
->Hint
= save_Hint
;
7104 table
->IndexMask
= save_IndexMask
;
7105 table
->InitNames
= save_InitNames
;
7106 table
->IsEnabled
= exec_IsEnabled
;
7107 table
->IsList
= _mesa_IsList
;
7108 table
->LightModelf
= save_LightModelf
;
7109 table
->LightModelfv
= save_LightModelfv
;
7110 table
->LightModeli
= save_LightModeli
;
7111 table
->LightModeliv
= save_LightModeliv
;
7112 table
->Lightf
= save_Lightf
;
7113 table
->Lightfv
= save_Lightfv
;
7114 table
->Lighti
= save_Lighti
;
7115 table
->Lightiv
= save_Lightiv
;
7116 table
->LineStipple
= save_LineStipple
;
7117 table
->LineWidth
= save_LineWidth
;
7118 table
->ListBase
= save_ListBase
;
7119 table
->LoadIdentity
= save_LoadIdentity
;
7120 table
->LoadMatrixd
= save_LoadMatrixd
;
7121 table
->LoadMatrixf
= save_LoadMatrixf
;
7122 table
->LoadName
= save_LoadName
;
7123 table
->LogicOp
= save_LogicOp
;
7124 table
->Map1d
= save_Map1d
;
7125 table
->Map1f
= save_Map1f
;
7126 table
->Map2d
= save_Map2d
;
7127 table
->Map2f
= save_Map2f
;
7128 table
->MapGrid1d
= save_MapGrid1d
;
7129 table
->MapGrid1f
= save_MapGrid1f
;
7130 table
->MapGrid2d
= save_MapGrid2d
;
7131 table
->MapGrid2f
= save_MapGrid2f
;
7132 table
->MatrixMode
= save_MatrixMode
;
7133 table
->MultMatrixd
= save_MultMatrixd
;
7134 table
->MultMatrixf
= save_MultMatrixf
;
7135 table
->NewList
= save_NewList
;
7136 table
->Ortho
= save_Ortho
;
7137 table
->PassThrough
= save_PassThrough
;
7138 table
->PixelMapfv
= save_PixelMapfv
;
7139 table
->PixelMapuiv
= save_PixelMapuiv
;
7140 table
->PixelMapusv
= save_PixelMapusv
;
7141 table
->PixelStoref
= exec_PixelStoref
;
7142 table
->PixelStorei
= exec_PixelStorei
;
7143 table
->PixelTransferf
= save_PixelTransferf
;
7144 table
->PixelTransferi
= save_PixelTransferi
;
7145 table
->PixelZoom
= save_PixelZoom
;
7146 table
->PointSize
= save_PointSize
;
7147 table
->PolygonMode
= save_PolygonMode
;
7148 table
->PolygonOffset
= save_PolygonOffset
;
7149 table
->PolygonStipple
= save_PolygonStipple
;
7150 table
->PopAttrib
= save_PopAttrib
;
7151 table
->PopMatrix
= save_PopMatrix
;
7152 table
->PopName
= save_PopName
;
7153 table
->PushAttrib
= save_PushAttrib
;
7154 table
->PushMatrix
= save_PushMatrix
;
7155 table
->PushName
= save_PushName
;
7156 table
->RasterPos2d
= save_RasterPos2d
;
7157 table
->RasterPos2dv
= save_RasterPos2dv
;
7158 table
->RasterPos2f
= save_RasterPos2f
;
7159 table
->RasterPos2fv
= save_RasterPos2fv
;
7160 table
->RasterPos2i
= save_RasterPos2i
;
7161 table
->RasterPos2iv
= save_RasterPos2iv
;
7162 table
->RasterPos2s
= save_RasterPos2s
;
7163 table
->RasterPos2sv
= save_RasterPos2sv
;
7164 table
->RasterPos3d
= save_RasterPos3d
;
7165 table
->RasterPos3dv
= save_RasterPos3dv
;
7166 table
->RasterPos3f
= save_RasterPos3f
;
7167 table
->RasterPos3fv
= save_RasterPos3fv
;
7168 table
->RasterPos3i
= save_RasterPos3i
;
7169 table
->RasterPos3iv
= save_RasterPos3iv
;
7170 table
->RasterPos3s
= save_RasterPos3s
;
7171 table
->RasterPos3sv
= save_RasterPos3sv
;
7172 table
->RasterPos4d
= save_RasterPos4d
;
7173 table
->RasterPos4dv
= save_RasterPos4dv
;
7174 table
->RasterPos4f
= save_RasterPos4f
;
7175 table
->RasterPos4fv
= save_RasterPos4fv
;
7176 table
->RasterPos4i
= save_RasterPos4i
;
7177 table
->RasterPos4iv
= save_RasterPos4iv
;
7178 table
->RasterPos4s
= save_RasterPos4s
;
7179 table
->RasterPos4sv
= save_RasterPos4sv
;
7180 table
->ReadBuffer
= save_ReadBuffer
;
7181 table
->ReadPixels
= exec_ReadPixels
;
7182 table
->RenderMode
= exec_RenderMode
;
7183 table
->Rotated
= save_Rotated
;
7184 table
->Rotatef
= save_Rotatef
;
7185 table
->Scaled
= save_Scaled
;
7186 table
->Scalef
= save_Scalef
;
7187 table
->Scissor
= save_Scissor
;
7188 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7189 table
->SelectBuffer
= exec_SelectBuffer
;
7190 table
->ShadeModel
= save_ShadeModel
;
7191 table
->StencilFunc
= save_StencilFunc
;
7192 table
->StencilMask
= save_StencilMask
;
7193 table
->StencilOp
= save_StencilOp
;
7194 table
->TexEnvf
= save_TexEnvf
;
7195 table
->TexEnvfv
= save_TexEnvfv
;
7196 table
->TexEnvi
= save_TexEnvi
;
7197 table
->TexEnviv
= save_TexEnviv
;
7198 table
->TexGend
= save_TexGend
;
7199 table
->TexGendv
= save_TexGendv
;
7200 table
->TexGenf
= save_TexGenf
;
7201 table
->TexGenfv
= save_TexGenfv
;
7202 table
->TexGeni
= save_TexGeni
;
7203 table
->TexGeniv
= save_TexGeniv
;
7204 table
->TexImage1D
= save_TexImage1D
;
7205 table
->TexImage2D
= save_TexImage2D
;
7206 table
->TexParameterf
= save_TexParameterf
;
7207 table
->TexParameterfv
= save_TexParameterfv
;
7208 table
->TexParameteri
= save_TexParameteri
;
7209 table
->TexParameteriv
= save_TexParameteriv
;
7210 table
->Translated
= save_Translated
;
7211 table
->Translatef
= save_Translatef
;
7212 table
->Viewport
= save_Viewport
;
7215 table
->AreTexturesResident
= exec_AreTexturesResident
;
7216 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7217 table
->BindTexture
= save_BindTexture
;
7218 table
->ColorPointer
= exec_ColorPointer
;
7219 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7220 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7221 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7222 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7223 table
->DeleteTextures
= exec_DeleteTextures
;
7224 table
->DisableClientState
= exec_DisableClientState
;
7225 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7226 table
->EnableClientState
= exec_EnableClientState
;
7227 table
->GenTextures
= exec_GenTextures
;
7228 table
->GenTexturesEXT
= exec_GenTextures
;
7229 table
->GetPointerv
= exec_GetPointerv
;
7230 table
->IndexPointer
= exec_IndexPointer
;
7231 table
->InterleavedArrays
= exec_InterleavedArrays
;
7232 table
->IsTexture
= exec_IsTexture
;
7233 table
->IsTextureEXT
= exec_IsTexture
;
7234 table
->NormalPointer
= exec_NormalPointer
;
7235 table
->PopClientAttrib
= exec_PopClientAttrib
;
7236 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7237 table
->PushClientAttrib
= exec_PushClientAttrib
;
7238 table
->TexCoordPointer
= exec_TexCoordPointer
;
7239 table
->TexSubImage1D
= save_TexSubImage1D
;
7240 table
->TexSubImage2D
= save_TexSubImage2D
;
7241 table
->VertexPointer
= exec_VertexPointer
;
7244 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7245 table
->TexImage3D
= save_TexImage3D
;
7246 table
->TexSubImage3D
= save_TexSubImage3D
;
7248 /* GL_ARB_imaging */
7249 /* Not all are supported */
7250 table
->BlendColor
= save_BlendColor
;
7251 table
->BlendEquation
= save_BlendEquation
;
7252 table
->ColorSubTable
= save_ColorSubTable
;
7253 table
->ColorTable
= save_ColorTable
;
7254 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7255 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7256 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7257 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7258 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7259 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7260 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7261 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7262 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7263 table
->CopyColorTable
= save_CopyColorTable
;
7264 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7265 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7266 table
->GetColorTable
= exec_GetColorTable
;
7267 table
->GetColorTableEXT
= exec_GetColorTable
;
7268 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7269 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7270 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7271 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7272 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7273 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7274 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7275 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7276 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7277 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7278 table
->GetHistogram
= exec_GetHistogram
;
7279 table
->GetHistogramEXT
= exec_GetHistogram
;
7280 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7281 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7282 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7283 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7284 table
->GetMinmax
= exec_GetMinmax
;
7285 table
->GetMinmaxEXT
= exec_GetMinmax
;
7286 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7287 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7288 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7289 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7290 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7291 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7292 table
->Histogram
= save_Histogram
;
7293 table
->Minmax
= save_Minmax
;
7294 table
->ResetHistogram
= save_ResetHistogram
;
7295 table
->ResetMinmax
= save_ResetMinmax
;
7296 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7298 /* 2. GL_EXT_blend_color */
7300 table
->BlendColorEXT
= save_BlendColorEXT
;
7303 /* 3. GL_EXT_polygon_offset */
7304 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7306 /* 6. GL_EXT_texture3d */
7308 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7309 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7310 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7313 /* 15. GL_SGIX_pixel_texture */
7314 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7316 /* 15. GL_SGIS_pixel_texture */
7317 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7318 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7319 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7320 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7321 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7322 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7324 /* 30. GL_EXT_vertex_array */
7325 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7326 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7327 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7328 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7329 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7330 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7332 /* 37. GL_EXT_blend_minmax */
7334 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7337 /* 54. GL_EXT_point_parameters */
7338 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7339 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7341 /* 78. GL_EXT_paletted_texture */
7343 table
->ColorTableEXT
= save_ColorTable
;
7344 table
->ColorSubTableEXT
= save_ColorSubTable
;
7346 table
->GetColorTableEXT
= exec_GetColorTable
;
7347 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7348 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7350 /* 97. GL_EXT_compiled_vertex_array */
7351 table
->LockArraysEXT
= exec_LockArraysEXT
;
7352 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7354 /* 145. GL_EXT_secondary_color */
7355 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7357 /* 148. GL_EXT_multi_draw_arrays */
7358 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7359 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7361 /* 149. GL_EXT_fog_coord */
7362 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7364 /* 173. GL_EXT_blend_func_separate */
7365 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7367 /* 196. GL_MESA_resize_buffers */
7368 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7370 /* 197. GL_MESA_window_pos */
7371 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7372 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7373 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7374 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7375 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7376 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7377 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7378 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7379 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7380 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7381 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7382 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7383 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7384 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7385 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7386 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7387 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7388 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7389 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7390 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7391 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7392 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7393 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7394 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7396 /* 200. GL_IBM_multimode_draw_arrays */
7397 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7398 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7400 #if FEATURE_NV_vertex_program
7401 /* 233. GL_NV_vertex_program */
7402 /* The following commands DO NOT go into display lists:
7403 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7404 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7406 table
->BindProgramNV
= save_BindProgramNV
;
7407 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7408 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7409 table
->GenProgramsNV
= _mesa_GenPrograms
;
7410 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7411 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7412 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7413 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7414 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7415 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7416 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7417 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7418 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7419 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7420 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7421 table
->IsProgramNV
= _mesa_IsProgram
;
7422 table
->LoadProgramNV
= save_LoadProgramNV
;
7423 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7424 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7425 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7426 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7427 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7428 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7429 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7430 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7433 /* 282. GL_NV_fragment_program */
7434 #if FEATURE_NV_fragment_program
7435 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7436 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7437 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7438 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7439 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7440 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7441 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7442 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7443 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7444 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7445 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7446 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7449 /* 262. GL_NV_point_sprite */
7450 table
->PointParameteriNV
= save_PointParameteriNV
;
7451 table
->PointParameterivNV
= save_PointParameterivNV
;
7453 /* 268. GL_EXT_stencil_two_side */
7454 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7456 /* ???. GL_EXT_depth_bounds_test */
7457 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7459 /* ARB 1. GL_ARB_multitexture */
7460 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7461 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7463 /* ARB 3. GL_ARB_transpose_matrix */
7464 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7465 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7466 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7467 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7469 /* ARB 5. GL_ARB_multisample */
7470 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7472 /* ARB 12. GL_ARB_texture_compression */
7473 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7474 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7475 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7476 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7477 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7478 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7479 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7481 /* ARB 14. GL_ARB_point_parameters */
7482 /* aliased with EXT_point_parameters functions */
7484 /* ARB 25. GL_ARB_window_pos */
7485 /* aliased with MESA_window_pos functions */
7487 /* ARB 26. GL_ARB_vertex_program */
7488 /* ARB 27. GL_ARB_fragment_program */
7489 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7490 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7491 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7492 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7493 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7494 table
->ProgramStringARB
= save_ProgramStringARB
;
7495 table
->BindProgramNV
= save_BindProgramNV
;
7496 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7497 table
->GenProgramsNV
= _mesa_GenPrograms
;
7498 table
->IsProgramNV
= _mesa_IsProgram
;
7499 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7500 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7501 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7502 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7503 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7504 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7505 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7506 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7507 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7508 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7509 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7510 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7511 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7512 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7513 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7514 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7515 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7516 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7519 /* ARB 28. GL_ARB_vertex_buffer_object */
7520 #if FEATURE_ARB_vertex_buffer_object
7521 /* None of the extension's functions get compiled */
7522 table
->BindBufferARB
= _mesa_BindBufferARB
;
7523 table
->BufferDataARB
= _mesa_BufferDataARB
;
7524 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7525 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7526 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7527 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7528 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7529 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7530 table
->IsBufferARB
= _mesa_IsBufferARB
;
7531 table
->MapBufferARB
= _mesa_MapBufferARB
;
7532 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7535 /* 299. GL_EXT_blend_equation_separate */
7536 table
->BlendEquationSeparateEXT
= save_BlendEquationSeparateEXT
;
7544 static const char *enum_string( GLenum k
)
7546 return _mesa_lookup_enum_by_nr( k
);
7551 * Print the commands in a display list. For debugging only.
7552 * TODO: many commands aren't handled yet.
7554 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7559 if (!glIsList(list
)) {
7560 _mesa_printf("%u is not a display list ID\n", list
);
7564 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7566 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7568 done
= n
? GL_FALSE
: GL_TRUE
;
7570 OpCode opcode
= n
[0].opcode
;
7571 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
7573 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
7574 /* this is a driver-extended opcode */
7575 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
7576 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
7581 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7584 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7585 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7587 case OPCODE_CALL_LIST
:
7588 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7590 case OPCODE_CALL_LIST_OFFSET
:
7591 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7592 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7594 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7595 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7596 enum_string(n
[1].e
), enum_string(n
[2].e
),
7597 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7599 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7600 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7601 enum_string(n
[1].e
), enum_string(n
[2].e
),
7602 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7604 case OPCODE_DISABLE
:
7605 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7608 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7610 case OPCODE_FRUSTUM
:
7611 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7612 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7614 case OPCODE_LINE_STIPPLE
:
7615 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7617 case OPCODE_LOAD_IDENTITY
:
7618 _mesa_printf("LoadIdentity\n");
7620 case OPCODE_LOAD_MATRIX
:
7621 _mesa_printf("LoadMatrix\n");
7622 _mesa_printf(" %8f %8f %8f %8f\n",
7623 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7624 _mesa_printf(" %8f %8f %8f %8f\n",
7625 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7626 _mesa_printf(" %8f %8f %8f %8f\n",
7627 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7628 _mesa_printf(" %8f %8f %8f %8f\n",
7629 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7631 case OPCODE_MULT_MATRIX
:
7632 _mesa_printf("MultMatrix (or Rotate)\n");
7633 _mesa_printf(" %8f %8f %8f %8f\n",
7634 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7635 _mesa_printf(" %8f %8f %8f %8f\n",
7636 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7637 _mesa_printf(" %8f %8f %8f %8f\n",
7638 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7639 _mesa_printf(" %8f %8f %8f %8f\n",
7640 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7643 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7644 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7646 case OPCODE_POP_ATTRIB
:
7647 _mesa_printf("PopAttrib\n");
7649 case OPCODE_POP_MATRIX
:
7650 _mesa_printf("PopMatrix\n");
7652 case OPCODE_POP_NAME
:
7653 _mesa_printf("PopName\n");
7655 case OPCODE_PUSH_ATTRIB
:
7656 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7658 case OPCODE_PUSH_MATRIX
:
7659 _mesa_printf("PushMatrix\n");
7661 case OPCODE_PUSH_NAME
:
7662 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7664 case OPCODE_RASTER_POS
:
7665 _mesa_printf("RasterPos %g %g %g %g\n",
7666 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7669 _mesa_printf("Rotate %g %g %g %g\n",
7670 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7673 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7675 case OPCODE_TRANSLATE
:
7676 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7678 case OPCODE_BIND_TEXTURE
:
7679 _mesa_printf("BindTexture %s %d\n",
7680 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7682 case OPCODE_SHADE_MODEL
:
7683 _mesa_printf("ShadeModel %s\n",
7684 _mesa_lookup_enum_by_nr(n
[1].ui
));
7687 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7688 _mesa_lookup_enum_by_nr(n
[1].ui
),
7689 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7692 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7693 _mesa_lookup_enum_by_nr(n
[1].ui
),
7694 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7695 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7697 case OPCODE_MAPGRID1
:
7698 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7699 n
[1].i
, n
[2].f
, n
[3].f
);
7701 case OPCODE_MAPGRID2
:
7702 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7703 n
[1].i
, n
[2].f
, n
[3].f
,
7704 n
[4].i
, n
[5].f
, n
[6].f
);
7706 case OPCODE_EVALMESH1
:
7707 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7709 case OPCODE_EVALMESH2
:
7710 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7711 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7715 * meta opcodes/commands
7718 _mesa_printf("Error: %s %s\n",
7719 enum_string(n
[1].e
), (const char *)n
[2].data
);
7721 case OPCODE_CONTINUE
:
7722 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7723 n
= (Node
*) n
[1].next
;
7725 case OPCODE_END_OF_LIST
:
7726 _mesa_printf("END-LIST %u\n", list
);
7730 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7731 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7736 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7739 /* increment n to point to next compiled command */
7740 if (opcode
!=OPCODE_CONTINUE
) {
7741 n
+= InstSize
[opcode
];
7750 * Clients may call this function to help debug display list problems.
7751 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7752 * changed, or break in the future without notice.
7754 void mesa_print_display_list( GLuint list
)
7756 GET_CURRENT_CONTEXT(ctx
);
7757 print_list( ctx
, list
);
7761 /**********************************************************************/
7762 /***** Initialization *****/
7763 /**********************************************************************/
7766 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7768 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7769 vfmt
->Begin
= save_Begin
;
7770 vfmt
->CallList
= _mesa_save_CallList
;
7771 vfmt
->CallLists
= _mesa_save_CallLists
;
7772 vfmt
->Color3f
= save_Color3f
;
7773 vfmt
->Color3fv
= save_Color3fv
;
7774 vfmt
->Color4f
= save_Color4f
;
7775 vfmt
->Color4fv
= save_Color4fv
;
7776 vfmt
->EdgeFlag
= save_EdgeFlag
;
7777 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7778 vfmt
->End
= save_End
;
7779 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7780 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7781 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7782 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7783 vfmt
->EvalPoint1
= save_EvalPoint1
;
7784 vfmt
->EvalPoint2
= save_EvalPoint2
;
7785 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7786 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7787 vfmt
->Indexf
= save_Indexf
;
7788 vfmt
->Indexfv
= save_Indexfv
;
7789 vfmt
->Materialfv
= save_Materialfv
;
7790 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7791 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7792 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7793 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7794 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7795 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7796 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7797 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7798 vfmt
->Normal3f
= save_Normal3f
;
7799 vfmt
->Normal3fv
= save_Normal3fv
;
7800 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7801 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7802 vfmt
->TexCoord1f
= save_TexCoord1f
;
7803 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7804 vfmt
->TexCoord2f
= save_TexCoord2f
;
7805 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7806 vfmt
->TexCoord3f
= save_TexCoord3f
;
7807 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7808 vfmt
->TexCoord4f
= save_TexCoord4f
;
7809 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7810 vfmt
->Vertex2f
= save_Vertex2f
;
7811 vfmt
->Vertex2fv
= save_Vertex2fv
;
7812 vfmt
->Vertex3f
= save_Vertex3f
;
7813 vfmt
->Vertex3fv
= save_Vertex3fv
;
7814 vfmt
->Vertex4f
= save_Vertex4f
;
7815 vfmt
->Vertex4fv
= save_Vertex4fv
;
7816 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7817 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7818 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7819 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7820 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7821 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7822 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7823 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7825 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7826 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7827 vfmt
->Rectf
= save_Rectf
;
7829 /* The driver is required to implement these as
7830 * 1) They can probably do a better job.
7831 * 2) A lot of new mechanisms would have to be added to this module
7832 * to support it. That code would probably never get used,
7836 vfmt
->DrawArrays
= 0;
7837 vfmt
->DrawElements
= 0;
7838 vfmt
->DrawRangeElements
= 0;
7844 void _mesa_init_display_list( GLcontext
* ctx
)
7847 ctx
->ListState
.CallDepth
= 0;
7848 ctx
->ExecuteFlag
= GL_TRUE
;
7849 ctx
->CompileFlag
= GL_FALSE
;
7850 ctx
->ListState
.CurrentListPtr
= NULL
;
7851 ctx
->ListState
.CurrentBlock
= NULL
;
7852 ctx
->ListState
.CurrentListNum
= 0;
7853 ctx
->ListState
.CurrentPos
= 0;
7855 /* Display List group */
7856 ctx
->List
.ListBase
= 0;
7858 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);