2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2005 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
56 #include "extensions.h"
61 #include "histogram.h"
78 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
79 #include "nvprogram.h"
82 #if FEATURE_ATI_fragment_shader
83 #include "atifragshader.h"
86 #include "math/m_matrix.h"
87 #include "math/m_xform.h"
95 * \param ctx GL context.
97 * Checks if dd_function_table::SaveNeedFlush is marked to flush
98 * stored (save) vertices, and calls
99 * dd_function_table::SaveFlushVertices if so.
101 #define SAVE_FLUSH_VERTICES(ctx) \
103 if (ctx->Driver.SaveNeedFlush) \
104 ctx->Driver.SaveFlushVertices(ctx); \
109 * Macro to assert that the API call was made outside the
110 * glBegin()/glEnd() pair, with return value.
112 * \param ctx GL context.
113 * \param retval value to return value in case the assertion fails.
115 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
117 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
118 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
119 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
125 * Macro to assert that the API call was made outside the
126 * glBegin()/glEnd() pair.
128 * \param ctx GL context.
130 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
132 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
133 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
134 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
140 * Macro to assert that the API call was made outside the
141 * glBegin()/glEnd() pair and flush the vertices.
143 * \param ctx GL context.
145 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
147 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
148 SAVE_FLUSH_VERTICES(ctx); \
152 * Macro to assert that the API call was made outside the
153 * glBegin()/glEnd() pair and flush the vertices, with return value.
155 * \param ctx GL context.
156 * \param retval value to return value in case the assertion fails.
158 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
160 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
161 SAVE_FLUSH_VERTICES(ctx); \
167 * Display list opcodes.
169 * The fact that these identifiers are assigned consecutive
170 * integer values starting at 0 is very important, see InstSize array usage)
173 OPCODE_INVALID
= -1, /* Force signed enum */
179 OPCODE_BLEND_EQUATION
,
180 OPCODE_BLEND_EQUATION_SEPARATE
,
181 OPCODE_BLEND_FUNC_SEPARATE
,
183 OPCODE_CALL_LIST_OFFSET
,
189 OPCODE_CLEAR_STENCIL
,
192 OPCODE_COLOR_MATERIAL
,
194 OPCODE_COLOR_TABLE_PARAMETER_FV
,
195 OPCODE_COLOR_TABLE_PARAMETER_IV
,
196 OPCODE_COLOR_SUB_TABLE
,
197 OPCODE_CONVOLUTION_FILTER_1D
,
198 OPCODE_CONVOLUTION_FILTER_2D
,
199 OPCODE_CONVOLUTION_PARAMETER_I
,
200 OPCODE_CONVOLUTION_PARAMETER_IV
,
201 OPCODE_CONVOLUTION_PARAMETER_F
,
202 OPCODE_CONVOLUTION_PARAMETER_FV
,
203 OPCODE_COPY_COLOR_SUB_TABLE
,
204 OPCODE_COPY_COLOR_TABLE
,
206 OPCODE_COPY_TEX_IMAGE1D
,
207 OPCODE_COPY_TEX_IMAGE2D
,
208 OPCODE_COPY_TEX_SUB_IMAGE1D
,
209 OPCODE_COPY_TEX_SUB_IMAGE2D
,
210 OPCODE_COPY_TEX_SUB_IMAGE3D
,
233 OPCODE_LOAD_IDENTITY
,
247 OPCODE_PIXEL_TRANSFER
,
250 OPCODE_POINT_PARAMETERS
,
252 OPCODE_POLYGON_STIPPLE
,
253 OPCODE_POLYGON_OFFSET
,
257 OPCODE_PRIORITIZE_TEXTURE
,
263 OPCODE_RESET_HISTOGRAM
,
264 OPCODE_RESET_MIN_MAX
,
268 OPCODE_SELECT_TEXTURE_SGIS
,
269 OPCODE_SELECT_TEXTURE_COORD_SET
,
280 OPCODE_TEX_SUB_IMAGE1D
,
281 OPCODE_TEX_SUB_IMAGE2D
,
282 OPCODE_TEX_SUB_IMAGE3D
,
286 /* GL_ARB_multitexture */
287 OPCODE_ACTIVE_TEXTURE
,
288 /* GL_ARB_texture_compression */
289 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
290 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
291 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
292 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
293 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
294 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
295 /* GL_ARB_multisample */
296 OPCODE_SAMPLE_COVERAGE
,
297 /* GL_ARB_window_pos */
298 OPCODE_WINDOW_POS_ARB
,
299 /* GL_NV_vertex_program */
300 OPCODE_BIND_PROGRAM_NV
,
301 OPCODE_EXECUTE_PROGRAM_NV
,
302 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
303 OPCODE_LOAD_PROGRAM_NV
,
304 OPCODE_PROGRAM_PARAMETER4F_NV
,
305 OPCODE_TRACK_MATRIX_NV
,
306 /* GL_NV_fragment_program */
307 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
308 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
309 /* GL_EXT_stencil_two_side */
310 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
311 /* GL_EXT_depth_bounds_test */
312 OPCODE_DEPTH_BOUNDS_EXT
,
313 /* GL_ARB_vertex/fragment_program */
314 OPCODE_PROGRAM_STRING_ARB
,
315 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
316 /* GL_ARB_occlusion_query */
317 OPCODE_BEGIN_QUERY_ARB
,
318 OPCODE_END_QUERY_ARB
,
319 /* GL_ARB_draw_buffers */
320 OPCODE_DRAW_BUFFERS_ARB
,
321 /* GL_ATI_fragment_shader */
322 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
323 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
325 OPCODE_STENCIL_FUNC_SEPARATE
,
326 OPCODE_STENCIL_OP_SEPARATE
,
327 OPCODE_STENCIL_MASK_SEPARATE
,
329 /* Vertex attributes -- fallback for when optimized display
330 * list build isn't active.
352 /* The following three are meta instructions */
353 OPCODE_ERROR
, /* raise compiled-in error */
364 * Display list instructions are stored as sequences of "nodes". Nodes
365 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
366 * are linked together with a pointer.
368 * Each instruction in the display list is stored as a sequence of
369 * contiguous nodes in memory.
370 * Each node is the union of a variety of data types.
384 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
389 * How many nodes to allocate at a time.
391 * \note Reduced now that we hold vertices etc. elsewhere.
393 #define BLOCK_SIZE 256
398 * Number of nodes of storage needed for each instruction.
399 * Sizes for dynamically allocated opcodes are stored in the context struct.
401 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
403 void mesa_print_display_list( GLuint list
);
406 /**********************************************************************/
407 /***** Private *****/
408 /**********************************************************************/
411 * Make an empty display list. This is used by glGenLists() to
412 * reserver display list IDs.
414 static struct mesa_display_list
*make_list( GLuint list
, GLuint count
)
416 struct mesa_display_list
*dlist
= CALLOC_STRUCT( mesa_display_list
);
418 dlist
->node
= (Node
*) MALLOC( sizeof(Node
) * count
);
419 dlist
->node
[0].opcode
= OPCODE_END_OF_LIST
;
426 * Destroy all nodes in a display list.
427 * \param list - display list number
429 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
431 struct mesa_display_list
*dlist
;
438 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
442 n
= block
= dlist
->node
;
444 done
= block
? GL_FALSE
: GL_TRUE
;
447 /* check for extension opcodes first */
449 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
450 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
451 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
452 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
455 switch (n
[0].opcode
) {
456 /* for some commands, we need to free malloc'd memory */
459 n
+= InstSize
[n
[0].opcode
];
463 n
+= InstSize
[n
[0].opcode
];
465 case OPCODE_DRAW_PIXELS
:
467 n
+= InstSize
[n
[0].opcode
];
471 n
+= InstSize
[n
[0].opcode
];
473 case OPCODE_COLOR_TABLE
:
475 n
+= InstSize
[n
[0].opcode
];
477 case OPCODE_COLOR_SUB_TABLE
:
479 n
+= InstSize
[n
[0].opcode
];
481 case OPCODE_CONVOLUTION_FILTER_1D
:
483 n
+= InstSize
[n
[0].opcode
];
485 case OPCODE_CONVOLUTION_FILTER_2D
:
487 n
+= InstSize
[n
[0].opcode
];
489 case OPCODE_POLYGON_STIPPLE
:
491 n
+= InstSize
[n
[0].opcode
];
493 case OPCODE_TEX_IMAGE1D
:
495 n
+= InstSize
[n
[0].opcode
];
497 case OPCODE_TEX_IMAGE2D
:
499 n
+= InstSize
[n
[0].opcode
];
501 case OPCODE_TEX_IMAGE3D
:
503 n
+= InstSize
[n
[0].opcode
];
505 case OPCODE_TEX_SUB_IMAGE1D
:
507 n
+= InstSize
[n
[0].opcode
];
509 case OPCODE_TEX_SUB_IMAGE2D
:
511 n
+= InstSize
[n
[0].opcode
];
513 case OPCODE_TEX_SUB_IMAGE3D
:
515 n
+= InstSize
[n
[0].opcode
];
517 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
523 n
+= InstSize
[n
[0].opcode
];
525 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
527 n
+= InstSize
[n
[0].opcode
];
529 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
531 n
+= InstSize
[n
[0].opcode
];
533 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
535 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
539 n
+= InstSize
[n
[0].opcode
];
541 #if FEATURE_NV_vertex_program
542 case OPCODE_LOAD_PROGRAM_NV
:
543 FREE(n
[4].data
); /* program string */
544 n
+= InstSize
[n
[0].opcode
];
546 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
547 FREE(n
[2].data
); /* array of program ids */
548 n
+= InstSize
[n
[0].opcode
];
551 #if FEATURE_NV_fragment_program
552 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
553 FREE(n
[3].data
); /* parameter name */
554 n
+= InstSize
[n
[0].opcode
];
557 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
558 case OPCODE_PROGRAM_STRING_ARB
:
559 FREE(n
[4].data
); /* program string */
560 n
+= InstSize
[n
[0].opcode
];
563 case OPCODE_CONTINUE
:
564 n
= (Node
*) n
[1].next
;
568 case OPCODE_END_OF_LIST
:
573 /* Most frequent case */
574 n
+= InstSize
[n
[0].opcode
];
581 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
587 * Translate the nth element of list from type to GLuint.
589 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
601 bptr
= (GLbyte
*) list
;
602 return (GLuint
) *(bptr
+n
);
603 case GL_UNSIGNED_BYTE
:
604 ubptr
= (GLubyte
*) list
;
605 return (GLuint
) *(ubptr
+n
);
607 sptr
= (GLshort
*) list
;
608 return (GLuint
) *(sptr
+n
);
609 case GL_UNSIGNED_SHORT
:
610 usptr
= (GLushort
*) list
;
611 return (GLuint
) *(usptr
+n
);
613 iptr
= (GLint
*) list
;
614 return (GLuint
) *(iptr
+n
);
615 case GL_UNSIGNED_INT
:
616 uiptr
= (GLuint
*) list
;
617 return (GLuint
) *(uiptr
+n
);
619 fptr
= (GLfloat
*) list
;
620 return (GLuint
) *(fptr
+n
);
622 ubptr
= ((GLubyte
*) list
) + 2*n
;
623 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
625 ubptr
= ((GLubyte
*) list
) + 3*n
;
626 return (GLuint
) *ubptr
* 65536
627 + (GLuint
) *(ubptr
+1) * 256
628 + (GLuint
) *(ubptr
+2);
630 ubptr
= ((GLubyte
*) list
) + 4*n
;
631 return (GLuint
) *ubptr
* 16777216
632 + (GLuint
) *(ubptr
+1) * 65536
633 + (GLuint
) *(ubptr
+2) * 256
634 + (GLuint
) *(ubptr
+3);
643 /**********************************************************************/
645 /**********************************************************************/
648 * Do one-time initialiazations for display lists.
651 _mesa_init_lists( void )
653 static int init_flag
= 0;
656 InstSize
[OPCODE_ACCUM
] = 3;
657 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
658 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
659 InstSize
[OPCODE_BITMAP
] = 8;
660 InstSize
[OPCODE_BLEND_COLOR
] = 5;
661 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
662 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
663 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
664 InstSize
[OPCODE_CALL_LIST
] = 2;
665 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
666 InstSize
[OPCODE_CLEAR
] = 2;
667 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
668 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
669 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
670 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
671 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
672 InstSize
[OPCODE_CLIP_PLANE
] = 6;
673 InstSize
[OPCODE_COLOR_MASK
] = 5;
674 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
675 InstSize
[OPCODE_COLOR_TABLE
] = 7;
676 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
677 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
678 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
679 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
680 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
681 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
682 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
683 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
684 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
685 InstSize
[OPCODE_COPY_PIXELS
] = 6;
686 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
687 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
688 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
689 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
690 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
691 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
692 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
693 InstSize
[OPCODE_CULL_FACE
] = 2;
694 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
695 InstSize
[OPCODE_DEPTH_MASK
] = 2;
696 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
697 InstSize
[OPCODE_DISABLE
] = 2;
698 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
699 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
700 InstSize
[OPCODE_ENABLE
] = 2;
701 InstSize
[OPCODE_EVALMESH1
] = 4;
702 InstSize
[OPCODE_EVALMESH2
] = 6;
703 InstSize
[OPCODE_FOG
] = 6;
704 InstSize
[OPCODE_FRONT_FACE
] = 2;
705 InstSize
[OPCODE_FRUSTUM
] = 7;
706 InstSize
[OPCODE_HINT
] = 3;
707 InstSize
[OPCODE_HISTOGRAM
] = 5;
708 InstSize
[OPCODE_INDEX_MASK
] = 2;
709 InstSize
[OPCODE_INIT_NAMES
] = 1;
710 InstSize
[OPCODE_LIGHT
] = 7;
711 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
712 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
713 InstSize
[OPCODE_LINE_WIDTH
] = 2;
714 InstSize
[OPCODE_LIST_BASE
] = 2;
715 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
716 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
717 InstSize
[OPCODE_LOAD_NAME
] = 2;
718 InstSize
[OPCODE_LOGIC_OP
] = 2;
719 InstSize
[OPCODE_MAP1
] = 7;
720 InstSize
[OPCODE_MAP2
] = 11;
721 InstSize
[OPCODE_MAPGRID1
] = 4;
722 InstSize
[OPCODE_MAPGRID2
] = 7;
723 InstSize
[OPCODE_MATRIX_MODE
] = 2;
724 InstSize
[OPCODE_MIN_MAX
] = 4;
725 InstSize
[OPCODE_MULT_MATRIX
] = 17;
726 InstSize
[OPCODE_ORTHO
] = 7;
727 InstSize
[OPCODE_PASSTHROUGH
] = 2;
728 InstSize
[OPCODE_PIXEL_MAP
] = 4;
729 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
730 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
731 InstSize
[OPCODE_POINT_SIZE
] = 2;
732 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
733 InstSize
[OPCODE_POLYGON_MODE
] = 3;
734 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
735 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
736 InstSize
[OPCODE_POP_ATTRIB
] = 1;
737 InstSize
[OPCODE_POP_MATRIX
] = 1;
738 InstSize
[OPCODE_POP_NAME
] = 1;
739 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
740 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
741 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
742 InstSize
[OPCODE_PUSH_NAME
] = 2;
743 InstSize
[OPCODE_RASTER_POS
] = 5;
744 InstSize
[OPCODE_READ_BUFFER
] = 2;
745 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
746 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
747 InstSize
[OPCODE_ROTATE
] = 5;
748 InstSize
[OPCODE_SCALE
] = 4;
749 InstSize
[OPCODE_SCISSOR
] = 5;
750 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
751 InstSize
[OPCODE_STENCIL_MASK
] = 2;
752 InstSize
[OPCODE_STENCIL_OP
] = 4;
753 InstSize
[OPCODE_SHADE_MODEL
] = 2;
754 InstSize
[OPCODE_TEXENV
] = 7;
755 InstSize
[OPCODE_TEXGEN
] = 7;
756 InstSize
[OPCODE_TEXPARAMETER
] = 7;
757 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
758 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
759 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
760 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
761 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
762 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
763 InstSize
[OPCODE_TRANSLATE
] = 4;
764 InstSize
[OPCODE_VIEWPORT
] = 5;
765 InstSize
[OPCODE_WINDOW_POS
] = 5;
766 InstSize
[OPCODE_CONTINUE
] = 2;
767 InstSize
[OPCODE_ERROR
] = 3;
768 InstSize
[OPCODE_END_OF_LIST
] = 1;
769 /* GL_ARB_texture_compression */
770 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
771 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
772 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
773 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
774 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
775 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
776 /* GL_ARB_multisample */
777 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
778 /* GL_ARB_multitexture */
779 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
780 /* GL_ARB_window_pos */
781 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
782 /* GL_NV_vertex_program */
783 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
784 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
785 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
786 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
787 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
788 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
789 /* GL_NV_fragment_program */
790 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
791 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
792 /* GL_EXT_stencil_two_side */
793 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
794 /* GL_EXT_depth_bounds_test */
795 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
796 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
797 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
798 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
800 #if FEATURE_ARB_occlusion_query
801 InstSize
[OPCODE_BEGIN_QUERY_ARB
] = 3;
802 InstSize
[OPCODE_END_QUERY_ARB
] = 2;
804 InstSize
[OPCODE_DRAW_BUFFERS_ARB
] = 2 + MAX_DRAW_BUFFERS
;
805 #if FEATURE_ATI_fragment_shader
806 InstSize
[OPCODE_BIND_FRAGMENT_SHADER_ATI
] = 2;
807 InstSize
[OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
] = 6;
810 InstSize
[OPCODE_STENCIL_FUNC_SEPARATE
] = 5;
811 InstSize
[OPCODE_STENCIL_MASK_SEPARATE
] = 3;
812 InstSize
[OPCODE_STENCIL_OP_SEPARATE
] = 5;
814 InstSize
[OPCODE_ATTR_1F_NV
] = 3;
815 InstSize
[OPCODE_ATTR_2F_NV
] = 4;
816 InstSize
[OPCODE_ATTR_3F_NV
] = 5;
817 InstSize
[OPCODE_ATTR_4F_NV
] = 6;
818 InstSize
[OPCODE_ATTR_1F_ARB
] = 3;
819 InstSize
[OPCODE_ATTR_2F_ARB
] = 4;
820 InstSize
[OPCODE_ATTR_3F_ARB
] = 5;
821 InstSize
[OPCODE_ATTR_4F_ARB
] = 6;
822 InstSize
[OPCODE_MATERIAL
] = 7;
823 InstSize
[OPCODE_INDEX
] = 2;
824 InstSize
[OPCODE_EDGEFLAG
] = 2;
825 InstSize
[OPCODE_BEGIN
] = 2;
826 InstSize
[OPCODE_END
] = 1;
827 InstSize
[OPCODE_RECTF
] = 5;
828 InstSize
[OPCODE_EVAL_C1
] = 2;
829 InstSize
[OPCODE_EVAL_C2
] = 3;
830 InstSize
[OPCODE_EVAL_P1
] = 2;
831 InstSize
[OPCODE_EVAL_P2
] = 3;
839 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
840 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
843 unpack_image( GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
844 GLenum format
, GLenum type
, const GLvoid
*pixels
,
845 const struct gl_pixelstore_attrib
*unpack
)
847 if (unpack
->BufferObj
->Name
== 0) {
849 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
, type
,
852 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
853 format
, type
, pixels
)) {
854 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
855 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
, type
,
864 * Allocate space for a display list instruction.
865 * \param opcode - type of instruction
866 * argcount - size in bytes of data required.
867 * \return pointer to the usable data area (not including the internal
871 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
874 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
877 if (opcode
< (int) OPCODE_EXT_0
) {
878 assert( count
== InstSize
[opcode
] );
882 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
883 /* This block is full. Allocate a new block and chain to it */
884 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
885 n
[0].opcode
= OPCODE_CONTINUE
;
886 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
888 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
891 n
[1].next
= (Node
*) newblock
;
892 ctx
->ListState
.CurrentBlock
= newblock
;
893 ctx
->ListState
.CurrentPos
= 0;
896 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
897 ctx
->ListState
.CurrentPos
+= count
;
899 n
[0].opcode
= (OpCode
) opcode
;
901 return (void *)&n
[1];
906 * This function allows modules and drivers to get their own opcodes
907 * for extending display list functionality.
908 * \param ctx the rendering context
909 * \param size number of bytes for storing the new display list command
910 * \param execute function to execute the new display list command
911 * \param destroy function to destroy the new display list command
912 * \param print function to print the new display list command
913 * \return the new opcode number or -1 if error
916 _mesa_alloc_opcode( GLcontext
*ctx
,
918 void (*execute
)( GLcontext
*, void * ),
919 void (*destroy
)( GLcontext
*, void * ),
920 void (*print
)( GLcontext
*, void * ) )
922 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
923 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
924 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
925 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
926 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
927 ctx
->ListExt
.Opcode
[i
].Print
= print
;
928 return i
+ OPCODE_EXT_0
;
935 /* Mimic the old behaviour of alloc_instruction:
936 * - sz is in units of sizeof(Node)
937 * - return value a pointer to sizeof(Node) before the actual
940 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
941 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
946 * Display List compilation functions
948 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
950 GET_CURRENT_CONTEXT(ctx
);
952 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
953 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
958 if (ctx
->ExecuteFlag
) {
959 CALL_Accum(ctx
->Exec
, ( op
, value
));
964 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
966 GET_CURRENT_CONTEXT(ctx
);
968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
969 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
972 n
[2].f
= (GLfloat
) ref
;
974 if (ctx
->ExecuteFlag
) {
975 CALL_AlphaFunc(ctx
->Exec
, ( func
, ref
));
980 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
982 GET_CURRENT_CONTEXT(ctx
);
984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
985 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
990 if (ctx
->ExecuteFlag
) {
991 CALL_BindTexture(ctx
->Exec
, ( target
, texture
));
996 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
997 GLfloat xorig
, GLfloat yorig
,
998 GLfloat xmove
, GLfloat ymove
,
999 const GLubyte
*pixels
)
1001 GET_CURRENT_CONTEXT(ctx
);
1002 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
1004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1005 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
1007 n
[1].i
= (GLint
) width
;
1008 n
[2].i
= (GLint
) height
;
1018 if (ctx
->ExecuteFlag
) {
1019 CALL_Bitmap(ctx
->Exec
, ( width
, height
,
1020 xorig
, yorig
, xmove
, ymove
, pixels
));
1025 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
1027 GET_CURRENT_CONTEXT(ctx
);
1029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1030 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
1034 if (ctx
->ExecuteFlag
) {
1035 CALL_BlendEquation(ctx
->Exec
, ( mode
));
1040 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1043 GET_CURRENT_CONTEXT(ctx
);
1045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1046 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1051 if (ctx
->ExecuteFlag
) {
1052 CALL_BlendEquationSeparateEXT(ctx
->Exec
, ( modeRGB
, modeA
));
1057 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1058 GLenum sfactorA
, GLenum dfactorA
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1065 n
[1].e
= sfactorRGB
;
1066 n
[2].e
= dfactorRGB
;
1070 if (ctx
->ExecuteFlag
) {
1071 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1072 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1077 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1078 GLfloat blue
, GLfloat alpha
)
1080 GET_CURRENT_CONTEXT(ctx
);
1082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1083 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1090 if (ctx
->ExecuteFlag
) {
1091 CALL_BlendColor(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1096 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1098 GET_CURRENT_CONTEXT(ctx
);
1100 SAVE_FLUSH_VERTICES(ctx
);
1102 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1107 /* After this, we don't know what begin/end state we're in:
1109 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1111 if (ctx
->ExecuteFlag
) {
1112 CALL_CallList(ctx
->Exec
, ( list
));
1117 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1119 GET_CURRENT_CONTEXT(ctx
);
1121 GLboolean typeErrorFlag
;
1123 SAVE_FLUSH_VERTICES(ctx
);
1127 case GL_UNSIGNED_BYTE
:
1129 case GL_UNSIGNED_SHORT
:
1131 case GL_UNSIGNED_INT
:
1136 typeErrorFlag
= GL_FALSE
;
1139 typeErrorFlag
= GL_TRUE
;
1143 GLuint list
= translate_id( i
, type
, lists
);
1144 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1147 n
[2].b
= typeErrorFlag
;
1151 /* After this, we don't know what begin/end state we're in:
1153 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1155 if (ctx
->ExecuteFlag
) {
1156 CALL_CallLists(ctx
->Exec
, ( n
, type
, lists
));
1161 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1163 GET_CURRENT_CONTEXT(ctx
);
1165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1166 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1170 if (ctx
->ExecuteFlag
) {
1171 CALL_Clear(ctx
->Exec
, ( mask
));
1176 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1177 GLfloat blue
, GLfloat alpha
)
1179 GET_CURRENT_CONTEXT(ctx
);
1181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1182 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1189 if (ctx
->ExecuteFlag
) {
1190 CALL_ClearAccum(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1195 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1196 GLclampf blue
, GLclampf alpha
)
1198 GET_CURRENT_CONTEXT(ctx
);
1200 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1201 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1208 if (ctx
->ExecuteFlag
) {
1209 CALL_ClearColor(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1214 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1216 GET_CURRENT_CONTEXT(ctx
);
1218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1219 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1221 n
[1].f
= (GLfloat
) depth
;
1223 if (ctx
->ExecuteFlag
) {
1224 CALL_ClearDepth(ctx
->Exec
, ( depth
));
1229 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1231 GET_CURRENT_CONTEXT(ctx
);
1233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1234 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1238 if (ctx
->ExecuteFlag
) {
1239 CALL_ClearIndex(ctx
->Exec
, ( c
));
1244 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1246 GET_CURRENT_CONTEXT(ctx
);
1248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1249 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1253 if (ctx
->ExecuteFlag
) {
1254 CALL_ClearStencil(ctx
->Exec
, ( s
));
1259 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1261 GET_CURRENT_CONTEXT(ctx
);
1263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1264 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1267 n
[2].f
= (GLfloat
) equ
[0];
1268 n
[3].f
= (GLfloat
) equ
[1];
1269 n
[4].f
= (GLfloat
) equ
[2];
1270 n
[5].f
= (GLfloat
) equ
[3];
1272 if (ctx
->ExecuteFlag
) {
1273 CALL_ClipPlane(ctx
->Exec
, ( plane
, equ
));
1279 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1280 GLboolean blue
, GLboolean alpha
)
1282 GET_CURRENT_CONTEXT(ctx
);
1284 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1285 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1292 if (ctx
->ExecuteFlag
) {
1293 CALL_ColorMask(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1298 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1300 GET_CURRENT_CONTEXT(ctx
);
1302 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1304 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1309 if (ctx
->ExecuteFlag
) {
1310 CALL_ColorMaterial(ctx
->Exec
, ( face
, mode
));
1315 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1316 GLsizei width
, GLenum format
, GLenum type
,
1317 const GLvoid
*table
)
1319 GET_CURRENT_CONTEXT(ctx
);
1320 if (_mesa_is_proxy_texture(target
)) {
1321 /* execute immediately */
1322 CALL_ColorTable(ctx
->Exec
, ( target
, internalFormat
, width
,
1323 format
, type
, table
));
1326 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1330 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1333 n
[2].e
= internalFormat
;
1342 if (ctx
->ExecuteFlag
) {
1343 CALL_ColorTable(ctx
->Exec
, ( target
, internalFormat
, width
,
1344 format
, type
, table
));
1351 static void GLAPIENTRY
1352 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1354 GET_CURRENT_CONTEXT(ctx
);
1357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1359 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1364 if (pname
== GL_COLOR_TABLE_SGI
||
1365 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1366 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1367 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1374 if (ctx
->ExecuteFlag
) {
1375 CALL_ColorTableParameterfv(ctx
->Exec
, ( target
, pname
, params
));
1380 static void GLAPIENTRY
1381 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1383 GET_CURRENT_CONTEXT(ctx
);
1386 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1388 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1393 if (pname
== GL_COLOR_TABLE_SGI
||
1394 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1395 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1396 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1403 if (ctx
->ExecuteFlag
) {
1404 CALL_ColorTableParameteriv(ctx
->Exec
, ( target
, pname
, params
));
1410 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1411 GLenum format
, GLenum type
,
1412 const GLvoid
*table
)
1414 GET_CURRENT_CONTEXT(ctx
);
1415 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1418 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1419 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1431 if (ctx
->ExecuteFlag
) {
1432 CALL_ColorSubTable(ctx
->Exec
, (target
, start
, count
, format
, type
, table
));
1437 static void GLAPIENTRY
1438 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1439 GLint x
, GLint y
, GLsizei width
)
1441 GET_CURRENT_CONTEXT(ctx
);
1444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1445 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1453 if (ctx
->ExecuteFlag
) {
1454 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1459 static void GLAPIENTRY
1460 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1461 GLint x
, GLint y
, GLsizei width
)
1463 GET_CURRENT_CONTEXT(ctx
);
1466 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1467 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1470 n
[2].e
= internalformat
;
1475 if (ctx
->ExecuteFlag
) {
1476 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1481 static void GLAPIENTRY
1482 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1483 GLenum format
, GLenum type
, const GLvoid
*filter
)
1485 GET_CURRENT_CONTEXT(ctx
);
1486 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1490 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1493 n
[2].e
= internalFormat
;
1502 if (ctx
->ExecuteFlag
) {
1503 CALL_ConvolutionFilter1D(ctx
->Exec
, ( target
, internalFormat
, width
,
1504 format
, type
, filter
));
1509 static void GLAPIENTRY
1510 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1511 GLsizei width
, GLsizei height
, GLenum format
,
1512 GLenum type
, const GLvoid
*filter
)
1514 GET_CURRENT_CONTEXT(ctx
);
1515 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1519 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1522 n
[2].e
= internalFormat
;
1532 if (ctx
->ExecuteFlag
) {
1533 CALL_ConvolutionFilter2D(ctx
->Exec
, ( target
, internalFormat
, width
, height
,
1534 format
, type
, filter
));
1539 static void GLAPIENTRY
1540 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1542 GET_CURRENT_CONTEXT(ctx
);
1544 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1545 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1551 if (ctx
->ExecuteFlag
) {
1552 CALL_ConvolutionParameteri(ctx
->Exec
, ( target
, pname
, param
));
1557 static void GLAPIENTRY
1558 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1560 GET_CURRENT_CONTEXT(ctx
);
1562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1563 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1568 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1569 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1570 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1576 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1579 if (ctx
->ExecuteFlag
) {
1580 CALL_ConvolutionParameteriv(ctx
->Exec
, ( target
, pname
, params
));
1585 static void GLAPIENTRY
1586 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1588 GET_CURRENT_CONTEXT(ctx
);
1590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1591 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1597 if (ctx
->ExecuteFlag
) {
1598 CALL_ConvolutionParameterf(ctx
->Exec
, ( target
, pname
, param
));
1603 static void GLAPIENTRY
1604 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1606 GET_CURRENT_CONTEXT(ctx
);
1608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1609 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1614 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1615 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1616 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1622 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1625 if (ctx
->ExecuteFlag
) {
1626 CALL_ConvolutionParameterfv(ctx
->Exec
, ( target
, pname
, params
));
1631 static void GLAPIENTRY
1632 save_CopyPixels( GLint x
, GLint y
,
1633 GLsizei width
, GLsizei height
, GLenum type
)
1635 GET_CURRENT_CONTEXT(ctx
);
1637 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1638 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1642 n
[3].i
= (GLint
) width
;
1643 n
[4].i
= (GLint
) height
;
1646 if (ctx
->ExecuteFlag
) {
1647 CALL_CopyPixels(ctx
->Exec
, ( x
, y
, width
, height
, type
));
1653 static void GLAPIENTRY
1654 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1655 GLint x
, GLint y
, GLsizei width
, GLint border
)
1657 GET_CURRENT_CONTEXT(ctx
);
1659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1660 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1664 n
[3].e
= internalformat
;
1670 if (ctx
->ExecuteFlag
) {
1671 CALL_CopyTexImage1D(ctx
->Exec
, ( target
, level
, internalformat
,
1672 x
, y
, width
, border
));
1677 static void GLAPIENTRY
1678 save_CopyTexImage2D( GLenum target
, GLint level
,
1679 GLenum internalformat
,
1680 GLint x
, GLint y
, GLsizei width
,
1681 GLsizei height
, GLint border
)
1683 GET_CURRENT_CONTEXT(ctx
);
1685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1686 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1690 n
[3].e
= internalformat
;
1697 if (ctx
->ExecuteFlag
) {
1698 CALL_CopyTexImage2D(ctx
->Exec
, ( target
, level
, internalformat
,
1699 x
, y
, width
, height
, border
));
1705 static void GLAPIENTRY
1706 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1707 GLint xoffset
, GLint x
, GLint y
,
1710 GET_CURRENT_CONTEXT(ctx
);
1712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1713 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1722 if (ctx
->ExecuteFlag
) {
1723 CALL_CopyTexSubImage1D(ctx
->Exec
, ( target
, level
, xoffset
, x
, y
, width
));
1728 static void GLAPIENTRY
1729 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1730 GLint xoffset
, GLint yoffset
,
1732 GLsizei width
, GLint height
)
1734 GET_CURRENT_CONTEXT(ctx
);
1736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1737 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1748 if (ctx
->ExecuteFlag
) {
1749 CALL_CopyTexSubImage2D(ctx
->Exec
, ( target
, level
, xoffset
, yoffset
,
1750 x
, y
, width
, height
));
1755 static void GLAPIENTRY
1756 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1757 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1759 GLsizei width
, GLint height
)
1761 GET_CURRENT_CONTEXT(ctx
);
1763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1764 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1776 if (ctx
->ExecuteFlag
) {
1777 CALL_CopyTexSubImage3D(ctx
->Exec
, ( target
, level
,
1778 xoffset
, yoffset
, zoffset
,
1779 x
, y
, width
, height
));
1784 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1786 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1793 if (ctx
->ExecuteFlag
) {
1794 CALL_CullFace(ctx
->Exec
, ( mode
));
1799 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1801 GET_CURRENT_CONTEXT(ctx
);
1803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1804 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1808 if (ctx
->ExecuteFlag
) {
1809 CALL_DepthFunc(ctx
->Exec
, ( func
));
1814 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1816 GET_CURRENT_CONTEXT(ctx
);
1818 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1819 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1823 if (ctx
->ExecuteFlag
) {
1824 CALL_DepthMask(ctx
->Exec
, ( mask
));
1829 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1831 GET_CURRENT_CONTEXT(ctx
);
1833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1834 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1836 n
[1].f
= (GLfloat
) nearval
;
1837 n
[2].f
= (GLfloat
) farval
;
1839 if (ctx
->ExecuteFlag
) {
1840 CALL_DepthRange(ctx
->Exec
, ( nearval
, farval
));
1845 static void GLAPIENTRY
save_Disable( GLenum cap
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1854 if (ctx
->ExecuteFlag
) {
1855 CALL_Disable(ctx
->Exec
, ( cap
));
1860 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1862 GET_CURRENT_CONTEXT(ctx
);
1864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1865 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1869 if (ctx
->ExecuteFlag
) {
1870 CALL_DrawBuffer(ctx
->Exec
, ( mode
));
1875 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1876 GLenum format
, GLenum type
,
1877 const GLvoid
*pixels
)
1879 GET_CURRENT_CONTEXT(ctx
);
1880 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1881 pixels
, &ctx
->Unpack
);
1883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1884 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1895 if (ctx
->ExecuteFlag
) {
1896 CALL_DrawPixels(ctx
->Exec
, ( width
, height
, format
, type
, pixels
));
1902 static void GLAPIENTRY
save_Enable( GLenum cap
)
1904 GET_CURRENT_CONTEXT(ctx
);
1906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1907 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1911 if (ctx
->ExecuteFlag
) {
1912 CALL_Enable(ctx
->Exec
, ( cap
));
1918 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1920 GET_CURRENT_CONTEXT(ctx
);
1922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1923 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1929 if (ctx
->ExecuteFlag
) {
1930 CALL_EvalMesh1(ctx
->Exec
, ( mode
, i1
, i2
));
1935 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1937 GET_CURRENT_CONTEXT(ctx
);
1939 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1940 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1948 if (ctx
->ExecuteFlag
) {
1949 CALL_EvalMesh2(ctx
->Exec
, ( mode
, i1
, i2
, j1
, j2
));
1956 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1958 GET_CURRENT_CONTEXT(ctx
);
1960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1961 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1969 if (ctx
->ExecuteFlag
) {
1970 CALL_Fogfv(ctx
->Exec
, ( pname
, params
));
1975 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1977 save_Fogfv(pname
, ¶m
);
1981 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1986 case GL_FOG_DENSITY
:
1990 p
[0] = (GLfloat
) *params
;
1993 p
[0] = INT_TO_FLOAT( params
[0] );
1994 p
[1] = INT_TO_FLOAT( params
[1] );
1995 p
[2] = INT_TO_FLOAT( params
[2] );
1996 p
[3] = INT_TO_FLOAT( params
[3] );
1999 /* Error will be caught later in gl_Fogfv */
2002 save_Fogfv(pname
, p
);
2006 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
2008 save_Fogiv(pname
, ¶m
);
2012 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
2014 GET_CURRENT_CONTEXT(ctx
);
2016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2017 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
2021 if (ctx
->ExecuteFlag
) {
2022 CALL_FrontFace(ctx
->Exec
, ( mode
));
2027 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
2028 GLdouble bottom
, GLdouble top
,
2029 GLdouble nearval
, GLdouble farval
)
2031 GET_CURRENT_CONTEXT(ctx
);
2033 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2034 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
2036 n
[1].f
= (GLfloat
) left
;
2037 n
[2].f
= (GLfloat
) right
;
2038 n
[3].f
= (GLfloat
) bottom
;
2039 n
[4].f
= (GLfloat
) top
;
2040 n
[5].f
= (GLfloat
) nearval
;
2041 n
[6].f
= (GLfloat
) farval
;
2043 if (ctx
->ExecuteFlag
) {
2044 CALL_Frustum(ctx
->Exec
, ( left
, right
, bottom
, top
, nearval
, farval
));
2049 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2051 GET_CURRENT_CONTEXT(ctx
);
2053 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2054 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2059 if (ctx
->ExecuteFlag
) {
2060 CALL_Hint(ctx
->Exec
, ( target
, mode
));
2065 static void GLAPIENTRY
2066 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2068 GET_CURRENT_CONTEXT(ctx
);
2071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2072 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2076 n
[3].e
= internalFormat
;
2079 if (ctx
->ExecuteFlag
) {
2080 CALL_Histogram(ctx
->Exec
, ( target
, width
, internalFormat
, sink
));
2085 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2087 GET_CURRENT_CONTEXT(ctx
);
2089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2090 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2094 if (ctx
->ExecuteFlag
) {
2095 CALL_IndexMask(ctx
->Exec
, ( mask
));
2100 static void GLAPIENTRY
save_InitNames( void )
2102 GET_CURRENT_CONTEXT(ctx
);
2103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2104 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2105 if (ctx
->ExecuteFlag
) {
2106 CALL_InitNames(ctx
->Exec
, ());
2111 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2113 GET_CURRENT_CONTEXT(ctx
);
2115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2116 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2134 case GL_SPOT_DIRECTION
:
2137 case GL_SPOT_EXPONENT
:
2140 case GL_SPOT_CUTOFF
:
2143 case GL_CONSTANT_ATTENUATION
:
2146 case GL_LINEAR_ATTENUATION
:
2149 case GL_QUADRATIC_ATTENUATION
:
2155 for (i
= 0; i
< nParams
; i
++) {
2156 n
[3+i
].f
= params
[i
];
2159 if (ctx
->ExecuteFlag
) {
2160 CALL_Lightfv(ctx
->Exec
, ( light
, pname
, params
));
2165 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2167 save_Lightfv(light
, pname
, ¶ms
);
2171 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2178 fparam
[0] = INT_TO_FLOAT( params
[0] );
2179 fparam
[1] = INT_TO_FLOAT( params
[1] );
2180 fparam
[2] = INT_TO_FLOAT( params
[2] );
2181 fparam
[3] = INT_TO_FLOAT( params
[3] );
2184 fparam
[0] = (GLfloat
) params
[0];
2185 fparam
[1] = (GLfloat
) params
[1];
2186 fparam
[2] = (GLfloat
) params
[2];
2187 fparam
[3] = (GLfloat
) params
[3];
2189 case GL_SPOT_DIRECTION
:
2190 fparam
[0] = (GLfloat
) params
[0];
2191 fparam
[1] = (GLfloat
) params
[1];
2192 fparam
[2] = (GLfloat
) params
[2];
2194 case GL_SPOT_EXPONENT
:
2195 case GL_SPOT_CUTOFF
:
2196 case GL_CONSTANT_ATTENUATION
:
2197 case GL_LINEAR_ATTENUATION
:
2198 case GL_QUADRATIC_ATTENUATION
:
2199 fparam
[0] = (GLfloat
) params
[0];
2202 /* error will be caught later in gl_Lightfv */
2205 save_Lightfv( light
, pname
, fparam
);
2209 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2211 save_Lightiv( light
, pname
, ¶m
);
2215 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2217 GET_CURRENT_CONTEXT(ctx
);
2219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2220 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2228 if (ctx
->ExecuteFlag
) {
2229 CALL_LightModelfv(ctx
->Exec
, ( pname
, params
));
2234 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2236 save_LightModelfv(pname
, ¶m
);
2240 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2244 case GL_LIGHT_MODEL_AMBIENT
:
2245 fparam
[0] = INT_TO_FLOAT( params
[0] );
2246 fparam
[1] = INT_TO_FLOAT( params
[1] );
2247 fparam
[2] = INT_TO_FLOAT( params
[2] );
2248 fparam
[3] = INT_TO_FLOAT( params
[3] );
2250 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2251 case GL_LIGHT_MODEL_TWO_SIDE
:
2252 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2253 fparam
[0] = (GLfloat
) params
[0];
2256 /* Error will be caught later in gl_LightModelfv */
2259 save_LightModelfv(pname
, fparam
);
2263 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2265 save_LightModeliv(pname
, ¶m
);
2269 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2271 GET_CURRENT_CONTEXT(ctx
);
2273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2274 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2279 if (ctx
->ExecuteFlag
) {
2280 CALL_LineStipple(ctx
->Exec
, ( factor
, pattern
));
2285 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2287 GET_CURRENT_CONTEXT(ctx
);
2289 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2290 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2294 if (ctx
->ExecuteFlag
) {
2295 CALL_LineWidth(ctx
->Exec
, ( width
));
2300 static void GLAPIENTRY
save_ListBase( GLuint base
)
2302 GET_CURRENT_CONTEXT(ctx
);
2304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2305 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2309 if (ctx
->ExecuteFlag
) {
2310 CALL_ListBase(ctx
->Exec
, ( base
));
2315 static void GLAPIENTRY
save_LoadIdentity( void )
2317 GET_CURRENT_CONTEXT(ctx
);
2318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2319 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2320 if (ctx
->ExecuteFlag
) {
2321 CALL_LoadIdentity(ctx
->Exec
, ());
2326 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2328 GET_CURRENT_CONTEXT(ctx
);
2330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2331 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2334 for (i
=0;i
<16;i
++) {
2338 if (ctx
->ExecuteFlag
) {
2339 CALL_LoadMatrixf(ctx
->Exec
, ( m
));
2344 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2348 for (i
= 0; i
< 16; i
++) {
2349 f
[i
] = (GLfloat
) m
[i
];
2351 save_LoadMatrixf(f
);
2355 static void GLAPIENTRY
save_LoadName( GLuint name
)
2357 GET_CURRENT_CONTEXT(ctx
);
2359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2360 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2364 if (ctx
->ExecuteFlag
) {
2365 CALL_LoadName(ctx
->Exec
, ( name
));
2370 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2372 GET_CURRENT_CONTEXT(ctx
);
2374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2375 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2379 if (ctx
->ExecuteFlag
) {
2380 CALL_LogicOp(ctx
->Exec
, ( opcode
));
2385 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2386 GLint order
, const GLdouble
*points
)
2388 GET_CURRENT_CONTEXT(ctx
);
2390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2391 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2393 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2395 n
[2].f
= (GLfloat
) u1
;
2396 n
[3].f
= (GLfloat
) u2
;
2397 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2399 n
[6].data
= (void *) pnts
;
2401 if (ctx
->ExecuteFlag
) {
2402 CALL_Map1d(ctx
->Exec
, ( target
, u1
, u2
, stride
, order
, points
));
2406 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2407 GLint order
, const GLfloat
*points
)
2409 GET_CURRENT_CONTEXT(ctx
);
2411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2412 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2414 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2418 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2420 n
[6].data
= (void *) pnts
;
2422 if (ctx
->ExecuteFlag
) {
2423 CALL_Map1f(ctx
->Exec
, ( target
, u1
, u2
, stride
, order
, points
));
2428 static void GLAPIENTRY
save_Map2d( GLenum target
,
2429 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2430 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2431 const GLdouble
*points
)
2433 GET_CURRENT_CONTEXT(ctx
);
2435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2436 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2438 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2439 vstride
, vorder
, points
);
2441 n
[2].f
= (GLfloat
) u1
;
2442 n
[3].f
= (GLfloat
) u2
;
2443 n
[4].f
= (GLfloat
) v1
;
2444 n
[5].f
= (GLfloat
) v2
;
2445 /* XXX verify these strides are correct */
2446 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2447 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2450 n
[10].data
= (void *) pnts
;
2452 if (ctx
->ExecuteFlag
) {
2453 CALL_Map2d(ctx
->Exec
, ( target
,
2454 u1
, u2
, ustride
, uorder
,
2455 v1
, v2
, vstride
, vorder
, points
));
2460 static void GLAPIENTRY
save_Map2f( GLenum target
,
2461 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2462 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2463 const GLfloat
*points
)
2465 GET_CURRENT_CONTEXT(ctx
);
2467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2468 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2470 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2471 vstride
, vorder
, points
);
2477 /* XXX verify these strides are correct */
2478 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2479 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2482 n
[10].data
= (void *) pnts
;
2484 if (ctx
->ExecuteFlag
) {
2485 CALL_Map2f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
2486 v1
, v2
, vstride
, vorder
, points
));
2491 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2493 GET_CURRENT_CONTEXT(ctx
);
2495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2496 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2502 if (ctx
->ExecuteFlag
) {
2503 CALL_MapGrid1f(ctx
->Exec
, ( un
, u1
, u2
));
2508 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2510 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2514 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2515 GLint vn
, GLfloat v1
, GLfloat v2
)
2517 GET_CURRENT_CONTEXT(ctx
);
2519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2520 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2529 if (ctx
->ExecuteFlag
) {
2530 CALL_MapGrid2f(ctx
->Exec
, ( un
, u1
, u2
, vn
, v1
, v2
));
2536 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2537 GLint vn
, GLdouble v1
, GLdouble v2
)
2539 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2540 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2544 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2546 GET_CURRENT_CONTEXT(ctx
);
2548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2549 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2553 if (ctx
->ExecuteFlag
) {
2554 CALL_MatrixMode(ctx
->Exec
, ( mode
));
2559 static void GLAPIENTRY
2560 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2562 GET_CURRENT_CONTEXT(ctx
);
2565 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2566 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2569 n
[2].e
= internalFormat
;
2572 if (ctx
->ExecuteFlag
) {
2573 CALL_Minmax(ctx
->Exec
, ( target
, internalFormat
, sink
));
2578 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2580 GET_CURRENT_CONTEXT(ctx
);
2582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2583 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2586 for (i
=0;i
<16;i
++) {
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_MultMatrixf(ctx
->Exec
, ( m
));
2596 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2600 for (i
= 0; i
< 16; i
++) {
2601 f
[i
] = (GLfloat
) m
[i
];
2603 save_MultMatrixf(f
);
2607 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2609 GET_CURRENT_CONTEXT(ctx
);
2610 /* It's an error to call this function while building a display list */
2611 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2618 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2619 GLdouble bottom
, GLdouble top
,
2620 GLdouble nearval
, GLdouble farval
)
2622 GET_CURRENT_CONTEXT(ctx
);
2624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2625 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2627 n
[1].f
= (GLfloat
) left
;
2628 n
[2].f
= (GLfloat
) right
;
2629 n
[3].f
= (GLfloat
) bottom
;
2630 n
[4].f
= (GLfloat
) top
;
2631 n
[5].f
= (GLfloat
) nearval
;
2632 n
[6].f
= (GLfloat
) farval
;
2634 if (ctx
->ExecuteFlag
) {
2635 CALL_Ortho(ctx
->Exec
, ( left
, right
, bottom
, top
, nearval
, farval
));
2640 static void GLAPIENTRY
2641 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2643 GET_CURRENT_CONTEXT(ctx
);
2645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2646 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2650 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2651 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2653 if (ctx
->ExecuteFlag
) {
2654 CALL_PixelMapfv(ctx
->Exec
, ( map
, mapsize
, values
));
2659 static void GLAPIENTRY
2660 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2662 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2664 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2665 for (i
=0;i
<mapsize
;i
++) {
2666 fvalues
[i
] = (GLfloat
) values
[i
];
2670 for (i
=0;i
<mapsize
;i
++) {
2671 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2674 save_PixelMapfv(map
, mapsize
, fvalues
);
2678 static void GLAPIENTRY
2679 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2681 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2683 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2684 for (i
=0;i
<mapsize
;i
++) {
2685 fvalues
[i
] = (GLfloat
) values
[i
];
2689 for (i
=0;i
<mapsize
;i
++) {
2690 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2693 save_PixelMapfv(map
, mapsize
, fvalues
);
2697 static void GLAPIENTRY
2698 save_PixelTransferf( GLenum pname
, GLfloat param
)
2700 GET_CURRENT_CONTEXT(ctx
);
2702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2703 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2708 if (ctx
->ExecuteFlag
) {
2709 CALL_PixelTransferf(ctx
->Exec
, ( pname
, param
));
2714 static void GLAPIENTRY
2715 save_PixelTransferi( GLenum pname
, GLint param
)
2717 save_PixelTransferf( pname
, (GLfloat
) param
);
2721 static void GLAPIENTRY
2722 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2724 GET_CURRENT_CONTEXT(ctx
);
2726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2727 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2732 if (ctx
->ExecuteFlag
) {
2733 CALL_PixelZoom(ctx
->Exec
, ( xfactor
, yfactor
));
2738 static void GLAPIENTRY
2739 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2741 GET_CURRENT_CONTEXT(ctx
);
2743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2744 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2751 if (ctx
->ExecuteFlag
) {
2752 CALL_PointParameterfvEXT(ctx
->Exec
, ( pname
, params
));
2757 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2759 save_PointParameterfvEXT(pname
, ¶m
);
2762 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2764 GLfloat p
= (GLfloat
) param
;
2765 save_PointParameterfvEXT(pname
, &p
);
2768 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2770 GLfloat p
= (GLfloat
) param
[0];
2771 save_PointParameterfvEXT(pname
, &p
);
2775 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2777 GET_CURRENT_CONTEXT(ctx
);
2779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2780 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2784 if (ctx
->ExecuteFlag
) {
2785 CALL_PointSize(ctx
->Exec
, ( size
));
2790 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2792 GET_CURRENT_CONTEXT(ctx
);
2794 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2795 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2800 if (ctx
->ExecuteFlag
) {
2801 CALL_PolygonMode(ctx
->Exec
, ( face
, mode
));
2807 * Polygon stipple must have been upacked already!
2809 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2811 GET_CURRENT_CONTEXT(ctx
);
2813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2814 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2817 n
[1].data
= MALLOC( 32 * 4 );
2818 data
= n
[1].data
; /* This needed for Acorn compiler */
2819 MEMCPY( data
, pattern
, 32 * 4 );
2821 if (ctx
->ExecuteFlag
) {
2822 CALL_PolygonStipple(ctx
->Exec
, ( (GLubyte
*) pattern
));
2827 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2829 GET_CURRENT_CONTEXT(ctx
);
2831 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2832 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2837 if (ctx
->ExecuteFlag
) {
2838 CALL_PolygonOffset(ctx
->Exec
, ( factor
, units
));
2843 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2845 GET_CURRENT_CONTEXT(ctx
);
2846 /* XXX mult by DepthMaxF here??? */
2847 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2851 static void GLAPIENTRY
save_PopAttrib( void )
2853 GET_CURRENT_CONTEXT(ctx
);
2854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2855 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2856 if (ctx
->ExecuteFlag
) {
2857 CALL_PopAttrib(ctx
->Exec
, ());
2862 static void GLAPIENTRY
save_PopMatrix( void )
2864 GET_CURRENT_CONTEXT(ctx
);
2865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2866 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2867 if (ctx
->ExecuteFlag
) {
2868 CALL_PopMatrix(ctx
->Exec
, ());
2873 static void GLAPIENTRY
save_PopName( void )
2875 GET_CURRENT_CONTEXT(ctx
);
2876 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2877 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2878 if (ctx
->ExecuteFlag
) {
2879 CALL_PopName(ctx
->Exec
, ());
2884 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2885 const GLclampf
*priorities
)
2887 GET_CURRENT_CONTEXT(ctx
);
2889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2891 for (i
=0;i
<num
;i
++) {
2893 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2895 n
[1].ui
= textures
[i
];
2896 n
[2].f
= priorities
[i
];
2899 if (ctx
->ExecuteFlag
) {
2900 CALL_PrioritizeTextures(ctx
->Exec
, ( num
, textures
, priorities
));
2905 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2907 GET_CURRENT_CONTEXT(ctx
);
2909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2910 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2914 if (ctx
->ExecuteFlag
) {
2915 CALL_PushAttrib(ctx
->Exec
, ( mask
));
2920 static void GLAPIENTRY
save_PushMatrix( void )
2922 GET_CURRENT_CONTEXT(ctx
);
2923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2924 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2925 if (ctx
->ExecuteFlag
) {
2926 CALL_PushMatrix(ctx
->Exec
, ());
2931 static void GLAPIENTRY
save_PushName( GLuint name
)
2933 GET_CURRENT_CONTEXT(ctx
);
2935 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2936 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2940 if (ctx
->ExecuteFlag
) {
2941 CALL_PushName(ctx
->Exec
, ( name
));
2946 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2948 GET_CURRENT_CONTEXT(ctx
);
2950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2958 if (ctx
->ExecuteFlag
) {
2959 CALL_RasterPos4f(ctx
->Exec
, ( x
, y
, z
, w
));
2963 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2965 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2968 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2970 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2973 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2975 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2978 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2980 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2983 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2985 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2988 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2990 save_RasterPos4f(x
, y
, z
, 1.0F
);
2993 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2995 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2998 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3000 save_RasterPos4f(x
, y
, z
, 1.0F
);
3003 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3005 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3008 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3010 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3013 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3015 save_RasterPos4f(x
, y
, z
, w
);
3018 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
3020 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3023 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
3025 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3028 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
3030 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3033 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
3035 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3038 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3040 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3043 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3045 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3048 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3050 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3053 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3055 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3058 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3060 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3061 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3064 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3066 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3069 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3071 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3072 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3075 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3077 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3081 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3083 GET_CURRENT_CONTEXT(ctx
);
3085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3086 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3090 if (ctx
->ExecuteFlag
) {
3091 CALL_PassThrough(ctx
->Exec
, ( token
));
3096 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3098 GET_CURRENT_CONTEXT(ctx
);
3100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3101 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3105 if (ctx
->ExecuteFlag
) {
3106 CALL_ReadBuffer(ctx
->Exec
, ( mode
));
3111 static void GLAPIENTRY
3112 save_ResetHistogram(GLenum target
)
3114 GET_CURRENT_CONTEXT(ctx
);
3116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3117 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3121 if (ctx
->ExecuteFlag
) {
3122 CALL_ResetHistogram(ctx
->Exec
, ( target
));
3127 static void GLAPIENTRY
3128 save_ResetMinmax(GLenum target
)
3130 GET_CURRENT_CONTEXT(ctx
);
3132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3133 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3137 if (ctx
->ExecuteFlag
) {
3138 CALL_ResetMinmax(ctx
->Exec
, ( target
));
3143 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3145 GET_CURRENT_CONTEXT(ctx
);
3147 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3148 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3155 if (ctx
->ExecuteFlag
) {
3156 CALL_Rotatef(ctx
->Exec
, ( angle
, x
, y
, z
));
3161 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3163 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3167 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3169 GET_CURRENT_CONTEXT(ctx
);
3171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3172 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3178 if (ctx
->ExecuteFlag
) {
3179 CALL_Scalef(ctx
->Exec
, ( x
, y
, z
));
3184 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3186 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3190 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3192 GET_CURRENT_CONTEXT(ctx
);
3194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3195 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3202 if (ctx
->ExecuteFlag
) {
3203 CALL_Scissor(ctx
->Exec
, ( x
, y
, width
, height
));
3208 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3210 GET_CURRENT_CONTEXT(ctx
);
3212 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3213 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3217 if (ctx
->ExecuteFlag
) {
3218 CALL_ShadeModel(ctx
->Exec
, ( mode
));
3223 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3225 GET_CURRENT_CONTEXT(ctx
);
3227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3228 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3234 if (ctx
->ExecuteFlag
) {
3235 CALL_StencilFunc(ctx
->Exec
, ( func
, ref
, mask
));
3240 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3242 GET_CURRENT_CONTEXT(ctx
);
3244 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3245 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3249 if (ctx
->ExecuteFlag
) {
3250 CALL_StencilMask(ctx
->Exec
, ( mask
));
3255 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3257 GET_CURRENT_CONTEXT(ctx
);
3259 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3260 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3266 if (ctx
->ExecuteFlag
) {
3267 CALL_StencilOp(ctx
->Exec
, ( fail
, zfail
, zpass
));
3272 static void GLAPIENTRY
3273 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3275 GET_CURRENT_CONTEXT(ctx
);
3277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3278 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3285 if (ctx
->ExecuteFlag
) {
3286 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3291 static void GLAPIENTRY
3292 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3294 GET_CURRENT_CONTEXT(ctx
);
3296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3297 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3302 if (ctx
->ExecuteFlag
) {
3303 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3308 static void GLAPIENTRY
3309 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3311 GET_CURRENT_CONTEXT(ctx
);
3313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3314 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4 );
3321 if (ctx
->ExecuteFlag
) {
3322 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3327 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3329 GET_CURRENT_CONTEXT(ctx
);
3331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3332 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3336 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3344 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3347 if (ctx
->ExecuteFlag
) {
3348 CALL_TexEnvfv(ctx
->Exec
, ( target
, pname
, params
));
3353 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3355 save_TexEnvfv( target
, pname
, ¶m
);
3359 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3362 p
[0] = (GLfloat
) param
;
3363 p
[1] = p
[2] = p
[3] = 0.0;
3364 save_TexEnvfv( target
, pname
, p
);
3368 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3371 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3372 p
[0] = INT_TO_FLOAT( param
[0] );
3373 p
[1] = INT_TO_FLOAT( param
[1] );
3374 p
[2] = INT_TO_FLOAT( param
[2] );
3375 p
[3] = INT_TO_FLOAT( param
[3] );
3378 p
[0] = (GLfloat
) param
[0];
3379 p
[1] = p
[2] = p
[3] = 0.0F
;
3381 save_TexEnvfv( target
, pname
, p
);
3385 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3387 GET_CURRENT_CONTEXT(ctx
);
3389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3390 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3399 if (ctx
->ExecuteFlag
) {
3400 CALL_TexGenfv(ctx
->Exec
, ( coord
, pname
, params
));
3405 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3408 p
[0] = (GLfloat
) params
[0];
3409 p
[1] = (GLfloat
) params
[1];
3410 p
[2] = (GLfloat
) params
[2];
3411 p
[3] = (GLfloat
) params
[3];
3412 save_TexGenfv(coord
, pname
, p
);
3416 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3418 GLfloat p
= (GLfloat
) param
;
3419 save_TexGenfv( coord
, pname
, &p
);
3423 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3426 p
[0] = (GLfloat
) params
[0];
3427 p
[1] = (GLfloat
) params
[1];
3428 p
[2] = (GLfloat
) params
[2];
3429 p
[3] = (GLfloat
) params
[3];
3430 save_TexGenfv( coord
, pname
, p
);
3434 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3436 save_TexGenfv(coord
, pname
, ¶m
);
3440 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3442 save_TexGeniv( coord
, pname
, ¶m
);
3446 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3447 GLenum pname
, const GLfloat
*params
)
3449 GET_CURRENT_CONTEXT(ctx
);
3451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3452 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3461 if (ctx
->ExecuteFlag
) {
3462 CALL_TexParameterfv(ctx
->Exec
, ( target
, pname
, params
));
3467 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3469 save_TexParameterfv(target
, pname
, ¶m
);
3473 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3476 fparam
[0] = (GLfloat
) param
;
3477 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3478 save_TexParameterfv(target
, pname
, fparam
);
3482 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3485 fparam
[0] = (GLfloat
) params
[0];
3486 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3487 save_TexParameterfv(target
, pname
, fparam
);
3491 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3492 GLint level
, GLint components
,
3493 GLsizei width
, GLint border
,
3494 GLenum format
, GLenum type
,
3495 const GLvoid
*pixels
)
3497 GET_CURRENT_CONTEXT(ctx
);
3498 if (target
== GL_PROXY_TEXTURE_1D
) {
3499 /* don't compile, execute immediately */
3500 CALL_TexImage1D(ctx
->Exec
, ( target
, level
, components
, width
,
3501 border
, format
, type
, pixels
));
3504 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3505 pixels
, &ctx
->Unpack
);
3507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3508 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3512 n
[3].i
= components
;
3513 n
[4].i
= (GLint
) width
;
3522 if (ctx
->ExecuteFlag
) {
3523 CALL_TexImage1D(ctx
->Exec
, ( target
, level
, components
, width
,
3524 border
, format
, type
, pixels
));
3530 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3531 GLint level
, GLint components
,
3532 GLsizei width
, GLsizei height
, GLint border
,
3533 GLenum format
, GLenum type
,
3534 const GLvoid
*pixels
)
3536 GET_CURRENT_CONTEXT(ctx
);
3537 if (target
== GL_PROXY_TEXTURE_2D
) {
3538 /* don't compile, execute immediately */
3539 CALL_TexImage2D(ctx
->Exec
, ( target
, level
, components
, width
,
3540 height
, border
, format
, type
, pixels
));
3543 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3544 pixels
, &ctx
->Unpack
);
3546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3547 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3551 n
[3].i
= components
;
3552 n
[4].i
= (GLint
) width
;
3553 n
[5].i
= (GLint
) height
;
3562 if (ctx
->ExecuteFlag
) {
3563 CALL_TexImage2D(ctx
->Exec
, ( target
, level
, components
, width
,
3564 height
, border
, format
, type
, pixels
));
3570 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3571 GLint level
, GLint internalFormat
,
3572 GLsizei width
, GLsizei height
, GLsizei depth
,
3574 GLenum format
, GLenum type
,
3575 const GLvoid
*pixels
)
3577 GET_CURRENT_CONTEXT(ctx
);
3578 if (target
== GL_PROXY_TEXTURE_3D
) {
3579 /* don't compile, execute immediately */
3580 CALL_TexImage3D(ctx
->Exec
, ( target
, level
, internalFormat
, width
,
3581 height
, depth
, border
, format
, type
, pixels
));
3585 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3586 pixels
, &ctx
->Unpack
);
3587 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3588 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3592 n
[3].i
= (GLint
) internalFormat
;
3593 n
[4].i
= (GLint
) width
;
3594 n
[5].i
= (GLint
) height
;
3595 n
[6].i
= (GLint
) depth
;
3604 if (ctx
->ExecuteFlag
) {
3605 CALL_TexImage3D(ctx
->Exec
, ( target
, level
, internalFormat
, width
,
3606 height
, depth
, border
, format
, type
, pixels
));
3612 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3613 GLsizei width
, GLenum format
, GLenum type
,
3614 const GLvoid
*pixels
)
3616 GET_CURRENT_CONTEXT(ctx
);
3618 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3619 pixels
, &ctx
->Unpack
);
3620 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3621 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3626 n
[4].i
= (GLint
) width
;
3634 if (ctx
->ExecuteFlag
) {
3635 CALL_TexSubImage1D(ctx
->Exec
, ( target
, level
, xoffset
, width
,
3636 format
, type
, pixels
));
3641 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3642 GLint xoffset
, GLint yoffset
,
3643 GLsizei width
, GLsizei height
,
3644 GLenum format
, GLenum type
,
3645 const GLvoid
*pixels
)
3647 GET_CURRENT_CONTEXT(ctx
);
3649 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3650 pixels
, &ctx
->Unpack
);
3651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3652 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3658 n
[5].i
= (GLint
) width
;
3659 n
[6].i
= (GLint
) height
;
3667 if (ctx
->ExecuteFlag
) {
3668 CALL_TexSubImage2D(ctx
->Exec
, ( target
, level
, xoffset
, yoffset
,
3669 width
, height
, format
, type
, pixels
));
3674 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3675 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3676 GLsizei width
, GLsizei height
, GLsizei depth
,
3677 GLenum format
, GLenum type
,
3678 const GLvoid
*pixels
)
3680 GET_CURRENT_CONTEXT(ctx
);
3682 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3683 pixels
, &ctx
->Unpack
);
3684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3685 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3692 n
[6].i
= (GLint
) width
;
3693 n
[7].i
= (GLint
) height
;
3694 n
[8].i
= (GLint
) depth
;
3702 if (ctx
->ExecuteFlag
) {
3703 CALL_TexSubImage3D(ctx
->Exec
, ( target
, level
,
3704 xoffset
, yoffset
, zoffset
,
3705 width
, height
, depth
, format
, type
, pixels
));
3710 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3712 GET_CURRENT_CONTEXT(ctx
);
3714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3715 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3721 if (ctx
->ExecuteFlag
) {
3722 CALL_Translatef(ctx
->Exec
, ( x
, y
, z
));
3727 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3729 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3734 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3736 GET_CURRENT_CONTEXT(ctx
);
3738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3739 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3743 n
[3].i
= (GLint
) width
;
3744 n
[4].i
= (GLint
) height
;
3746 if (ctx
->ExecuteFlag
) {
3747 CALL_Viewport(ctx
->Exec
, ( x
, y
, width
, height
));
3752 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3754 GET_CURRENT_CONTEXT(ctx
);
3756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3757 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3764 if (ctx
->ExecuteFlag
) {
3765 CALL_WindowPos4fMESA(ctx
->Exec
, ( x
, y
, z
, w
));
3769 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3771 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3774 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3776 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3779 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3781 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3784 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3786 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3789 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3791 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3794 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3796 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3799 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3801 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3804 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3806 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3809 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3811 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3814 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3816 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3819 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3821 save_WindowPos4fMESA(x
, y
, z
, w
);
3824 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3826 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3829 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3831 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3834 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3836 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3839 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3841 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3844 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3846 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3849 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3851 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3854 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3856 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3859 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3861 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3864 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3866 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3867 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3870 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3872 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3875 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3877 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3878 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3881 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3883 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3888 /* GL_ARB_multitexture */
3889 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3891 GET_CURRENT_CONTEXT(ctx
);
3893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3894 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3898 if (ctx
->ExecuteFlag
) {
3899 CALL_ActiveTextureARB(ctx
->Exec
, ( target
));
3904 /* GL_ARB_transpose_matrix */
3906 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3909 _math_transposefd(tm
, m
);
3910 save_LoadMatrixf(tm
);
3914 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3917 _math_transposef(tm
, m
);
3918 save_LoadMatrixf(tm
);
3922 static void GLAPIENTRY
3923 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3926 _math_transposefd(tm
, m
);
3927 save_MultMatrixf(tm
);
3931 static void GLAPIENTRY
3932 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3935 _math_transposef(tm
, m
);
3936 save_MultMatrixf(tm
);
3940 /* GL_ARB_texture_compression */
3941 static void GLAPIENTRY
3942 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3943 GLenum internalFormat
, GLsizei width
,
3944 GLint border
, GLsizei imageSize
,
3947 GET_CURRENT_CONTEXT(ctx
);
3948 if (target
== GL_PROXY_TEXTURE_1D
) {
3949 /* don't compile, execute immediately */
3950 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3951 width
, border
, imageSize
, data
));
3956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3957 /* make copy of image */
3958 image
= MALLOC(imageSize
);
3960 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3963 MEMCPY(image
, data
, imageSize
);
3964 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3968 n
[3].e
= internalFormat
;
3969 n
[4].i
= (GLint
) width
;
3977 if (ctx
->ExecuteFlag
) {
3978 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3979 width
, border
, imageSize
, data
));
3985 static void GLAPIENTRY
3986 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3987 GLenum internalFormat
, GLsizei width
,
3988 GLsizei height
, GLint border
, GLsizei imageSize
,
3991 GET_CURRENT_CONTEXT(ctx
);
3992 if (target
== GL_PROXY_TEXTURE_2D
) {
3993 /* don't compile, execute immediately */
3994 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3995 width
, height
, border
, imageSize
, data
));
4000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4001 /* make copy of image */
4002 image
= MALLOC(imageSize
);
4004 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4007 MEMCPY(image
, data
, imageSize
);
4008 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
4012 n
[3].e
= internalFormat
;
4013 n
[4].i
= (GLint
) width
;
4014 n
[5].i
= (GLint
) height
;
4022 if (ctx
->ExecuteFlag
) {
4023 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4024 width
, height
, border
, imageSize
, data
));
4030 static void GLAPIENTRY
4031 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4032 GLenum internalFormat
, GLsizei width
,
4033 GLsizei height
, GLsizei depth
, GLint border
,
4034 GLsizei imageSize
, const GLvoid
*data
)
4036 GET_CURRENT_CONTEXT(ctx
);
4037 if (target
== GL_PROXY_TEXTURE_3D
) {
4038 /* don't compile, execute immediately */
4039 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4040 width
, height
, depth
, border
, imageSize
, data
));
4045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4046 /* make copy of image */
4047 image
= MALLOC(imageSize
);
4049 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4052 MEMCPY(image
, data
, imageSize
);
4053 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
4057 n
[3].e
= internalFormat
;
4058 n
[4].i
= (GLint
) width
;
4059 n
[5].i
= (GLint
) height
;
4060 n
[6].i
= (GLint
) depth
;
4068 if (ctx
->ExecuteFlag
) {
4069 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4070 width
, height
, depth
, border
, imageSize
, data
));
4076 static void GLAPIENTRY
4077 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4078 GLsizei width
, GLenum format
,
4079 GLsizei imageSize
, const GLvoid
*data
)
4084 GET_CURRENT_CONTEXT(ctx
);
4085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4087 /* make copy of image */
4088 image
= MALLOC(imageSize
);
4090 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4093 MEMCPY(image
, data
, imageSize
);
4094 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4099 n
[4].i
= (GLint
) width
;
4107 if (ctx
->ExecuteFlag
) {
4108 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4109 width
, format
, imageSize
, data
));
4114 static void GLAPIENTRY
4115 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4116 GLint yoffset
, GLsizei width
, GLsizei height
,
4117 GLenum format
, GLsizei imageSize
,
4123 GET_CURRENT_CONTEXT(ctx
);
4124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4126 /* make copy of image */
4127 image
= MALLOC(imageSize
);
4129 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4132 MEMCPY(image
, data
, imageSize
);
4133 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4139 n
[5].i
= (GLint
) width
;
4140 n
[6].i
= (GLint
) height
;
4148 if (ctx
->ExecuteFlag
) {
4149 CALL_CompressedTexSubImage2DARB(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4150 width
, height
, format
, imageSize
, data
));
4155 static void GLAPIENTRY
4156 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4157 GLint yoffset
, GLint zoffset
, GLsizei width
,
4158 GLsizei height
, GLsizei depth
, GLenum format
,
4159 GLsizei imageSize
, const GLvoid
*data
)
4164 GET_CURRENT_CONTEXT(ctx
);
4165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4167 /* make copy of image */
4168 image
= MALLOC(imageSize
);
4170 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4173 MEMCPY(image
, data
, imageSize
);
4174 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4181 n
[6].i
= (GLint
) width
;
4182 n
[7].i
= (GLint
) height
;
4183 n
[8].i
= (GLint
) depth
;
4185 n
[10].i
= imageSize
;
4191 if (ctx
->ExecuteFlag
) {
4192 CALL_CompressedTexSubImage3DARB(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4193 zoffset
, width
, height
, depth
, format
, imageSize
, data
));
4198 /* GL_ARB_multisample */
4199 static void GLAPIENTRY
4200 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4202 GET_CURRENT_CONTEXT(ctx
);
4204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4205 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4210 if (ctx
->ExecuteFlag
) {
4211 CALL_SampleCoverageARB(ctx
->Exec
, ( value
, invert
));
4217 * GL_NV_vertex_program
4219 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4220 static void GLAPIENTRY
4221 save_BindProgramNV(GLenum target
, GLuint id
)
4223 GET_CURRENT_CONTEXT(ctx
);
4225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4226 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4231 if (ctx
->ExecuteFlag
) {
4232 CALL_BindProgramNV(ctx
->Exec
, ( target
, id
));
4235 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4237 #if FEATURE_NV_vertex_program
4238 static void GLAPIENTRY
4239 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4241 GET_CURRENT_CONTEXT(ctx
);
4243 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4244 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4253 if (ctx
->ExecuteFlag
) {
4254 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4259 static void GLAPIENTRY
4260 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4261 GLfloat x
, GLfloat y
,
4262 GLfloat z
, GLfloat w
)
4264 GET_CURRENT_CONTEXT(ctx
);
4266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4267 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4276 if (ctx
->ExecuteFlag
) {
4277 CALL_ProgramParameter4fNV(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4282 static void GLAPIENTRY
4283 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4285 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4286 params
[2], params
[3]);
4290 static void GLAPIENTRY
4291 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4292 GLdouble x
, GLdouble y
,
4293 GLdouble z
, GLdouble w
)
4295 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4296 (GLfloat
) z
, (GLfloat
) w
);
4300 static void GLAPIENTRY
4301 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4302 const GLdouble
*params
)
4304 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4305 (GLfloat
) params
[1], (GLfloat
) params
[2],
4306 (GLfloat
) params
[3]);
4310 static void GLAPIENTRY
4311 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4312 GLuint num
, const GLdouble
*params
)
4315 for (i
= 0; i
< num
; i
++) {
4316 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4321 static void GLAPIENTRY
4322 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4323 GLuint num
, const GLfloat
*params
)
4326 for (i
= 0; i
< num
; i
++) {
4327 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4332 static void GLAPIENTRY
4333 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4334 const GLubyte
*program
)
4336 GET_CURRENT_CONTEXT(ctx
);
4338 GLubyte
*programCopy
;
4340 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4342 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4345 _mesa_memcpy(programCopy
, program
, len
);
4347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4348 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4353 n
[4].data
= programCopy
;
4355 if (ctx
->ExecuteFlag
) {
4356 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4361 static void GLAPIENTRY
4362 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4364 GET_CURRENT_CONTEXT(ctx
);
4366 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4368 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4371 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4373 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4378 if (ctx
->ExecuteFlag
) {
4379 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4384 static void GLAPIENTRY
4385 save_TrackMatrixNV(GLenum target
, GLuint address
,
4386 GLenum matrix
, GLenum transform
)
4388 GET_CURRENT_CONTEXT(ctx
);
4390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4391 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4398 if (ctx
->ExecuteFlag
) {
4399 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4402 #endif /* FEATURE_NV_vertex_program */
4406 * GL_NV_fragment_program
4408 #if FEATURE_NV_fragment_program
4409 static void GLAPIENTRY
4410 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4411 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4413 GET_CURRENT_CONTEXT(ctx
);
4415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4416 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4425 if (ctx
->ExecuteFlag
) {
4426 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4431 static void GLAPIENTRY
4432 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4433 const GLfloat
*params
)
4435 GET_CURRENT_CONTEXT(ctx
);
4437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4438 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4447 if (ctx
->ExecuteFlag
) {
4448 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4453 static void GLAPIENTRY
4454 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4455 GLdouble x
, GLdouble y
,
4456 GLdouble z
, GLdouble w
)
4458 GET_CURRENT_CONTEXT(ctx
);
4460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4461 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4465 n
[3].f
= (GLfloat
) x
;
4466 n
[4].f
= (GLfloat
) y
;
4467 n
[5].f
= (GLfloat
) z
;
4468 n
[6].f
= (GLfloat
) w
;
4470 if (ctx
->ExecuteFlag
) {
4471 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4476 static void GLAPIENTRY
4477 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4478 const GLdouble
*params
)
4480 GET_CURRENT_CONTEXT(ctx
);
4482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4483 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4487 n
[3].f
= (GLfloat
) params
[0];
4488 n
[4].f
= (GLfloat
) params
[1];
4489 n
[5].f
= (GLfloat
) params
[2];
4490 n
[6].f
= (GLfloat
) params
[3];
4492 if (ctx
->ExecuteFlag
) {
4493 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4497 static void GLAPIENTRY
4498 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4499 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4501 GET_CURRENT_CONTEXT(ctx
);
4503 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4505 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4508 _mesa_memcpy(nameCopy
, name
, len
);
4510 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4511 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4515 n
[3].data
= nameCopy
;
4521 if (ctx
->ExecuteFlag
) {
4522 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4527 static void GLAPIENTRY
4528 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4531 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4535 static void GLAPIENTRY
4536 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4537 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4539 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4540 (GLfloat
) z
,(GLfloat
) w
);
4544 static void GLAPIENTRY
4545 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4548 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4549 (GLfloat
) v
[1], (GLfloat
) v
[2],
4553 #endif /* FEATURE_NV_fragment_program */
4557 /* GL_EXT_stencil_two_side */
4558 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4560 GET_CURRENT_CONTEXT(ctx
);
4562 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4563 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4567 if (ctx
->ExecuteFlag
) {
4568 CALL_ActiveStencilFaceEXT(ctx
->Exec
, ( face
));
4573 /* GL_EXT_depth_bounds_test */
4574 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4576 GET_CURRENT_CONTEXT(ctx
);
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4579 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2 );
4581 n
[1].f
= (GLfloat
) zmin
;
4582 n
[2].f
= (GLfloat
) zmax
;
4584 if (ctx
->ExecuteFlag
) {
4585 CALL_DepthBoundsEXT(ctx
->Exec
, ( zmin
, zmax
));
4591 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4593 static void GLAPIENTRY
4594 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4595 const GLvoid
*string
)
4597 GET_CURRENT_CONTEXT(ctx
);
4599 GLubyte
*programCopy
;
4601 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4603 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4606 _mesa_memcpy(programCopy
, string
, len
);
4608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4609 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4614 n
[4].data
= programCopy
;
4616 if (ctx
->ExecuteFlag
) {
4617 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4622 static void GLAPIENTRY
4623 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4624 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4626 GET_CURRENT_CONTEXT(ctx
);
4628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4629 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4638 if (ctx
->ExecuteFlag
) {
4639 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, ( target
, index
, x
, y
, z
, w
));
4644 static void GLAPIENTRY
4645 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4646 const GLfloat
*params
)
4648 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4649 params
[2], params
[3]);
4653 static void GLAPIENTRY
4654 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4655 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4657 save_ProgramEnvParameter4fARB(target
, index
,
4665 static void GLAPIENTRY
4666 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4667 const GLdouble
*params
)
4669 save_ProgramEnvParameter4fARB(target
, index
,
4670 (GLfloat
) params
[0],
4671 (GLfloat
) params
[1],
4672 (GLfloat
) params
[2],
4673 (GLfloat
) params
[3]);
4676 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4679 #ifdef FEATURE_ARB_occlusion_query
4681 static void GLAPIENTRY
4682 save_BeginQueryARB(GLenum target
, GLuint id
)
4684 GET_CURRENT_CONTEXT(ctx
);
4686 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4687 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN_QUERY_ARB
, 2 );
4692 if (ctx
->ExecuteFlag
) {
4693 CALL_BeginQueryARB(ctx
->Exec
, ( target
, id
));
4698 static void GLAPIENTRY
4699 save_EndQueryARB(GLenum target
)
4701 GET_CURRENT_CONTEXT(ctx
);
4703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4704 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_END_QUERY_ARB
, 1 );
4708 if (ctx
->ExecuteFlag
) {
4709 CALL_EndQueryARB(ctx
->Exec
, ( target
));
4713 #endif /* FEATURE_ARB_occlusion_query */
4716 static void GLAPIENTRY
4717 save_DrawBuffersARB(GLsizei count
, const GLenum
*buffers
)
4719 GET_CURRENT_CONTEXT(ctx
);
4721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4722 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4726 if (count
> MAX_DRAW_BUFFERS
)
4727 count
= MAX_DRAW_BUFFERS
;
4728 for (i
= 0; i
< count
; i
++) {
4729 n
[2 + i
].e
= buffers
[i
];
4732 if (ctx
->ExecuteFlag
) {
4733 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4737 #if FEATURE_ATI_fragment_shader
4738 static void GLAPIENTRY
4739 save_BindFragmentShaderATI(GLuint id
)
4741 GET_CURRENT_CONTEXT(ctx
);
4744 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4748 if (ctx
->ExecuteFlag
) {
4749 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4753 static void GLAPIENTRY
4754 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4756 GET_CURRENT_CONTEXT(ctx
);
4759 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4767 if (ctx
->ExecuteFlag
) {
4768 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4773 static void save_Attr1fNV( GLenum attr
, GLfloat x
)
4775 GET_CURRENT_CONTEXT(ctx
);
4777 SAVE_FLUSH_VERTICES( ctx
);
4778 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F_NV
, 2 );
4784 ASSERT(attr
< VERT_ATTRIB_MAX
);
4785 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4786 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4788 if (ctx
->ExecuteFlag
) {
4789 CALL_VertexAttrib1fNV(ctx
->Exec
, ( attr
, x
));
4793 static void save_Attr2fNV( GLenum attr
, GLfloat x
, GLfloat y
)
4795 GET_CURRENT_CONTEXT(ctx
);
4797 SAVE_FLUSH_VERTICES( ctx
);
4798 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F_NV
, 3 );
4805 ASSERT(attr
< VERT_ATTRIB_MAX
);
4806 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4807 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4809 if (ctx
->ExecuteFlag
) {
4810 CALL_VertexAttrib2fNV(ctx
->Exec
, ( attr
, x
, y
));
4814 static void save_Attr3fNV( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4816 GET_CURRENT_CONTEXT(ctx
);
4818 SAVE_FLUSH_VERTICES( ctx
);
4819 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F_NV
, 4 );
4827 ASSERT(attr
< VERT_ATTRIB_MAX
);
4828 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4829 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4831 if (ctx
->ExecuteFlag
) {
4832 CALL_VertexAttrib3fNV(ctx
->Exec
, ( attr
, x
, y
, z
));
4836 static void save_Attr4fNV( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4839 GET_CURRENT_CONTEXT(ctx
);
4841 SAVE_FLUSH_VERTICES( ctx
);
4842 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F_NV
, 5 );
4851 ASSERT(attr
< VERT_ATTRIB_MAX
);
4852 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4853 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4855 if (ctx
->ExecuteFlag
) {
4856 CALL_VertexAttrib4fNV(ctx
->Exec
, ( attr
, x
, y
, z
, w
));
4861 static void save_Attr1fARB( GLenum attr
, GLfloat x
)
4863 GET_CURRENT_CONTEXT(ctx
);
4865 SAVE_FLUSH_VERTICES( ctx
);
4866 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F_ARB
, 2 );
4872 ASSERT(attr
< VERT_ATTRIB_MAX
);
4873 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4874 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4876 if (ctx
->ExecuteFlag
) {
4877 CALL_VertexAttrib1fARB(ctx
->Exec
, ( attr
, x
));
4881 static void save_Attr2fARB( GLenum attr
, GLfloat x
, GLfloat y
)
4883 GET_CURRENT_CONTEXT(ctx
);
4885 SAVE_FLUSH_VERTICES( ctx
);
4886 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F_ARB
, 3 );
4893 ASSERT(attr
< VERT_ATTRIB_MAX
);
4894 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4895 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4897 if (ctx
->ExecuteFlag
) {
4898 CALL_VertexAttrib2fARB(ctx
->Exec
, ( attr
, x
, y
));
4902 static void save_Attr3fARB( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4904 GET_CURRENT_CONTEXT(ctx
);
4906 SAVE_FLUSH_VERTICES( ctx
);
4907 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F_ARB
, 4 );
4915 ASSERT(attr
< VERT_ATTRIB_MAX
);
4916 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4917 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4919 if (ctx
->ExecuteFlag
) {
4920 CALL_VertexAttrib3fARB(ctx
->Exec
, ( attr
, x
, y
, z
));
4924 static void save_Attr4fARB( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4927 GET_CURRENT_CONTEXT(ctx
);
4929 SAVE_FLUSH_VERTICES( ctx
);
4930 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F_ARB
, 5 );
4939 ASSERT(attr
< VERT_ATTRIB_MAX
);
4940 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4941 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4943 if (ctx
->ExecuteFlag
) {
4944 CALL_VertexAttrib4fARB(ctx
->Exec
, ( attr
, x
, y
, z
, w
));
4949 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4951 GET_CURRENT_CONTEXT(ctx
);
4953 SAVE_FLUSH_VERTICES( ctx
);
4954 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4958 if (ctx
->ExecuteFlag
) {
4959 CALL_EvalCoord1f(ctx
->Exec
, ( x
));
4963 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4965 save_EvalCoord1f( v
[0] );
4968 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4970 GET_CURRENT_CONTEXT(ctx
);
4972 SAVE_FLUSH_VERTICES( ctx
);
4973 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4978 if (ctx
->ExecuteFlag
) {
4979 CALL_EvalCoord2f(ctx
->Exec
, ( x
, y
));
4983 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4985 save_EvalCoord2f( v
[0], v
[1] );
4989 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4991 GET_CURRENT_CONTEXT(ctx
);
4993 SAVE_FLUSH_VERTICES( ctx
);
4994 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4998 if (ctx
->ExecuteFlag
) {
4999 CALL_EvalPoint1(ctx
->Exec
, ( x
));
5003 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
5005 GET_CURRENT_CONTEXT(ctx
);
5007 SAVE_FLUSH_VERTICES( ctx
);
5008 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
5013 if (ctx
->ExecuteFlag
) {
5014 CALL_EvalPoint2(ctx
->Exec
, ( x
, y
));
5018 static void GLAPIENTRY
save_Indexf( GLfloat x
)
5020 GET_CURRENT_CONTEXT(ctx
);
5022 SAVE_FLUSH_VERTICES( ctx
);
5023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
5028 ctx
->ListState
.ActiveIndex
= 1;
5029 ctx
->ListState
.CurrentIndex
= x
;
5031 if (ctx
->ExecuteFlag
) {
5032 CALL_Indexi(ctx
->Exec
, ( (GLint
) x
));
5036 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
5038 save_Indexf( v
[0] );
5041 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
5043 GET_CURRENT_CONTEXT(ctx
);
5045 SAVE_FLUSH_VERTICES( ctx
);
5046 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
5051 ctx
->ListState
.ActiveEdgeFlag
= 1;
5052 ctx
->ListState
.CurrentEdgeFlag
= x
;
5054 if (ctx
->ExecuteFlag
) {
5055 CALL_EdgeFlag(ctx
->Exec
, ( x
));
5059 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
5061 save_EdgeFlag( v
[0] );
5064 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
5066 GET_CURRENT_CONTEXT(ctx
);
5070 SAVE_FLUSH_VERTICES( ctx
);
5075 case GL_FRONT_AND_BACK
:
5078 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
5087 case GL_AMBIENT_AND_DIFFUSE
:
5093 case GL_COLOR_INDEXES
:
5097 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
5101 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
5105 for (i
= 0 ; i
< args
; i
++)
5106 n
[3+i
].f
= param
[i
];
5110 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, NULL
);
5111 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
5112 if (bitmask
& (1<<i
)) {
5113 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5114 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5118 if (ctx
->ExecuteFlag
) {
5119 CALL_Materialfv(ctx
->Exec
, ( face
, pname
, param
));
5123 static void GLAPIENTRY
save_Begin( GLenum mode
)
5125 GET_CURRENT_CONTEXT(ctx
);
5127 GLboolean error
= GL_FALSE
;
5129 if (/*mode < GL_POINTS ||*/ mode
> GL_POLYGON
) {
5130 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5133 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5134 /* Typically the first begin. This may raise an error on
5135 * playback, depending on whether CallList is issued from inside
5136 * a begin/end or not.
5138 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5140 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5141 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5144 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
5149 /* Give the driver an opportunity to hook in an optimized
5150 * display list compiler.
5152 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
5155 SAVE_FLUSH_VERTICES( ctx
);
5156 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
5162 if (ctx
->ExecuteFlag
) {
5163 CALL_Begin(ctx
->Exec
, ( mode
));
5167 static void GLAPIENTRY
save_End( void )
5169 GET_CURRENT_CONTEXT(ctx
);
5170 SAVE_FLUSH_VERTICES( ctx
);
5171 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
5172 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5173 if (ctx
->ExecuteFlag
) {
5174 CALL_End(ctx
->Exec
, ( ));
5178 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5180 GET_CURRENT_CONTEXT(ctx
);
5182 SAVE_FLUSH_VERTICES( ctx
);
5183 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
5190 if (ctx
->ExecuteFlag
) {
5191 CALL_Rectf(ctx
->Exec
, ( a
, b
, c
, d
));
5196 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
5198 save_Attr2fNV( VERT_ATTRIB_POS
, x
, y
);
5201 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
5203 save_Attr2fNV( VERT_ATTRIB_POS
, v
[0], v
[1] );
5206 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
5208 save_Attr3fNV( VERT_ATTRIB_POS
, x
, y
, z
);
5211 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
5213 save_Attr3fNV( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
5216 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5218 save_Attr4fNV( VERT_ATTRIB_POS
, x
, y
, z
, w
);
5221 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
5223 save_Attr4fNV( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
5226 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
5228 save_Attr1fNV( VERT_ATTRIB_TEX0
, x
);
5231 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5233 save_Attr1fNV( VERT_ATTRIB_TEX0
, v
[0] );
5236 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5238 save_Attr2fNV( VERT_ATTRIB_TEX0
, x
, y
);
5241 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5243 save_Attr2fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5246 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5248 save_Attr3fNV( VERT_ATTRIB_TEX0
, x
, y
, z
);
5251 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5253 save_Attr3fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5256 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5258 save_Attr4fNV( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5261 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5263 save_Attr4fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5266 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5268 save_Attr3fNV( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5271 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5273 save_Attr3fNV( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5276 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5278 save_Attr1fNV( VERT_ATTRIB_FOG
, x
);
5281 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5283 save_Attr1fNV( VERT_ATTRIB_FOG
, v
[0] );
5286 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5288 save_Attr3fNV( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5291 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5293 save_Attr3fNV( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5296 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5298 save_Attr4fNV( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5301 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5303 save_Attr4fNV( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5306 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5308 save_Attr3fNV( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5311 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5313 save_Attr3fNV( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5317 /* Just call the respective ATTR for texcoord
5319 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5321 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5322 save_Attr1fNV( attr
, x
);
5325 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5327 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5328 save_Attr1fNV( attr
, v
[0] );
5331 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5333 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5334 save_Attr2fNV( attr
, x
, y
);
5337 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5339 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5340 save_Attr2fNV( attr
, v
[0], v
[1] );
5343 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5346 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5347 save_Attr3fNV( attr
, x
, y
, z
);
5350 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5352 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5353 save_Attr3fNV( attr
, v
[0], v
[1], v
[2] );
5356 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5357 GLfloat z
, GLfloat w
)
5359 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5360 save_Attr4fNV( attr
, x
, y
, z
, w
);
5363 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5365 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5366 save_Attr4fNV( attr
, v
[0], v
[1], v
[2], v
[3] );
5370 static void enum_error( void )
5372 GET_CURRENT_CONTEXT( ctx
);
5373 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5376 /* First level for NV_vertex_program:
5378 * Check for errors at compile time?.
5380 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5382 if (index
< VERT_ATTRIB_MAX
)
5383 save_Attr1fNV( index
, x
);
5388 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5390 if (index
< VERT_ATTRIB_MAX
)
5391 save_Attr1fNV( index
, v
[0] );
5396 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5398 if (index
< VERT_ATTRIB_MAX
)
5399 save_Attr2fNV( index
, x
, y
);
5404 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5406 if (index
< VERT_ATTRIB_MAX
)
5407 save_Attr2fNV( index
, v
[0], v
[1] );
5412 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5415 if (index
< VERT_ATTRIB_MAX
)
5416 save_Attr3fNV( index
, x
, y
, z
);
5421 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5423 if (index
< VERT_ATTRIB_MAX
)
5424 save_Attr3fNV( index
, v
[0], v
[1], v
[2] );
5429 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5430 GLfloat z
, GLfloat w
)
5432 if (index
< VERT_ATTRIB_MAX
)
5433 save_Attr4fNV( index
, x
, y
, z
, w
);
5438 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5440 if (index
< VERT_ATTRIB_MAX
)
5441 save_Attr4fNV( index
, v
[0], v
[1], v
[2], v
[3] );
5449 static void GLAPIENTRY
5450 save_VertexAttrib1fARB( GLuint index
, GLfloat x
)
5452 if (index
< VERT_ATTRIB_MAX
)
5453 save_Attr1fARB( index
, x
);
5458 static void GLAPIENTRY
5459 save_VertexAttrib1fvARB( GLuint index
, const GLfloat
*v
)
5461 if (index
< VERT_ATTRIB_MAX
)
5462 save_Attr1fARB( index
, v
[0] );
5467 static void GLAPIENTRY
5468 save_VertexAttrib2fARB( GLuint index
, GLfloat x
, GLfloat y
)
5470 if (index
< VERT_ATTRIB_MAX
)
5471 save_Attr2fARB( index
, x
, y
);
5476 static void GLAPIENTRY
5477 save_VertexAttrib2fvARB( GLuint index
, const GLfloat
*v
)
5479 if (index
< VERT_ATTRIB_MAX
)
5480 save_Attr2fARB( index
, v
[0], v
[1] );
5485 static void GLAPIENTRY
5486 save_VertexAttrib3fARB( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5488 if (index
< VERT_ATTRIB_MAX
)
5489 save_Attr3fARB( index
, x
, y
, z
);
5494 static void GLAPIENTRY
5495 save_VertexAttrib3fvARB( GLuint index
, const GLfloat
*v
)
5497 if (index
< VERT_ATTRIB_MAX
)
5498 save_Attr3fARB( index
, v
[0], v
[1], v
[2] );
5503 static void GLAPIENTRY
5504 save_VertexAttrib4fARB( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5506 if (index
< VERT_ATTRIB_MAX
)
5507 save_Attr4fARB( index
, x
, y
, z
, w
);
5512 static void GLAPIENTRY
5513 save_VertexAttrib4fvARB( GLuint index
, const GLfloat
*v
)
5515 if (index
< VERT_ATTRIB_MAX
)
5516 save_Attr4fARB( index
, v
[0], v
[1], v
[2], v
[3] );
5525 /* KW: Compile commands
5527 * Will appear in the list before the vertex buffer containing the
5528 * command that provoked the error. I don't see this as a problem.
5531 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5534 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5537 n
[2].data
= (void *) s
;
5539 /* execute already done */
5544 * Compile an error into current display list.
5547 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5549 if (ctx
->CompileFlag
)
5550 _mesa_save_error( ctx
, error
, s
);
5552 if (ctx
->ExecuteFlag
)
5553 _mesa_error( ctx
, error
, s
);
5559 islist(GLcontext
*ctx
, GLuint list
)
5561 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5571 /**********************************************************************/
5572 /* Display list execution */
5573 /**********************************************************************/
5577 * Execute a display list. Note that the ListBase offset must have already
5578 * been added before calling this function. I.e. the list argument is
5579 * the absolute list number, not relative to ListBase.
5580 * \param list - display list number
5582 static void GLAPIENTRY
5583 execute_list( GLcontext
*ctx
, GLuint list
)
5585 struct mesa_display_list
*dlist
;
5589 if (list
== 0 || !islist(ctx
,list
))
5592 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5593 /* raise an error? */
5598 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5602 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
++] = dlist
;
5604 if (ctx
->Driver
.BeginCallList
)
5605 ctx
->Driver
.BeginCallList( ctx
, dlist
);
5611 OpCode opcode
= n
[0].opcode
;
5612 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5614 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5615 /* this is a driver-extended opcode */
5616 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5617 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5622 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5625 CALL_Accum(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
5627 case OPCODE_ALPHA_FUNC
:
5628 CALL_AlphaFunc(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
5630 case OPCODE_BIND_TEXTURE
:
5631 CALL_BindTexture(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
5635 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5636 ctx
->Unpack
= ctx
->DefaultPacking
;
5637 CALL_Bitmap(ctx
->Exec
, ( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5638 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
));
5639 ctx
->Unpack
= save
; /* restore */
5642 case OPCODE_BLEND_COLOR
:
5643 CALL_BlendColor(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5645 case OPCODE_BLEND_EQUATION
:
5646 CALL_BlendEquation(ctx
->Exec
, ( n
[1].e
));
5648 case OPCODE_BLEND_EQUATION_SEPARATE
:
5649 CALL_BlendEquationSeparateEXT(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5651 case OPCODE_BLEND_FUNC_SEPARATE
:
5652 CALL_BlendFuncSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5654 case OPCODE_CALL_LIST
:
5655 /* Generated by glCallList(), don't add ListBase */
5656 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5657 execute_list( ctx
, n
[1].ui
);
5660 case OPCODE_CALL_LIST_OFFSET
:
5661 /* Generated by glCallLists() so we must add ListBase */
5663 /* user specified a bad data type at compile time */
5664 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5666 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5667 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5671 CALL_Clear(ctx
->Exec
, ( n
[1].bf
));
5673 case OPCODE_CLEAR_COLOR
:
5674 CALL_ClearColor(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5676 case OPCODE_CLEAR_ACCUM
:
5677 CALL_ClearAccum(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5679 case OPCODE_CLEAR_DEPTH
:
5680 CALL_ClearDepth(ctx
->Exec
, ( (GLclampd
) n
[1].f
));
5682 case OPCODE_CLEAR_INDEX
:
5683 CALL_ClearIndex(ctx
->Exec
, ( (GLfloat
) n
[1].ui
));
5685 case OPCODE_CLEAR_STENCIL
:
5686 CALL_ClearStencil(ctx
->Exec
, ( n
[1].i
));
5688 case OPCODE_CLIP_PLANE
:
5695 CALL_ClipPlane(ctx
->Exec
, ( n
[1].e
, eq
));
5698 case OPCODE_COLOR_MASK
:
5699 CALL_ColorMask(ctx
->Exec
, ( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5701 case OPCODE_COLOR_MATERIAL
:
5702 CALL_ColorMaterial(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5704 case OPCODE_COLOR_TABLE
:
5706 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5707 ctx
->Unpack
= ctx
->DefaultPacking
;
5708 CALL_ColorTable(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5709 n
[5].e
, n
[6].data
));
5710 ctx
->Unpack
= save
; /* restore */
5713 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5720 CALL_ColorTableParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5723 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5730 CALL_ColorTableParameteriv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5733 case OPCODE_COLOR_SUB_TABLE
:
5735 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5736 ctx
->Unpack
= ctx
->DefaultPacking
;
5737 CALL_ColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5738 n
[4].e
, n
[5].e
, n
[6].data
));
5739 ctx
->Unpack
= save
; /* restore */
5742 case OPCODE_CONVOLUTION_FILTER_1D
:
5744 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5745 ctx
->Unpack
= ctx
->DefaultPacking
;
5746 CALL_ConvolutionFilter1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5747 n
[4].e
, n
[5].e
, n
[6].data
));
5748 ctx
->Unpack
= save
; /* restore */
5751 case OPCODE_CONVOLUTION_FILTER_2D
:
5753 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5754 ctx
->Unpack
= ctx
->DefaultPacking
;
5755 CALL_ConvolutionFilter2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5756 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
));
5757 ctx
->Unpack
= save
; /* restore */
5760 case OPCODE_CONVOLUTION_PARAMETER_I
:
5761 CALL_ConvolutionParameteri(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
));
5763 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5770 CALL_ConvolutionParameteriv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5773 case OPCODE_CONVOLUTION_PARAMETER_F
:
5774 CALL_ConvolutionParameterf(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].f
));
5776 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5783 CALL_ConvolutionParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5786 case OPCODE_COPY_COLOR_SUB_TABLE
:
5787 CALL_CopyColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
,
5788 n
[3].i
, n
[4].i
, n
[5].i
));
5790 case OPCODE_COPY_COLOR_TABLE
:
5791 CALL_CopyColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
,
5792 n
[3].i
, n
[4].i
, n
[5].i
));
5794 case OPCODE_COPY_PIXELS
:
5795 CALL_CopyPixels(ctx
->Exec
, ( n
[1].i
, n
[2].i
,
5796 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
));
5798 case OPCODE_COPY_TEX_IMAGE1D
:
5799 CALL_CopyTexImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5800 n
[5].i
, n
[6].i
, n
[7].i
));
5802 case OPCODE_COPY_TEX_IMAGE2D
:
5803 CALL_CopyTexImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5804 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5806 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5807 CALL_CopyTexSubImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5808 n
[4].i
, n
[5].i
, n
[6].i
));
5810 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5811 CALL_CopyTexSubImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5812 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5814 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5815 CALL_CopyTexSubImage3D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5816 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
));
5818 case OPCODE_CULL_FACE
:
5819 CALL_CullFace(ctx
->Exec
, ( n
[1].e
));
5821 case OPCODE_DEPTH_FUNC
:
5822 CALL_DepthFunc(ctx
->Exec
, ( n
[1].e
));
5824 case OPCODE_DEPTH_MASK
:
5825 CALL_DepthMask(ctx
->Exec
, ( n
[1].b
));
5827 case OPCODE_DEPTH_RANGE
:
5828 CALL_DepthRange(ctx
->Exec
, ( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5830 case OPCODE_DISABLE
:
5831 CALL_Disable(ctx
->Exec
, ( n
[1].e
));
5833 case OPCODE_DRAW_BUFFER
:
5834 CALL_DrawBuffer(ctx
->Exec
, ( n
[1].e
));
5836 case OPCODE_DRAW_PIXELS
:
5838 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5839 ctx
->Unpack
= ctx
->DefaultPacking
;
5840 CALL_DrawPixels(ctx
->Exec
, ( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5842 ctx
->Unpack
= save
; /* restore */
5846 CALL_Enable(ctx
->Exec
, ( n
[1].e
));
5848 case OPCODE_EVALMESH1
:
5849 CALL_EvalMesh1(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
));
5851 case OPCODE_EVALMESH2
:
5852 CALL_EvalMesh2(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
5861 CALL_Fogfv(ctx
->Exec
, ( n
[1].e
, p
));
5864 case OPCODE_FRONT_FACE
:
5865 CALL_FrontFace(ctx
->Exec
, ( n
[1].e
));
5867 case OPCODE_FRUSTUM
:
5868 CALL_Frustum(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
5871 CALL_Hint(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5873 case OPCODE_HISTOGRAM
:
5874 CALL_Histogram(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
5876 case OPCODE_INDEX_MASK
:
5877 CALL_IndexMask(ctx
->Exec
, ( n
[1].ui
));
5879 case OPCODE_INIT_NAMES
:
5880 CALL_InitNames(ctx
->Exec
, ());
5889 CALL_Lightfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, p
));
5892 case OPCODE_LIGHT_MODEL
:
5899 CALL_LightModelfv(ctx
->Exec
, ( n
[1].e
, p
));
5902 case OPCODE_LINE_STIPPLE
:
5903 CALL_LineStipple(ctx
->Exec
, ( n
[1].i
, n
[2].us
));
5905 case OPCODE_LINE_WIDTH
:
5906 CALL_LineWidth(ctx
->Exec
, ( n
[1].f
));
5908 case OPCODE_LIST_BASE
:
5909 CALL_ListBase(ctx
->Exec
, ( n
[1].ui
));
5911 case OPCODE_LOAD_IDENTITY
:
5912 CALL_LoadIdentity(ctx
->Exec
, ());
5914 case OPCODE_LOAD_MATRIX
:
5915 if (sizeof(Node
)==sizeof(GLfloat
)) {
5916 CALL_LoadMatrixf(ctx
->Exec
, ( &n
[1].f
));
5921 for (i
=0;i
<16;i
++) {
5924 CALL_LoadMatrixf(ctx
->Exec
, ( m
));
5927 case OPCODE_LOAD_NAME
:
5928 CALL_LoadName(ctx
->Exec
, ( n
[1].ui
));
5930 case OPCODE_LOGIC_OP
:
5931 CALL_LogicOp(ctx
->Exec
, ( n
[1].e
));
5935 GLenum target
= n
[1].e
;
5936 GLint ustride
= _mesa_evaluator_components(target
);
5937 GLint uorder
= n
[5].i
;
5938 GLfloat u1
= n
[2].f
;
5939 GLfloat u2
= n
[3].f
;
5940 CALL_Map1f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
5941 (GLfloat
*) n
[6].data
));
5946 GLenum target
= n
[1].e
;
5947 GLfloat u1
= n
[2].f
;
5948 GLfloat u2
= n
[3].f
;
5949 GLfloat v1
= n
[4].f
;
5950 GLfloat v2
= n
[5].f
;
5951 GLint ustride
= n
[6].i
;
5952 GLint vstride
= n
[7].i
;
5953 GLint uorder
= n
[8].i
;
5954 GLint vorder
= n
[9].i
;
5955 CALL_Map2f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
5956 v1
, v2
, vstride
, vorder
,
5957 (GLfloat
*) n
[10].data
));
5960 case OPCODE_MAPGRID1
:
5961 CALL_MapGrid1f(ctx
->Exec
, ( n
[1].i
, n
[2].f
, n
[3].f
));
5963 case OPCODE_MAPGRID2
:
5964 CALL_MapGrid2f(ctx
->Exec
, ( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
5966 case OPCODE_MATRIX_MODE
:
5967 CALL_MatrixMode(ctx
->Exec
, ( n
[1].e
));
5969 case OPCODE_MIN_MAX
:
5970 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
5972 case OPCODE_MULT_MATRIX
:
5973 if (sizeof(Node
)==sizeof(GLfloat
)) {
5974 CALL_MultMatrixf(ctx
->Exec
, ( &n
[1].f
));
5979 for (i
=0;i
<16;i
++) {
5982 CALL_MultMatrixf(ctx
->Exec
, ( m
));
5986 CALL_Ortho(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
5988 case OPCODE_PASSTHROUGH
:
5989 CALL_PassThrough(ctx
->Exec
, ( n
[1].f
));
5991 case OPCODE_PIXEL_MAP
:
5992 CALL_PixelMapfv(ctx
->Exec
, ( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
5994 case OPCODE_PIXEL_TRANSFER
:
5995 CALL_PixelTransferf(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
5997 case OPCODE_PIXEL_ZOOM
:
5998 CALL_PixelZoom(ctx
->Exec
, ( n
[1].f
, n
[2].f
));
6000 case OPCODE_POINT_SIZE
:
6001 CALL_PointSize(ctx
->Exec
, ( n
[1].f
));
6003 case OPCODE_POINT_PARAMETERS
:
6009 CALL_PointParameterfvEXT(ctx
->Exec
, ( n
[1].e
, params
));
6012 case OPCODE_POLYGON_MODE
:
6013 CALL_PolygonMode(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
6015 case OPCODE_POLYGON_STIPPLE
:
6016 CALL_PolygonStipple(ctx
->Exec
, ( (GLubyte
*) n
[1].data
));
6018 case OPCODE_POLYGON_OFFSET
:
6019 CALL_PolygonOffset(ctx
->Exec
, ( n
[1].f
, n
[2].f
));
6021 case OPCODE_POP_ATTRIB
:
6022 CALL_PopAttrib(ctx
->Exec
, ());
6024 case OPCODE_POP_MATRIX
:
6025 CALL_PopMatrix(ctx
->Exec
, ());
6027 case OPCODE_POP_NAME
:
6028 CALL_PopName(ctx
->Exec
, ());
6030 case OPCODE_PRIORITIZE_TEXTURE
:
6031 CALL_PrioritizeTextures(ctx
->Exec
, ( 1, &n
[1].ui
, &n
[2].f
));
6033 case OPCODE_PUSH_ATTRIB
:
6034 CALL_PushAttrib(ctx
->Exec
, ( n
[1].bf
));
6036 case OPCODE_PUSH_MATRIX
:
6037 CALL_PushMatrix(ctx
->Exec
, ());
6039 case OPCODE_PUSH_NAME
:
6040 CALL_PushName(ctx
->Exec
, ( n
[1].ui
));
6042 case OPCODE_RASTER_POS
:
6043 CALL_RasterPos4f(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6045 case OPCODE_READ_BUFFER
:
6046 CALL_ReadBuffer(ctx
->Exec
, ( n
[1].e
));
6048 case OPCODE_RESET_HISTOGRAM
:
6049 CALL_ResetHistogram(ctx
->Exec
, ( n
[1].e
));
6051 case OPCODE_RESET_MIN_MAX
:
6052 CALL_ResetMinmax(ctx
->Exec
, ( n
[1].e
));
6055 CALL_Rotatef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6058 CALL_Scalef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6060 case OPCODE_SCISSOR
:
6061 CALL_Scissor(ctx
->Exec
, ( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6063 case OPCODE_SHADE_MODEL
:
6064 CALL_ShadeModel(ctx
->Exec
, ( n
[1].e
));
6066 case OPCODE_STENCIL_FUNC
:
6067 CALL_StencilFunc(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].ui
));
6069 case OPCODE_STENCIL_MASK
:
6070 CALL_StencilMask(ctx
->Exec
, ( n
[1].ui
));
6072 case OPCODE_STENCIL_OP
:
6073 CALL_StencilOp(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].e
));
6075 case OPCODE_STENCIL_FUNC_SEPARATE
:
6076 CALL_StencilFuncSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6078 case OPCODE_STENCIL_MASK_SEPARATE
:
6079 CALL_StencilMaskSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
6081 case OPCODE_STENCIL_OP_SEPARATE
:
6082 CALL_StencilOpSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6091 CALL_TexEnvfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6101 CALL_TexGenfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6104 case OPCODE_TEXPARAMETER
:
6111 CALL_TexParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6114 case OPCODE_TEX_IMAGE1D
:
6116 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6117 ctx
->Unpack
= ctx
->DefaultPacking
;
6118 CALL_TexImage1D(ctx
->Exec
, (
6119 n
[1].e
, /* target */
6121 n
[3].i
, /* components */
6123 n
[5].e
, /* border */
6124 n
[6].e
, /* format */
6127 ctx
->Unpack
= save
; /* restore */
6130 case OPCODE_TEX_IMAGE2D
:
6132 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6133 ctx
->Unpack
= ctx
->DefaultPacking
;
6134 CALL_TexImage2D(ctx
->Exec
, (
6135 n
[1].e
, /* target */
6137 n
[3].i
, /* components */
6139 n
[5].i
, /* height */
6140 n
[6].e
, /* border */
6141 n
[7].e
, /* format */
6144 ctx
->Unpack
= save
; /* restore */
6147 case OPCODE_TEX_IMAGE3D
:
6149 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6150 ctx
->Unpack
= ctx
->DefaultPacking
;
6151 CALL_TexImage3D(ctx
->Exec
, (
6152 n
[1].e
, /* target */
6154 n
[3].i
, /* components */
6156 n
[5].i
, /* height */
6158 n
[7].e
, /* border */
6159 n
[8].e
, /* format */
6162 ctx
->Unpack
= save
; /* restore */
6165 case OPCODE_TEX_SUB_IMAGE1D
:
6167 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6168 ctx
->Unpack
= ctx
->DefaultPacking
;
6169 CALL_TexSubImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6171 n
[6].e
, n
[7].data
));
6172 ctx
->Unpack
= save
; /* restore */
6175 case OPCODE_TEX_SUB_IMAGE2D
:
6177 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6178 ctx
->Unpack
= ctx
->DefaultPacking
;
6179 CALL_TexSubImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6181 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
));
6182 ctx
->Unpack
= save
; /* restore */
6185 case OPCODE_TEX_SUB_IMAGE3D
:
6187 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6188 ctx
->Unpack
= ctx
->DefaultPacking
;
6189 CALL_TexSubImage3D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6190 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6191 n
[8].i
, n
[9].e
, n
[10].e
,
6193 ctx
->Unpack
= save
; /* restore */
6196 case OPCODE_TRANSLATE
:
6197 CALL_Translatef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6199 case OPCODE_VIEWPORT
:
6200 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6201 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6203 case OPCODE_WINDOW_POS
:
6204 CALL_WindowPos4fMESA(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6206 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6207 CALL_ActiveTextureARB(ctx
->Exec
, ( n
[1].e
));
6209 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6210 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6211 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
));
6213 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6214 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6215 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
));
6217 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6218 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6219 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
));
6221 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6222 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6223 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
));
6225 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6226 CALL_CompressedTexSubImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6227 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
));
6229 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6230 CALL_CompressedTexSubImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6231 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6232 n
[9].e
, n
[10].i
, n
[11].data
));
6234 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6235 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6237 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6238 CALL_WindowPos3fMESA(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6240 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6241 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6242 CALL_BindProgramNV(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
6245 #if FEATURE_NV_vertex_program
6246 case OPCODE_EXECUTE_PROGRAM_NV
:
6253 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6256 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6257 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6258 (GLuint
*) n
[2].data
));
6260 case OPCODE_LOAD_PROGRAM_NV
:
6261 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6262 (const GLubyte
*) n
[4].data
));
6264 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6265 CALL_ProgramParameter4fNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6266 n
[4].f
, n
[5].f
, n
[6].f
));
6268 case OPCODE_TRACK_MATRIX_NV
:
6269 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6273 #if FEATURE_NV_fragment_program
6274 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6275 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6276 n
[4].f
, n
[5].f
, n
[6].f
));
6278 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6279 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6280 (const GLubyte
*) n
[3].data
,
6281 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
));
6285 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6286 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6288 case OPCODE_DEPTH_BOUNDS_EXT
:
6289 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6291 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6292 case OPCODE_PROGRAM_STRING_ARB
:
6293 CALL_ProgramStringARB(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6295 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6296 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6297 n
[4].f
, n
[5].f
, n
[6].f
));
6300 #if FEATURE_ARB_occlusion_query
6301 case OPCODE_BEGIN_QUERY_ARB
:
6302 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6304 case OPCODE_END_QUERY_ARB
:
6305 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6308 case OPCODE_DRAW_BUFFERS_ARB
:
6310 GLenum buffers
[MAX_DRAW_BUFFERS
];
6311 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6312 for (i
= 0; i
< count
; i
++)
6313 buffers
[i
] = n
[2 + i
].e
;
6314 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6317 #if FEATURE_ATI_fragment_shader
6318 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6319 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6321 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6324 GLuint i
, dst
= n
[1].ui
;
6326 for (i
= 0; i
< 4; i
++)
6327 values
[i
] = n
[1+i
].f
;
6328 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6332 case OPCODE_ATTR_1F_NV
:
6333 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6335 case OPCODE_ATTR_2F_NV
:
6336 /* Really shouldn't have to do this - the Node structure
6337 * is convenient, but it would be better to store the data
6338 * packed appropriately so that it can be sent directly
6339 * on. With x86_64 becoming common, this will start to
6342 if (sizeof(Node
)==sizeof(GLfloat
))
6343 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6345 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6347 case OPCODE_ATTR_3F_NV
:
6348 if (sizeof(Node
)==sizeof(GLfloat
))
6349 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6351 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6354 case OPCODE_ATTR_4F_NV
:
6355 if (sizeof(Node
)==sizeof(GLfloat
))
6356 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6358 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6361 case OPCODE_ATTR_1F_ARB
:
6362 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6364 case OPCODE_ATTR_2F_ARB
:
6365 /* Really shouldn't have to do this - the Node structure
6366 * is convenient, but it would be better to store the data
6367 * packed appropriately so that it can be sent directly
6368 * on. With x86_64 becoming common, this will start to
6371 if (sizeof(Node
)==sizeof(GLfloat
))
6372 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6374 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6376 case OPCODE_ATTR_3F_ARB
:
6377 if (sizeof(Node
)==sizeof(GLfloat
))
6378 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6380 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6383 case OPCODE_ATTR_4F_ARB
:
6384 if (sizeof(Node
)==sizeof(GLfloat
))
6385 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6387 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6390 case OPCODE_MATERIAL
:
6391 if (sizeof(Node
)==sizeof(GLfloat
))
6392 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6399 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6403 CALL_Indexi(ctx
->Exec
, (n
[1].i
));
6405 case OPCODE_EDGEFLAG
:
6406 CALL_EdgeFlag(ctx
->Exec
, (n
[1].b
));
6409 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6412 CALL_End(ctx
->Exec
, ());
6415 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6417 case OPCODE_EVAL_C1
:
6418 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6420 case OPCODE_EVAL_C2
:
6421 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6423 case OPCODE_EVAL_P1
:
6424 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6426 case OPCODE_EVAL_P2
:
6427 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6433 case OPCODE_CONTINUE
:
6434 n
= (Node
*) n
[1].next
;
6436 case OPCODE_END_OF_LIST
:
6442 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6443 _mesa_problem(ctx
, msg
);
6448 /* increment n to point to next compiled command */
6449 if (opcode
!=OPCODE_CONTINUE
) {
6450 n
+= InstSize
[opcode
];
6455 if (ctx
->Driver
.EndCallList
)
6456 ctx
->Driver
.EndCallList( ctx
);
6458 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
--] = NULL
;
6465 /**********************************************************************/
6467 /**********************************************************************/
6473 * Test if a display list number is valid.
6475 GLboolean GLAPIENTRY
6476 _mesa_IsList( GLuint list
)
6478 GET_CURRENT_CONTEXT(ctx
);
6479 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6480 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6481 return islist(ctx
, list
);
6486 * Delete a sequence of consecutive display lists.
6489 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6491 GET_CURRENT_CONTEXT(ctx
);
6493 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6494 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6497 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6500 for (i
=list
;i
<list
+range
;i
++) {
6501 _mesa_destroy_list( ctx
, i
);
6508 * Return a display list number, n, such that lists n through n+range-1
6512 _mesa_GenLists(GLsizei range
)
6514 GET_CURRENT_CONTEXT(ctx
);
6516 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6517 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6520 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6528 * Make this an atomic operation
6530 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6532 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6534 /* reserve the list IDs by with empty/dummy lists */
6536 for (i
=0; i
<range
; i
++) {
6537 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_list(base
+i
, 1));
6541 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6549 * Begin a new display list.
6552 _mesa_NewList( GLuint list
, GLenum mode
)
6554 GET_CURRENT_CONTEXT(ctx
);
6557 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6558 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6560 if (MESA_VERBOSE
&VERBOSE_API
)
6561 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6562 _mesa_lookup_enum_by_nr(mode
));
6565 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6569 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6570 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6574 if (ctx
->ListState
.CurrentListPtr
) {
6575 /* already compiling a display list */
6576 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6580 ctx
->CompileFlag
= GL_TRUE
;
6581 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6583 /* Allocate new display list */
6584 ctx
->ListState
.CurrentListNum
= list
;
6585 ctx
->ListState
.CurrentList
= make_list( list
, BLOCK_SIZE
);
6586 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6587 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6588 ctx
->ListState
.CurrentPos
= 0;
6590 /* Reset acumulated list state:
6592 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6593 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6595 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6596 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6598 ctx
->ListState
.ActiveIndex
= 0;
6599 ctx
->ListState
.ActiveEdgeFlag
= 0;
6601 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6602 ctx
->Driver
.NewList( ctx
, list
, mode
);
6604 ctx
->CurrentDispatch
= ctx
->Save
;
6605 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6611 * End definition of current display list.
6614 _mesa_EndList( void )
6616 GET_CURRENT_CONTEXT(ctx
);
6617 SAVE_FLUSH_VERTICES(ctx
);
6618 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6620 if (MESA_VERBOSE
&VERBOSE_API
)
6621 _mesa_debug(ctx
, "glEndList\n");
6623 /* Check that a list is under construction */
6624 if (!ctx
->ListState
.CurrentListPtr
) {
6625 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6629 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6631 /* Destroy old list, if any */
6632 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6633 /* Install the list */
6634 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentList
);
6637 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6638 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6640 ctx
->Driver
.EndList( ctx
);
6642 ctx
->ListState
.CurrentList
= NULL
;
6643 ctx
->ListState
.CurrentListNum
= 0;
6644 ctx
->ListState
.CurrentListPtr
= NULL
;
6645 ctx
->ExecuteFlag
= GL_TRUE
;
6646 ctx
->CompileFlag
= GL_FALSE
;
6648 ctx
->CurrentDispatch
= ctx
->Exec
;
6649 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6655 _mesa_CallList( GLuint list
)
6657 GLboolean save_compile_flag
;
6658 GET_CURRENT_CONTEXT(ctx
);
6659 FLUSH_CURRENT(ctx
, 0);
6660 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6661 /* execute the display list, and restore the CompileFlag. */
6663 if (MESA_VERBOSE
& VERBOSE_API
)
6664 _mesa_debug(ctx
, "glCallList %d\n", list
);
6667 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6671 /* mesa_print_display_list( list ); */
6673 save_compile_flag
= ctx
->CompileFlag
;
6674 if (save_compile_flag
) {
6675 ctx
->CompileFlag
= GL_FALSE
;
6678 execute_list( ctx
, list
);
6679 ctx
->CompileFlag
= save_compile_flag
;
6681 /* also restore API function pointers to point to "save" versions */
6682 if (save_compile_flag
) {
6683 ctx
->CurrentDispatch
= ctx
->Save
;
6684 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6691 * Execute glCallLists: call multiple display lists.
6694 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6696 GET_CURRENT_CONTEXT(ctx
);
6699 GLboolean save_compile_flag
;
6701 if (MESA_VERBOSE
& VERBOSE_API
)
6702 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6706 case GL_UNSIGNED_BYTE
:
6708 case GL_UNSIGNED_SHORT
:
6710 case GL_UNSIGNED_INT
:
6718 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6722 /* Save the CompileFlag status, turn it off, execute display list,
6723 * and restore the CompileFlag.
6725 save_compile_flag
= ctx
->CompileFlag
;
6726 ctx
->CompileFlag
= GL_FALSE
;
6729 list
= translate_id( i
, type
, lists
);
6730 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6733 ctx
->CompileFlag
= save_compile_flag
;
6735 /* also restore API function pointers to point to "save" versions */
6736 if (save_compile_flag
) {
6737 ctx
->CurrentDispatch
= ctx
->Save
;
6738 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6745 * Set the offset added to list numbers in glCallLists.
6748 _mesa_ListBase( GLuint base
)
6750 GET_CURRENT_CONTEXT(ctx
);
6751 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6752 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6753 ctx
->List
.ListBase
= base
;
6757 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6759 static void GLAPIENTRY
exec_Finish( void )
6761 GET_CURRENT_CONTEXT(ctx
);
6762 FLUSH_VERTICES(ctx
, 0);
6763 CALL_Finish(ctx
->Exec
, ());
6766 static void GLAPIENTRY
exec_Flush( void )
6768 GET_CURRENT_CONTEXT(ctx
);
6769 FLUSH_VERTICES(ctx
, 0);
6770 CALL_Flush(ctx
->Exec
, ( ));
6773 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6775 GET_CURRENT_CONTEXT(ctx
);
6776 FLUSH_VERTICES(ctx
, 0);
6777 CALL_GetBooleanv(ctx
->Exec
, ( pname
, params
));
6780 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6782 GET_CURRENT_CONTEXT(ctx
);
6783 FLUSH_VERTICES(ctx
, 0);
6784 CALL_GetClipPlane(ctx
->Exec
, ( plane
, equation
));
6787 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6789 GET_CURRENT_CONTEXT(ctx
);
6790 FLUSH_VERTICES(ctx
, 0);
6791 CALL_GetDoublev(ctx
->Exec
, ( pname
, params
));
6794 static GLenum GLAPIENTRY
exec_GetError( void )
6796 GET_CURRENT_CONTEXT(ctx
);
6797 FLUSH_VERTICES(ctx
, 0);
6798 return CALL_GetError(ctx
->Exec
, ( ));
6801 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6803 GET_CURRENT_CONTEXT(ctx
);
6804 FLUSH_VERTICES(ctx
, 0);
6805 CALL_GetFloatv(ctx
->Exec
, ( pname
, params
));
6808 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6810 GET_CURRENT_CONTEXT(ctx
);
6811 FLUSH_VERTICES(ctx
, 0);
6812 CALL_GetIntegerv(ctx
->Exec
, ( pname
, params
));
6815 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6817 GET_CURRENT_CONTEXT(ctx
);
6818 FLUSH_VERTICES(ctx
, 0);
6819 CALL_GetLightfv(ctx
->Exec
, ( light
, pname
, params
));
6822 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6824 GET_CURRENT_CONTEXT(ctx
);
6825 FLUSH_VERTICES(ctx
, 0);
6826 CALL_GetLightiv(ctx
->Exec
, ( light
, pname
, params
));
6829 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6831 GET_CURRENT_CONTEXT(ctx
);
6832 FLUSH_VERTICES(ctx
, 0);
6833 CALL_GetMapdv(ctx
->Exec
, ( target
, query
, v
));
6836 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6838 GET_CURRENT_CONTEXT(ctx
);
6839 FLUSH_VERTICES(ctx
, 0);
6840 CALL_GetMapfv(ctx
->Exec
, ( target
, query
, v
));
6843 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6845 GET_CURRENT_CONTEXT(ctx
);
6846 FLUSH_VERTICES(ctx
, 0);
6847 CALL_GetMapiv(ctx
->Exec
, ( target
, query
, v
));
6850 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6852 GET_CURRENT_CONTEXT(ctx
);
6853 FLUSH_VERTICES(ctx
, 0);
6854 CALL_GetMaterialfv(ctx
->Exec
, ( face
, pname
, params
));
6857 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6859 GET_CURRENT_CONTEXT(ctx
);
6860 FLUSH_VERTICES(ctx
, 0);
6861 CALL_GetMaterialiv(ctx
->Exec
, ( face
, pname
, params
));
6864 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6866 GET_CURRENT_CONTEXT(ctx
);
6867 FLUSH_VERTICES(ctx
, 0);
6868 CALL_GetPixelMapfv(ctx
->Exec
, ( map
, values
));
6871 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6873 GET_CURRENT_CONTEXT(ctx
);
6874 FLUSH_VERTICES(ctx
, 0);
6875 CALL_GetPixelMapuiv(ctx
->Exec
, ( map
, values
));
6878 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6880 GET_CURRENT_CONTEXT(ctx
);
6881 FLUSH_VERTICES(ctx
, 0);
6882 CALL_GetPixelMapusv(ctx
->Exec
, ( map
, values
));
6885 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6887 GET_CURRENT_CONTEXT(ctx
);
6888 FLUSH_VERTICES(ctx
, 0);
6889 CALL_GetPolygonStipple(ctx
->Exec
, ( dest
));
6892 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6894 GET_CURRENT_CONTEXT(ctx
);
6895 FLUSH_VERTICES(ctx
, 0);
6896 return CALL_GetString(ctx
->Exec
, ( name
));
6899 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6901 GET_CURRENT_CONTEXT(ctx
);
6902 FLUSH_VERTICES(ctx
, 0);
6903 CALL_GetTexEnvfv(ctx
->Exec
, ( target
, pname
, params
));
6906 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6908 GET_CURRENT_CONTEXT(ctx
);
6909 FLUSH_VERTICES(ctx
, 0);
6910 CALL_GetTexEnviv(ctx
->Exec
, ( target
, pname
, params
));
6913 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6915 GET_CURRENT_CONTEXT(ctx
);
6916 FLUSH_VERTICES(ctx
, 0);
6917 CALL_GetTexGendv(ctx
->Exec
, ( coord
, pname
, params
));
6920 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6922 GET_CURRENT_CONTEXT(ctx
);
6923 FLUSH_VERTICES(ctx
, 0);
6924 CALL_GetTexGenfv(ctx
->Exec
, ( coord
, pname
, params
));
6927 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6929 GET_CURRENT_CONTEXT(ctx
);
6930 FLUSH_VERTICES(ctx
, 0);
6931 CALL_GetTexGeniv(ctx
->Exec
, ( coord
, pname
, params
));
6934 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6935 GLenum type
, GLvoid
*pixels
)
6937 GET_CURRENT_CONTEXT(ctx
);
6938 FLUSH_VERTICES(ctx
, 0);
6939 CALL_GetTexImage(ctx
->Exec
, ( target
, level
, format
, type
, pixels
));
6942 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6943 GLenum pname
, GLfloat
*params
)
6945 GET_CURRENT_CONTEXT(ctx
);
6946 FLUSH_VERTICES(ctx
, 0);
6947 CALL_GetTexLevelParameterfv(ctx
->Exec
, ( target
, level
, pname
, params
));
6950 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6951 GLenum pname
, GLint
*params
)
6953 GET_CURRENT_CONTEXT(ctx
);
6954 FLUSH_VERTICES(ctx
, 0);
6955 CALL_GetTexLevelParameteriv(ctx
->Exec
, ( target
, level
, pname
, params
));
6958 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6961 GET_CURRENT_CONTEXT(ctx
);
6962 FLUSH_VERTICES(ctx
, 0);
6963 CALL_GetTexParameterfv(ctx
->Exec
, ( target
, pname
, params
));
6966 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6968 GET_CURRENT_CONTEXT(ctx
);
6969 FLUSH_VERTICES(ctx
, 0);
6970 CALL_GetTexParameteriv(ctx
->Exec
, ( target
, pname
, params
));
6973 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6975 GET_CURRENT_CONTEXT(ctx
);
6976 FLUSH_VERTICES(ctx
, 0);
6977 return CALL_IsEnabled(ctx
->Exec
, ( cap
));
6980 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6982 GET_CURRENT_CONTEXT(ctx
);
6983 FLUSH_VERTICES(ctx
, 0);
6984 CALL_PixelStoref(ctx
->Exec
, ( pname
, param
));
6987 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6989 GET_CURRENT_CONTEXT(ctx
);
6990 FLUSH_VERTICES(ctx
, 0);
6991 CALL_PixelStorei(ctx
->Exec
, ( pname
, param
));
6994 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6995 GLenum format
, GLenum type
, GLvoid
*pixels
)
6997 GET_CURRENT_CONTEXT(ctx
);
6998 FLUSH_VERTICES(ctx
, 0);
6999 CALL_ReadPixels(ctx
->Exec
, ( x
, y
, width
, height
, format
, type
, pixels
));
7002 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
7004 GET_CURRENT_CONTEXT(ctx
);
7005 FLUSH_VERTICES(ctx
, 0);
7006 return CALL_RenderMode(ctx
->Exec
, ( mode
));
7009 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
7011 GET_CURRENT_CONTEXT(ctx
);
7012 FLUSH_VERTICES(ctx
, 0);
7013 CALL_FeedbackBuffer(ctx
->Exec
, ( size
, type
, buffer
));
7016 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
7018 GET_CURRENT_CONTEXT(ctx
);
7019 FLUSH_VERTICES(ctx
, 0);
7020 CALL_SelectBuffer(ctx
->Exec
, ( size
, buffer
));
7023 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
7024 GLboolean
*residences
)
7026 GET_CURRENT_CONTEXT(ctx
);
7027 FLUSH_VERTICES(ctx
, 0);
7028 return CALL_AreTexturesResident(ctx
->Exec
, ( n
, texName
, residences
));
7031 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
7034 GET_CURRENT_CONTEXT(ctx
);
7035 FLUSH_VERTICES(ctx
, 0);
7036 CALL_ColorPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7039 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
7041 GET_CURRENT_CONTEXT(ctx
);
7042 FLUSH_VERTICES(ctx
, 0);
7043 CALL_DeleteTextures(ctx
->Exec
, ( n
, texName
));
7046 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
7048 GET_CURRENT_CONTEXT(ctx
);
7049 FLUSH_VERTICES(ctx
, 0);
7050 CALL_DisableClientState(ctx
->Exec
, ( cap
));
7053 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
7055 GET_CURRENT_CONTEXT(ctx
);
7056 FLUSH_VERTICES(ctx
, 0);
7057 CALL_EdgeFlagPointer(ctx
->Exec
, ( stride
, vptr
));
7060 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
7062 GET_CURRENT_CONTEXT(ctx
);
7063 FLUSH_VERTICES(ctx
, 0);
7064 CALL_EnableClientState(ctx
->Exec
, ( cap
));
7067 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
7069 GET_CURRENT_CONTEXT(ctx
);
7070 FLUSH_VERTICES(ctx
, 0);
7071 CALL_GenTextures(ctx
->Exec
, ( n
, texName
));
7074 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
7076 GET_CURRENT_CONTEXT(ctx
);
7077 FLUSH_VERTICES(ctx
, 0);
7078 CALL_GetPointerv(ctx
->Exec
, ( pname
, params
));
7081 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7083 GET_CURRENT_CONTEXT(ctx
);
7084 FLUSH_VERTICES(ctx
, 0);
7085 CALL_IndexPointer(ctx
->Exec
, ( type
, stride
, ptr
));
7088 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
7089 const GLvoid
*pointer
)
7091 GET_CURRENT_CONTEXT(ctx
);
7092 FLUSH_VERTICES(ctx
, 0);
7093 CALL_InterleavedArrays(ctx
->Exec
, ( format
, stride
, pointer
));
7096 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
7098 GET_CURRENT_CONTEXT(ctx
);
7099 FLUSH_VERTICES(ctx
, 0);
7100 return CALL_IsTexture(ctx
->Exec
, ( texture
));
7103 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7105 GET_CURRENT_CONTEXT(ctx
);
7106 FLUSH_VERTICES(ctx
, 0);
7107 CALL_NormalPointer(ctx
->Exec
, ( type
, stride
, ptr
));
7110 static void GLAPIENTRY
exec_PopClientAttrib(void)
7112 GET_CURRENT_CONTEXT(ctx
);
7113 FLUSH_VERTICES(ctx
, 0);
7114 CALL_PopClientAttrib(ctx
->Exec
, ());
7117 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
7119 GET_CURRENT_CONTEXT(ctx
);
7120 FLUSH_VERTICES(ctx
, 0);
7121 CALL_PushClientAttrib(ctx
->Exec
, ( mask
));
7124 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7127 GET_CURRENT_CONTEXT(ctx
);
7128 FLUSH_VERTICES(ctx
, 0);
7129 CALL_TexCoordPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7132 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
7135 GET_CURRENT_CONTEXT(ctx
);
7136 FLUSH_VERTICES(ctx
, 0);
7137 CALL_GetCompressedTexImageARB(ctx
->Exec
, ( target
, level
, img
));
7140 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7143 GET_CURRENT_CONTEXT(ctx
);
7144 FLUSH_VERTICES(ctx
, 0);
7145 CALL_VertexPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7148 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7149 GLint x
, GLint y
, GLsizei width
)
7151 GET_CURRENT_CONTEXT(ctx
);
7152 FLUSH_VERTICES(ctx
, 0);
7153 CALL_CopyConvolutionFilter1D(ctx
->Exec
, ( target
, internalFormat
, x
, y
, width
));
7156 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7157 GLint x
, GLint y
, GLsizei width
,
7160 GET_CURRENT_CONTEXT(ctx
);
7161 FLUSH_VERTICES(ctx
, 0);
7162 CALL_CopyConvolutionFilter2D(ctx
->Exec
, ( target
, internalFormat
, x
, y
, width
,
7166 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
7167 GLenum type
, GLvoid
*data
)
7169 GET_CURRENT_CONTEXT(ctx
);
7170 FLUSH_VERTICES(ctx
, 0);
7171 CALL_GetColorTable(ctx
->Exec
, ( target
, format
, type
, data
));
7174 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
7177 GET_CURRENT_CONTEXT(ctx
);
7178 FLUSH_VERTICES(ctx
, 0);
7179 CALL_GetColorTableParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7182 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
7185 GET_CURRENT_CONTEXT(ctx
);
7186 FLUSH_VERTICES(ctx
, 0);
7187 CALL_GetColorTableParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7190 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7193 GET_CURRENT_CONTEXT(ctx
);
7194 FLUSH_VERTICES(ctx
, 0);
7195 CALL_GetConvolutionFilter(ctx
->Exec
, ( target
, format
, type
, image
));
7198 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
7201 GET_CURRENT_CONTEXT(ctx
);
7202 FLUSH_VERTICES(ctx
, 0);
7203 CALL_GetConvolutionParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7206 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
7209 GET_CURRENT_CONTEXT(ctx
);
7210 FLUSH_VERTICES(ctx
, 0);
7211 CALL_GetConvolutionParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7214 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7215 GLenum type
, GLvoid
*values
)
7217 GET_CURRENT_CONTEXT(ctx
);
7218 FLUSH_VERTICES(ctx
, 0);
7219 CALL_GetHistogram(ctx
->Exec
, ( target
, reset
, format
, type
, values
));
7222 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
7225 GET_CURRENT_CONTEXT(ctx
);
7226 FLUSH_VERTICES(ctx
, 0);
7227 CALL_GetHistogramParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7230 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
7233 GET_CURRENT_CONTEXT(ctx
);
7234 FLUSH_VERTICES(ctx
, 0);
7235 CALL_GetHistogramParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7238 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7239 GLenum type
, GLvoid
*values
)
7241 GET_CURRENT_CONTEXT(ctx
);
7242 FLUSH_VERTICES(ctx
, 0);
7243 CALL_GetMinmax(ctx
->Exec
, ( target
, reset
, format
, type
, values
));
7246 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
7249 GET_CURRENT_CONTEXT(ctx
);
7250 FLUSH_VERTICES(ctx
, 0);
7251 CALL_GetMinmaxParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7254 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
7257 GET_CURRENT_CONTEXT(ctx
);
7258 FLUSH_VERTICES(ctx
, 0);
7259 CALL_GetMinmaxParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7262 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7263 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7265 GET_CURRENT_CONTEXT(ctx
);
7266 FLUSH_VERTICES(ctx
, 0);
7267 CALL_GetSeparableFilter(ctx
->Exec
, ( target
, format
, type
, row
, column
, span
));
7270 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7271 GLsizei width
, GLsizei height
, GLenum format
,
7272 GLenum type
, const GLvoid
*row
,
7273 const GLvoid
*column
)
7275 GET_CURRENT_CONTEXT(ctx
);
7276 FLUSH_VERTICES(ctx
, 0);
7277 CALL_SeparableFilter2D(ctx
->Exec
, ( target
, internalFormat
, width
, height
, format
,
7278 type
, row
, column
));
7281 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7282 GLsizei count
, const GLvoid
*ptr
)
7284 GET_CURRENT_CONTEXT(ctx
);
7285 FLUSH_VERTICES(ctx
, 0);
7286 CALL_ColorPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7289 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
7290 const GLboolean
*ptr
)
7292 GET_CURRENT_CONTEXT(ctx
);
7293 FLUSH_VERTICES(ctx
, 0);
7294 CALL_EdgeFlagPointerEXT(ctx
->Exec
, ( stride
, count
, ptr
));
7297 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7300 GET_CURRENT_CONTEXT(ctx
);
7301 FLUSH_VERTICES(ctx
, 0);
7302 CALL_IndexPointerEXT(ctx
->Exec
, ( type
, stride
, count
, ptr
));
7305 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7308 GET_CURRENT_CONTEXT(ctx
);
7309 FLUSH_VERTICES(ctx
, 0);
7310 CALL_NormalPointerEXT(ctx
->Exec
, ( type
, stride
, count
, ptr
));
7313 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7314 GLsizei count
, const GLvoid
*ptr
)
7316 GET_CURRENT_CONTEXT(ctx
);
7317 FLUSH_VERTICES(ctx
, 0);
7318 CALL_TexCoordPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7321 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7322 GLsizei count
, const GLvoid
*ptr
)
7324 GET_CURRENT_CONTEXT(ctx
);
7325 FLUSH_VERTICES(ctx
, 0);
7326 CALL_VertexPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7329 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
7331 GET_CURRENT_CONTEXT(ctx
);
7332 FLUSH_VERTICES(ctx
, 0);
7333 CALL_LockArraysEXT(ctx
->Exec
, ( first
, count
));
7336 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
7338 GET_CURRENT_CONTEXT(ctx
);
7339 FLUSH_VERTICES(ctx
, 0);
7340 CALL_UnlockArraysEXT(ctx
->Exec
, ( ));
7343 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
7345 GET_CURRENT_CONTEXT(ctx
);
7346 FLUSH_VERTICES(ctx
, 0);
7347 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7350 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7351 GLsizei stride
, const GLvoid
*ptr
)
7353 GET_CURRENT_CONTEXT(ctx
);
7354 FLUSH_VERTICES(ctx
, 0);
7355 CALL_SecondaryColorPointerEXT(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7358 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
7361 GET_CURRENT_CONTEXT(ctx
);
7362 FLUSH_VERTICES(ctx
, 0);
7363 CALL_FogCoordPointerEXT(ctx
->Exec
, ( type
, stride
, ptr
));
7366 /* GL_EXT_multi_draw_arrays */
7367 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
7368 GLsizei
*count
, GLsizei primcount
)
7370 GET_CURRENT_CONTEXT(ctx
);
7371 FLUSH_VERTICES(ctx
, 0);
7372 CALL_MultiDrawArraysEXT(ctx
->Exec
, ( mode
, first
, count
, primcount
));
7375 /* GL_EXT_multi_draw_arrays */
7376 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
7377 GLenum type
, const GLvoid
**indices
,
7380 GET_CURRENT_CONTEXT(ctx
);
7381 FLUSH_VERTICES(ctx
, 0);
7382 CALL_MultiDrawElementsEXT(ctx
->Exec
, (mode
, count
, type
, indices
, primcount
));
7385 /* GL_IBM_multimode_draw_arrays */
7386 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
7387 const GLsizei
*count
, GLsizei primcount
,
7390 GET_CURRENT_CONTEXT(ctx
);
7391 FLUSH_VERTICES(ctx
, 0);
7392 CALL_MultiModeDrawArraysIBM(ctx
->Exec
, (mode
, first
, count
, primcount
, modestride
));
7395 /* GL_IBM_multimode_draw_arrays */
7396 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7397 const GLsizei
*count
,
7399 const GLvoid
* const *indices
,
7400 GLsizei primcount
, GLint modestride
)
7402 GET_CURRENT_CONTEXT(ctx
);
7403 FLUSH_VERTICES(ctx
, 0);
7404 CALL_MultiModeDrawElementsIBM(ctx
->Exec
, (mode
, count
, type
, indices
, primcount
,
7412 * Setup the given dispatch table to point to Mesa's display list
7413 * building functions.
7415 * This does not include any of the tnl functions - they are
7416 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7420 _mesa_init_dlist_table( struct _glapi_table
*table
)
7422 _mesa_loopback_init_api_table( table
);
7425 SET_Accum(table
, save_Accum
);
7426 SET_AlphaFunc(table
, save_AlphaFunc
);
7427 SET_Bitmap(table
, save_Bitmap
);
7428 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7429 SET_CallList(table
, _mesa_save_CallList
);
7430 SET_CallLists(table
, _mesa_save_CallLists
);
7431 SET_Clear(table
, save_Clear
);
7432 SET_ClearAccum(table
, save_ClearAccum
);
7433 SET_ClearColor(table
, save_ClearColor
);
7434 SET_ClearDepth(table
, save_ClearDepth
);
7435 SET_ClearIndex(table
, save_ClearIndex
);
7436 SET_ClearStencil(table
, save_ClearStencil
);
7437 SET_ClipPlane(table
, save_ClipPlane
);
7438 SET_ColorMask(table
, save_ColorMask
);
7439 SET_ColorMaterial(table
, save_ColorMaterial
);
7440 SET_CopyPixels(table
, save_CopyPixels
);
7441 SET_CullFace(table
, save_CullFace
);
7442 SET_DeleteLists(table
, _mesa_DeleteLists
);
7443 SET_DepthFunc(table
, save_DepthFunc
);
7444 SET_DepthMask(table
, save_DepthMask
);
7445 SET_DepthRange(table
, save_DepthRange
);
7446 SET_Disable(table
, save_Disable
);
7447 SET_DrawBuffer(table
, save_DrawBuffer
);
7448 SET_DrawPixels(table
, save_DrawPixels
);
7449 SET_Enable(table
, save_Enable
);
7450 SET_EndList(table
, _mesa_EndList
);
7451 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7452 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7453 SET_Finish(table
, exec_Finish
);
7454 SET_Flush(table
, exec_Flush
);
7455 SET_Fogf(table
, save_Fogf
);
7456 SET_Fogfv(table
, save_Fogfv
);
7457 SET_Fogi(table
, save_Fogi
);
7458 SET_Fogiv(table
, save_Fogiv
);
7459 SET_FrontFace(table
, save_FrontFace
);
7460 SET_Frustum(table
, save_Frustum
);
7461 SET_GenLists(table
, _mesa_GenLists
);
7462 SET_GetBooleanv(table
, exec_GetBooleanv
);
7463 SET_GetClipPlane(table
, exec_GetClipPlane
);
7464 SET_GetDoublev(table
, exec_GetDoublev
);
7465 SET_GetError(table
, exec_GetError
);
7466 SET_GetFloatv(table
, exec_GetFloatv
);
7467 SET_GetIntegerv(table
, exec_GetIntegerv
);
7468 SET_GetLightfv(table
, exec_GetLightfv
);
7469 SET_GetLightiv(table
, exec_GetLightiv
);
7470 SET_GetMapdv(table
, exec_GetMapdv
);
7471 SET_GetMapfv(table
, exec_GetMapfv
);
7472 SET_GetMapiv(table
, exec_GetMapiv
);
7473 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7474 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7475 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7476 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7477 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7478 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7479 SET_GetString(table
, exec_GetString
);
7480 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7481 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7482 SET_GetTexGendv(table
, exec_GetTexGendv
);
7483 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7484 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7485 SET_GetTexImage(table
, exec_GetTexImage
);
7486 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7487 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7488 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7489 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7490 SET_Hint(table
, save_Hint
);
7491 SET_IndexMask(table
, save_IndexMask
);
7492 SET_InitNames(table
, save_InitNames
);
7493 SET_IsEnabled(table
, exec_IsEnabled
);
7494 SET_IsList(table
, _mesa_IsList
);
7495 SET_LightModelf(table
, save_LightModelf
);
7496 SET_LightModelfv(table
, save_LightModelfv
);
7497 SET_LightModeli(table
, save_LightModeli
);
7498 SET_LightModeliv(table
, save_LightModeliv
);
7499 SET_Lightf(table
, save_Lightf
);
7500 SET_Lightfv(table
, save_Lightfv
);
7501 SET_Lighti(table
, save_Lighti
);
7502 SET_Lightiv(table
, save_Lightiv
);
7503 SET_LineStipple(table
, save_LineStipple
);
7504 SET_LineWidth(table
, save_LineWidth
);
7505 SET_ListBase(table
, save_ListBase
);
7506 SET_LoadIdentity(table
, save_LoadIdentity
);
7507 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7508 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7509 SET_LoadName(table
, save_LoadName
);
7510 SET_LogicOp(table
, save_LogicOp
);
7511 SET_Map1d(table
, save_Map1d
);
7512 SET_Map1f(table
, save_Map1f
);
7513 SET_Map2d(table
, save_Map2d
);
7514 SET_Map2f(table
, save_Map2f
);
7515 SET_MapGrid1d(table
, save_MapGrid1d
);
7516 SET_MapGrid1f(table
, save_MapGrid1f
);
7517 SET_MapGrid2d(table
, save_MapGrid2d
);
7518 SET_MapGrid2f(table
, save_MapGrid2f
);
7519 SET_MatrixMode(table
, save_MatrixMode
);
7520 SET_MultMatrixd(table
, save_MultMatrixd
);
7521 SET_MultMatrixf(table
, save_MultMatrixf
);
7522 SET_NewList(table
, save_NewList
);
7523 SET_Ortho(table
, save_Ortho
);
7524 SET_PassThrough(table
, save_PassThrough
);
7525 SET_PixelMapfv(table
, save_PixelMapfv
);
7526 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7527 SET_PixelMapusv(table
, save_PixelMapusv
);
7528 SET_PixelStoref(table
, exec_PixelStoref
);
7529 SET_PixelStorei(table
, exec_PixelStorei
);
7530 SET_PixelTransferf(table
, save_PixelTransferf
);
7531 SET_PixelTransferi(table
, save_PixelTransferi
);
7532 SET_PixelZoom(table
, save_PixelZoom
);
7533 SET_PointSize(table
, save_PointSize
);
7534 SET_PolygonMode(table
, save_PolygonMode
);
7535 SET_PolygonOffset(table
, save_PolygonOffset
);
7536 SET_PolygonStipple(table
, save_PolygonStipple
);
7537 SET_PopAttrib(table
, save_PopAttrib
);
7538 SET_PopMatrix(table
, save_PopMatrix
);
7539 SET_PopName(table
, save_PopName
);
7540 SET_PushAttrib(table
, save_PushAttrib
);
7541 SET_PushMatrix(table
, save_PushMatrix
);
7542 SET_PushName(table
, save_PushName
);
7543 SET_RasterPos2d(table
, save_RasterPos2d
);
7544 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7545 SET_RasterPos2f(table
, save_RasterPos2f
);
7546 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7547 SET_RasterPos2i(table
, save_RasterPos2i
);
7548 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7549 SET_RasterPos2s(table
, save_RasterPos2s
);
7550 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7551 SET_RasterPos3d(table
, save_RasterPos3d
);
7552 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7553 SET_RasterPos3f(table
, save_RasterPos3f
);
7554 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7555 SET_RasterPos3i(table
, save_RasterPos3i
);
7556 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7557 SET_RasterPos3s(table
, save_RasterPos3s
);
7558 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7559 SET_RasterPos4d(table
, save_RasterPos4d
);
7560 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7561 SET_RasterPos4f(table
, save_RasterPos4f
);
7562 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7563 SET_RasterPos4i(table
, save_RasterPos4i
);
7564 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7565 SET_RasterPos4s(table
, save_RasterPos4s
);
7566 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7567 SET_ReadBuffer(table
, save_ReadBuffer
);
7568 SET_ReadPixels(table
, exec_ReadPixels
);
7569 SET_RenderMode(table
, exec_RenderMode
);
7570 SET_Rotated(table
, save_Rotated
);
7571 SET_Rotatef(table
, save_Rotatef
);
7572 SET_Scaled(table
, save_Scaled
);
7573 SET_Scalef(table
, save_Scalef
);
7574 SET_Scissor(table
, save_Scissor
);
7575 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7576 SET_SelectBuffer(table
, exec_SelectBuffer
);
7577 SET_ShadeModel(table
, save_ShadeModel
);
7578 SET_StencilFunc(table
, save_StencilFunc
);
7579 SET_StencilMask(table
, save_StencilMask
);
7580 SET_StencilOp(table
, save_StencilOp
);
7581 SET_TexEnvf(table
, save_TexEnvf
);
7582 SET_TexEnvfv(table
, save_TexEnvfv
);
7583 SET_TexEnvi(table
, save_TexEnvi
);
7584 SET_TexEnviv(table
, save_TexEnviv
);
7585 SET_TexGend(table
, save_TexGend
);
7586 SET_TexGendv(table
, save_TexGendv
);
7587 SET_TexGenf(table
, save_TexGenf
);
7588 SET_TexGenfv(table
, save_TexGenfv
);
7589 SET_TexGeni(table
, save_TexGeni
);
7590 SET_TexGeniv(table
, save_TexGeniv
);
7591 SET_TexImage1D(table
, save_TexImage1D
);
7592 SET_TexImage2D(table
, save_TexImage2D
);
7593 SET_TexParameterf(table
, save_TexParameterf
);
7594 SET_TexParameterfv(table
, save_TexParameterfv
);
7595 SET_TexParameteri(table
, save_TexParameteri
);
7596 SET_TexParameteriv(table
, save_TexParameteriv
);
7597 SET_Translated(table
, save_Translated
);
7598 SET_Translatef(table
, save_Translatef
);
7599 SET_Viewport(table
, save_Viewport
);
7602 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7603 SET_AreTexturesResidentEXT(table
, exec_AreTexturesResident
);
7604 SET_BindTexture(table
, save_BindTexture
);
7605 SET_ColorPointer(table
, exec_ColorPointer
);
7606 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7607 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7608 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7609 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7610 SET_DeleteTextures(table
, exec_DeleteTextures
);
7611 SET_DisableClientState(table
, exec_DisableClientState
);
7612 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7613 SET_EnableClientState(table
, exec_EnableClientState
);
7614 SET_GenTextures(table
, exec_GenTextures
);
7615 SET_GenTexturesEXT(table
, exec_GenTextures
);
7616 SET_GetPointerv(table
, exec_GetPointerv
);
7617 SET_IndexPointer(table
, exec_IndexPointer
);
7618 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7619 SET_IsTexture(table
, exec_IsTexture
);
7620 SET_IsTextureEXT(table
, exec_IsTexture
);
7621 SET_NormalPointer(table
, exec_NormalPointer
);
7622 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7623 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7624 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7625 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7626 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7627 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7628 SET_VertexPointer(table
, exec_VertexPointer
);
7631 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7632 SET_TexImage3D(table
, save_TexImage3D
);
7633 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7636 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7637 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7638 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7640 /* GL_ARB_imaging */
7641 /* Not all are supported */
7642 SET_BlendColor(table
, save_BlendColor
);
7643 SET_BlendEquation(table
, save_BlendEquation
);
7644 SET_ColorSubTable(table
, save_ColorSubTable
);
7645 SET_ColorTable(table
, save_ColorTable
);
7646 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7647 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7648 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7649 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7650 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7651 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7652 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7653 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7654 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7655 SET_CopyColorTable(table
, save_CopyColorTable
);
7656 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7657 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7658 SET_GetColorTable(table
, exec_GetColorTable
);
7659 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7660 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7661 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7662 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7663 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7664 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7665 SET_GetConvolutionFilterEXT(table
, exec_GetConvolutionFilter
);
7666 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7667 SET_GetConvolutionParameterfvEXT(table
, exec_GetConvolutionParameterfv
);
7668 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7669 SET_GetConvolutionParameterivEXT(table
, exec_GetConvolutionParameteriv
);
7670 SET_GetHistogram(table
, exec_GetHistogram
);
7671 SET_GetHistogramEXT(table
, exec_GetHistogram
);
7672 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7673 SET_GetHistogramParameterfvEXT(table
, exec_GetHistogramParameterfv
);
7674 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7675 SET_GetHistogramParameterivEXT(table
, exec_GetHistogramParameteriv
);
7676 SET_GetMinmax(table
, exec_GetMinmax
);
7677 SET_GetMinmaxEXT(table
, exec_GetMinmax
);
7678 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7679 SET_GetMinmaxParameterfvEXT(table
, exec_GetMinmaxParameterfv
);
7680 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7681 SET_GetMinmaxParameterivEXT(table
, exec_GetMinmaxParameteriv
);
7682 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7683 SET_GetSeparableFilterEXT(table
, exec_GetSeparableFilter
);
7684 SET_Histogram(table
, save_Histogram
);
7685 SET_Minmax(table
, save_Minmax
);
7686 SET_ResetHistogram(table
, save_ResetHistogram
);
7687 SET_ResetMinmax(table
, save_ResetMinmax
);
7688 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7690 /* 2. GL_EXT_blend_color */
7692 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7695 /* 3. GL_EXT_polygon_offset */
7696 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7698 /* 6. GL_EXT_texture3d */
7700 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7701 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7702 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7705 /* 30. GL_EXT_vertex_array */
7706 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7707 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7708 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7709 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7710 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7711 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7713 /* 37. GL_EXT_blend_minmax */
7715 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7718 /* 54. GL_EXT_point_parameters */
7719 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7720 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7722 /* 78. GL_EXT_paletted_texture */
7724 SET_ColorTableEXT(table
, save_ColorTable
);
7725 SET_ColorSubTableEXT(table
, save_ColorSubTable
);
7727 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7728 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7729 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7731 /* 97. GL_EXT_compiled_vertex_array */
7732 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7733 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7735 /* 145. GL_EXT_secondary_color */
7736 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7738 /* 148. GL_EXT_multi_draw_arrays */
7739 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7740 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7742 /* 149. GL_EXT_fog_coord */
7743 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7745 /* 173. GL_EXT_blend_func_separate */
7746 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7748 /* 196. GL_MESA_resize_buffers */
7749 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7751 /* 197. GL_MESA_window_pos */
7752 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7753 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7754 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7755 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7756 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7757 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7758 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7759 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7760 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7761 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7762 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7763 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7764 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7765 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7766 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7767 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7768 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7769 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7770 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7771 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7772 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7773 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7774 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7775 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7777 /* 200. GL_IBM_multimode_draw_arrays */
7778 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7779 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7781 #if FEATURE_NV_vertex_program
7782 /* 233. GL_NV_vertex_program */
7783 /* The following commands DO NOT go into display lists:
7784 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7785 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7787 SET_BindProgramNV(table
, save_BindProgramNV
);
7788 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7789 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
7790 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7791 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
7792 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
7793 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
7794 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
7795 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
7796 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
7797 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
7798 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
7799 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
7800 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
7801 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
7802 SET_IsProgramNV(table
, _mesa_IsProgram
);
7803 SET_LoadProgramNV(table
, save_LoadProgramNV
);
7804 SET_ProgramParameter4dNV(table
, save_ProgramParameter4dNV
);
7805 SET_ProgramParameter4dvNV(table
, save_ProgramParameter4dvNV
);
7806 SET_ProgramParameter4fNV(table
, save_ProgramParameter4fNV
);
7807 SET_ProgramParameter4fvNV(table
, save_ProgramParameter4fvNV
);
7808 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
7809 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
7810 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
7811 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
7814 /* 245. GL_ATI_fragment_shader */
7815 #if FEATURE_ATI_fragment_shader
7816 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
7817 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
7820 /* 282. GL_NV_fragment_program */
7821 #if FEATURE_NV_fragment_program
7822 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
7823 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
7824 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
7825 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
7826 SET_GetProgramNamedParameterfvNV(table
, _mesa_GetProgramNamedParameterfvNV
);
7827 SET_GetProgramNamedParameterdvNV(table
, _mesa_GetProgramNamedParameterdvNV
);
7828 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
7829 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
7830 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
7831 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
7832 SET_GetProgramLocalParameterdvARB(table
, _mesa_GetProgramLocalParameterdvARB
);
7833 SET_GetProgramLocalParameterfvARB(table
, _mesa_GetProgramLocalParameterfvARB
);
7836 /* 262. GL_NV_point_sprite */
7837 SET_PointParameteriNV(table
, save_PointParameteriNV
);
7838 SET_PointParameterivNV(table
, save_PointParameterivNV
);
7840 /* 268. GL_EXT_stencil_two_side */
7841 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
7843 /* ???. GL_EXT_depth_bounds_test */
7844 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
7846 /* ARB 1. GL_ARB_multitexture */
7847 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
7848 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
7850 /* ARB 3. GL_ARB_transpose_matrix */
7851 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
7852 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
7853 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
7854 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
7856 /* ARB 5. GL_ARB_multisample */
7857 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
7859 /* ARB 12. GL_ARB_texture_compression */
7860 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
7861 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
7862 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
7863 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
7864 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
7865 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
7866 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
7868 /* ARB 14. GL_ARB_point_parameters */
7869 /* aliased with EXT_point_parameters functions */
7871 /* ARB 25. GL_ARB_window_pos */
7872 /* aliased with MESA_window_pos functions */
7874 /* ARB 26. GL_ARB_vertex_program */
7875 /* ARB 27. GL_ARB_fragment_program */
7876 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7877 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7878 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
7879 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
7880 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
7881 SET_ProgramStringARB(table
, save_ProgramStringARB
);
7882 SET_BindProgramNV(table
, save_BindProgramNV
);
7883 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7884 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7885 SET_IsProgramNV(table
, _mesa_IsProgram
);
7886 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
7887 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
7888 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
7889 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
7890 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
7891 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
7892 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
7893 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
7894 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
7895 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
7896 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
7897 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
7898 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
7899 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
7900 SET_GetProgramLocalParameterdvARB(table
, _mesa_GetProgramLocalParameterdvARB
);
7901 SET_GetProgramLocalParameterfvARB(table
, _mesa_GetProgramLocalParameterfvARB
);
7902 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
7903 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
7906 /* ARB 28. GL_ARB_vertex_buffer_object */
7907 #if FEATURE_ARB_vertex_buffer_object
7908 /* None of the extension's functions get compiled */
7909 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
7910 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
7911 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
7912 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
7913 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
7914 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
7915 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
7916 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
7917 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
7918 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
7919 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
7922 #if FEATURE_ARB_occlusion_query
7923 SET_BeginQueryARB(table
, save_BeginQueryARB
);
7924 SET_EndQueryARB(table
, save_EndQueryARB
);
7925 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
7926 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
7927 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
7928 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
7929 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
7930 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
7932 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
7934 /* 299. GL_EXT_blend_equation_separate */
7935 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
7943 static const char *enum_string( GLenum k
)
7945 return _mesa_lookup_enum_by_nr( k
);
7950 * Print the commands in a display list. For debugging only.
7951 * TODO: many commands aren't handled yet.
7953 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7955 struct mesa_display_list
*dlist
;
7959 if (!CALL_IsList(GET_DISPATCH(), (list
))) {
7960 _mesa_printf("%u is not a display list ID\n", list
);
7964 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7970 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7972 done
= n
? GL_FALSE
: GL_TRUE
;
7974 OpCode opcode
= n
[0].opcode
;
7975 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
7977 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
7978 /* this is a driver-extended opcode */
7979 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
7980 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
7985 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7988 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7989 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7991 case OPCODE_CALL_LIST
:
7992 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7994 case OPCODE_CALL_LIST_OFFSET
:
7995 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7996 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7998 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7999 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8000 enum_string(n
[1].e
), enum_string(n
[2].e
),
8001 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8003 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8004 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8005 enum_string(n
[1].e
), enum_string(n
[2].e
),
8006 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8008 case OPCODE_DISABLE
:
8009 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8012 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8014 case OPCODE_FRUSTUM
:
8015 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8016 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8018 case OPCODE_LINE_STIPPLE
:
8019 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8021 case OPCODE_LOAD_IDENTITY
:
8022 _mesa_printf("LoadIdentity\n");
8024 case OPCODE_LOAD_MATRIX
:
8025 _mesa_printf("LoadMatrix\n");
8026 _mesa_printf(" %8f %8f %8f %8f\n",
8027 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8028 _mesa_printf(" %8f %8f %8f %8f\n",
8029 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8030 _mesa_printf(" %8f %8f %8f %8f\n",
8031 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8032 _mesa_printf(" %8f %8f %8f %8f\n",
8033 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8035 case OPCODE_MULT_MATRIX
:
8036 _mesa_printf("MultMatrix (or Rotate)\n");
8037 _mesa_printf(" %8f %8f %8f %8f\n",
8038 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8039 _mesa_printf(" %8f %8f %8f %8f\n",
8040 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8041 _mesa_printf(" %8f %8f %8f %8f\n",
8042 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8043 _mesa_printf(" %8f %8f %8f %8f\n",
8044 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8047 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8048 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8050 case OPCODE_POP_ATTRIB
:
8051 _mesa_printf("PopAttrib\n");
8053 case OPCODE_POP_MATRIX
:
8054 _mesa_printf("PopMatrix\n");
8056 case OPCODE_POP_NAME
:
8057 _mesa_printf("PopName\n");
8059 case OPCODE_PUSH_ATTRIB
:
8060 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8062 case OPCODE_PUSH_MATRIX
:
8063 _mesa_printf("PushMatrix\n");
8065 case OPCODE_PUSH_NAME
:
8066 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8068 case OPCODE_RASTER_POS
:
8069 _mesa_printf("RasterPos %g %g %g %g\n",
8070 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
8073 _mesa_printf("Rotate %g %g %g %g\n",
8074 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8077 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8079 case OPCODE_TRANSLATE
:
8080 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8082 case OPCODE_BIND_TEXTURE
:
8083 _mesa_printf("BindTexture %s %d\n",
8084 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8086 case OPCODE_SHADE_MODEL
:
8087 _mesa_printf("ShadeModel %s\n",
8088 _mesa_lookup_enum_by_nr(n
[1].ui
));
8091 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8092 _mesa_lookup_enum_by_nr(n
[1].ui
),
8093 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8096 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8097 _mesa_lookup_enum_by_nr(n
[1].ui
),
8098 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8099 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8101 case OPCODE_MAPGRID1
:
8102 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
8103 n
[1].i
, n
[2].f
, n
[3].f
);
8105 case OPCODE_MAPGRID2
:
8106 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8107 n
[1].i
, n
[2].f
, n
[3].f
,
8108 n
[4].i
, n
[5].f
, n
[6].f
);
8110 case OPCODE_EVALMESH1
:
8111 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8113 case OPCODE_EVALMESH2
:
8114 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8115 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8118 case OPCODE_ATTR_1F_NV
:
8119 _mesa_printf("ATTR_1F_NV attr %d: %f\n",
8122 case OPCODE_ATTR_2F_NV
:
8123 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8124 n
[1].i
, n
[2].f
, n
[3].f
);
8126 case OPCODE_ATTR_3F_NV
:
8127 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8128 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8130 case OPCODE_ATTR_4F_NV
:
8131 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8132 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8134 case OPCODE_ATTR_1F_ARB
:
8135 _mesa_printf("ATTR_1F_ARB attr %d: %f\n",
8138 case OPCODE_ATTR_2F_ARB
:
8139 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8140 n
[1].i
, n
[2].f
, n
[3].f
);
8142 case OPCODE_ATTR_3F_ARB
:
8143 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8144 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8146 case OPCODE_ATTR_4F_ARB
:
8147 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8148 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8151 case OPCODE_MATERIAL
:
8152 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8153 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8156 _mesa_printf("INDEX: %f\n", n
[1].f
);
8158 case OPCODE_EDGEFLAG
:
8159 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
8162 _mesa_printf("BEGIN %x\n", n
[1].i
);
8165 _mesa_printf("END\n");
8168 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8170 case OPCODE_EVAL_C1
:
8171 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8173 case OPCODE_EVAL_C2
:
8174 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8176 case OPCODE_EVAL_P1
:
8177 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8179 case OPCODE_EVAL_P2
:
8180 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8186 * meta opcodes/commands
8189 _mesa_printf("Error: %s %s\n",
8190 enum_string(n
[1].e
), (const char *)n
[2].data
);
8192 case OPCODE_CONTINUE
:
8193 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8194 n
= (Node
*) n
[1].next
;
8196 case OPCODE_END_OF_LIST
:
8197 _mesa_printf("END-LIST %u\n", list
);
8201 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8202 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8207 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
8210 /* increment n to point to next compiled command */
8211 if (opcode
!=OPCODE_CONTINUE
) {
8212 n
+= InstSize
[opcode
];
8221 * Clients may call this function to help debug display list problems.
8222 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8223 * changed, or break in the future without notice.
8225 void mesa_print_display_list( GLuint list
)
8227 GET_CURRENT_CONTEXT(ctx
);
8228 print_list( ctx
, list
);
8232 /**********************************************************************/
8233 /***** Initialization *****/
8234 /**********************************************************************/
8237 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
8239 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8240 vfmt
->Begin
= save_Begin
;
8241 vfmt
->CallList
= _mesa_save_CallList
;
8242 vfmt
->CallLists
= _mesa_save_CallLists
;
8243 vfmt
->Color3f
= save_Color3f
;
8244 vfmt
->Color3fv
= save_Color3fv
;
8245 vfmt
->Color4f
= save_Color4f
;
8246 vfmt
->Color4fv
= save_Color4fv
;
8247 vfmt
->EdgeFlag
= save_EdgeFlag
;
8248 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
8249 vfmt
->End
= save_End
;
8250 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8251 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8252 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8253 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8254 vfmt
->EvalPoint1
= save_EvalPoint1
;
8255 vfmt
->EvalPoint2
= save_EvalPoint2
;
8256 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8257 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8258 vfmt
->Indexf
= save_Indexf
;
8259 vfmt
->Indexfv
= save_Indexfv
;
8260 vfmt
->Materialfv
= save_Materialfv
;
8261 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8262 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8263 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8264 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8265 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8266 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8267 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8268 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8269 vfmt
->Normal3f
= save_Normal3f
;
8270 vfmt
->Normal3fv
= save_Normal3fv
;
8271 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8272 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8273 vfmt
->TexCoord1f
= save_TexCoord1f
;
8274 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8275 vfmt
->TexCoord2f
= save_TexCoord2f
;
8276 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8277 vfmt
->TexCoord3f
= save_TexCoord3f
;
8278 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8279 vfmt
->TexCoord4f
= save_TexCoord4f
;
8280 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8281 vfmt
->Vertex2f
= save_Vertex2f
;
8282 vfmt
->Vertex2fv
= save_Vertex2fv
;
8283 vfmt
->Vertex3f
= save_Vertex3f
;
8284 vfmt
->Vertex3fv
= save_Vertex3fv
;
8285 vfmt
->Vertex4f
= save_Vertex4f
;
8286 vfmt
->Vertex4fv
= save_Vertex4fv
;
8287 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8288 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8289 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8290 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8291 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8292 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8293 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8294 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8295 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8296 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8297 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8298 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8299 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8300 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8301 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8302 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8304 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8305 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8306 vfmt
->Rectf
= save_Rectf
;
8308 /* The driver is required to implement these as
8309 * 1) They can probably do a better job.
8310 * 2) A lot of new mechanisms would have to be added to this module
8311 * to support it. That code would probably never get used,
8315 vfmt
->DrawArrays
= 0;
8316 vfmt
->DrawElements
= 0;
8317 vfmt
->DrawRangeElements
= 0;
8323 void _mesa_init_display_list( GLcontext
* ctx
)
8326 ctx
->ListState
.CallDepth
= 0;
8327 ctx
->ExecuteFlag
= GL_TRUE
;
8328 ctx
->CompileFlag
= GL_FALSE
;
8329 ctx
->ListState
.CurrentListPtr
= NULL
;
8330 ctx
->ListState
.CurrentBlock
= NULL
;
8331 ctx
->ListState
.CurrentListNum
= 0;
8332 ctx
->ListState
.CurrentPos
= 0;
8334 /* Display List group */
8335 ctx
->List
.ListBase
= 0;
8337 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);