3 * Display lists management functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2003 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #include "api_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
,
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_DRV_0
;
425 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
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 /**********************************************************************/
621 void _mesa_init_lists( void )
623 static int init_flag
= 0;
626 InstSize
[OPCODE_ACCUM
] = 3;
627 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
628 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
629 InstSize
[OPCODE_BITMAP
] = 8;
630 InstSize
[OPCODE_BLEND_COLOR
] = 5;
631 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
632 InstSize
[OPCODE_BLEND_FUNC
] = 3;
633 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
634 InstSize
[OPCODE_CALL_LIST
] = 2;
635 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
636 InstSize
[OPCODE_CLEAR
] = 2;
637 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
638 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
639 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
640 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
641 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
642 InstSize
[OPCODE_CLIP_PLANE
] = 6;
643 InstSize
[OPCODE_COLOR_MASK
] = 5;
644 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
645 InstSize
[OPCODE_COLOR_TABLE
] = 7;
646 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
647 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
648 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
649 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
650 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
651 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
652 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
653 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
654 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
655 InstSize
[OPCODE_COPY_PIXELS
] = 6;
656 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
657 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
658 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
659 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
660 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
661 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
662 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
663 InstSize
[OPCODE_CULL_FACE
] = 2;
664 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
665 InstSize
[OPCODE_DEPTH_MASK
] = 2;
666 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
667 InstSize
[OPCODE_DISABLE
] = 2;
668 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
669 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
670 InstSize
[OPCODE_ENABLE
] = 2;
671 InstSize
[OPCODE_EVALMESH1
] = 4;
672 InstSize
[OPCODE_EVALMESH2
] = 6;
673 InstSize
[OPCODE_FOG
] = 6;
674 InstSize
[OPCODE_FRONT_FACE
] = 2;
675 InstSize
[OPCODE_FRUSTUM
] = 7;
676 InstSize
[OPCODE_HINT
] = 3;
677 InstSize
[OPCODE_HISTOGRAM
] = 5;
678 InstSize
[OPCODE_INDEX_MASK
] = 2;
679 InstSize
[OPCODE_INIT_NAMES
] = 1;
680 InstSize
[OPCODE_LIGHT
] = 7;
681 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
682 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
683 InstSize
[OPCODE_LINE_WIDTH
] = 2;
684 InstSize
[OPCODE_LIST_BASE
] = 2;
685 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
686 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
687 InstSize
[OPCODE_LOAD_NAME
] = 2;
688 InstSize
[OPCODE_LOGIC_OP
] = 2;
689 InstSize
[OPCODE_MAP1
] = 7;
690 InstSize
[OPCODE_MAP2
] = 11;
691 InstSize
[OPCODE_MAPGRID1
] = 4;
692 InstSize
[OPCODE_MAPGRID2
] = 7;
693 InstSize
[OPCODE_MATRIX_MODE
] = 2;
694 InstSize
[OPCODE_MIN_MAX
] = 4;
695 InstSize
[OPCODE_MULT_MATRIX
] = 17;
696 InstSize
[OPCODE_ORTHO
] = 7;
697 InstSize
[OPCODE_PASSTHROUGH
] = 2;
698 InstSize
[OPCODE_PIXEL_MAP
] = 4;
699 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
700 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
701 InstSize
[OPCODE_POINT_SIZE
] = 2;
702 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
703 InstSize
[OPCODE_POLYGON_MODE
] = 3;
704 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
705 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
706 InstSize
[OPCODE_POP_ATTRIB
] = 1;
707 InstSize
[OPCODE_POP_MATRIX
] = 1;
708 InstSize
[OPCODE_POP_NAME
] = 1;
709 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
710 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
711 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
712 InstSize
[OPCODE_PUSH_NAME
] = 2;
713 InstSize
[OPCODE_RASTER_POS
] = 5;
714 InstSize
[OPCODE_READ_BUFFER
] = 2;
715 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
716 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
717 InstSize
[OPCODE_ROTATE
] = 5;
718 InstSize
[OPCODE_SCALE
] = 4;
719 InstSize
[OPCODE_SCISSOR
] = 5;
720 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
721 InstSize
[OPCODE_STENCIL_MASK
] = 2;
722 InstSize
[OPCODE_STENCIL_OP
] = 4;
723 InstSize
[OPCODE_SHADE_MODEL
] = 2;
724 InstSize
[OPCODE_TEXENV
] = 7;
725 InstSize
[OPCODE_TEXGEN
] = 7;
726 InstSize
[OPCODE_TEXPARAMETER
] = 7;
727 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
728 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
729 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
730 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
731 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
732 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
733 InstSize
[OPCODE_TRANSLATE
] = 4;
734 InstSize
[OPCODE_VIEWPORT
] = 5;
735 InstSize
[OPCODE_WINDOW_POS
] = 5;
736 InstSize
[OPCODE_CONTINUE
] = 2;
737 InstSize
[OPCODE_ERROR
] = 3;
738 InstSize
[OPCODE_END_OF_LIST
] = 1;
739 /* GL_SGIX/SGIS_pixel_texture */
740 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
741 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
742 /* GL_ARB_texture_compression */
743 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
744 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
745 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
746 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
747 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
748 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
749 /* GL_ARB_multisample */
750 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
751 /* GL_ARB_multitexture */
752 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
753 /* GL_ARB_window_pos */
754 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
755 /* GL_NV_vertex_program */
756 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
757 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
758 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
759 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
760 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
761 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
762 /* GL_NV_fragment_program */
763 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
764 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
765 /* GL_EXT_stencil_two_side */
766 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
767 /* GL_EXT_depth_bounds_test */
768 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
769 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
770 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
771 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
773 InstSize
[OPCODE_ATTR_1F
] = 3;
774 InstSize
[OPCODE_ATTR_2F
] = 4;
775 InstSize
[OPCODE_ATTR_3F
] = 5;
776 InstSize
[OPCODE_ATTR_4F
] = 6;
777 InstSize
[OPCODE_MATERIAL
] = 7;
778 InstSize
[OPCODE_INDEX
] = 2;
779 InstSize
[OPCODE_EDGEFLAG
] = 2;
780 InstSize
[OPCODE_BEGIN
] = 2;
781 InstSize
[OPCODE_END
] = 1;
782 InstSize
[OPCODE_RECTF
] = 5;
783 InstSize
[OPCODE_EVAL_C1
] = 2;
784 InstSize
[OPCODE_EVAL_C2
] = 3;
785 InstSize
[OPCODE_EVAL_P1
] = 2;
786 InstSize
[OPCODE_EVAL_P2
] = 3;
793 * Allocate space for a display list instruction.
794 * \param opcode - type of instruction
795 * argcount - size in bytes of data required.
796 * \return pointer to the usable data area (not including the internal
800 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
803 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
806 if (opcode
< (int) OPCODE_DRV_0
) {
807 assert( count
== InstSize
[opcode
] );
811 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
812 /* This block is full. Allocate a new block and chain to it */
813 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
814 n
[0].opcode
= OPCODE_CONTINUE
;
815 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
817 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
820 n
[1].next
= (Node
*) newblock
;
821 ctx
->ListState
.CurrentBlock
= newblock
;
822 ctx
->ListState
.CurrentPos
= 0;
825 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
826 ctx
->ListState
.CurrentPos
+= count
;
828 n
[0].opcode
= (OpCode
) opcode
;
830 return (void *)&n
[1];
834 /* Allow modules and drivers to get their own opcodes.
837 _mesa_alloc_opcode( GLcontext
*ctx
,
839 void (*execute
)( GLcontext
*, void * ),
840 void (*destroy
)( GLcontext
*, void * ),
841 void (*print
)( GLcontext
*, void * ) )
843 if (ctx
->listext
.nr_opcodes
< GL_MAX_EXT_OPCODES
) {
844 GLuint i
= ctx
->listext
.nr_opcodes
++;
845 ctx
->listext
.opcode
[i
].size
= 1 + (sz
+ sizeof(Node
) - 1)/sizeof(Node
);
846 ctx
->listext
.opcode
[i
].execute
= execute
;
847 ctx
->listext
.opcode
[i
].destroy
= destroy
;
848 ctx
->listext
.opcode
[i
].print
= print
;
849 return i
+ OPCODE_DRV_0
;
856 /* Mimic the old behaviour of alloc_instruction:
857 * - sz is in units of sizeof(Node)
858 * - return value a pointer to sizeof(Node) before the actual
861 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
862 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
867 * Display List compilation functions
869 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
871 GET_CURRENT_CONTEXT(ctx
);
873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
874 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
879 if (ctx
->ExecuteFlag
) {
880 (*ctx
->Exec
->Accum
)( op
, value
);
885 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
887 GET_CURRENT_CONTEXT(ctx
);
889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
890 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
893 n
[2].f
= (GLfloat
) ref
;
895 if (ctx
->ExecuteFlag
) {
896 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
901 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
903 GET_CURRENT_CONTEXT(ctx
);
905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
906 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
911 if (ctx
->ExecuteFlag
) {
912 (*ctx
->Exec
->BindTexture
)( target
, texture
);
917 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
918 GLfloat xorig
, GLfloat yorig
,
919 GLfloat xmove
, GLfloat ymove
,
920 const GLubyte
*pixels
)
922 GET_CURRENT_CONTEXT(ctx
);
923 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
926 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
928 n
[1].i
= (GLint
) width
;
929 n
[2].i
= (GLint
) height
;
939 if (ctx
->ExecuteFlag
) {
940 (*ctx
->Exec
->Bitmap
)( width
, height
,
941 xorig
, yorig
, xmove
, ymove
, pixels
);
946 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
948 GET_CURRENT_CONTEXT(ctx
);
950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
955 if (ctx
->ExecuteFlag
) {
956 (*ctx
->Exec
->BlendEquation
)( mode
);
961 static void GLAPIENTRY
save_BlendFunc( GLenum sfactor
, GLenum dfactor
)
963 GET_CURRENT_CONTEXT(ctx
);
965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
966 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC
, 2 );
971 if (ctx
->ExecuteFlag
) {
972 (*ctx
->Exec
->BlendFunc
)( sfactor
, dfactor
);
977 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
978 GLenum sfactorA
, GLenum dfactorA
)
980 GET_CURRENT_CONTEXT(ctx
);
982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
983 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
990 if (ctx
->ExecuteFlag
) {
991 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
997 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
998 GLfloat blue
, GLfloat alpha
)
1000 GET_CURRENT_CONTEXT(ctx
);
1002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1003 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1010 if (ctx
->ExecuteFlag
) {
1011 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1016 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1018 GET_CURRENT_CONTEXT(ctx
);
1020 SAVE_FLUSH_VERTICES(ctx
);
1022 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1027 /* After this, we don't know what begin/end state we're in:
1029 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1031 if (ctx
->ExecuteFlag
) {
1032 (*ctx
->Exec
->CallList
)( list
);
1037 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1039 GET_CURRENT_CONTEXT(ctx
);
1041 GLboolean typeErrorFlag
;
1043 SAVE_FLUSH_VERTICES(ctx
);
1047 case GL_UNSIGNED_BYTE
:
1049 case GL_UNSIGNED_SHORT
:
1051 case GL_UNSIGNED_INT
:
1056 typeErrorFlag
= GL_FALSE
;
1059 typeErrorFlag
= GL_TRUE
;
1063 GLuint list
= translate_id( i
, type
, lists
);
1064 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1067 n
[2].b
= typeErrorFlag
;
1071 /* After this, we don't know what begin/end state we're in:
1073 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1075 if (ctx
->ExecuteFlag
) {
1076 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1081 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1083 GET_CURRENT_CONTEXT(ctx
);
1085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1086 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1090 if (ctx
->ExecuteFlag
) {
1091 (*ctx
->Exec
->Clear
)( mask
);
1096 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1097 GLfloat blue
, GLfloat alpha
)
1099 GET_CURRENT_CONTEXT(ctx
);
1101 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1102 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1109 if (ctx
->ExecuteFlag
) {
1110 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1115 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1116 GLclampf blue
, GLclampf alpha
)
1118 GET_CURRENT_CONTEXT(ctx
);
1120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1121 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1128 if (ctx
->ExecuteFlag
) {
1129 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1134 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1136 GET_CURRENT_CONTEXT(ctx
);
1138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1139 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1141 n
[1].f
= (GLfloat
) depth
;
1143 if (ctx
->ExecuteFlag
) {
1144 (*ctx
->Exec
->ClearDepth
)( depth
);
1149 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1151 GET_CURRENT_CONTEXT(ctx
);
1153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1154 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1158 if (ctx
->ExecuteFlag
) {
1159 (*ctx
->Exec
->ClearIndex
)( c
);
1164 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1166 GET_CURRENT_CONTEXT(ctx
);
1168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1169 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1173 if (ctx
->ExecuteFlag
) {
1174 (*ctx
->Exec
->ClearStencil
)( s
);
1179 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1181 GET_CURRENT_CONTEXT(ctx
);
1183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1184 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1187 n
[2].f
= (GLfloat
) equ
[0];
1188 n
[3].f
= (GLfloat
) equ
[1];
1189 n
[4].f
= (GLfloat
) equ
[2];
1190 n
[5].f
= (GLfloat
) equ
[3];
1192 if (ctx
->ExecuteFlag
) {
1193 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1199 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1200 GLboolean blue
, GLboolean alpha
)
1202 GET_CURRENT_CONTEXT(ctx
);
1204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1205 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1212 if (ctx
->ExecuteFlag
) {
1213 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1218 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1220 GET_CURRENT_CONTEXT(ctx
);
1222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1224 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1229 if (ctx
->ExecuteFlag
) {
1230 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1235 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1236 GLsizei width
, GLenum format
, GLenum type
,
1237 const GLvoid
*table
)
1239 GET_CURRENT_CONTEXT(ctx
);
1240 if (target
== GL_PROXY_TEXTURE_1D
||
1241 target
== GL_PROXY_TEXTURE_2D
||
1242 target
== GL_PROXY_TEXTURE_3D
||
1243 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1244 /* execute immediately */
1245 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1246 format
, type
, table
);
1249 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, table
,
1252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1253 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1256 n
[2].e
= internalFormat
;
1265 if (ctx
->ExecuteFlag
) {
1266 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1267 format
, type
, table
);
1274 static void GLAPIENTRY
1275 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1277 GET_CURRENT_CONTEXT(ctx
);
1280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1282 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1287 if (pname
== GL_COLOR_TABLE_SGI
||
1288 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1289 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1290 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1297 if (ctx
->ExecuteFlag
) {
1298 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1303 static void GLAPIENTRY
1304 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1306 GET_CURRENT_CONTEXT(ctx
);
1309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1311 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1316 if (pname
== GL_COLOR_TABLE_SGI
||
1317 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1318 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1319 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1326 if (ctx
->ExecuteFlag
) {
1327 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1333 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1334 GLenum format
, GLenum type
,
1335 const GLvoid
*table
)
1337 GET_CURRENT_CONTEXT(ctx
);
1338 GLvoid
*image
= _mesa_unpack_image(count
, 1, 1, format
, type
, table
,
1341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1342 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1354 if (ctx
->ExecuteFlag
) {
1355 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1360 static void GLAPIENTRY
1361 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1362 GLint x
, GLint y
, GLsizei width
)
1364 GET_CURRENT_CONTEXT(ctx
);
1367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1368 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1376 if (ctx
->ExecuteFlag
) {
1377 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1382 static void GLAPIENTRY
1383 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1384 GLint x
, GLint y
, GLsizei width
)
1386 GET_CURRENT_CONTEXT(ctx
);
1389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1390 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1393 n
[2].e
= internalformat
;
1398 if (ctx
->ExecuteFlag
) {
1399 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1404 static void GLAPIENTRY
1405 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1406 GLenum format
, GLenum type
, const GLvoid
*filter
)
1408 GET_CURRENT_CONTEXT(ctx
);
1409 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, filter
,
1412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1413 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1416 n
[2].e
= internalFormat
;
1425 if (ctx
->ExecuteFlag
) {
1426 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1427 format
, type
, filter
);
1432 static void GLAPIENTRY
1433 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1434 GLsizei width
, GLsizei height
, GLenum format
,
1435 GLenum type
, const GLvoid
*filter
)
1437 GET_CURRENT_CONTEXT(ctx
);
1438 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
, filter
,
1441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1442 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1445 n
[2].e
= internalFormat
;
1455 if (ctx
->ExecuteFlag
) {
1456 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1457 format
, type
, filter
);
1462 static void GLAPIENTRY
1463 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1465 GET_CURRENT_CONTEXT(ctx
);
1467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1468 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1474 if (ctx
->ExecuteFlag
) {
1475 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1480 static void GLAPIENTRY
1481 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1483 GET_CURRENT_CONTEXT(ctx
);
1485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1486 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1491 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1492 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1493 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1499 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1502 if (ctx
->ExecuteFlag
) {
1503 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1508 static void GLAPIENTRY
1509 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1511 GET_CURRENT_CONTEXT(ctx
);
1513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1514 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1520 if (ctx
->ExecuteFlag
) {
1521 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1526 static void GLAPIENTRY
1527 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1529 GET_CURRENT_CONTEXT(ctx
);
1531 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1532 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1537 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1538 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1539 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1545 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1548 if (ctx
->ExecuteFlag
) {
1549 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1554 static void GLAPIENTRY
1555 save_CopyPixels( GLint x
, GLint y
,
1556 GLsizei width
, GLsizei height
, GLenum type
)
1558 GET_CURRENT_CONTEXT(ctx
);
1560 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1561 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1565 n
[3].i
= (GLint
) width
;
1566 n
[4].i
= (GLint
) height
;
1569 if (ctx
->ExecuteFlag
) {
1570 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1576 static void GLAPIENTRY
1577 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1578 GLint x
, GLint y
, GLsizei width
, GLint border
)
1580 GET_CURRENT_CONTEXT(ctx
);
1582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1583 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1587 n
[3].e
= internalformat
;
1593 if (ctx
->ExecuteFlag
) {
1594 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1595 x
, y
, width
, border
);
1600 static void GLAPIENTRY
1601 save_CopyTexImage2D( GLenum target
, GLint level
,
1602 GLenum internalformat
,
1603 GLint x
, GLint y
, GLsizei width
,
1604 GLsizei height
, GLint border
)
1606 GET_CURRENT_CONTEXT(ctx
);
1608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1609 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1613 n
[3].e
= internalformat
;
1620 if (ctx
->ExecuteFlag
) {
1621 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1622 x
, y
, width
, height
, border
);
1628 static void GLAPIENTRY
1629 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1630 GLint xoffset
, GLint x
, GLint y
,
1633 GET_CURRENT_CONTEXT(ctx
);
1635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1636 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1645 if (ctx
->ExecuteFlag
) {
1646 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1651 static void GLAPIENTRY
1652 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1653 GLint xoffset
, GLint yoffset
,
1655 GLsizei width
, GLint height
)
1657 GET_CURRENT_CONTEXT(ctx
);
1659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1660 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1671 if (ctx
->ExecuteFlag
) {
1672 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1673 x
, y
, width
, height
);
1678 static void GLAPIENTRY
1679 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1680 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1682 GLsizei width
, GLint height
)
1684 GET_CURRENT_CONTEXT(ctx
);
1686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1687 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1699 if (ctx
->ExecuteFlag
) {
1700 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1701 xoffset
, yoffset
, zoffset
,
1702 x
, y
, width
, height
);
1707 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1709 GET_CURRENT_CONTEXT(ctx
);
1711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1712 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1716 if (ctx
->ExecuteFlag
) {
1717 (*ctx
->Exec
->CullFace
)( mode
);
1722 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1724 GET_CURRENT_CONTEXT(ctx
);
1726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1727 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1731 if (ctx
->ExecuteFlag
) {
1732 (*ctx
->Exec
->DepthFunc
)( func
);
1737 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1739 GET_CURRENT_CONTEXT(ctx
);
1741 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1742 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1746 if (ctx
->ExecuteFlag
) {
1747 (*ctx
->Exec
->DepthMask
)( mask
);
1752 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1754 GET_CURRENT_CONTEXT(ctx
);
1756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1757 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1759 n
[1].f
= (GLfloat
) nearval
;
1760 n
[2].f
= (GLfloat
) farval
;
1762 if (ctx
->ExecuteFlag
) {
1763 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1768 static void GLAPIENTRY
save_Disable( GLenum cap
)
1770 GET_CURRENT_CONTEXT(ctx
);
1772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1773 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1777 if (ctx
->ExecuteFlag
) {
1778 (*ctx
->Exec
->Disable
)( cap
);
1783 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1785 GET_CURRENT_CONTEXT(ctx
);
1787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1788 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1792 if (ctx
->ExecuteFlag
) {
1793 (*ctx
->Exec
->DrawBuffer
)( mode
);
1798 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1799 GLenum format
, GLenum type
,
1800 const GLvoid
*pixels
)
1802 GET_CURRENT_CONTEXT(ctx
);
1803 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
1804 pixels
, &ctx
->Unpack
);
1806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1807 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1818 if (ctx
->ExecuteFlag
) {
1819 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1825 static void GLAPIENTRY
save_Enable( GLenum cap
)
1827 GET_CURRENT_CONTEXT(ctx
);
1829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1830 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1834 if (ctx
->ExecuteFlag
) {
1835 (*ctx
->Exec
->Enable
)( cap
);
1841 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1843 GET_CURRENT_CONTEXT(ctx
);
1845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1846 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1852 if (ctx
->ExecuteFlag
) {
1853 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1858 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1860 GET_CURRENT_CONTEXT(ctx
);
1862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1863 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1871 if (ctx
->ExecuteFlag
) {
1872 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1879 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1881 GET_CURRENT_CONTEXT(ctx
);
1883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1884 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1892 if (ctx
->ExecuteFlag
) {
1893 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1898 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1900 save_Fogfv(pname
, ¶m
);
1904 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1909 case GL_FOG_DENSITY
:
1913 p
[0] = (GLfloat
) *params
;
1916 p
[0] = INT_TO_FLOAT( params
[0] );
1917 p
[1] = INT_TO_FLOAT( params
[1] );
1918 p
[2] = INT_TO_FLOAT( params
[2] );
1919 p
[3] = INT_TO_FLOAT( params
[3] );
1922 /* Error will be caught later in gl_Fogfv */
1925 save_Fogfv(pname
, p
);
1929 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1931 save_Fogiv(pname
, ¶m
);
1935 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1937 GET_CURRENT_CONTEXT(ctx
);
1939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1940 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1944 if (ctx
->ExecuteFlag
) {
1945 (*ctx
->Exec
->FrontFace
)( mode
);
1950 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1951 GLdouble bottom
, GLdouble top
,
1952 GLdouble nearval
, GLdouble farval
)
1954 GET_CURRENT_CONTEXT(ctx
);
1956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1957 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1959 n
[1].f
= (GLfloat
) left
;
1960 n
[2].f
= (GLfloat
) right
;
1961 n
[3].f
= (GLfloat
) bottom
;
1962 n
[4].f
= (GLfloat
) top
;
1963 n
[5].f
= (GLfloat
) nearval
;
1964 n
[6].f
= (GLfloat
) farval
;
1966 if (ctx
->ExecuteFlag
) {
1967 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
1972 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
1974 GET_CURRENT_CONTEXT(ctx
);
1976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1977 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
1982 if (ctx
->ExecuteFlag
) {
1983 (*ctx
->Exec
->Hint
)( target
, mode
);
1988 static void GLAPIENTRY
1989 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
1991 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
1999 n
[3].e
= internalFormat
;
2002 if (ctx
->ExecuteFlag
) {
2003 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2008 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2010 GET_CURRENT_CONTEXT(ctx
);
2012 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2013 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2017 if (ctx
->ExecuteFlag
) {
2018 (*ctx
->Exec
->IndexMask
)( mask
);
2023 static void GLAPIENTRY
save_InitNames( void )
2025 GET_CURRENT_CONTEXT(ctx
);
2026 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2027 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2028 if (ctx
->ExecuteFlag
) {
2029 (*ctx
->Exec
->InitNames
)();
2034 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2036 GET_CURRENT_CONTEXT(ctx
);
2038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2039 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2057 case GL_SPOT_DIRECTION
:
2060 case GL_SPOT_EXPONENT
:
2063 case GL_SPOT_CUTOFF
:
2066 case GL_CONSTANT_ATTENUATION
:
2069 case GL_LINEAR_ATTENUATION
:
2072 case GL_QUADRATIC_ATTENUATION
:
2078 for (i
= 0; i
< nParams
; i
++) {
2079 n
[3+i
].f
= params
[i
];
2082 if (ctx
->ExecuteFlag
) {
2083 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2088 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2090 save_Lightfv(light
, pname
, ¶ms
);
2094 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2101 fparam
[0] = INT_TO_FLOAT( params
[0] );
2102 fparam
[1] = INT_TO_FLOAT( params
[1] );
2103 fparam
[2] = INT_TO_FLOAT( params
[2] );
2104 fparam
[3] = INT_TO_FLOAT( params
[3] );
2107 fparam
[0] = (GLfloat
) params
[0];
2108 fparam
[1] = (GLfloat
) params
[1];
2109 fparam
[2] = (GLfloat
) params
[2];
2110 fparam
[3] = (GLfloat
) params
[3];
2112 case GL_SPOT_DIRECTION
:
2113 fparam
[0] = (GLfloat
) params
[0];
2114 fparam
[1] = (GLfloat
) params
[1];
2115 fparam
[2] = (GLfloat
) params
[2];
2117 case GL_SPOT_EXPONENT
:
2118 case GL_SPOT_CUTOFF
:
2119 case GL_CONSTANT_ATTENUATION
:
2120 case GL_LINEAR_ATTENUATION
:
2121 case GL_QUADRATIC_ATTENUATION
:
2122 fparam
[0] = (GLfloat
) params
[0];
2125 /* error will be caught later in gl_Lightfv */
2128 save_Lightfv( light
, pname
, fparam
);
2132 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2134 save_Lightiv( light
, pname
, ¶m
);
2138 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2140 GET_CURRENT_CONTEXT(ctx
);
2142 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2143 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2151 if (ctx
->ExecuteFlag
) {
2152 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2157 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2159 save_LightModelfv(pname
, ¶m
);
2163 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2167 case GL_LIGHT_MODEL_AMBIENT
:
2168 fparam
[0] = INT_TO_FLOAT( params
[0] );
2169 fparam
[1] = INT_TO_FLOAT( params
[1] );
2170 fparam
[2] = INT_TO_FLOAT( params
[2] );
2171 fparam
[3] = INT_TO_FLOAT( params
[3] );
2173 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2174 case GL_LIGHT_MODEL_TWO_SIDE
:
2175 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2176 fparam
[0] = (GLfloat
) params
[0];
2179 /* Error will be caught later in gl_LightModelfv */
2182 save_LightModelfv(pname
, fparam
);
2186 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2188 save_LightModeliv(pname
, ¶m
);
2192 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2194 GET_CURRENT_CONTEXT(ctx
);
2196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2197 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2202 if (ctx
->ExecuteFlag
) {
2203 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2208 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2210 GET_CURRENT_CONTEXT(ctx
);
2212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2213 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2217 if (ctx
->ExecuteFlag
) {
2218 (*ctx
->Exec
->LineWidth
)( width
);
2223 static void GLAPIENTRY
save_ListBase( GLuint base
)
2225 GET_CURRENT_CONTEXT(ctx
);
2227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2228 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2232 if (ctx
->ExecuteFlag
) {
2233 (*ctx
->Exec
->ListBase
)( base
);
2238 static void GLAPIENTRY
save_LoadIdentity( void )
2240 GET_CURRENT_CONTEXT(ctx
);
2241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2242 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2243 if (ctx
->ExecuteFlag
) {
2244 (*ctx
->Exec
->LoadIdentity
)();
2249 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2257 for (i
=0;i
<16;i
++) {
2261 if (ctx
->ExecuteFlag
) {
2262 (*ctx
->Exec
->LoadMatrixf
)( m
);
2267 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2271 for (i
= 0; i
< 16; i
++) {
2272 f
[i
] = (GLfloat
) m
[i
];
2274 save_LoadMatrixf(f
);
2278 static void GLAPIENTRY
save_LoadName( GLuint name
)
2280 GET_CURRENT_CONTEXT(ctx
);
2282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2283 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2287 if (ctx
->ExecuteFlag
) {
2288 (*ctx
->Exec
->LoadName
)( name
);
2293 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2295 GET_CURRENT_CONTEXT(ctx
);
2297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2298 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2302 if (ctx
->ExecuteFlag
) {
2303 (*ctx
->Exec
->LogicOp
)( opcode
);
2308 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2309 GLint order
, const GLdouble
*points
)
2311 GET_CURRENT_CONTEXT(ctx
);
2313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2314 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2316 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2318 n
[2].f
= (GLfloat
) u1
;
2319 n
[3].f
= (GLfloat
) u2
;
2320 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2322 n
[6].data
= (void *) pnts
;
2324 if (ctx
->ExecuteFlag
) {
2325 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2329 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2330 GLint order
, const GLfloat
*points
)
2332 GET_CURRENT_CONTEXT(ctx
);
2334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2335 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2337 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2341 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2343 n
[6].data
= (void *) pnts
;
2345 if (ctx
->ExecuteFlag
) {
2346 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2351 static void GLAPIENTRY
save_Map2d( GLenum target
,
2352 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2353 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2354 const GLdouble
*points
)
2356 GET_CURRENT_CONTEXT(ctx
);
2358 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2359 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2361 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2362 vstride
, vorder
, points
);
2364 n
[2].f
= (GLfloat
) u1
;
2365 n
[3].f
= (GLfloat
) u2
;
2366 n
[4].f
= (GLfloat
) v1
;
2367 n
[5].f
= (GLfloat
) v2
;
2368 /* XXX verify these strides are correct */
2369 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2370 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2373 n
[10].data
= (void *) pnts
;
2375 if (ctx
->ExecuteFlag
) {
2376 (*ctx
->Exec
->Map2d
)( target
,
2377 u1
, u2
, ustride
, uorder
,
2378 v1
, v2
, vstride
, vorder
, points
);
2383 static void GLAPIENTRY
save_Map2f( GLenum target
,
2384 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2385 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2386 const GLfloat
*points
)
2388 GET_CURRENT_CONTEXT(ctx
);
2390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2391 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2393 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2394 vstride
, vorder
, points
);
2400 /* XXX verify these strides are correct */
2401 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2402 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2405 n
[10].data
= (void *) pnts
;
2407 if (ctx
->ExecuteFlag
) {
2408 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2409 v1
, v2
, vstride
, vorder
, points
);
2414 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2416 GET_CURRENT_CONTEXT(ctx
);
2418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2419 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2425 if (ctx
->ExecuteFlag
) {
2426 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2431 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2433 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2437 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2438 GLint vn
, GLfloat v1
, GLfloat v2
)
2440 GET_CURRENT_CONTEXT(ctx
);
2442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2443 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2452 if (ctx
->ExecuteFlag
) {
2453 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2459 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2460 GLint vn
, GLdouble v1
, GLdouble v2
)
2462 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2463 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2467 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2469 GET_CURRENT_CONTEXT(ctx
);
2471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2472 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2476 if (ctx
->ExecuteFlag
) {
2477 (*ctx
->Exec
->MatrixMode
)( mode
);
2482 static void GLAPIENTRY
2483 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2485 GET_CURRENT_CONTEXT(ctx
);
2488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2489 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2492 n
[2].e
= internalFormat
;
2495 if (ctx
->ExecuteFlag
) {
2496 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2501 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2503 GET_CURRENT_CONTEXT(ctx
);
2505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2506 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2509 for (i
=0;i
<16;i
++) {
2513 if (ctx
->ExecuteFlag
) {
2514 (*ctx
->Exec
->MultMatrixf
)( m
);
2519 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2523 for (i
= 0; i
< 16; i
++) {
2524 f
[i
] = (GLfloat
) m
[i
];
2526 save_MultMatrixf(f
);
2530 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2532 GET_CURRENT_CONTEXT(ctx
);
2533 /* It's an error to call this function while building a display list */
2534 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2541 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2542 GLdouble bottom
, GLdouble top
,
2543 GLdouble nearval
, GLdouble farval
)
2545 GET_CURRENT_CONTEXT(ctx
);
2547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2548 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2550 n
[1].f
= (GLfloat
) left
;
2551 n
[2].f
= (GLfloat
) right
;
2552 n
[3].f
= (GLfloat
) bottom
;
2553 n
[4].f
= (GLfloat
) top
;
2554 n
[5].f
= (GLfloat
) nearval
;
2555 n
[6].f
= (GLfloat
) farval
;
2557 if (ctx
->ExecuteFlag
) {
2558 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2563 static void GLAPIENTRY
2564 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2566 GET_CURRENT_CONTEXT(ctx
);
2568 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2569 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2573 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2574 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2576 if (ctx
->ExecuteFlag
) {
2577 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2582 static void GLAPIENTRY
2583 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2585 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2587 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2588 for (i
=0;i
<mapsize
;i
++) {
2589 fvalues
[i
] = (GLfloat
) values
[i
];
2593 for (i
=0;i
<mapsize
;i
++) {
2594 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2597 save_PixelMapfv(map
, mapsize
, fvalues
);
2601 static void GLAPIENTRY
2602 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2604 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2606 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2607 for (i
=0;i
<mapsize
;i
++) {
2608 fvalues
[i
] = (GLfloat
) values
[i
];
2612 for (i
=0;i
<mapsize
;i
++) {
2613 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2616 save_PixelMapfv(map
, mapsize
, fvalues
);
2620 static void GLAPIENTRY
2621 save_PixelTransferf( GLenum pname
, GLfloat param
)
2623 GET_CURRENT_CONTEXT(ctx
);
2625 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2626 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2631 if (ctx
->ExecuteFlag
) {
2632 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2637 static void GLAPIENTRY
2638 save_PixelTransferi( GLenum pname
, GLint param
)
2640 save_PixelTransferf( pname
, (GLfloat
) param
);
2644 static void GLAPIENTRY
2645 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2647 GET_CURRENT_CONTEXT(ctx
);
2649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2650 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2655 if (ctx
->ExecuteFlag
) {
2656 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2661 static void GLAPIENTRY
2662 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2664 GET_CURRENT_CONTEXT(ctx
);
2666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2667 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2674 if (ctx
->ExecuteFlag
) {
2675 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2680 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2682 save_PointParameterfvEXT(pname
, ¶m
);
2685 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2687 GLfloat p
= (GLfloat
) param
;
2688 save_PointParameterfvEXT(pname
, &p
);
2691 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2693 GLfloat p
= (GLfloat
) param
[0];
2694 save_PointParameterfvEXT(pname
, &p
);
2698 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2700 GET_CURRENT_CONTEXT(ctx
);
2702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2703 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2707 if (ctx
->ExecuteFlag
) {
2708 (*ctx
->Exec
->PointSize
)( size
);
2713 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2715 GET_CURRENT_CONTEXT(ctx
);
2717 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2718 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2723 if (ctx
->ExecuteFlag
) {
2724 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2730 * Polygon stipple must have been upacked already!
2732 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2734 GET_CURRENT_CONTEXT(ctx
);
2736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2737 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2740 n
[1].data
= MALLOC( 32 * 4 );
2741 data
= n
[1].data
; /* This needed for Acorn compiler */
2742 MEMCPY( data
, pattern
, 32 * 4 );
2744 if (ctx
->ExecuteFlag
) {
2745 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2750 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2752 GET_CURRENT_CONTEXT(ctx
);
2754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2755 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2760 if (ctx
->ExecuteFlag
) {
2761 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2766 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2768 GET_CURRENT_CONTEXT(ctx
);
2769 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2773 static void GLAPIENTRY
save_PopAttrib( void )
2775 GET_CURRENT_CONTEXT(ctx
);
2776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2777 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2778 if (ctx
->ExecuteFlag
) {
2779 (*ctx
->Exec
->PopAttrib
)();
2784 static void GLAPIENTRY
save_PopMatrix( void )
2786 GET_CURRENT_CONTEXT(ctx
);
2787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2788 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2789 if (ctx
->ExecuteFlag
) {
2790 (*ctx
->Exec
->PopMatrix
)();
2795 static void GLAPIENTRY
save_PopName( void )
2797 GET_CURRENT_CONTEXT(ctx
);
2798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2799 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2800 if (ctx
->ExecuteFlag
) {
2801 (*ctx
->Exec
->PopName
)();
2806 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2807 const GLclampf
*priorities
)
2809 GET_CURRENT_CONTEXT(ctx
);
2811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2813 for (i
=0;i
<num
;i
++) {
2815 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2817 n
[1].ui
= textures
[i
];
2818 n
[2].f
= priorities
[i
];
2821 if (ctx
->ExecuteFlag
) {
2822 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2827 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2829 GET_CURRENT_CONTEXT(ctx
);
2831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2832 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2836 if (ctx
->ExecuteFlag
) {
2837 (*ctx
->Exec
->PushAttrib
)( mask
);
2842 static void GLAPIENTRY
save_PushMatrix( void )
2844 GET_CURRENT_CONTEXT(ctx
);
2845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2846 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2847 if (ctx
->ExecuteFlag
) {
2848 (*ctx
->Exec
->PushMatrix
)();
2853 static void GLAPIENTRY
save_PushName( GLuint name
)
2855 GET_CURRENT_CONTEXT(ctx
);
2857 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2858 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2862 if (ctx
->ExecuteFlag
) {
2863 (*ctx
->Exec
->PushName
)( name
);
2868 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2870 GET_CURRENT_CONTEXT(ctx
);
2872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2873 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2880 if (ctx
->ExecuteFlag
) {
2881 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2885 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2887 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2890 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2892 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2895 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2897 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2900 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2902 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2905 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2907 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2910 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2912 save_RasterPos4f(x
, y
, z
, 1.0F
);
2915 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2917 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2920 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2922 save_RasterPos4f(x
, y
, z
, 1.0F
);
2925 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2927 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2930 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2932 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2935 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2937 save_RasterPos4f(x
, y
, z
, w
);
2940 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2942 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2945 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2947 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2950 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2952 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2955 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
2957 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2960 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
2962 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2965 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
2967 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2970 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
2972 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2975 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
2977 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2980 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
2982 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2983 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2986 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
2988 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2991 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
2993 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2994 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2997 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
2999 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3003 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3005 GET_CURRENT_CONTEXT(ctx
);
3007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3008 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3012 if (ctx
->ExecuteFlag
) {
3013 (*ctx
->Exec
->PassThrough
)( token
);
3018 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3020 GET_CURRENT_CONTEXT(ctx
);
3022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3027 if (ctx
->ExecuteFlag
) {
3028 (*ctx
->Exec
->ReadBuffer
)( mode
);
3033 static void GLAPIENTRY
3034 save_ResetHistogram(GLenum target
)
3036 GET_CURRENT_CONTEXT(ctx
);
3038 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3039 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3043 if (ctx
->ExecuteFlag
) {
3044 (*ctx
->Exec
->ResetHistogram
)( target
);
3049 static void GLAPIENTRY
3050 save_ResetMinmax(GLenum target
)
3052 GET_CURRENT_CONTEXT(ctx
);
3054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3055 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3059 if (ctx
->ExecuteFlag
) {
3060 (*ctx
->Exec
->ResetMinmax
)( target
);
3065 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3067 GET_CURRENT_CONTEXT(ctx
);
3069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3070 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3077 if (ctx
->ExecuteFlag
) {
3078 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3083 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3085 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3089 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3091 GET_CURRENT_CONTEXT(ctx
);
3093 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3094 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3100 if (ctx
->ExecuteFlag
) {
3101 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3106 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3108 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3112 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3114 GET_CURRENT_CONTEXT(ctx
);
3116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3117 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3124 if (ctx
->ExecuteFlag
) {
3125 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3130 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3132 GET_CURRENT_CONTEXT(ctx
);
3134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3135 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3139 if (ctx
->ExecuteFlag
) {
3140 (*ctx
->Exec
->ShadeModel
)( mode
);
3145 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3147 GET_CURRENT_CONTEXT(ctx
);
3149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3150 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3156 if (ctx
->ExecuteFlag
) {
3157 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3162 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3164 GET_CURRENT_CONTEXT(ctx
);
3166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3171 if (ctx
->ExecuteFlag
) {
3172 (*ctx
->Exec
->StencilMask
)( mask
);
3177 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3179 GET_CURRENT_CONTEXT(ctx
);
3181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3182 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3188 if (ctx
->ExecuteFlag
) {
3189 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3194 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3196 GET_CURRENT_CONTEXT(ctx
);
3198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3199 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3208 if (ctx
->ExecuteFlag
) {
3209 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3214 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3216 save_TexEnvfv( target
, pname
, ¶m
);
3220 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3223 p
[0] = (GLfloat
) param
;
3224 p
[1] = p
[2] = p
[3] = 0.0;
3225 save_TexEnvfv( target
, pname
, p
);
3229 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3232 p
[0] = INT_TO_FLOAT( param
[0] );
3233 p
[1] = INT_TO_FLOAT( param
[1] );
3234 p
[2] = INT_TO_FLOAT( param
[2] );
3235 p
[3] = INT_TO_FLOAT( param
[3] );
3236 save_TexEnvfv( target
, pname
, p
);
3240 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3242 GET_CURRENT_CONTEXT(ctx
);
3244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3245 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3254 if (ctx
->ExecuteFlag
) {
3255 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3260 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3263 p
[0] = (GLfloat
) params
[0];
3264 p
[1] = (GLfloat
) params
[1];
3265 p
[2] = (GLfloat
) params
[2];
3266 p
[3] = (GLfloat
) params
[3];
3267 save_TexGenfv(coord
, pname
, p
);
3271 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3273 GLfloat p
= (GLfloat
) param
;
3274 save_TexGenfv( coord
, pname
, &p
);
3278 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3281 p
[0] = (GLfloat
) params
[0];
3282 p
[1] = (GLfloat
) params
[1];
3283 p
[2] = (GLfloat
) params
[2];
3284 p
[3] = (GLfloat
) params
[3];
3285 save_TexGenfv( coord
, pname
, p
);
3289 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3291 save_TexGenfv(coord
, pname
, ¶m
);
3295 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3297 save_TexGeniv( coord
, pname
, ¶m
);
3301 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3302 GLenum pname
, const GLfloat
*params
)
3304 GET_CURRENT_CONTEXT(ctx
);
3306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3307 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3316 if (ctx
->ExecuteFlag
) {
3317 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3322 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3324 save_TexParameterfv(target
, pname
, ¶m
);
3328 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3331 fparam
[0] = (GLfloat
) param
;
3332 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3333 save_TexParameterfv(target
, pname
, fparam
);
3337 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3340 fparam
[0] = (GLfloat
) params
[0];
3341 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3342 save_TexParameterfv(target
, pname
, fparam
);
3346 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3347 GLint level
, GLint components
,
3348 GLsizei width
, GLint border
,
3349 GLenum format
, GLenum type
,
3350 const GLvoid
*pixels
)
3352 GET_CURRENT_CONTEXT(ctx
);
3353 if (target
== GL_PROXY_TEXTURE_1D
) {
3354 /* don't compile, execute immediately */
3355 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3356 border
, format
, type
, pixels
);
3359 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3360 pixels
, &ctx
->Unpack
);
3362 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3363 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3367 n
[3].i
= components
;
3368 n
[4].i
= (GLint
) width
;
3377 if (ctx
->ExecuteFlag
) {
3378 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3379 border
, format
, type
, pixels
);
3385 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3386 GLint level
, GLint components
,
3387 GLsizei width
, GLsizei height
, GLint border
,
3388 GLenum format
, GLenum type
,
3389 const GLvoid
*pixels
)
3391 GET_CURRENT_CONTEXT(ctx
);
3392 if (target
== GL_PROXY_TEXTURE_2D
) {
3393 /* don't compile, execute immediately */
3394 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3395 height
, border
, format
, type
, pixels
);
3398 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3399 pixels
, &ctx
->Unpack
);
3401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3402 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3406 n
[3].i
= components
;
3407 n
[4].i
= (GLint
) width
;
3408 n
[5].i
= (GLint
) height
;
3417 if (ctx
->ExecuteFlag
) {
3418 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3419 height
, border
, format
, type
, pixels
);
3425 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3426 GLint level
, GLint internalFormat
,
3427 GLsizei width
, GLsizei height
, GLsizei depth
,
3429 GLenum format
, GLenum type
,
3430 const GLvoid
*pixels
)
3432 GET_CURRENT_CONTEXT(ctx
);
3433 if (target
== GL_PROXY_TEXTURE_3D
) {
3434 /* don't compile, execute immediately */
3435 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3436 height
, depth
, border
, format
, type
, pixels
);
3440 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3441 pixels
, &ctx
->Unpack
);
3442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3443 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3447 n
[3].i
= (GLint
) internalFormat
;
3448 n
[4].i
= (GLint
) width
;
3449 n
[5].i
= (GLint
) height
;
3450 n
[6].i
= (GLint
) depth
;
3459 if (ctx
->ExecuteFlag
) {
3460 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3461 height
, depth
, border
, format
, type
, pixels
);
3467 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3468 GLsizei width
, GLenum format
, GLenum type
,
3469 const GLvoid
*pixels
)
3471 GET_CURRENT_CONTEXT(ctx
);
3473 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3474 pixels
, &ctx
->Unpack
);
3475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3476 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3481 n
[4].i
= (GLint
) width
;
3489 if (ctx
->ExecuteFlag
) {
3490 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3491 format
, type
, pixels
);
3496 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3497 GLint xoffset
, GLint yoffset
,
3498 GLsizei width
, GLsizei height
,
3499 GLenum format
, GLenum type
,
3500 const GLvoid
*pixels
)
3502 GET_CURRENT_CONTEXT(ctx
);
3504 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3505 pixels
, &ctx
->Unpack
);
3506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3507 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3513 n
[5].i
= (GLint
) width
;
3514 n
[6].i
= (GLint
) height
;
3522 if (ctx
->ExecuteFlag
) {
3523 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3524 width
, height
, format
, type
, pixels
);
3529 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3530 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3531 GLsizei width
, GLsizei height
, GLsizei depth
,
3532 GLenum format
, GLenum type
,
3533 const GLvoid
*pixels
)
3535 GET_CURRENT_CONTEXT(ctx
);
3537 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3538 pixels
, &ctx
->Unpack
);
3539 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3540 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3547 n
[6].i
= (GLint
) width
;
3548 n
[7].i
= (GLint
) height
;
3549 n
[8].i
= (GLint
) depth
;
3557 if (ctx
->ExecuteFlag
) {
3558 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3559 xoffset
, yoffset
, zoffset
,
3560 width
, height
, depth
, format
, type
, pixels
);
3565 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3567 GET_CURRENT_CONTEXT(ctx
);
3569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3570 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3576 if (ctx
->ExecuteFlag
) {
3577 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3582 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3584 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3589 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3591 GET_CURRENT_CONTEXT(ctx
);
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3598 n
[3].i
= (GLint
) width
;
3599 n
[4].i
= (GLint
) height
;
3601 if (ctx
->ExecuteFlag
) {
3602 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3607 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3609 GET_CURRENT_CONTEXT(ctx
);
3611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3612 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3619 if (ctx
->ExecuteFlag
) {
3620 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3624 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3626 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3629 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3631 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3634 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3636 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3639 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3641 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3644 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3646 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3649 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3651 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3654 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3656 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3659 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3661 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3664 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3666 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3669 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3671 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3674 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3676 save_WindowPos4fMESA(x
, y
, z
, w
);
3679 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3681 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3684 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3686 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3689 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3691 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3694 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3696 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3699 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3701 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3704 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3706 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3709 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3711 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3714 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3716 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3719 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3721 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3722 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3725 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3727 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3730 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3732 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3733 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3736 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3738 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3743 /* GL_ARB_multitexture */
3744 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3746 GET_CURRENT_CONTEXT(ctx
);
3748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3749 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3753 if (ctx
->ExecuteFlag
) {
3754 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3759 /* GL_ARB_transpose_matrix */
3761 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3764 _math_transposefd(tm
, m
);
3765 save_LoadMatrixf(tm
);
3769 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3772 _math_transposef(tm
, m
);
3773 save_LoadMatrixf(tm
);
3777 static void GLAPIENTRY
3778 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3781 _math_transposefd(tm
, m
);
3782 save_MultMatrixf(tm
);
3786 static void GLAPIENTRY
3787 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3790 _math_transposef(tm
, m
);
3791 save_MultMatrixf(tm
);
3795 static void GLAPIENTRY
3796 save_PixelTexGenSGIX(GLenum mode
)
3798 GET_CURRENT_CONTEXT(ctx
);
3800 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3801 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3805 if (ctx
->ExecuteFlag
) {
3806 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3811 /* GL_ARB_texture_compression */
3812 static void GLAPIENTRY
3813 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3814 GLenum internalFormat
, GLsizei width
,
3815 GLint border
, GLsizei imageSize
,
3818 GET_CURRENT_CONTEXT(ctx
);
3819 if (target
== GL_PROXY_TEXTURE_1D
) {
3820 /* don't compile, execute immediately */
3821 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3822 width
, border
, imageSize
, data
);
3827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3828 /* make copy of image */
3829 image
= MALLOC(imageSize
);
3831 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3834 MEMCPY(image
, data
, imageSize
);
3835 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3839 n
[3].e
= internalFormat
;
3840 n
[4].i
= (GLint
) width
;
3848 if (ctx
->ExecuteFlag
) {
3849 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3850 width
, border
, imageSize
, data
);
3856 static void GLAPIENTRY
3857 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3858 GLenum internalFormat
, GLsizei width
,
3859 GLsizei height
, GLint border
, GLsizei imageSize
,
3862 GET_CURRENT_CONTEXT(ctx
);
3863 if (target
== GL_PROXY_TEXTURE_2D
) {
3864 /* don't compile, execute immediately */
3865 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3866 width
, height
, border
, imageSize
, data
);
3871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3872 /* make copy of image */
3873 image
= MALLOC(imageSize
);
3875 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3878 MEMCPY(image
, data
, imageSize
);
3879 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3883 n
[3].e
= internalFormat
;
3884 n
[4].i
= (GLint
) width
;
3885 n
[5].i
= (GLint
) height
;
3893 if (ctx
->ExecuteFlag
) {
3894 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3895 width
, height
, border
, imageSize
, data
);
3901 static void GLAPIENTRY
3902 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3903 GLenum internalFormat
, GLsizei width
,
3904 GLsizei height
, GLsizei depth
, GLint border
,
3905 GLsizei imageSize
, const GLvoid
*data
)
3907 GET_CURRENT_CONTEXT(ctx
);
3908 if (target
== GL_PROXY_TEXTURE_3D
) {
3909 /* don't compile, execute immediately */
3910 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3911 width
, height
, depth
, border
, imageSize
, data
);
3916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3917 /* make copy of image */
3918 image
= MALLOC(imageSize
);
3920 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3923 MEMCPY(image
, data
, imageSize
);
3924 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3928 n
[3].e
= internalFormat
;
3929 n
[4].i
= (GLint
) width
;
3930 n
[5].i
= (GLint
) height
;
3931 n
[6].i
= (GLint
) depth
;
3939 if (ctx
->ExecuteFlag
) {
3940 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3941 width
, height
, depth
, border
, imageSize
, data
);
3947 static void GLAPIENTRY
3948 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3949 GLsizei width
, GLenum format
,
3950 GLsizei imageSize
, const GLvoid
*data
)
3955 GET_CURRENT_CONTEXT(ctx
);
3956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3958 /* make copy of image */
3959 image
= MALLOC(imageSize
);
3961 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
3964 MEMCPY(image
, data
, imageSize
);
3965 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
3970 n
[4].i
= (GLint
) width
;
3978 if (ctx
->ExecuteFlag
) {
3979 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
3980 width
, format
, imageSize
, data
);
3985 static void GLAPIENTRY
3986 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
3987 GLint yoffset
, GLsizei width
, GLsizei height
,
3988 GLenum format
, GLsizei imageSize
,
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
, "glCompressedTexSubImage2DARB");
4003 MEMCPY(image
, data
, imageSize
);
4004 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4010 n
[5].i
= (GLint
) width
;
4011 n
[6].i
= (GLint
) height
;
4019 if (ctx
->ExecuteFlag
) {
4020 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4021 width
, height
, format
, imageSize
, data
);
4026 static void GLAPIENTRY
4027 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4028 GLint yoffset
, GLint zoffset
, GLsizei width
,
4029 GLsizei height
, GLsizei depth
, GLenum format
,
4030 GLsizei imageSize
, const GLvoid
*data
)
4035 GET_CURRENT_CONTEXT(ctx
);
4036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4038 /* make copy of image */
4039 image
= MALLOC(imageSize
);
4041 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4044 MEMCPY(image
, data
, imageSize
);
4045 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4052 n
[6].i
= (GLint
) width
;
4053 n
[7].i
= (GLint
) height
;
4054 n
[8].i
= (GLint
) depth
;
4056 n
[10].i
= imageSize
;
4062 if (ctx
->ExecuteFlag
) {
4063 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4064 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4069 /* GL_ARB_multisample */
4070 static void GLAPIENTRY
4071 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4073 GET_CURRENT_CONTEXT(ctx
);
4075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4076 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4081 if (ctx
->ExecuteFlag
) {
4082 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4087 /* GL_SGIS_pixel_texture */
4089 static void GLAPIENTRY
4090 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4092 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4095 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4100 if (ctx
->ExecuteFlag
) {
4101 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4106 static void GLAPIENTRY
4107 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4109 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4113 static void GLAPIENTRY
4114 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4116 save_PixelTexGenParameteriSGIS(target
, *value
);
4120 static void GLAPIENTRY
4121 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4123 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4128 * GL_NV_vertex_program
4130 #if FEATURE_NV_vertex_program
4131 static void GLAPIENTRY
4132 save_BindProgramNV(GLenum target
, GLuint id
)
4134 GET_CURRENT_CONTEXT(ctx
);
4136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4137 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4142 if (ctx
->ExecuteFlag
) {
4143 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4147 static void GLAPIENTRY
4148 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4150 GET_CURRENT_CONTEXT(ctx
);
4152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4153 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4162 if (ctx
->ExecuteFlag
) {
4163 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4168 static void GLAPIENTRY
4169 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4170 GLfloat x
, GLfloat y
,
4171 GLfloat z
, GLfloat w
)
4173 GET_CURRENT_CONTEXT(ctx
);
4175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4176 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4185 if (ctx
->ExecuteFlag
) {
4186 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4191 static void GLAPIENTRY
4192 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4194 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4195 params
[2], params
[3]);
4199 static void GLAPIENTRY
4200 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4201 GLdouble x
, GLdouble y
,
4202 GLdouble z
, GLdouble w
)
4204 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4205 (GLfloat
) z
, (GLfloat
) w
);
4209 static void GLAPIENTRY
4210 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4211 const GLdouble
*params
)
4213 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4214 (GLfloat
) params
[1], (GLfloat
) params
[2],
4215 (GLfloat
) params
[3]);
4219 static void GLAPIENTRY
4220 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4221 GLuint num
, const GLdouble
*params
)
4224 for (i
= 0; i
< num
; i
++) {
4225 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4230 static void GLAPIENTRY
4231 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4232 GLuint num
, const GLfloat
*params
)
4235 for (i
= 0; i
< num
; i
++) {
4236 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4241 static void GLAPIENTRY
4242 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4243 const GLubyte
*program
)
4245 GET_CURRENT_CONTEXT(ctx
);
4247 GLubyte
*programCopy
;
4249 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4251 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4254 _mesa_memcpy(programCopy
, program
, len
);
4256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4257 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4262 n
[4].data
= programCopy
;
4264 if (ctx
->ExecuteFlag
) {
4265 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4270 static void GLAPIENTRY
4271 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4273 GET_CURRENT_CONTEXT(ctx
);
4275 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4277 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4280 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4282 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4287 if (ctx
->ExecuteFlag
) {
4288 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4293 static void GLAPIENTRY
4294 save_TrackMatrixNV(GLenum target
, GLuint address
,
4295 GLenum matrix
, GLenum transform
)
4297 GET_CURRENT_CONTEXT(ctx
);
4299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4300 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4307 if (ctx
->ExecuteFlag
) {
4308 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4311 #endif /* FEATURE_NV_vertex_program */
4315 * GL_NV_fragment_program
4317 #if FEATURE_NV_fragment_program
4318 static void GLAPIENTRY
4319 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4320 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4322 GET_CURRENT_CONTEXT(ctx
);
4324 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4325 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4334 if (ctx
->ExecuteFlag
) {
4335 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4340 static void GLAPIENTRY
4341 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4342 const GLfloat
*params
)
4344 GET_CURRENT_CONTEXT(ctx
);
4346 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4347 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4356 if (ctx
->ExecuteFlag
) {
4357 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4362 static void GLAPIENTRY
4363 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4364 GLdouble x
, GLdouble y
,
4365 GLdouble z
, GLdouble w
)
4367 GET_CURRENT_CONTEXT(ctx
);
4369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4370 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4374 n
[3].f
= (GLfloat
) x
;
4375 n
[4].f
= (GLfloat
) y
;
4376 n
[5].f
= (GLfloat
) z
;
4377 n
[6].f
= (GLfloat
) w
;
4379 if (ctx
->ExecuteFlag
) {
4380 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4385 static void GLAPIENTRY
4386 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4387 const GLdouble
*params
)
4389 GET_CURRENT_CONTEXT(ctx
);
4391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4392 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4396 n
[3].f
= (GLfloat
) params
[0];
4397 n
[4].f
= (GLfloat
) params
[1];
4398 n
[5].f
= (GLfloat
) params
[2];
4399 n
[6].f
= (GLfloat
) params
[3];
4401 if (ctx
->ExecuteFlag
) {
4402 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4406 static void GLAPIENTRY
4407 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4408 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4410 GET_CURRENT_CONTEXT(ctx
);
4412 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4414 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4417 _mesa_memcpy(nameCopy
, name
, len
);
4419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4420 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4424 n
[3].data
= nameCopy
;
4430 if (ctx
->ExecuteFlag
) {
4431 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4436 static void GLAPIENTRY
4437 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4440 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4444 static void GLAPIENTRY
4445 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4446 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4448 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4449 (GLfloat
) z
,(GLfloat
) w
);
4453 static void GLAPIENTRY
4454 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4457 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4458 (GLfloat
) v
[1], (GLfloat
) v
[2],
4462 #endif /* FEATURE_NV_fragment_program */
4466 /* GL_EXT_stencil_two_side */
4467 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4469 GET_CURRENT_CONTEXT(ctx
);
4471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4472 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4476 if (ctx
->ExecuteFlag
) {
4477 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4482 /* GL_EXT_depth_bounds_test */
4483 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4485 GET_CURRENT_CONTEXT(ctx
);
4487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4488 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4490 n
[1].f
= (GLfloat
) zmin
;
4491 n
[2].f
= (GLfloat
) zmax
;
4493 if (ctx
->ExecuteFlag
) {
4494 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4500 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4502 static void GLAPIENTRY
4503 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4504 const GLvoid
*string
)
4506 GET_CURRENT_CONTEXT(ctx
);
4508 GLubyte
*programCopy
;
4510 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4512 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4515 _mesa_memcpy(programCopy
, string
, len
);
4517 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4518 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4523 n
[4].data
= programCopy
;
4525 if (ctx
->ExecuteFlag
) {
4526 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4531 static void GLAPIENTRY
4532 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4533 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4535 GET_CURRENT_CONTEXT(ctx
);
4537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4538 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4547 if (ctx
->ExecuteFlag
) {
4548 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4553 static void GLAPIENTRY
4554 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4555 const GLfloat
*params
)
4557 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4558 params
[2], params
[3]);
4562 static void GLAPIENTRY
4563 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4564 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4566 save_ProgramEnvParameter4fARB(target
, index
,
4574 static void GLAPIENTRY
4575 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4576 const GLdouble
*params
)
4578 save_ProgramEnvParameter4fARB(target
, index
,
4579 (GLfloat
) params
[0],
4580 (GLfloat
) params
[1],
4581 (GLfloat
) params
[2],
4582 (GLfloat
) params
[3]);
4585 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4590 static void save_Attr1f( GLenum attr
, GLfloat x
)
4592 GET_CURRENT_CONTEXT(ctx
);
4594 SAVE_FLUSH_VERTICES( ctx
);
4595 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4601 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4602 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4604 if (ctx
->ExecuteFlag
) {
4605 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4609 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4611 GET_CURRENT_CONTEXT(ctx
);
4613 SAVE_FLUSH_VERTICES( ctx
);
4614 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4621 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4622 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4624 if (ctx
->ExecuteFlag
) {
4625 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4629 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4631 GET_CURRENT_CONTEXT(ctx
);
4633 SAVE_FLUSH_VERTICES( ctx
);
4634 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4642 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4643 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4645 if (ctx
->ExecuteFlag
) {
4646 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4650 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4653 GET_CURRENT_CONTEXT(ctx
);
4655 SAVE_FLUSH_VERTICES( ctx
);
4656 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4665 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4666 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4668 if (ctx
->ExecuteFlag
) {
4669 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4673 static void save_EvalCoord1f( GLfloat x
)
4675 GET_CURRENT_CONTEXT(ctx
);
4677 SAVE_FLUSH_VERTICES( ctx
);
4678 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4682 if (ctx
->ExecuteFlag
) {
4683 (*ctx
->Exec
->EvalCoord1f
)( x
);
4687 static void save_EvalCoord1fv( const GLfloat
*v
)
4689 save_EvalCoord1f( v
[0] );
4692 static void save_EvalCoord2f( GLfloat x
, GLfloat y
)
4694 GET_CURRENT_CONTEXT(ctx
);
4696 SAVE_FLUSH_VERTICES( ctx
);
4697 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4702 if (ctx
->ExecuteFlag
) {
4703 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4707 static void save_EvalCoord2fv( const GLfloat
*v
)
4709 save_EvalCoord2f( v
[0], v
[1] );
4713 static void save_EvalPoint1( GLint x
)
4715 GET_CURRENT_CONTEXT(ctx
);
4717 SAVE_FLUSH_VERTICES( ctx
);
4718 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4722 if (ctx
->ExecuteFlag
) {
4723 (*ctx
->Exec
->EvalPoint1
)( x
);
4727 static void save_EvalPoint2( GLint x
, GLint y
)
4729 GET_CURRENT_CONTEXT(ctx
);
4731 SAVE_FLUSH_VERTICES( ctx
);
4732 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4737 if (ctx
->ExecuteFlag
) {
4738 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4742 static void save_Indexf( GLfloat x
)
4744 GET_CURRENT_CONTEXT(ctx
);
4746 SAVE_FLUSH_VERTICES( ctx
);
4747 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4752 ctx
->ListState
.ActiveIndex
= 1;
4753 ctx
->ListState
.CurrentIndex
= x
;
4755 if (ctx
->ExecuteFlag
) {
4756 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4760 static void save_Indexfv( const GLfloat
*v
)
4762 save_Indexf( v
[0] );
4765 static void save_EdgeFlag( GLboolean x
)
4767 GET_CURRENT_CONTEXT(ctx
);
4769 SAVE_FLUSH_VERTICES( ctx
);
4770 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4775 ctx
->ListState
.ActiveEdgeFlag
= 1;
4776 ctx
->ListState
.CurrentEdgeFlag
= x
;
4778 if (ctx
->ExecuteFlag
) {
4779 (*ctx
->Exec
->EdgeFlag
)( x
);
4783 static void save_EdgeFlagv( const GLboolean
*v
)
4785 save_EdgeFlag( v
[0] );
4788 static void save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4790 GET_CURRENT_CONTEXT(ctx
);
4794 SAVE_FLUSH_VERTICES( ctx
);
4799 case GL_FRONT_AND_BACK
:
4802 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4811 case GL_AMBIENT_AND_DIFFUSE
:
4817 case GL_COLOR_INDEXES
:
4821 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4825 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4829 for (i
= 0 ; i
< args
; i
++)
4830 n
[3+i
].f
= param
[i
];
4834 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4835 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4836 if (bitmask
& (1<<i
)) {
4837 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4838 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4842 if (ctx
->ExecuteFlag
) {
4843 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4847 static void save_Begin( GLenum mode
)
4849 GET_CURRENT_CONTEXT(ctx
);
4851 GLboolean error
= GL_FALSE
;
4853 if (mode
< GL_POINTS
|| mode
> GL_POLYGON
) {
4854 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4857 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4858 /* Typically the first begin. This may raise an error on
4859 * playback, depending on whether CallList is issued from inside
4860 * a begin/end or not.
4862 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4864 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4865 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4868 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4873 /* Give the driver an opportunity to hook in an optimized
4874 * display list compiler.
4876 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4879 SAVE_FLUSH_VERTICES( ctx
);
4880 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4886 if (ctx
->ExecuteFlag
) {
4887 (*ctx
->Exec
->Begin
)( mode
);
4891 static void save_End( void )
4893 GET_CURRENT_CONTEXT(ctx
);
4894 SAVE_FLUSH_VERTICES( ctx
);
4895 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4896 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4897 if (ctx
->ExecuteFlag
) {
4898 (*ctx
->Exec
->End
)( );
4902 static void save_Rectf( GLfloat a
, GLfloat b
,
4903 GLfloat c
, GLfloat d
)
4905 GET_CURRENT_CONTEXT(ctx
);
4907 SAVE_FLUSH_VERTICES( ctx
);
4908 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
4915 if (ctx
->ExecuteFlag
) {
4916 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
4922 static void save_Vertex2f( GLfloat x
, GLfloat y
)
4924 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
4927 static void save_Vertex2fv( const GLfloat
*v
)
4929 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
4932 static void save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
4934 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
4937 static void save_Vertex3fv( const GLfloat
*v
)
4939 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
4942 static void save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4944 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
4947 static void save_Vertex4fv( const GLfloat
*v
)
4949 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
4952 static void save_TexCoord1f( GLfloat x
)
4954 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
4957 static void save_TexCoord1fv( const GLfloat
*v
)
4959 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
4962 static void save_TexCoord2f( GLfloat x
, GLfloat y
)
4964 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
4967 static void save_TexCoord2fv( const GLfloat
*v
)
4969 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
4972 static void save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
4974 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
4977 static void save_TexCoord3fv( const GLfloat
*v
)
4979 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
4982 static void save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4984 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
4987 static void save_TexCoord4fv( const GLfloat
*v
)
4989 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
4992 static void save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
4994 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
4997 static void save_Normal3fv( const GLfloat
*v
)
4999 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5002 static void save_FogCoordfEXT( GLfloat x
)
5004 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5007 static void save_FogCoordfvEXT( const GLfloat
*v
)
5009 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5012 static void save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5014 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5017 static void save_Color3fv( const GLfloat
*v
)
5019 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5022 static void save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5024 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5027 static void save_Color4fv( const GLfloat
*v
)
5029 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5032 static void save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5034 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5037 static void save_SecondaryColor3fvEXT( const GLfloat
*v
)
5039 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5043 /* Just call the respective ATTR for texcoord
5045 static void save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5047 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5048 save_Attr1f( attr
, x
);
5051 static void save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5053 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5054 save_Attr1f( attr
, v
[0] );
5057 static void save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5059 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5060 save_Attr2f( attr
, x
, y
);
5063 static void save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5065 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5066 save_Attr2f( attr
, v
[0], v
[1] );
5069 static void save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5072 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5073 save_Attr3f( attr
, x
, y
, z
);
5076 static void save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5078 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5079 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5082 static void save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5083 GLfloat z
, GLfloat w
)
5085 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5086 save_Attr4f( attr
, x
, y
, z
, w
);
5089 static void save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5091 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5092 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5096 static void enum_error()
5098 GET_CURRENT_CONTEXT( ctx
);
5099 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5102 /* First level for NV_vertex_program:
5104 * Check for errors at compile time?.
5106 static void save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5108 if (index
< VERT_ATTRIB_MAX
)
5109 save_Attr1f( index
, x
);
5114 static void save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5116 if (index
< VERT_ATTRIB_MAX
)
5117 save_Attr1f( index
, v
[0] );
5122 static void save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5124 if (index
< VERT_ATTRIB_MAX
)
5125 save_Attr2f( index
, x
, y
);
5130 static void save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5132 if (index
< VERT_ATTRIB_MAX
)
5133 save_Attr2f( index
, v
[0], v
[1] );
5138 static void save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5141 if (index
< VERT_ATTRIB_MAX
)
5142 save_Attr3f( index
, x
, y
, z
);
5147 static void save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5149 if (index
< VERT_ATTRIB_MAX
)
5150 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5155 static void save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5156 GLfloat z
, GLfloat w
)
5158 if (index
< VERT_ATTRIB_MAX
)
5159 save_Attr4f( index
, x
, y
, z
, w
);
5164 static void save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5166 if (index
< VERT_ATTRIB_MAX
)
5167 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5176 /* KW: Compile commands
5178 * Will appear in the list before the vertex buffer containing the
5179 * command that provoked the error. I don't see this as a problem.
5182 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5185 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5188 n
[2].data
= (void *) s
;
5190 /* execute already done */
5195 * Compile an error into current display list.
5198 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5200 if (ctx
->CompileFlag
)
5201 _mesa_save_error( ctx
, error
, s
);
5203 if (ctx
->ExecuteFlag
)
5204 _mesa_error( ctx
, error
, s
);
5210 islist(GLcontext
*ctx
, GLuint list
)
5212 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5222 /**********************************************************************/
5223 /* Display list execution */
5224 /**********************************************************************/
5228 * Execute a display list. Note that the ListBase offset must have already
5229 * been added before calling this function. I.e. the list argument is
5230 * the absolute list number, not relative to ListBase.
5231 * \param list - display list number
5233 static void GLAPIENTRY
5234 execute_list( GLcontext
*ctx
, GLuint list
)
5239 if (list
== 0 || !islist(ctx
,list
))
5242 if (ctx
->Driver
.BeginCallList
)
5243 ctx
->Driver
.BeginCallList( ctx
, list
);
5245 ctx
->ListState
.CallDepth
++;
5247 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5251 OpCode opcode
= n
[0].opcode
;
5252 int i
= (int)n
[0].opcode
- (int)OPCODE_DRV_0
;
5254 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
5255 ctx
->listext
.opcode
[i
].execute(ctx
, &n
[1]);
5256 n
+= ctx
->listext
.opcode
[i
].size
;
5261 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5264 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5266 case OPCODE_ALPHA_FUNC
:
5267 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5269 case OPCODE_BIND_TEXTURE
:
5270 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5274 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5275 ctx
->Unpack
= _mesa_native_packing
;
5276 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5277 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5278 ctx
->Unpack
= save
; /* restore */
5281 case OPCODE_BLEND_COLOR
:
5282 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5284 case OPCODE_BLEND_EQUATION
:
5285 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5287 case OPCODE_BLEND_FUNC
:
5288 (*ctx
->Exec
->BlendFunc
)( n
[1].e
, n
[2].e
);
5290 case OPCODE_BLEND_FUNC_SEPARATE
:
5291 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5293 case OPCODE_CALL_LIST
:
5294 /* Generated by glCallList(), don't add ListBase */
5295 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5296 execute_list( ctx
, n
[1].ui
);
5299 case OPCODE_CALL_LIST_OFFSET
:
5300 /* Generated by glCallLists() so we must add ListBase */
5302 /* user specified a bad data type at compile time */
5303 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5305 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5306 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5310 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5312 case OPCODE_CLEAR_COLOR
:
5313 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5315 case OPCODE_CLEAR_ACCUM
:
5316 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5318 case OPCODE_CLEAR_DEPTH
:
5319 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5321 case OPCODE_CLEAR_INDEX
:
5322 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5324 case OPCODE_CLEAR_STENCIL
:
5325 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5327 case OPCODE_CLIP_PLANE
:
5334 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5337 case OPCODE_COLOR_MASK
:
5338 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5340 case OPCODE_COLOR_MATERIAL
:
5341 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5343 case OPCODE_COLOR_TABLE
:
5345 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5346 ctx
->Unpack
= _mesa_native_packing
;
5347 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5348 n
[5].e
, n
[6].data
);
5349 ctx
->Unpack
= save
; /* restore */
5352 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5359 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5362 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5369 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5372 case OPCODE_COLOR_SUB_TABLE
:
5374 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5375 ctx
->Unpack
= _mesa_native_packing
;
5376 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5377 n
[4].e
, n
[5].e
, n
[6].data
);
5378 ctx
->Unpack
= save
; /* restore */
5381 case OPCODE_CONVOLUTION_FILTER_1D
:
5383 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5384 ctx
->Unpack
= _mesa_native_packing
;
5385 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5386 n
[4].e
, n
[5].e
, n
[6].data
);
5387 ctx
->Unpack
= save
; /* restore */
5390 case OPCODE_CONVOLUTION_FILTER_2D
:
5392 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5393 ctx
->Unpack
= _mesa_native_packing
;
5394 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5395 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5396 ctx
->Unpack
= save
; /* restore */
5399 case OPCODE_CONVOLUTION_PARAMETER_I
:
5400 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5402 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5409 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5412 case OPCODE_CONVOLUTION_PARAMETER_F
:
5413 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5415 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5422 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5425 case OPCODE_COPY_COLOR_SUB_TABLE
:
5426 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5427 n
[3].i
, n
[4].i
, n
[5].i
);
5429 case OPCODE_COPY_COLOR_TABLE
:
5430 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5431 n
[3].i
, n
[4].i
, n
[5].i
);
5433 case OPCODE_COPY_PIXELS
:
5434 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5435 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5437 case OPCODE_COPY_TEX_IMAGE1D
:
5438 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5439 n
[5].i
, n
[6].i
, n
[7].i
);
5441 case OPCODE_COPY_TEX_IMAGE2D
:
5442 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5443 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5445 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5446 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5447 n
[4].i
, n
[5].i
, n
[6].i
);
5449 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5450 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5451 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5453 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5454 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5455 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5457 case OPCODE_CULL_FACE
:
5458 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5460 case OPCODE_DEPTH_FUNC
:
5461 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5463 case OPCODE_DEPTH_MASK
:
5464 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5466 case OPCODE_DEPTH_RANGE
:
5467 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5469 case OPCODE_DISABLE
:
5470 (*ctx
->Exec
->Disable
)( n
[1].e
);
5472 case OPCODE_DRAW_BUFFER
:
5473 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5475 case OPCODE_DRAW_PIXELS
:
5477 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5478 ctx
->Unpack
= _mesa_native_packing
;
5479 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5481 ctx
->Unpack
= save
; /* restore */
5485 (*ctx
->Exec
->Enable
)( n
[1].e
);
5487 case OPCODE_EVALMESH1
:
5488 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5490 case OPCODE_EVALMESH2
:
5491 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5500 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5503 case OPCODE_FRONT_FACE
:
5504 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5506 case OPCODE_FRUSTUM
:
5507 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5510 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5512 case OPCODE_HISTOGRAM
:
5513 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5515 case OPCODE_INDEX_MASK
:
5516 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5518 case OPCODE_INIT_NAMES
:
5519 (*ctx
->Exec
->InitNames
)();
5528 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5531 case OPCODE_LIGHT_MODEL
:
5538 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5541 case OPCODE_LINE_STIPPLE
:
5542 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5544 case OPCODE_LINE_WIDTH
:
5545 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5547 case OPCODE_LIST_BASE
:
5548 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5550 case OPCODE_LOAD_IDENTITY
:
5551 (*ctx
->Exec
->LoadIdentity
)();
5553 case OPCODE_LOAD_MATRIX
:
5554 if (sizeof(Node
)==sizeof(GLfloat
)) {
5555 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5560 for (i
=0;i
<16;i
++) {
5563 (*ctx
->Exec
->LoadMatrixf
)( m
);
5566 case OPCODE_LOAD_NAME
:
5567 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5569 case OPCODE_LOGIC_OP
:
5570 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5574 GLenum target
= n
[1].e
;
5575 GLint ustride
= _mesa_evaluator_components(target
);
5576 GLint uorder
= n
[5].i
;
5577 GLfloat u1
= n
[2].f
;
5578 GLfloat u2
= n
[3].f
;
5579 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5580 (GLfloat
*) n
[6].data
);
5585 GLenum target
= n
[1].e
;
5586 GLfloat u1
= n
[2].f
;
5587 GLfloat u2
= n
[3].f
;
5588 GLfloat v1
= n
[4].f
;
5589 GLfloat v2
= n
[5].f
;
5590 GLint ustride
= n
[6].i
;
5591 GLint vstride
= n
[7].i
;
5592 GLint uorder
= n
[8].i
;
5593 GLint vorder
= n
[9].i
;
5594 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5595 v1
, v2
, vstride
, vorder
,
5596 (GLfloat
*) n
[10].data
);
5599 case OPCODE_MAPGRID1
:
5600 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5602 case OPCODE_MAPGRID2
:
5603 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5605 case OPCODE_MATRIX_MODE
:
5606 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5608 case OPCODE_MIN_MAX
:
5609 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5611 case OPCODE_MULT_MATRIX
:
5612 if (sizeof(Node
)==sizeof(GLfloat
)) {
5613 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5618 for (i
=0;i
<16;i
++) {
5621 (*ctx
->Exec
->MultMatrixf
)( m
);
5625 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5627 case OPCODE_PASSTHROUGH
:
5628 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5630 case OPCODE_PIXEL_MAP
:
5631 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5633 case OPCODE_PIXEL_TRANSFER
:
5634 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5636 case OPCODE_PIXEL_ZOOM
:
5637 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5639 case OPCODE_POINT_SIZE
:
5640 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5642 case OPCODE_POINT_PARAMETERS
:
5648 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5651 case OPCODE_POLYGON_MODE
:
5652 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5654 case OPCODE_POLYGON_STIPPLE
:
5655 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5657 case OPCODE_POLYGON_OFFSET
:
5658 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5660 case OPCODE_POP_ATTRIB
:
5661 (*ctx
->Exec
->PopAttrib
)();
5663 case OPCODE_POP_MATRIX
:
5664 (*ctx
->Exec
->PopMatrix
)();
5666 case OPCODE_POP_NAME
:
5667 (*ctx
->Exec
->PopName
)();
5669 case OPCODE_PRIORITIZE_TEXTURE
:
5670 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5672 case OPCODE_PUSH_ATTRIB
:
5673 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5675 case OPCODE_PUSH_MATRIX
:
5676 (*ctx
->Exec
->PushMatrix
)();
5678 case OPCODE_PUSH_NAME
:
5679 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5681 case OPCODE_RASTER_POS
:
5682 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5684 case OPCODE_READ_BUFFER
:
5685 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5687 case OPCODE_RESET_HISTOGRAM
:
5688 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5690 case OPCODE_RESET_MIN_MAX
:
5691 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5694 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5697 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5699 case OPCODE_SCISSOR
:
5700 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5702 case OPCODE_SHADE_MODEL
:
5703 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5705 case OPCODE_STENCIL_FUNC
:
5706 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5708 case OPCODE_STENCIL_MASK
:
5709 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5711 case OPCODE_STENCIL_OP
:
5712 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5721 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5731 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5734 case OPCODE_TEXPARAMETER
:
5741 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5744 case OPCODE_TEX_IMAGE1D
:
5746 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5747 ctx
->Unpack
= _mesa_native_packing
;
5748 (*ctx
->Exec
->TexImage1D
)(
5749 n
[1].e
, /* target */
5751 n
[3].i
, /* components */
5753 n
[5].e
, /* border */
5754 n
[6].e
, /* format */
5757 ctx
->Unpack
= save
; /* restore */
5760 case OPCODE_TEX_IMAGE2D
:
5762 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5763 ctx
->Unpack
= _mesa_native_packing
;
5764 (*ctx
->Exec
->TexImage2D
)(
5765 n
[1].e
, /* target */
5767 n
[3].i
, /* components */
5769 n
[5].i
, /* height */
5770 n
[6].e
, /* border */
5771 n
[7].e
, /* format */
5774 ctx
->Unpack
= save
; /* restore */
5777 case OPCODE_TEX_IMAGE3D
:
5779 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5780 ctx
->Unpack
= _mesa_native_packing
;
5781 (*ctx
->Exec
->TexImage3D
)(
5782 n
[1].e
, /* target */
5784 n
[3].i
, /* components */
5786 n
[5].i
, /* height */
5788 n
[7].e
, /* border */
5789 n
[8].e
, /* format */
5792 ctx
->Unpack
= save
; /* restore */
5795 case OPCODE_TEX_SUB_IMAGE1D
:
5797 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5798 ctx
->Unpack
= _mesa_native_packing
;
5799 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5801 n
[6].e
, n
[7].data
);
5802 ctx
->Unpack
= save
; /* restore */
5805 case OPCODE_TEX_SUB_IMAGE2D
:
5807 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5808 ctx
->Unpack
= _mesa_native_packing
;
5809 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5811 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5812 ctx
->Unpack
= save
; /* restore */
5815 case OPCODE_TEX_SUB_IMAGE3D
:
5817 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5818 ctx
->Unpack
= _mesa_native_packing
;
5819 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5820 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5821 n
[8].i
, n
[9].e
, n
[10].e
,
5823 ctx
->Unpack
= save
; /* restore */
5826 case OPCODE_TRANSLATE
:
5827 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5829 case OPCODE_VIEWPORT
:
5830 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5831 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5833 case OPCODE_WINDOW_POS
:
5834 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5836 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5837 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5839 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5840 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5842 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5843 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5845 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5846 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5847 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5849 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5850 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5851 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5853 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5854 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5855 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5857 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5858 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5859 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5861 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5862 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5863 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5865 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5866 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5867 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5868 n
[9].e
, n
[10].i
, n
[11].data
);
5870 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5871 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5873 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5874 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5876 #if FEATURE_NV_vertex_program
5877 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5878 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5880 case OPCODE_EXECUTE_PROGRAM_NV
:
5887 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5890 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5891 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5892 (GLuint
*) n
[2].data
);
5894 case OPCODE_LOAD_PROGRAM_NV
:
5895 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5896 (const GLubyte
*) n
[4].data
);
5898 case OPCODE_PROGRAM_PARAMETER4F_NV
:
5899 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5900 n
[4].f
, n
[5].f
, n
[6].f
);
5902 case OPCODE_TRACK_MATRIX_NV
:
5903 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
5907 #if FEATURE_NV_fragment_program
5908 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
5909 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5910 n
[4].f
, n
[5].f
, n
[6].f
);
5912 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
5913 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
5914 (const GLubyte
*) n
[3].data
,
5915 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
5919 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
5920 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
5922 case OPCODE_DEPTH_BOUNDS_EXT
:
5923 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
5925 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5926 case OPCODE_PROGRAM_STRING_ARB
:
5927 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
5929 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
5930 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5931 n
[4].f
, n
[5].f
, n
[6].f
);
5935 case OPCODE_ATTR_1F
:
5936 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
5938 case OPCODE_ATTR_2F
:
5939 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
5941 case OPCODE_ATTR_3F
:
5942 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
5944 case OPCODE_ATTR_4F
:
5945 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
5947 case OPCODE_MATERIAL
:
5948 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
5951 (*ctx
->Exec
->Indexi
)(n
[1].i
);
5953 case OPCODE_EDGEFLAG
:
5954 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
5957 (*ctx
->Exec
->Begin
)(n
[1].e
);
5960 (*ctx
->Exec
->End
)();
5963 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5965 case OPCODE_EVAL_C1
:
5966 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
5968 case OPCODE_EVAL_C2
:
5969 (*ctx
->Exec
->EvalCoord2fv
)(&n
[1].f
);
5971 case OPCODE_EVAL_P1
:
5972 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
5974 case OPCODE_EVAL_P2
:
5975 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
5981 case OPCODE_CONTINUE
:
5982 n
= (Node
*) n
[1].next
;
5984 case OPCODE_END_OF_LIST
:
5990 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
5991 _mesa_problem(ctx
, msg
);
5996 /* increment n to point to next compiled command */
5997 if (opcode
!=OPCODE_CONTINUE
) {
5998 n
+= InstSize
[opcode
];
6002 ctx
->ListState
.CallDepth
--;
6004 if (ctx
->Driver
.EndCallList
)
6005 ctx
->Driver
.EndCallList( ctx
);
6012 /**********************************************************************/
6014 /**********************************************************************/
6020 * Test if a display list number is valid.
6022 GLboolean GLAPIENTRY
6023 _mesa_IsList( GLuint list
)
6025 GET_CURRENT_CONTEXT(ctx
);
6026 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6027 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6028 return islist(ctx
, list
);
6033 * Delete a sequence of consecutive display lists.
6036 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6038 GET_CURRENT_CONTEXT(ctx
);
6040 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6041 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6044 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6047 for (i
=list
;i
<list
+range
;i
++) {
6048 _mesa_destroy_list( ctx
, i
);
6055 * Return a display list number, n, such that lists n through n+range-1
6059 _mesa_GenLists(GLsizei range
)
6061 GET_CURRENT_CONTEXT(ctx
);
6063 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6064 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6067 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6075 * Make this an atomic operation
6077 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6079 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6081 /* reserve the list IDs by with empty/dummy lists */
6083 for (i
=0; i
<range
; i
++) {
6084 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6088 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6096 * Begin a new display list.
6099 _mesa_NewList( GLuint list
, GLenum mode
)
6101 GET_CURRENT_CONTEXT(ctx
);
6104 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6105 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6107 if (MESA_VERBOSE
&VERBOSE_API
)
6108 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6109 _mesa_lookup_enum_by_nr(mode
));
6112 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6116 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6117 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6121 if (ctx
->ListState
.CurrentListPtr
) {
6122 /* already compiling a display list */
6123 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6127 ctx
->CompileFlag
= GL_TRUE
;
6128 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6130 /* Allocate new display list */
6131 ctx
->ListState
.CurrentListNum
= list
;
6132 ctx
->ListState
.CurrentBlock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
6133 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6134 ctx
->ListState
.CurrentPos
= 0;
6136 /* Reset acumulated list state:
6138 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6139 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6141 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6142 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6144 ctx
->ListState
.ActiveIndex
= 0;
6145 ctx
->ListState
.ActiveEdgeFlag
= 0;
6147 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6148 ctx
->Driver
.NewList( ctx
, list
, mode
);
6150 ctx
->CurrentDispatch
= ctx
->Save
;
6151 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6157 * End definition of current display list.
6160 _mesa_EndList( void )
6162 GET_CURRENT_CONTEXT(ctx
);
6163 SAVE_FLUSH_VERTICES(ctx
);
6164 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6166 if (MESA_VERBOSE
&VERBOSE_API
)
6167 _mesa_debug(ctx
, "glEndList\n");
6169 /* Check that a list is under construction */
6170 if (!ctx
->ListState
.CurrentListPtr
) {
6171 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6175 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6177 /* Destroy old list, if any */
6178 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6179 /* Install the list */
6180 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6183 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6184 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6186 ctx
->ListState
.CurrentListNum
= 0;
6187 ctx
->ListState
.CurrentListPtr
= NULL
;
6188 ctx
->ExecuteFlag
= GL_TRUE
;
6189 ctx
->CompileFlag
= GL_FALSE
;
6191 ctx
->Driver
.EndList( ctx
);
6193 ctx
->CurrentDispatch
= ctx
->Exec
;
6194 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6200 _mesa_CallList( GLuint list
)
6202 GLboolean save_compile_flag
;
6203 GET_CURRENT_CONTEXT(ctx
);
6204 FLUSH_CURRENT(ctx
, 0);
6205 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6206 /* execute the display list, and restore the CompileFlag. */
6208 if (MESA_VERBOSE
& VERBOSE_API
)
6209 _mesa_debug(ctx
, "glCallList %d\n", list
);
6212 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6216 /* mesa_print_display_list( list ); */
6218 save_compile_flag
= ctx
->CompileFlag
;
6219 if (save_compile_flag
) {
6220 ctx
->CompileFlag
= GL_FALSE
;
6223 execute_list( ctx
, list
);
6224 ctx
->CompileFlag
= save_compile_flag
;
6226 /* also restore API function pointers to point to "save" versions */
6227 if (save_compile_flag
) {
6228 ctx
->CurrentDispatch
= ctx
->Save
;
6229 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6236 * Execute glCallLists: call multiple display lists.
6239 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6241 GET_CURRENT_CONTEXT(ctx
);
6244 GLboolean save_compile_flag
;
6246 if (MESA_VERBOSE
& VERBOSE_API
)
6247 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6251 case GL_UNSIGNED_BYTE
:
6253 case GL_UNSIGNED_SHORT
:
6255 case GL_UNSIGNED_INT
:
6263 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6267 /* Save the CompileFlag status, turn it off, execute display list,
6268 * and restore the CompileFlag.
6270 save_compile_flag
= ctx
->CompileFlag
;
6271 ctx
->CompileFlag
= GL_FALSE
;
6274 list
= translate_id( i
, type
, lists
);
6275 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6278 ctx
->CompileFlag
= save_compile_flag
;
6280 /* also restore API function pointers to point to "save" versions */
6281 if (save_compile_flag
) {
6282 ctx
->CurrentDispatch
= ctx
->Save
;
6283 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6290 * Set the offset added to list numbers in glCallLists.
6293 _mesa_ListBase( GLuint base
)
6295 GET_CURRENT_CONTEXT(ctx
);
6296 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6297 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6298 ctx
->List
.ListBase
= base
;
6302 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6304 static void GLAPIENTRY
exec_Finish( void )
6306 GET_CURRENT_CONTEXT(ctx
);
6307 FLUSH_VERTICES(ctx
, 0);
6308 ctx
->Exec
->Finish();
6311 static void GLAPIENTRY
exec_Flush( void )
6313 GET_CURRENT_CONTEXT(ctx
);
6314 FLUSH_VERTICES(ctx
, 0);
6315 ctx
->Exec
->Flush( );
6318 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6320 GET_CURRENT_CONTEXT(ctx
);
6321 FLUSH_VERTICES(ctx
, 0);
6322 ctx
->Exec
->GetBooleanv( pname
, params
);
6325 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6327 GET_CURRENT_CONTEXT(ctx
);
6328 FLUSH_VERTICES(ctx
, 0);
6329 ctx
->Exec
->GetClipPlane( plane
, equation
);
6332 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6334 GET_CURRENT_CONTEXT(ctx
);
6335 FLUSH_VERTICES(ctx
, 0);
6336 ctx
->Exec
->GetDoublev( pname
, params
);
6339 static GLenum GLAPIENTRY
exec_GetError( void )
6341 GET_CURRENT_CONTEXT(ctx
);
6342 FLUSH_VERTICES(ctx
, 0);
6343 return ctx
->Exec
->GetError( );
6346 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6348 GET_CURRENT_CONTEXT(ctx
);
6349 FLUSH_VERTICES(ctx
, 0);
6350 ctx
->Exec
->GetFloatv( pname
, params
);
6353 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6355 GET_CURRENT_CONTEXT(ctx
);
6356 FLUSH_VERTICES(ctx
, 0);
6357 ctx
->Exec
->GetIntegerv( pname
, params
);
6360 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6362 GET_CURRENT_CONTEXT(ctx
);
6363 FLUSH_VERTICES(ctx
, 0);
6364 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6367 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6369 GET_CURRENT_CONTEXT(ctx
);
6370 FLUSH_VERTICES(ctx
, 0);
6371 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6374 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6376 GET_CURRENT_CONTEXT(ctx
);
6377 FLUSH_VERTICES(ctx
, 0);
6378 ctx
->Exec
->GetMapdv( target
, query
, v
);
6381 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6383 GET_CURRENT_CONTEXT(ctx
);
6384 FLUSH_VERTICES(ctx
, 0);
6385 ctx
->Exec
->GetMapfv( target
, query
, v
);
6388 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6390 GET_CURRENT_CONTEXT(ctx
);
6391 FLUSH_VERTICES(ctx
, 0);
6392 ctx
->Exec
->GetMapiv( target
, query
, v
);
6395 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6397 GET_CURRENT_CONTEXT(ctx
);
6398 FLUSH_VERTICES(ctx
, 0);
6399 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6402 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6404 GET_CURRENT_CONTEXT(ctx
);
6405 FLUSH_VERTICES(ctx
, 0);
6406 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6409 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6411 GET_CURRENT_CONTEXT(ctx
);
6412 FLUSH_VERTICES(ctx
, 0);
6413 ctx
->Exec
->GetPixelMapfv( map
, values
);
6416 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6418 GET_CURRENT_CONTEXT(ctx
);
6419 FLUSH_VERTICES(ctx
, 0);
6420 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6423 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6425 GET_CURRENT_CONTEXT(ctx
);
6426 FLUSH_VERTICES(ctx
, 0);
6427 ctx
->Exec
->GetPixelMapusv( map
, values
);
6430 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6432 GET_CURRENT_CONTEXT(ctx
);
6433 FLUSH_VERTICES(ctx
, 0);
6434 ctx
->Exec
->GetPolygonStipple( dest
);
6437 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6439 GET_CURRENT_CONTEXT(ctx
);
6440 FLUSH_VERTICES(ctx
, 0);
6441 return ctx
->Exec
->GetString( name
);
6444 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6446 GET_CURRENT_CONTEXT(ctx
);
6447 FLUSH_VERTICES(ctx
, 0);
6448 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6451 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6453 GET_CURRENT_CONTEXT(ctx
);
6454 FLUSH_VERTICES(ctx
, 0);
6455 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6458 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6460 GET_CURRENT_CONTEXT(ctx
);
6461 FLUSH_VERTICES(ctx
, 0);
6462 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6465 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6467 GET_CURRENT_CONTEXT(ctx
);
6468 FLUSH_VERTICES(ctx
, 0);
6469 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6472 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6474 GET_CURRENT_CONTEXT(ctx
);
6475 FLUSH_VERTICES(ctx
, 0);
6476 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6479 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6480 GLenum type
, GLvoid
*pixels
)
6482 GET_CURRENT_CONTEXT(ctx
);
6483 FLUSH_VERTICES(ctx
, 0);
6484 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6487 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6488 GLenum pname
, GLfloat
*params
)
6490 GET_CURRENT_CONTEXT(ctx
);
6491 FLUSH_VERTICES(ctx
, 0);
6492 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6495 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6496 GLenum pname
, GLint
*params
)
6498 GET_CURRENT_CONTEXT(ctx
);
6499 FLUSH_VERTICES(ctx
, 0);
6500 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6503 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6506 GET_CURRENT_CONTEXT(ctx
);
6507 FLUSH_VERTICES(ctx
, 0);
6508 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6511 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6513 GET_CURRENT_CONTEXT(ctx
);
6514 FLUSH_VERTICES(ctx
, 0);
6515 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6518 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6520 GET_CURRENT_CONTEXT(ctx
);
6521 FLUSH_VERTICES(ctx
, 0);
6522 return ctx
->Exec
->IsEnabled( cap
);
6525 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6527 GET_CURRENT_CONTEXT(ctx
);
6528 FLUSH_VERTICES(ctx
, 0);
6529 ctx
->Exec
->PixelStoref( pname
, param
);
6532 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6534 GET_CURRENT_CONTEXT(ctx
);
6535 FLUSH_VERTICES(ctx
, 0);
6536 ctx
->Exec
->PixelStorei( pname
, param
);
6539 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6540 GLenum format
, GLenum type
, GLvoid
*pixels
)
6542 GET_CURRENT_CONTEXT(ctx
);
6543 FLUSH_VERTICES(ctx
, 0);
6544 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6547 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6549 GET_CURRENT_CONTEXT(ctx
);
6550 FLUSH_VERTICES(ctx
, 0);
6551 return ctx
->Exec
->RenderMode( mode
);
6554 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6556 GET_CURRENT_CONTEXT(ctx
);
6557 FLUSH_VERTICES(ctx
, 0);
6558 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6561 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6563 GET_CURRENT_CONTEXT(ctx
);
6564 FLUSH_VERTICES(ctx
, 0);
6565 ctx
->Exec
->SelectBuffer( size
, buffer
);
6568 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6569 GLboolean
*residences
)
6571 GET_CURRENT_CONTEXT(ctx
);
6572 FLUSH_VERTICES(ctx
, 0);
6573 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6576 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6579 GET_CURRENT_CONTEXT(ctx
);
6580 FLUSH_VERTICES(ctx
, 0);
6581 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6584 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6586 GET_CURRENT_CONTEXT(ctx
);
6587 FLUSH_VERTICES(ctx
, 0);
6588 ctx
->Exec
->DeleteTextures( n
, texName
);
6591 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6593 GET_CURRENT_CONTEXT(ctx
);
6594 FLUSH_VERTICES(ctx
, 0);
6595 ctx
->Exec
->DisableClientState( cap
);
6598 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6600 GET_CURRENT_CONTEXT(ctx
);
6601 FLUSH_VERTICES(ctx
, 0);
6602 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6605 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6607 GET_CURRENT_CONTEXT(ctx
);
6608 FLUSH_VERTICES(ctx
, 0);
6609 ctx
->Exec
->EnableClientState( cap
);
6612 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6614 GET_CURRENT_CONTEXT(ctx
);
6615 FLUSH_VERTICES(ctx
, 0);
6616 ctx
->Exec
->GenTextures( n
, texName
);
6619 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6621 GET_CURRENT_CONTEXT(ctx
);
6622 FLUSH_VERTICES(ctx
, 0);
6623 ctx
->Exec
->GetPointerv( pname
, params
);
6626 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6628 GET_CURRENT_CONTEXT(ctx
);
6629 FLUSH_VERTICES(ctx
, 0);
6630 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6633 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6634 const GLvoid
*pointer
)
6636 GET_CURRENT_CONTEXT(ctx
);
6637 FLUSH_VERTICES(ctx
, 0);
6638 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6641 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6643 GET_CURRENT_CONTEXT(ctx
);
6644 FLUSH_VERTICES(ctx
, 0);
6645 return ctx
->Exec
->IsTexture( texture
);
6648 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6650 GET_CURRENT_CONTEXT(ctx
);
6651 FLUSH_VERTICES(ctx
, 0);
6652 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6655 static void GLAPIENTRY
exec_PopClientAttrib(void)
6657 GET_CURRENT_CONTEXT(ctx
);
6658 FLUSH_VERTICES(ctx
, 0);
6659 ctx
->Exec
->PopClientAttrib();
6662 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6664 GET_CURRENT_CONTEXT(ctx
);
6665 FLUSH_VERTICES(ctx
, 0);
6666 ctx
->Exec
->PushClientAttrib( mask
);
6669 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6672 GET_CURRENT_CONTEXT(ctx
);
6673 FLUSH_VERTICES(ctx
, 0);
6674 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6677 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6680 GET_CURRENT_CONTEXT(ctx
);
6681 FLUSH_VERTICES(ctx
, 0);
6682 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6685 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6688 GET_CURRENT_CONTEXT(ctx
);
6689 FLUSH_VERTICES(ctx
, 0);
6690 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6693 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6694 GLint x
, GLint y
, GLsizei width
)
6696 GET_CURRENT_CONTEXT(ctx
);
6697 FLUSH_VERTICES(ctx
, 0);
6698 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6701 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6702 GLint x
, GLint y
, GLsizei width
,
6705 GET_CURRENT_CONTEXT(ctx
);
6706 FLUSH_VERTICES(ctx
, 0);
6707 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6711 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6712 GLenum type
, GLvoid
*data
)
6714 GET_CURRENT_CONTEXT(ctx
);
6715 FLUSH_VERTICES(ctx
, 0);
6716 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6719 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6722 GET_CURRENT_CONTEXT(ctx
);
6723 FLUSH_VERTICES(ctx
, 0);
6724 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6727 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6730 GET_CURRENT_CONTEXT(ctx
);
6731 FLUSH_VERTICES(ctx
, 0);
6732 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6735 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6738 GET_CURRENT_CONTEXT(ctx
);
6739 FLUSH_VERTICES(ctx
, 0);
6740 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6743 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6746 GET_CURRENT_CONTEXT(ctx
);
6747 FLUSH_VERTICES(ctx
, 0);
6748 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6751 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6754 GET_CURRENT_CONTEXT(ctx
);
6755 FLUSH_VERTICES(ctx
, 0);
6756 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6759 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6760 GLenum type
, GLvoid
*values
)
6762 GET_CURRENT_CONTEXT(ctx
);
6763 FLUSH_VERTICES(ctx
, 0);
6764 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6767 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6770 GET_CURRENT_CONTEXT(ctx
);
6771 FLUSH_VERTICES(ctx
, 0);
6772 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6775 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6778 GET_CURRENT_CONTEXT(ctx
);
6779 FLUSH_VERTICES(ctx
, 0);
6780 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6783 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6784 GLenum type
, GLvoid
*values
)
6786 GET_CURRENT_CONTEXT(ctx
);
6787 FLUSH_VERTICES(ctx
, 0);
6788 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6791 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6794 GET_CURRENT_CONTEXT(ctx
);
6795 FLUSH_VERTICES(ctx
, 0);
6796 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6799 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6802 GET_CURRENT_CONTEXT(ctx
);
6803 FLUSH_VERTICES(ctx
, 0);
6804 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6807 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6808 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6810 GET_CURRENT_CONTEXT(ctx
);
6811 FLUSH_VERTICES(ctx
, 0);
6812 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6815 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6816 GLsizei width
, GLsizei height
, GLenum format
,
6817 GLenum type
, const GLvoid
*row
,
6818 const GLvoid
*column
)
6820 GET_CURRENT_CONTEXT(ctx
);
6821 FLUSH_VERTICES(ctx
, 0);
6822 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6826 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6828 GET_CURRENT_CONTEXT(ctx
);
6829 FLUSH_VERTICES(ctx
, 0);
6830 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6833 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6835 GET_CURRENT_CONTEXT(ctx
);
6836 FLUSH_VERTICES(ctx
, 0);
6837 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6840 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6841 GLsizei count
, const GLvoid
*ptr
)
6843 GET_CURRENT_CONTEXT(ctx
);
6844 FLUSH_VERTICES(ctx
, 0);
6845 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6848 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6849 const GLboolean
*ptr
)
6851 GET_CURRENT_CONTEXT(ctx
);
6852 FLUSH_VERTICES(ctx
, 0);
6853 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6856 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6859 GET_CURRENT_CONTEXT(ctx
);
6860 FLUSH_VERTICES(ctx
, 0);
6861 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
6864 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6867 GET_CURRENT_CONTEXT(ctx
);
6868 FLUSH_VERTICES(ctx
, 0);
6869 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
6872 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6873 GLsizei count
, const GLvoid
*ptr
)
6875 GET_CURRENT_CONTEXT(ctx
);
6876 FLUSH_VERTICES(ctx
, 0);
6877 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
6880 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6881 GLsizei count
, const GLvoid
*ptr
)
6883 GET_CURRENT_CONTEXT(ctx
);
6884 FLUSH_VERTICES(ctx
, 0);
6885 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
6888 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
6890 GET_CURRENT_CONTEXT(ctx
);
6891 FLUSH_VERTICES(ctx
, 0);
6892 ctx
->Exec
->LockArraysEXT( first
, count
);
6895 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
6897 GET_CURRENT_CONTEXT(ctx
);
6898 FLUSH_VERTICES(ctx
, 0);
6899 ctx
->Exec
->UnlockArraysEXT( );
6902 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
6904 GET_CURRENT_CONTEXT(ctx
);
6905 FLUSH_VERTICES(ctx
, 0);
6906 ctx
->Exec
->ResizeBuffersMESA( );
6910 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
6912 GET_CURRENT_CONTEXT(ctx
);
6913 FLUSH_VERTICES(ctx
, 0);
6914 ctx
->Exec
->ClientActiveTextureARB(target
);
6917 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
6918 GLsizei stride
, const GLvoid
*ptr
)
6920 GET_CURRENT_CONTEXT(ctx
);
6921 FLUSH_VERTICES(ctx
, 0);
6922 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
6925 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
6928 GET_CURRENT_CONTEXT(ctx
);
6929 FLUSH_VERTICES(ctx
, 0);
6930 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
6933 /* GL_EXT_multi_draw_arrays */
6934 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
6935 GLsizei
*count
, GLsizei primcount
)
6937 GET_CURRENT_CONTEXT(ctx
);
6938 FLUSH_VERTICES(ctx
, 0);
6939 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
6942 /* GL_EXT_multi_draw_arrays */
6943 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
6944 GLenum type
, const GLvoid
**indices
,
6947 GET_CURRENT_CONTEXT(ctx
);
6948 FLUSH_VERTICES(ctx
, 0);
6949 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
6952 /* GL_IBM_multimode_draw_arrays */
6953 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
6954 const GLsizei
*count
, GLsizei primcount
,
6957 GET_CURRENT_CONTEXT(ctx
);
6958 FLUSH_VERTICES(ctx
, 0);
6959 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
6962 /* GL_IBM_multimode_draw_arrays */
6963 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
6964 const GLsizei
*count
,
6966 const GLvoid
* const *indices
,
6967 GLsizei primcount
, GLint modestride
)
6969 GET_CURRENT_CONTEXT(ctx
);
6970 FLUSH_VERTICES(ctx
, 0);
6971 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
6979 * Setup the given dispatch table to point to Mesa's display list
6980 * building functions.
6982 * This does not include any of the tnl functions - they are
6983 * initialized from _mesa_init_api_defaults and from the active vtxfmt
6987 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
6989 _mesa_init_no_op_table(table
, tableSize
);
6991 _mesa_loopback_init_api_table( table
);
6994 table
->Accum
= save_Accum
;
6995 table
->AlphaFunc
= save_AlphaFunc
;
6996 table
->Bitmap
= save_Bitmap
;
6997 table
->BlendFunc
= save_BlendFunc
;
6998 table
->CallList
= _mesa_save_CallList
;
6999 table
->CallLists
= _mesa_save_CallLists
;
7000 table
->Clear
= save_Clear
;
7001 table
->ClearAccum
= save_ClearAccum
;
7002 table
->ClearColor
= save_ClearColor
;
7003 table
->ClearDepth
= save_ClearDepth
;
7004 table
->ClearIndex
= save_ClearIndex
;
7005 table
->ClearStencil
= save_ClearStencil
;
7006 table
->ClipPlane
= save_ClipPlane
;
7007 table
->ColorMask
= save_ColorMask
;
7008 table
->ColorMaterial
= save_ColorMaterial
;
7009 table
->CopyPixels
= save_CopyPixels
;
7010 table
->CullFace
= save_CullFace
;
7011 table
->DeleteLists
= _mesa_DeleteLists
;
7012 table
->DepthFunc
= save_DepthFunc
;
7013 table
->DepthMask
= save_DepthMask
;
7014 table
->DepthRange
= save_DepthRange
;
7015 table
->Disable
= save_Disable
;
7016 table
->DrawBuffer
= save_DrawBuffer
;
7017 table
->DrawPixels
= save_DrawPixels
;
7018 table
->Enable
= save_Enable
;
7019 table
->EndList
= _mesa_EndList
;
7020 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7021 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7022 table
->Finish
= exec_Finish
;
7023 table
->Flush
= exec_Flush
;
7024 table
->Fogf
= save_Fogf
;
7025 table
->Fogfv
= save_Fogfv
;
7026 table
->Fogi
= save_Fogi
;
7027 table
->Fogiv
= save_Fogiv
;
7028 table
->FrontFace
= save_FrontFace
;
7029 table
->Frustum
= save_Frustum
;
7030 table
->GenLists
= _mesa_GenLists
;
7031 table
->GetBooleanv
= exec_GetBooleanv
;
7032 table
->GetClipPlane
= exec_GetClipPlane
;
7033 table
->GetDoublev
= exec_GetDoublev
;
7034 table
->GetError
= exec_GetError
;
7035 table
->GetFloatv
= exec_GetFloatv
;
7036 table
->GetIntegerv
= exec_GetIntegerv
;
7037 table
->GetLightfv
= exec_GetLightfv
;
7038 table
->GetLightiv
= exec_GetLightiv
;
7039 table
->GetMapdv
= exec_GetMapdv
;
7040 table
->GetMapfv
= exec_GetMapfv
;
7041 table
->GetMapiv
= exec_GetMapiv
;
7042 table
->GetMaterialfv
= exec_GetMaterialfv
;
7043 table
->GetMaterialiv
= exec_GetMaterialiv
;
7044 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7045 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7046 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7047 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7048 table
->GetString
= exec_GetString
;
7049 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7050 table
->GetTexEnviv
= exec_GetTexEnviv
;
7051 table
->GetTexGendv
= exec_GetTexGendv
;
7052 table
->GetTexGenfv
= exec_GetTexGenfv
;
7053 table
->GetTexGeniv
= exec_GetTexGeniv
;
7054 table
->GetTexImage
= exec_GetTexImage
;
7055 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7056 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7057 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7058 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7059 table
->Hint
= save_Hint
;
7060 table
->IndexMask
= save_IndexMask
;
7061 table
->InitNames
= save_InitNames
;
7062 table
->IsEnabled
= exec_IsEnabled
;
7063 table
->IsList
= _mesa_IsList
;
7064 table
->LightModelf
= save_LightModelf
;
7065 table
->LightModelfv
= save_LightModelfv
;
7066 table
->LightModeli
= save_LightModeli
;
7067 table
->LightModeliv
= save_LightModeliv
;
7068 table
->Lightf
= save_Lightf
;
7069 table
->Lightfv
= save_Lightfv
;
7070 table
->Lighti
= save_Lighti
;
7071 table
->Lightiv
= save_Lightiv
;
7072 table
->LineStipple
= save_LineStipple
;
7073 table
->LineWidth
= save_LineWidth
;
7074 table
->ListBase
= save_ListBase
;
7075 table
->LoadIdentity
= save_LoadIdentity
;
7076 table
->LoadMatrixd
= save_LoadMatrixd
;
7077 table
->LoadMatrixf
= save_LoadMatrixf
;
7078 table
->LoadName
= save_LoadName
;
7079 table
->LogicOp
= save_LogicOp
;
7080 table
->Map1d
= save_Map1d
;
7081 table
->Map1f
= save_Map1f
;
7082 table
->Map2d
= save_Map2d
;
7083 table
->Map2f
= save_Map2f
;
7084 table
->MapGrid1d
= save_MapGrid1d
;
7085 table
->MapGrid1f
= save_MapGrid1f
;
7086 table
->MapGrid2d
= save_MapGrid2d
;
7087 table
->MapGrid2f
= save_MapGrid2f
;
7088 table
->MatrixMode
= save_MatrixMode
;
7089 table
->MultMatrixd
= save_MultMatrixd
;
7090 table
->MultMatrixf
= save_MultMatrixf
;
7091 table
->NewList
= save_NewList
;
7092 table
->Ortho
= save_Ortho
;
7093 table
->PassThrough
= save_PassThrough
;
7094 table
->PixelMapfv
= save_PixelMapfv
;
7095 table
->PixelMapuiv
= save_PixelMapuiv
;
7096 table
->PixelMapusv
= save_PixelMapusv
;
7097 table
->PixelStoref
= exec_PixelStoref
;
7098 table
->PixelStorei
= exec_PixelStorei
;
7099 table
->PixelTransferf
= save_PixelTransferf
;
7100 table
->PixelTransferi
= save_PixelTransferi
;
7101 table
->PixelZoom
= save_PixelZoom
;
7102 table
->PointSize
= save_PointSize
;
7103 table
->PolygonMode
= save_PolygonMode
;
7104 table
->PolygonOffset
= save_PolygonOffset
;
7105 table
->PolygonStipple
= save_PolygonStipple
;
7106 table
->PopAttrib
= save_PopAttrib
;
7107 table
->PopMatrix
= save_PopMatrix
;
7108 table
->PopName
= save_PopName
;
7109 table
->PushAttrib
= save_PushAttrib
;
7110 table
->PushMatrix
= save_PushMatrix
;
7111 table
->PushName
= save_PushName
;
7112 table
->RasterPos2d
= save_RasterPos2d
;
7113 table
->RasterPos2dv
= save_RasterPos2dv
;
7114 table
->RasterPos2f
= save_RasterPos2f
;
7115 table
->RasterPos2fv
= save_RasterPos2fv
;
7116 table
->RasterPos2i
= save_RasterPos2i
;
7117 table
->RasterPos2iv
= save_RasterPos2iv
;
7118 table
->RasterPos2s
= save_RasterPos2s
;
7119 table
->RasterPos2sv
= save_RasterPos2sv
;
7120 table
->RasterPos3d
= save_RasterPos3d
;
7121 table
->RasterPos3dv
= save_RasterPos3dv
;
7122 table
->RasterPos3f
= save_RasterPos3f
;
7123 table
->RasterPos3fv
= save_RasterPos3fv
;
7124 table
->RasterPos3i
= save_RasterPos3i
;
7125 table
->RasterPos3iv
= save_RasterPos3iv
;
7126 table
->RasterPos3s
= save_RasterPos3s
;
7127 table
->RasterPos3sv
= save_RasterPos3sv
;
7128 table
->RasterPos4d
= save_RasterPos4d
;
7129 table
->RasterPos4dv
= save_RasterPos4dv
;
7130 table
->RasterPos4f
= save_RasterPos4f
;
7131 table
->RasterPos4fv
= save_RasterPos4fv
;
7132 table
->RasterPos4i
= save_RasterPos4i
;
7133 table
->RasterPos4iv
= save_RasterPos4iv
;
7134 table
->RasterPos4s
= save_RasterPos4s
;
7135 table
->RasterPos4sv
= save_RasterPos4sv
;
7136 table
->ReadBuffer
= save_ReadBuffer
;
7137 table
->ReadPixels
= exec_ReadPixels
;
7138 table
->RenderMode
= exec_RenderMode
;
7139 table
->Rotated
= save_Rotated
;
7140 table
->Rotatef
= save_Rotatef
;
7141 table
->Scaled
= save_Scaled
;
7142 table
->Scalef
= save_Scalef
;
7143 table
->Scissor
= save_Scissor
;
7144 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7145 table
->SelectBuffer
= exec_SelectBuffer
;
7146 table
->ShadeModel
= save_ShadeModel
;
7147 table
->StencilFunc
= save_StencilFunc
;
7148 table
->StencilMask
= save_StencilMask
;
7149 table
->StencilOp
= save_StencilOp
;
7150 table
->TexEnvf
= save_TexEnvf
;
7151 table
->TexEnvfv
= save_TexEnvfv
;
7152 table
->TexEnvi
= save_TexEnvi
;
7153 table
->TexEnviv
= save_TexEnviv
;
7154 table
->TexGend
= save_TexGend
;
7155 table
->TexGendv
= save_TexGendv
;
7156 table
->TexGenf
= save_TexGenf
;
7157 table
->TexGenfv
= save_TexGenfv
;
7158 table
->TexGeni
= save_TexGeni
;
7159 table
->TexGeniv
= save_TexGeniv
;
7160 table
->TexImage1D
= save_TexImage1D
;
7161 table
->TexImage2D
= save_TexImage2D
;
7162 table
->TexParameterf
= save_TexParameterf
;
7163 table
->TexParameterfv
= save_TexParameterfv
;
7164 table
->TexParameteri
= save_TexParameteri
;
7165 table
->TexParameteriv
= save_TexParameteriv
;
7166 table
->Translated
= save_Translated
;
7167 table
->Translatef
= save_Translatef
;
7168 table
->Viewport
= save_Viewport
;
7171 table
->AreTexturesResident
= exec_AreTexturesResident
;
7172 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7173 table
->BindTexture
= save_BindTexture
;
7174 table
->ColorPointer
= exec_ColorPointer
;
7175 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7176 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7177 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7178 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7179 table
->DeleteTextures
= exec_DeleteTextures
;
7180 table
->DisableClientState
= exec_DisableClientState
;
7181 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7182 table
->EnableClientState
= exec_EnableClientState
;
7183 table
->GenTextures
= exec_GenTextures
;
7184 table
->GenTexturesEXT
= exec_GenTextures
;
7185 table
->GetPointerv
= exec_GetPointerv
;
7186 table
->IndexPointer
= exec_IndexPointer
;
7187 table
->InterleavedArrays
= exec_InterleavedArrays
;
7188 table
->IsTexture
= exec_IsTexture
;
7189 table
->IsTextureEXT
= exec_IsTexture
;
7190 table
->NormalPointer
= exec_NormalPointer
;
7191 table
->PopClientAttrib
= exec_PopClientAttrib
;
7192 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7193 table
->PushClientAttrib
= exec_PushClientAttrib
;
7194 table
->TexCoordPointer
= exec_TexCoordPointer
;
7195 table
->TexSubImage1D
= save_TexSubImage1D
;
7196 table
->TexSubImage2D
= save_TexSubImage2D
;
7197 table
->VertexPointer
= exec_VertexPointer
;
7200 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7201 table
->TexImage3D
= save_TexImage3D
;
7202 table
->TexSubImage3D
= save_TexSubImage3D
;
7204 /* GL_ARB_imaging */
7205 /* Not all are supported */
7206 table
->BlendColor
= save_BlendColor
;
7207 table
->BlendEquation
= save_BlendEquation
;
7208 table
->ColorSubTable
= save_ColorSubTable
;
7209 table
->ColorTable
= save_ColorTable
;
7210 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7211 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7212 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7213 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7214 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7215 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7216 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7217 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7218 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7219 table
->CopyColorTable
= save_CopyColorTable
;
7220 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7221 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7222 table
->GetColorTable
= exec_GetColorTable
;
7223 table
->GetColorTableEXT
= exec_GetColorTable
;
7224 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7225 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7226 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7227 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7228 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7229 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7230 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7231 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7232 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7233 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7234 table
->GetHistogram
= exec_GetHistogram
;
7235 table
->GetHistogramEXT
= exec_GetHistogram
;
7236 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7237 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7238 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7239 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7240 table
->GetMinmax
= exec_GetMinmax
;
7241 table
->GetMinmaxEXT
= exec_GetMinmax
;
7242 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7243 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7244 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7245 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7246 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7247 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7248 table
->Histogram
= save_Histogram
;
7249 table
->Minmax
= save_Minmax
;
7250 table
->ResetHistogram
= save_ResetHistogram
;
7251 table
->ResetMinmax
= save_ResetMinmax
;
7252 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7254 /* 2. GL_EXT_blend_color */
7256 table
->BlendColorEXT
= save_BlendColorEXT
;
7259 /* 3. GL_EXT_polygon_offset */
7260 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7262 /* 6. GL_EXT_texture3d */
7264 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7265 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7266 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7269 /* 15. GL_SGIX_pixel_texture */
7270 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7272 /* 15. GL_SGIS_pixel_texture */
7273 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7274 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7275 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7276 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7277 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7278 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7280 /* 30. GL_EXT_vertex_array */
7281 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7282 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7283 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7284 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7285 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7286 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7288 /* 37. GL_EXT_blend_minmax */
7290 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7293 /* 54. GL_EXT_point_parameters */
7294 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7295 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7297 /* 78. GL_EXT_paletted_texture */
7299 table
->ColorTableEXT
= save_ColorTable
;
7300 table
->ColorSubTableEXT
= save_ColorSubTable
;
7302 table
->GetColorTableEXT
= exec_GetColorTable
;
7303 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7304 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7306 /* 97. GL_EXT_compiled_vertex_array */
7307 table
->LockArraysEXT
= exec_LockArraysEXT
;
7308 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7310 /* 145. GL_EXT_secondary_color */
7311 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7313 /* 148. GL_EXT_multi_draw_arrays */
7314 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7315 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7317 /* 149. GL_EXT_fog_coord */
7318 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7320 /* 173. GL_EXT_blend_func_separate */
7321 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7323 /* 196. GL_MESA_resize_buffers */
7324 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7326 /* 197. GL_MESA_window_pos */
7327 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7328 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7329 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7330 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7331 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7332 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7333 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7334 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7335 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7336 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7337 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7338 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7339 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7340 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7341 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7342 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7343 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7344 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7345 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7346 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7347 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7348 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7349 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7350 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7352 /* 200. GL_IBM_multimode_draw_arrays */
7353 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7354 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7356 #if FEATURE_NV_vertex_program
7357 /* 233. GL_NV_vertex_program */
7358 /* The following commands DO NOT go into display lists:
7359 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7360 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7362 table
->BindProgramNV
= save_BindProgramNV
;
7363 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7364 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7365 table
->GenProgramsNV
= _mesa_GenPrograms
;
7366 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7367 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7368 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7369 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7370 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7371 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7372 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7373 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7374 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7375 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7376 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7377 table
->IsProgramNV
= _mesa_IsProgram
;
7378 table
->LoadProgramNV
= save_LoadProgramNV
;
7379 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7380 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7381 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7382 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7383 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7384 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7385 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7386 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7389 /* 282. GL_NV_fragment_program */
7390 #if FEATURE_NV_fragment_program
7391 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7392 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7393 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7394 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7395 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7396 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7397 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7398 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7399 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7400 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7401 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7402 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7405 /* 262. GL_NV_point_sprite */
7406 table
->PointParameteriNV
= save_PointParameteriNV
;
7407 table
->PointParameterivNV
= save_PointParameterivNV
;
7409 /* 268. GL_EXT_stencil_two_side */
7410 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7412 /* ???. GL_EXT_depth_bounds_test */
7413 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7415 /* ARB 1. GL_ARB_multitexture */
7416 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7417 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7419 /* ARB 3. GL_ARB_transpose_matrix */
7420 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7421 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7422 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7423 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7425 /* ARB 5. GL_ARB_multisample */
7426 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7428 /* ARB 12. GL_ARB_texture_compression */
7429 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7430 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7431 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7432 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7433 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7434 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7435 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7437 /* ARB 14. GL_ARB_point_parameters */
7438 /* aliased with EXT_point_parameters functions */
7440 /* ARB 25. GL_ARB_window_pos */
7441 /* aliased with MESA_window_pos functions */
7443 /* ARB 26. GL_ARB_vertex_program */
7444 /* ARB 27. GL_ARB_fragment_program */
7445 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7446 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7447 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7448 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7449 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7450 table
->ProgramStringARB
= save_ProgramStringARB
;
7451 table
->BindProgramNV
= _mesa_BindProgram
;
7452 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7453 table
->GenProgramsNV
= _mesa_GenPrograms
;
7454 table
->IsProgramNV
= _mesa_IsProgram
;
7455 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7456 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7457 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7458 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7459 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7460 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7461 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7462 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7463 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7464 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7465 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7466 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7467 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7468 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7469 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7470 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7471 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7472 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7475 /* ARB 28. GL_ARB_vertex_buffer_object */
7476 #if FEATURE_ARB_vertex_buffer_object
7477 /* None of the extension's functions get compiled */
7478 table
->BindBufferARB
= _mesa_BindBufferARB
;
7479 table
->BufferDataARB
= _mesa_BufferDataARB
;
7480 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7481 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7482 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7483 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7484 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7485 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7486 table
->IsBufferARB
= _mesa_IsBufferARB
;
7487 table
->MapBufferARB
= _mesa_MapBufferARB
;
7488 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7497 static const char *enum_string( GLenum k
)
7499 return _mesa_lookup_enum_by_nr( k
);
7504 * Print the commands in a display list. For debugging only.
7505 * TODO: many commands aren't handled yet.
7507 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7512 if (!glIsList(list
)) {
7513 _mesa_printf("%u is not a display list ID\n", list
);
7517 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7519 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7521 done
= n
? GL_FALSE
: GL_TRUE
;
7523 OpCode opcode
= n
[0].opcode
;
7524 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
7526 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
7527 ctx
->listext
.opcode
[i
].print(ctx
, &n
[1]);
7528 n
+= ctx
->listext
.opcode
[i
].size
;
7533 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7536 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7537 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7539 case OPCODE_CALL_LIST
:
7540 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7542 case OPCODE_CALL_LIST_OFFSET
:
7543 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7544 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7546 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7547 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7548 enum_string(n
[1].e
), enum_string(n
[2].e
),
7549 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7551 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7552 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7553 enum_string(n
[1].e
), enum_string(n
[2].e
),
7554 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7556 case OPCODE_DISABLE
:
7557 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7560 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7562 case OPCODE_FRUSTUM
:
7563 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7564 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7566 case OPCODE_LINE_STIPPLE
:
7567 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7569 case OPCODE_LOAD_IDENTITY
:
7570 _mesa_printf("LoadIdentity\n");
7572 case OPCODE_LOAD_MATRIX
:
7573 _mesa_printf("LoadMatrix\n");
7574 _mesa_printf(" %8f %8f %8f %8f\n",
7575 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7576 _mesa_printf(" %8f %8f %8f %8f\n",
7577 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7578 _mesa_printf(" %8f %8f %8f %8f\n",
7579 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7580 _mesa_printf(" %8f %8f %8f %8f\n",
7581 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7583 case OPCODE_MULT_MATRIX
:
7584 _mesa_printf("MultMatrix (or Rotate)\n");
7585 _mesa_printf(" %8f %8f %8f %8f\n",
7586 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7587 _mesa_printf(" %8f %8f %8f %8f\n",
7588 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7589 _mesa_printf(" %8f %8f %8f %8f\n",
7590 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7591 _mesa_printf(" %8f %8f %8f %8f\n",
7592 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7595 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7596 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7598 case OPCODE_POP_ATTRIB
:
7599 _mesa_printf("PopAttrib\n");
7601 case OPCODE_POP_MATRIX
:
7602 _mesa_printf("PopMatrix\n");
7604 case OPCODE_POP_NAME
:
7605 _mesa_printf("PopName\n");
7607 case OPCODE_PUSH_ATTRIB
:
7608 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7610 case OPCODE_PUSH_MATRIX
:
7611 _mesa_printf("PushMatrix\n");
7613 case OPCODE_PUSH_NAME
:
7614 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7616 case OPCODE_RASTER_POS
:
7617 _mesa_printf("RasterPos %g %g %g %g\n",
7618 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7621 _mesa_printf("Rotate %g %g %g %g\n",
7622 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7625 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7627 case OPCODE_TRANSLATE
:
7628 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7630 case OPCODE_BIND_TEXTURE
:
7631 _mesa_printf("BindTexture %s %d\n",
7632 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7634 case OPCODE_SHADE_MODEL
:
7635 _mesa_printf("ShadeModel %s\n",
7636 _mesa_lookup_enum_by_nr(n
[1].ui
));
7639 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7640 _mesa_lookup_enum_by_nr(n
[1].ui
),
7641 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7644 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7645 _mesa_lookup_enum_by_nr(n
[1].ui
),
7646 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7647 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7649 case OPCODE_MAPGRID1
:
7650 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7651 n
[1].i
, n
[2].f
, n
[3].f
);
7653 case OPCODE_MAPGRID2
:
7654 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7655 n
[1].i
, n
[2].f
, n
[3].f
,
7656 n
[4].i
, n
[5].f
, n
[6].f
);
7658 case OPCODE_EVALMESH1
:
7659 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7661 case OPCODE_EVALMESH2
:
7662 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7663 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7667 * meta opcodes/commands
7670 _mesa_printf("Error: %s %s\n",
7671 enum_string(n
[1].e
), (const char *)n
[2].data
);
7673 case OPCODE_CONTINUE
:
7674 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7675 n
= (Node
*) n
[1].next
;
7677 case OPCODE_END_OF_LIST
:
7678 _mesa_printf("END-LIST %u\n", list
);
7682 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7683 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7688 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7691 /* increment n to point to next compiled command */
7692 if (opcode
!=OPCODE_CONTINUE
) {
7693 n
+= InstSize
[opcode
];
7702 * Clients may call this function to help debug display list problems.
7703 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7704 * changed, or break in the future without notice.
7706 void mesa_print_display_list( GLuint list
)
7708 GET_CURRENT_CONTEXT(ctx
);
7709 print_list( ctx
, list
);
7713 /**********************************************************************/
7714 /***** Initialization *****/
7715 /**********************************************************************/
7718 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7720 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7721 vfmt
->Begin
= save_Begin
;
7722 vfmt
->CallList
= _mesa_save_CallList
;
7723 vfmt
->CallLists
= _mesa_save_CallLists
;
7724 vfmt
->Color3f
= save_Color3f
;
7725 vfmt
->Color3fv
= save_Color3fv
;
7726 vfmt
->Color4f
= save_Color4f
;
7727 vfmt
->Color4fv
= save_Color4fv
;
7728 vfmt
->EdgeFlag
= save_EdgeFlag
;
7729 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7730 vfmt
->End
= save_End
;
7731 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7732 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7733 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7734 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7735 vfmt
->EvalPoint1
= save_EvalPoint1
;
7736 vfmt
->EvalPoint2
= save_EvalPoint2
;
7737 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7738 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7739 vfmt
->Indexf
= save_Indexf
;
7740 vfmt
->Indexfv
= save_Indexfv
;
7741 vfmt
->Materialfv
= save_Materialfv
;
7742 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7743 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7744 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7745 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7746 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7747 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7748 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7749 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7750 vfmt
->Normal3f
= save_Normal3f
;
7751 vfmt
->Normal3fv
= save_Normal3fv
;
7752 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7753 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7754 vfmt
->TexCoord1f
= save_TexCoord1f
;
7755 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7756 vfmt
->TexCoord2f
= save_TexCoord2f
;
7757 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7758 vfmt
->TexCoord3f
= save_TexCoord3f
;
7759 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7760 vfmt
->TexCoord4f
= save_TexCoord4f
;
7761 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7762 vfmt
->Vertex2f
= save_Vertex2f
;
7763 vfmt
->Vertex2fv
= save_Vertex2fv
;
7764 vfmt
->Vertex3f
= save_Vertex3f
;
7765 vfmt
->Vertex3fv
= save_Vertex3fv
;
7766 vfmt
->Vertex4f
= save_Vertex4f
;
7767 vfmt
->Vertex4fv
= save_Vertex4fv
;
7768 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7769 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7770 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7771 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7772 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7773 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7774 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7775 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7777 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7778 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7779 vfmt
->Rectf
= save_Rectf
;
7781 /* The driver is required to implement these as
7782 * 1) They can probably do a better job.
7783 * 2) A lot of new mechanisms would have to be added to this module
7784 * to support it. That code would probably never get used,
7788 vfmt
->DrawArrays
= 0;
7789 vfmt
->DrawElements
= 0;
7790 vfmt
->DrawRangeElements
= 0;
7796 void _mesa_init_display_list( GLcontext
* ctx
)
7799 ctx
->ListState
.CallDepth
= 0;
7800 ctx
->ExecuteFlag
= GL_TRUE
;
7801 ctx
->CompileFlag
= GL_FALSE
;
7802 ctx
->ListState
.CurrentListPtr
= NULL
;
7803 ctx
->ListState
.CurrentBlock
= NULL
;
7804 ctx
->ListState
.CurrentListNum
= 0;
7805 ctx
->ListState
.CurrentPos
= 0;
7807 /* Display List group */
7808 ctx
->List
.ListBase
= 0;
7810 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);