2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
7 * Permission is hereby granted, free of charge, to any person obtaining a
8 * copy of this software and associated documentation files (the "Software"),
9 * to deal in the Software without restriction, including without limitation
10 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
11 * and/or sell copies of the Software, and to permit persons to whom the
12 * Software is furnished to do so, subject to the following conditions:
14 * The above copyright notice and this permission notice shall be included
15 * in all copies or substantial portions of the Software.
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
18 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
21 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
22 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
28 * Display lists management functions.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
56 #include "extensions.h"
61 #include "histogram.h"
78 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
79 #include "nvprogram.h"
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_SGIX/SGIS_pixel_texture */
289 OPCODE_PIXEL_TEXGEN_SGIX
,
290 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
291 /* GL_ARB_texture_compression */
292 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
293 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
294 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
295 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
296 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
297 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
298 /* GL_ARB_multisample */
299 OPCODE_SAMPLE_COVERAGE
,
300 /* GL_ARB_window_pos */
301 OPCODE_WINDOW_POS_ARB
,
302 /* GL_NV_vertex_program */
303 OPCODE_BIND_PROGRAM_NV
,
304 OPCODE_EXECUTE_PROGRAM_NV
,
305 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
306 OPCODE_LOAD_PROGRAM_NV
,
307 OPCODE_PROGRAM_PARAMETER4F_NV
,
308 OPCODE_TRACK_MATRIX_NV
,
309 /* GL_NV_fragment_program */
310 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
311 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
312 /* GL_EXT_stencil_two_side */
313 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
314 /* GL_EXT_depth_bounds_test */
315 OPCODE_DEPTH_BOUNDS_EXT
,
316 /* GL_ARB_vertex/fragment_program */
317 OPCODE_PROGRAM_STRING_ARB
,
318 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
319 /* GL_ARB_occlusion_query */
320 OPCODE_BEGIN_QUERY_ARB
,
321 OPCODE_END_QUERY_ARB
,
322 /* GL_ARB_draw_buffers */
323 OPCODE_DRAW_BUFFERS_ARB
,
324 /* GL_ATI_fragment_shader */
325 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
326 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
328 OPCODE_STENCIL_FUNC_SEPARATE
,
329 OPCODE_STENCIL_OP_SEPARATE
,
330 OPCODE_STENCIL_MASK_SEPARATE
,
332 /* Vertex attributes -- fallback for when optimized display
333 * list build isn't active.
355 /* The following three are meta instructions */
356 OPCODE_ERROR
, /* raise compiled-in error */
367 * Display list instructions are stored as sequences of "nodes". Nodes
368 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
369 * are linked together with a pointer.
371 * Each instruction in the display list is stored as a sequence of
372 * contiguous nodes in memory.
373 * Each node is the union of a variety of data types.
387 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
392 * How many nodes to allocate at a time.
394 * \note Reduced now that we hold vertices etc. elsewhere.
396 #define BLOCK_SIZE 256
401 * Number of nodes of storage needed for each instruction.
402 * Sizes for dynamically allocated opcodes are stored in the context struct.
404 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
406 void mesa_print_display_list( GLuint list
);
409 /**********************************************************************/
410 /***** Private *****/
411 /**********************************************************************/
414 * Make an empty display list. This is used by glGenLists() to
415 * reserver display list IDs.
417 static struct mesa_display_list
*make_list( GLuint list
, GLuint count
)
419 struct mesa_display_list
*dlist
= CALLOC_STRUCT( mesa_display_list
);
421 dlist
->node
= (Node
*) MALLOC( sizeof(Node
) * count
);
422 dlist
->node
[0].opcode
= OPCODE_END_OF_LIST
;
429 * Destroy all nodes in a display list.
430 * \param list - display list number
432 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
434 struct mesa_display_list
*dlist
;
441 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
445 n
= block
= dlist
->node
;
447 done
= block
? GL_FALSE
: GL_TRUE
;
450 /* check for extension opcodes first */
452 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
453 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
454 ctx
->ListExt
.Opcode
[i
].Destroy(ctx
, &n
[1]);
455 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
458 switch (n
[0].opcode
) {
459 /* for some commands, we need to free malloc'd memory */
462 n
+= InstSize
[n
[0].opcode
];
466 n
+= InstSize
[n
[0].opcode
];
468 case OPCODE_DRAW_PIXELS
:
470 n
+= InstSize
[n
[0].opcode
];
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_COLOR_TABLE
:
478 n
+= InstSize
[n
[0].opcode
];
480 case OPCODE_COLOR_SUB_TABLE
:
482 n
+= InstSize
[n
[0].opcode
];
484 case OPCODE_CONVOLUTION_FILTER_1D
:
486 n
+= InstSize
[n
[0].opcode
];
488 case OPCODE_CONVOLUTION_FILTER_2D
:
490 n
+= InstSize
[n
[0].opcode
];
492 case OPCODE_POLYGON_STIPPLE
:
494 n
+= InstSize
[n
[0].opcode
];
496 case OPCODE_TEX_IMAGE1D
:
498 n
+= InstSize
[n
[0].opcode
];
500 case OPCODE_TEX_IMAGE2D
:
502 n
+= InstSize
[n
[0].opcode
];
504 case OPCODE_TEX_IMAGE3D
:
506 n
+= InstSize
[n
[0].opcode
];
508 case OPCODE_TEX_SUB_IMAGE1D
:
510 n
+= InstSize
[n
[0].opcode
];
512 case OPCODE_TEX_SUB_IMAGE2D
:
514 n
+= InstSize
[n
[0].opcode
];
516 case OPCODE_TEX_SUB_IMAGE3D
:
518 n
+= InstSize
[n
[0].opcode
];
520 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
522 n
+= InstSize
[n
[0].opcode
];
524 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
526 n
+= InstSize
[n
[0].opcode
];
528 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
530 n
+= InstSize
[n
[0].opcode
];
532 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
534 n
+= InstSize
[n
[0].opcode
];
536 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
538 n
+= InstSize
[n
[0].opcode
];
540 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
542 n
+= InstSize
[n
[0].opcode
];
544 #if FEATURE_NV_vertex_program
545 case OPCODE_LOAD_PROGRAM_NV
:
546 FREE(n
[4].data
); /* program string */
547 n
+= InstSize
[n
[0].opcode
];
549 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
550 FREE(n
[2].data
); /* array of program ids */
551 n
+= InstSize
[n
[0].opcode
];
554 #if FEATURE_NV_fragment_program
555 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
556 FREE(n
[3].data
); /* parameter name */
557 n
+= InstSize
[n
[0].opcode
];
560 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
561 case OPCODE_PROGRAM_STRING_ARB
:
562 FREE(n
[4].data
); /* program string */
563 n
+= InstSize
[n
[0].opcode
];
566 case OPCODE_CONTINUE
:
567 n
= (Node
*) n
[1].next
;
571 case OPCODE_END_OF_LIST
:
576 /* Most frequent case */
577 n
+= InstSize
[n
[0].opcode
];
584 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
590 * Translate the nth element of list from type to GLuint.
592 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
604 bptr
= (GLbyte
*) list
;
605 return (GLuint
) *(bptr
+n
);
606 case GL_UNSIGNED_BYTE
:
607 ubptr
= (GLubyte
*) list
;
608 return (GLuint
) *(ubptr
+n
);
610 sptr
= (GLshort
*) list
;
611 return (GLuint
) *(sptr
+n
);
612 case GL_UNSIGNED_SHORT
:
613 usptr
= (GLushort
*) list
;
614 return (GLuint
) *(usptr
+n
);
616 iptr
= (GLint
*) list
;
617 return (GLuint
) *(iptr
+n
);
618 case GL_UNSIGNED_INT
:
619 uiptr
= (GLuint
*) list
;
620 return (GLuint
) *(uiptr
+n
);
622 fptr
= (GLfloat
*) list
;
623 return (GLuint
) *(fptr
+n
);
625 ubptr
= ((GLubyte
*) list
) + 2*n
;
626 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
628 ubptr
= ((GLubyte
*) list
) + 3*n
;
629 return (GLuint
) *ubptr
* 65536
630 + (GLuint
) *(ubptr
+1) * 256
631 + (GLuint
) *(ubptr
+2);
633 ubptr
= ((GLubyte
*) list
) + 4*n
;
634 return (GLuint
) *ubptr
* 16777216
635 + (GLuint
) *(ubptr
+1) * 65536
636 + (GLuint
) *(ubptr
+2) * 256
637 + (GLuint
) *(ubptr
+3);
646 /**********************************************************************/
648 /**********************************************************************/
651 * Do one-time initialiazations for display lists.
654 _mesa_init_lists( void )
656 static int init_flag
= 0;
659 InstSize
[OPCODE_ACCUM
] = 3;
660 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
661 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
662 InstSize
[OPCODE_BITMAP
] = 8;
663 InstSize
[OPCODE_BLEND_COLOR
] = 5;
664 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
665 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
666 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
667 InstSize
[OPCODE_CALL_LIST
] = 2;
668 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
669 InstSize
[OPCODE_CLEAR
] = 2;
670 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
671 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
672 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
673 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
674 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
675 InstSize
[OPCODE_CLIP_PLANE
] = 6;
676 InstSize
[OPCODE_COLOR_MASK
] = 5;
677 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
678 InstSize
[OPCODE_COLOR_TABLE
] = 7;
679 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
680 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
681 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
682 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
683 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
684 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
685 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
686 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
687 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
688 InstSize
[OPCODE_COPY_PIXELS
] = 6;
689 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
690 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
691 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
692 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
693 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
694 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
695 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
696 InstSize
[OPCODE_CULL_FACE
] = 2;
697 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
698 InstSize
[OPCODE_DEPTH_MASK
] = 2;
699 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
700 InstSize
[OPCODE_DISABLE
] = 2;
701 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
702 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
703 InstSize
[OPCODE_ENABLE
] = 2;
704 InstSize
[OPCODE_EVALMESH1
] = 4;
705 InstSize
[OPCODE_EVALMESH2
] = 6;
706 InstSize
[OPCODE_FOG
] = 6;
707 InstSize
[OPCODE_FRONT_FACE
] = 2;
708 InstSize
[OPCODE_FRUSTUM
] = 7;
709 InstSize
[OPCODE_HINT
] = 3;
710 InstSize
[OPCODE_HISTOGRAM
] = 5;
711 InstSize
[OPCODE_INDEX_MASK
] = 2;
712 InstSize
[OPCODE_INIT_NAMES
] = 1;
713 InstSize
[OPCODE_LIGHT
] = 7;
714 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
715 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
716 InstSize
[OPCODE_LINE_WIDTH
] = 2;
717 InstSize
[OPCODE_LIST_BASE
] = 2;
718 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
719 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
720 InstSize
[OPCODE_LOAD_NAME
] = 2;
721 InstSize
[OPCODE_LOGIC_OP
] = 2;
722 InstSize
[OPCODE_MAP1
] = 7;
723 InstSize
[OPCODE_MAP2
] = 11;
724 InstSize
[OPCODE_MAPGRID1
] = 4;
725 InstSize
[OPCODE_MAPGRID2
] = 7;
726 InstSize
[OPCODE_MATRIX_MODE
] = 2;
727 InstSize
[OPCODE_MIN_MAX
] = 4;
728 InstSize
[OPCODE_MULT_MATRIX
] = 17;
729 InstSize
[OPCODE_ORTHO
] = 7;
730 InstSize
[OPCODE_PASSTHROUGH
] = 2;
731 InstSize
[OPCODE_PIXEL_MAP
] = 4;
732 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
733 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
734 InstSize
[OPCODE_POINT_SIZE
] = 2;
735 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
736 InstSize
[OPCODE_POLYGON_MODE
] = 3;
737 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
738 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
739 InstSize
[OPCODE_POP_ATTRIB
] = 1;
740 InstSize
[OPCODE_POP_MATRIX
] = 1;
741 InstSize
[OPCODE_POP_NAME
] = 1;
742 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
743 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
744 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
745 InstSize
[OPCODE_PUSH_NAME
] = 2;
746 InstSize
[OPCODE_RASTER_POS
] = 5;
747 InstSize
[OPCODE_READ_BUFFER
] = 2;
748 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
749 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
750 InstSize
[OPCODE_ROTATE
] = 5;
751 InstSize
[OPCODE_SCALE
] = 4;
752 InstSize
[OPCODE_SCISSOR
] = 5;
753 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
754 InstSize
[OPCODE_STENCIL_MASK
] = 2;
755 InstSize
[OPCODE_STENCIL_OP
] = 4;
756 InstSize
[OPCODE_SHADE_MODEL
] = 2;
757 InstSize
[OPCODE_TEXENV
] = 7;
758 InstSize
[OPCODE_TEXGEN
] = 7;
759 InstSize
[OPCODE_TEXPARAMETER
] = 7;
760 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
761 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
762 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
763 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
764 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
765 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
766 InstSize
[OPCODE_TRANSLATE
] = 4;
767 InstSize
[OPCODE_VIEWPORT
] = 5;
768 InstSize
[OPCODE_WINDOW_POS
] = 5;
769 InstSize
[OPCODE_CONTINUE
] = 2;
770 InstSize
[OPCODE_ERROR
] = 3;
771 InstSize
[OPCODE_END_OF_LIST
] = 1;
772 /* GL_SGIX/SGIS_pixel_texture */
773 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
774 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
775 /* GL_ARB_texture_compression */
776 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
777 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
778 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
779 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
780 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
781 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
782 /* GL_ARB_multisample */
783 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
784 /* GL_ARB_multitexture */
785 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
786 /* GL_ARB_window_pos */
787 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
788 /* GL_NV_vertex_program */
789 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
790 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
791 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
792 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
793 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
794 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
795 /* GL_NV_fragment_program */
796 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
797 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
798 /* GL_EXT_stencil_two_side */
799 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
800 /* GL_EXT_depth_bounds_test */
801 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
802 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
803 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
804 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
806 #if FEATURE_ARB_occlusion_query
807 InstSize
[OPCODE_BEGIN_QUERY_ARB
] = 3;
808 InstSize
[OPCODE_END_QUERY_ARB
] = 2;
810 InstSize
[OPCODE_DRAW_BUFFERS_ARB
] = 2 + MAX_DRAW_BUFFERS
;
811 #if FEATURE_ATI_fragment_shader
812 InstSize
[OPCODE_BIND_FRAGMENT_SHADER_ATI
] = 2;
813 InstSize
[OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
] = 6;
816 InstSize
[OPCODE_STENCIL_FUNC_SEPARATE
] = 5;
817 InstSize
[OPCODE_STENCIL_MASK_SEPARATE
] = 3;
818 InstSize
[OPCODE_STENCIL_OP_SEPARATE
] = 5;
820 InstSize
[OPCODE_ATTR_1F_NV
] = 3;
821 InstSize
[OPCODE_ATTR_2F_NV
] = 4;
822 InstSize
[OPCODE_ATTR_3F_NV
] = 5;
823 InstSize
[OPCODE_ATTR_4F_NV
] = 6;
824 InstSize
[OPCODE_ATTR_1F_ARB
] = 3;
825 InstSize
[OPCODE_ATTR_2F_ARB
] = 4;
826 InstSize
[OPCODE_ATTR_3F_ARB
] = 5;
827 InstSize
[OPCODE_ATTR_4F_ARB
] = 6;
828 InstSize
[OPCODE_MATERIAL
] = 7;
829 InstSize
[OPCODE_INDEX
] = 2;
830 InstSize
[OPCODE_EDGEFLAG
] = 2;
831 InstSize
[OPCODE_BEGIN
] = 2;
832 InstSize
[OPCODE_END
] = 1;
833 InstSize
[OPCODE_RECTF
] = 5;
834 InstSize
[OPCODE_EVAL_C1
] = 2;
835 InstSize
[OPCODE_EVAL_C2
] = 3;
836 InstSize
[OPCODE_EVAL_P1
] = 2;
837 InstSize
[OPCODE_EVAL_P2
] = 3;
845 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
846 * \todo This won't suffice when the PBO is really in VRAM/GPU memory.
849 unpack_image( GLuint dimensions
, GLsizei width
, GLsizei height
, GLsizei depth
,
850 GLenum format
, GLenum type
, const GLvoid
*pixels
,
851 const struct gl_pixelstore_attrib
*unpack
)
853 if (unpack
->BufferObj
->Name
== 0) {
855 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
, type
,
858 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
859 format
, type
, pixels
)) {
860 const GLubyte
*src
= ADD_POINTERS(unpack
->BufferObj
->Data
, pixels
);
861 return _mesa_unpack_image(dimensions
, width
, height
, depth
, format
, type
,
870 * Allocate space for a display list instruction.
871 * \param opcode - type of instruction
872 * argcount - size in bytes of data required.
873 * \return pointer to the usable data area (not including the internal
877 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
880 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
883 if (opcode
< (int) OPCODE_EXT_0
) {
884 assert( count
== InstSize
[opcode
] );
888 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
889 /* This block is full. Allocate a new block and chain to it */
890 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
891 n
[0].opcode
= OPCODE_CONTINUE
;
892 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
894 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
897 n
[1].next
= (Node
*) newblock
;
898 ctx
->ListState
.CurrentBlock
= newblock
;
899 ctx
->ListState
.CurrentPos
= 0;
902 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
903 ctx
->ListState
.CurrentPos
+= count
;
905 n
[0].opcode
= (OpCode
) opcode
;
907 return (void *)&n
[1];
912 * This function allows modules and drivers to get their own opcodes
913 * for extending display list functionality.
914 * \param ctx the rendering context
915 * \param size number of bytes for storing the new display list command
916 * \param execute function to execute the new display list command
917 * \param destroy function to destroy the new display list command
918 * \param print function to print the new display list command
919 * \return the new opcode number or -1 if error
922 _mesa_alloc_opcode( GLcontext
*ctx
,
924 void (*execute
)( GLcontext
*, void * ),
925 void (*destroy
)( GLcontext
*, void * ),
926 void (*print
)( GLcontext
*, void * ) )
928 if (ctx
->ListExt
.NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
929 const GLuint i
= ctx
->ListExt
.NumOpcodes
++;
930 ctx
->ListExt
.Opcode
[i
].Size
= 1 + (size
+ sizeof(Node
) - 1)/sizeof(Node
);
931 ctx
->ListExt
.Opcode
[i
].Execute
= execute
;
932 ctx
->ListExt
.Opcode
[i
].Destroy
= destroy
;
933 ctx
->ListExt
.Opcode
[i
].Print
= print
;
934 return i
+ OPCODE_EXT_0
;
941 /* Mimic the old behaviour of alloc_instruction:
942 * - sz is in units of sizeof(Node)
943 * - return value a pointer to sizeof(Node) before the actual
946 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
947 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
952 * Display List compilation functions
954 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
956 GET_CURRENT_CONTEXT(ctx
);
958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
959 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
964 if (ctx
->ExecuteFlag
) {
965 CALL_Accum(ctx
->Exec
, ( op
, value
));
970 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
972 GET_CURRENT_CONTEXT(ctx
);
974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
975 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
978 n
[2].f
= (GLfloat
) ref
;
980 if (ctx
->ExecuteFlag
) {
981 CALL_AlphaFunc(ctx
->Exec
, ( func
, ref
));
986 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
988 GET_CURRENT_CONTEXT(ctx
);
990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
991 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
996 if (ctx
->ExecuteFlag
) {
997 CALL_BindTexture(ctx
->Exec
, ( target
, texture
));
1002 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
1003 GLfloat xorig
, GLfloat yorig
,
1004 GLfloat xmove
, GLfloat ymove
,
1005 const GLubyte
*pixels
)
1007 GET_CURRENT_CONTEXT(ctx
);
1008 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
1010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1011 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
1013 n
[1].i
= (GLint
) width
;
1014 n
[2].i
= (GLint
) height
;
1024 if (ctx
->ExecuteFlag
) {
1025 CALL_Bitmap(ctx
->Exec
, ( width
, height
,
1026 xorig
, yorig
, xmove
, ymove
, pixels
));
1031 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
1033 GET_CURRENT_CONTEXT(ctx
);
1035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1036 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
1040 if (ctx
->ExecuteFlag
) {
1041 CALL_BlendEquation(ctx
->Exec
, ( mode
));
1046 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
1049 GET_CURRENT_CONTEXT(ctx
);
1051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1052 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
1057 if (ctx
->ExecuteFlag
) {
1058 CALL_BlendEquationSeparateEXT(ctx
->Exec
, ( modeRGB
, modeA
));
1063 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1064 GLenum sfactorA
, GLenum dfactorA
)
1066 GET_CURRENT_CONTEXT(ctx
);
1068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1069 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
1071 n
[1].e
= sfactorRGB
;
1072 n
[2].e
= dfactorRGB
;
1076 if (ctx
->ExecuteFlag
) {
1077 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1078 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1083 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
1084 GLfloat blue
, GLfloat alpha
)
1086 GET_CURRENT_CONTEXT(ctx
);
1088 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1089 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1096 if (ctx
->ExecuteFlag
) {
1097 CALL_BlendColor(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1102 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1104 GET_CURRENT_CONTEXT(ctx
);
1106 SAVE_FLUSH_VERTICES(ctx
);
1108 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1113 /* After this, we don't know what begin/end state we're in:
1115 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1117 if (ctx
->ExecuteFlag
) {
1118 CALL_CallList(ctx
->Exec
, ( list
));
1123 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1125 GET_CURRENT_CONTEXT(ctx
);
1127 GLboolean typeErrorFlag
;
1129 SAVE_FLUSH_VERTICES(ctx
);
1133 case GL_UNSIGNED_BYTE
:
1135 case GL_UNSIGNED_SHORT
:
1137 case GL_UNSIGNED_INT
:
1142 typeErrorFlag
= GL_FALSE
;
1145 typeErrorFlag
= GL_TRUE
;
1149 GLuint list
= translate_id( i
, type
, lists
);
1150 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1153 n
[2].b
= typeErrorFlag
;
1157 /* After this, we don't know what begin/end state we're in:
1159 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1161 if (ctx
->ExecuteFlag
) {
1162 CALL_CallLists(ctx
->Exec
, ( n
, type
, lists
));
1167 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1169 GET_CURRENT_CONTEXT(ctx
);
1171 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1172 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1176 if (ctx
->ExecuteFlag
) {
1177 CALL_Clear(ctx
->Exec
, ( mask
));
1182 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1183 GLfloat blue
, GLfloat alpha
)
1185 GET_CURRENT_CONTEXT(ctx
);
1187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1188 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1195 if (ctx
->ExecuteFlag
) {
1196 CALL_ClearAccum(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1201 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1202 GLclampf blue
, GLclampf alpha
)
1204 GET_CURRENT_CONTEXT(ctx
);
1206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1207 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1214 if (ctx
->ExecuteFlag
) {
1215 CALL_ClearColor(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1220 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1222 GET_CURRENT_CONTEXT(ctx
);
1224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1227 n
[1].f
= (GLfloat
) depth
;
1229 if (ctx
->ExecuteFlag
) {
1230 CALL_ClearDepth(ctx
->Exec
, ( depth
));
1235 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1237 GET_CURRENT_CONTEXT(ctx
);
1239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1240 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1244 if (ctx
->ExecuteFlag
) {
1245 CALL_ClearIndex(ctx
->Exec
, ( c
));
1250 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1252 GET_CURRENT_CONTEXT(ctx
);
1254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1255 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1259 if (ctx
->ExecuteFlag
) {
1260 CALL_ClearStencil(ctx
->Exec
, ( s
));
1265 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1267 GET_CURRENT_CONTEXT(ctx
);
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1273 n
[2].f
= (GLfloat
) equ
[0];
1274 n
[3].f
= (GLfloat
) equ
[1];
1275 n
[4].f
= (GLfloat
) equ
[2];
1276 n
[5].f
= (GLfloat
) equ
[3];
1278 if (ctx
->ExecuteFlag
) {
1279 CALL_ClipPlane(ctx
->Exec
, ( plane
, equ
));
1285 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1286 GLboolean blue
, GLboolean alpha
)
1288 GET_CURRENT_CONTEXT(ctx
);
1290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1291 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1298 if (ctx
->ExecuteFlag
) {
1299 CALL_ColorMask(ctx
->Exec
, ( red
, green
, blue
, alpha
));
1304 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1306 GET_CURRENT_CONTEXT(ctx
);
1308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1310 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1315 if (ctx
->ExecuteFlag
) {
1316 CALL_ColorMaterial(ctx
->Exec
, ( face
, mode
));
1321 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1322 GLsizei width
, GLenum format
, GLenum type
,
1323 const GLvoid
*table
)
1325 GET_CURRENT_CONTEXT(ctx
);
1326 if (target
== GL_PROXY_TEXTURE_1D
||
1327 target
== GL_PROXY_TEXTURE_2D
||
1328 target
== GL_PROXY_TEXTURE_3D
||
1329 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1330 /* execute immediately */
1331 CALL_ColorTable(ctx
->Exec
, ( target
, internalFormat
, width
,
1332 format
, type
, table
));
1335 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, table
,
1338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1339 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1342 n
[2].e
= internalFormat
;
1351 if (ctx
->ExecuteFlag
) {
1352 CALL_ColorTable(ctx
->Exec
, ( target
, internalFormat
, width
,
1353 format
, type
, table
));
1360 static void GLAPIENTRY
1361 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1363 GET_CURRENT_CONTEXT(ctx
);
1366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1368 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1373 if (pname
== GL_COLOR_TABLE_SGI
||
1374 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1375 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1376 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1383 if (ctx
->ExecuteFlag
) {
1384 CALL_ColorTableParameterfv(ctx
->Exec
, ( target
, pname
, params
));
1389 static void GLAPIENTRY
1390 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1392 GET_CURRENT_CONTEXT(ctx
);
1395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1397 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1402 if (pname
== GL_COLOR_TABLE_SGI
||
1403 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1404 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1405 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1412 if (ctx
->ExecuteFlag
) {
1413 CALL_ColorTableParameteriv(ctx
->Exec
, ( target
, pname
, params
));
1419 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1420 GLenum format
, GLenum type
,
1421 const GLvoid
*table
)
1423 GET_CURRENT_CONTEXT(ctx
);
1424 GLvoid
*image
= unpack_image(1, count
, 1, 1, format
, type
, table
,
1427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1428 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1440 if (ctx
->ExecuteFlag
) {
1441 CALL_ColorSubTable(ctx
->Exec
, (target
, start
, count
, format
, type
, table
));
1446 static void GLAPIENTRY
1447 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1448 GLint x
, GLint y
, GLsizei width
)
1450 GET_CURRENT_CONTEXT(ctx
);
1453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1454 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1462 if (ctx
->ExecuteFlag
) {
1463 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1468 static void GLAPIENTRY
1469 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1470 GLint x
, GLint y
, GLsizei width
)
1472 GET_CURRENT_CONTEXT(ctx
);
1475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1476 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1479 n
[2].e
= internalformat
;
1484 if (ctx
->ExecuteFlag
) {
1485 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1490 static void GLAPIENTRY
1491 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1492 GLenum format
, GLenum type
, const GLvoid
*filter
)
1494 GET_CURRENT_CONTEXT(ctx
);
1495 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
, filter
,
1498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1499 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1502 n
[2].e
= internalFormat
;
1511 if (ctx
->ExecuteFlag
) {
1512 CALL_ConvolutionFilter1D(ctx
->Exec
, ( target
, internalFormat
, width
,
1513 format
, type
, filter
));
1518 static void GLAPIENTRY
1519 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1520 GLsizei width
, GLsizei height
, GLenum format
,
1521 GLenum type
, const GLvoid
*filter
)
1523 GET_CURRENT_CONTEXT(ctx
);
1524 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
, filter
,
1527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1528 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1531 n
[2].e
= internalFormat
;
1541 if (ctx
->ExecuteFlag
) {
1542 CALL_ConvolutionFilter2D(ctx
->Exec
, ( target
, internalFormat
, width
, height
,
1543 format
, type
, filter
));
1548 static void GLAPIENTRY
1549 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1551 GET_CURRENT_CONTEXT(ctx
);
1553 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1554 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1560 if (ctx
->ExecuteFlag
) {
1561 CALL_ConvolutionParameteri(ctx
->Exec
, ( target
, pname
, param
));
1566 static void GLAPIENTRY
1567 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1569 GET_CURRENT_CONTEXT(ctx
);
1571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1572 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1577 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1578 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1579 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1585 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1588 if (ctx
->ExecuteFlag
) {
1589 CALL_ConvolutionParameteriv(ctx
->Exec
, ( target
, pname
, params
));
1594 static void GLAPIENTRY
1595 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1597 GET_CURRENT_CONTEXT(ctx
);
1599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1600 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1606 if (ctx
->ExecuteFlag
) {
1607 CALL_ConvolutionParameterf(ctx
->Exec
, ( target
, pname
, param
));
1612 static void GLAPIENTRY
1613 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1615 GET_CURRENT_CONTEXT(ctx
);
1617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1618 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1623 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1624 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1625 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1631 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1634 if (ctx
->ExecuteFlag
) {
1635 CALL_ConvolutionParameterfv(ctx
->Exec
, ( target
, pname
, params
));
1640 static void GLAPIENTRY
1641 save_CopyPixels( GLint x
, GLint y
,
1642 GLsizei width
, GLsizei height
, GLenum type
)
1644 GET_CURRENT_CONTEXT(ctx
);
1646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1647 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1651 n
[3].i
= (GLint
) width
;
1652 n
[4].i
= (GLint
) height
;
1655 if (ctx
->ExecuteFlag
) {
1656 CALL_CopyPixels(ctx
->Exec
, ( x
, y
, width
, height
, type
));
1662 static void GLAPIENTRY
1663 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1664 GLint x
, GLint y
, GLsizei width
, GLint border
)
1666 GET_CURRENT_CONTEXT(ctx
);
1668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1669 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1673 n
[3].e
= internalformat
;
1679 if (ctx
->ExecuteFlag
) {
1680 CALL_CopyTexImage1D(ctx
->Exec
, ( target
, level
, internalformat
,
1681 x
, y
, width
, border
));
1686 static void GLAPIENTRY
1687 save_CopyTexImage2D( GLenum target
, GLint level
,
1688 GLenum internalformat
,
1689 GLint x
, GLint y
, GLsizei width
,
1690 GLsizei height
, GLint border
)
1692 GET_CURRENT_CONTEXT(ctx
);
1694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1695 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1699 n
[3].e
= internalformat
;
1706 if (ctx
->ExecuteFlag
) {
1707 CALL_CopyTexImage2D(ctx
->Exec
, ( target
, level
, internalformat
,
1708 x
, y
, width
, height
, border
));
1714 static void GLAPIENTRY
1715 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1716 GLint xoffset
, GLint x
, GLint y
,
1719 GET_CURRENT_CONTEXT(ctx
);
1721 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1722 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1731 if (ctx
->ExecuteFlag
) {
1732 CALL_CopyTexSubImage1D(ctx
->Exec
, ( target
, level
, xoffset
, x
, y
, width
));
1737 static void GLAPIENTRY
1738 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1739 GLint xoffset
, GLint yoffset
,
1741 GLsizei width
, GLint height
)
1743 GET_CURRENT_CONTEXT(ctx
);
1745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1746 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1757 if (ctx
->ExecuteFlag
) {
1758 CALL_CopyTexSubImage2D(ctx
->Exec
, ( target
, level
, xoffset
, yoffset
,
1759 x
, y
, width
, height
));
1764 static void GLAPIENTRY
1765 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1766 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1768 GLsizei width
, GLint height
)
1770 GET_CURRENT_CONTEXT(ctx
);
1772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1773 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1785 if (ctx
->ExecuteFlag
) {
1786 CALL_CopyTexSubImage3D(ctx
->Exec
, ( target
, level
,
1787 xoffset
, yoffset
, zoffset
,
1788 x
, y
, width
, height
));
1793 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1795 GET_CURRENT_CONTEXT(ctx
);
1797 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1798 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1802 if (ctx
->ExecuteFlag
) {
1803 CALL_CullFace(ctx
->Exec
, ( mode
));
1808 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1810 GET_CURRENT_CONTEXT(ctx
);
1812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1813 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1817 if (ctx
->ExecuteFlag
) {
1818 CALL_DepthFunc(ctx
->Exec
, ( func
));
1823 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1825 GET_CURRENT_CONTEXT(ctx
);
1827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1828 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1832 if (ctx
->ExecuteFlag
) {
1833 CALL_DepthMask(ctx
->Exec
, ( mask
));
1838 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1840 GET_CURRENT_CONTEXT(ctx
);
1842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1843 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1845 n
[1].f
= (GLfloat
) nearval
;
1846 n
[2].f
= (GLfloat
) farval
;
1848 if (ctx
->ExecuteFlag
) {
1849 CALL_DepthRange(ctx
->Exec
, ( nearval
, farval
));
1854 static void GLAPIENTRY
save_Disable( GLenum cap
)
1856 GET_CURRENT_CONTEXT(ctx
);
1858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1859 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1863 if (ctx
->ExecuteFlag
) {
1864 CALL_Disable(ctx
->Exec
, ( cap
));
1869 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1871 GET_CURRENT_CONTEXT(ctx
);
1873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1874 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1878 if (ctx
->ExecuteFlag
) {
1879 CALL_DrawBuffer(ctx
->Exec
, ( mode
));
1884 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1885 GLenum format
, GLenum type
,
1886 const GLvoid
*pixels
)
1888 GET_CURRENT_CONTEXT(ctx
);
1889 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
1890 pixels
, &ctx
->Unpack
);
1892 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1893 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1904 if (ctx
->ExecuteFlag
) {
1905 CALL_DrawPixels(ctx
->Exec
, ( width
, height
, format
, type
, pixels
));
1911 static void GLAPIENTRY
save_Enable( GLenum cap
)
1913 GET_CURRENT_CONTEXT(ctx
);
1915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1916 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1920 if (ctx
->ExecuteFlag
) {
1921 CALL_Enable(ctx
->Exec
, ( cap
));
1927 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1929 GET_CURRENT_CONTEXT(ctx
);
1931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1932 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1938 if (ctx
->ExecuteFlag
) {
1939 CALL_EvalMesh1(ctx
->Exec
, ( mode
, i1
, i2
));
1944 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1946 GET_CURRENT_CONTEXT(ctx
);
1948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1949 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1957 if (ctx
->ExecuteFlag
) {
1958 CALL_EvalMesh2(ctx
->Exec
, ( mode
, i1
, i2
, j1
, j2
));
1965 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1967 GET_CURRENT_CONTEXT(ctx
);
1969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1970 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1978 if (ctx
->ExecuteFlag
) {
1979 CALL_Fogfv(ctx
->Exec
, ( pname
, params
));
1984 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1986 save_Fogfv(pname
, ¶m
);
1990 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1995 case GL_FOG_DENSITY
:
1999 p
[0] = (GLfloat
) *params
;
2002 p
[0] = INT_TO_FLOAT( params
[0] );
2003 p
[1] = INT_TO_FLOAT( params
[1] );
2004 p
[2] = INT_TO_FLOAT( params
[2] );
2005 p
[3] = INT_TO_FLOAT( params
[3] );
2008 /* Error will be caught later in gl_Fogfv */
2011 save_Fogfv(pname
, p
);
2015 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
2017 save_Fogiv(pname
, ¶m
);
2021 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
2023 GET_CURRENT_CONTEXT(ctx
);
2025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2026 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
2030 if (ctx
->ExecuteFlag
) {
2031 CALL_FrontFace(ctx
->Exec
, ( mode
));
2036 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
2037 GLdouble bottom
, GLdouble top
,
2038 GLdouble nearval
, GLdouble farval
)
2040 GET_CURRENT_CONTEXT(ctx
);
2042 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2043 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
2045 n
[1].f
= (GLfloat
) left
;
2046 n
[2].f
= (GLfloat
) right
;
2047 n
[3].f
= (GLfloat
) bottom
;
2048 n
[4].f
= (GLfloat
) top
;
2049 n
[5].f
= (GLfloat
) nearval
;
2050 n
[6].f
= (GLfloat
) farval
;
2052 if (ctx
->ExecuteFlag
) {
2053 CALL_Frustum(ctx
->Exec
, ( left
, right
, bottom
, top
, nearval
, farval
));
2058 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
2060 GET_CURRENT_CONTEXT(ctx
);
2062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2063 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
2068 if (ctx
->ExecuteFlag
) {
2069 CALL_Hint(ctx
->Exec
, ( target
, mode
));
2074 static void GLAPIENTRY
2075 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
2077 GET_CURRENT_CONTEXT(ctx
);
2080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2081 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2085 n
[3].e
= internalFormat
;
2088 if (ctx
->ExecuteFlag
) {
2089 CALL_Histogram(ctx
->Exec
, ( target
, width
, internalFormat
, sink
));
2094 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2096 GET_CURRENT_CONTEXT(ctx
);
2098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2099 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2103 if (ctx
->ExecuteFlag
) {
2104 CALL_IndexMask(ctx
->Exec
, ( mask
));
2109 static void GLAPIENTRY
save_InitNames( void )
2111 GET_CURRENT_CONTEXT(ctx
);
2112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2113 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2114 if (ctx
->ExecuteFlag
) {
2115 CALL_InitNames(ctx
->Exec
, ());
2120 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2122 GET_CURRENT_CONTEXT(ctx
);
2124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2125 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2143 case GL_SPOT_DIRECTION
:
2146 case GL_SPOT_EXPONENT
:
2149 case GL_SPOT_CUTOFF
:
2152 case GL_CONSTANT_ATTENUATION
:
2155 case GL_LINEAR_ATTENUATION
:
2158 case GL_QUADRATIC_ATTENUATION
:
2164 for (i
= 0; i
< nParams
; i
++) {
2165 n
[3+i
].f
= params
[i
];
2168 if (ctx
->ExecuteFlag
) {
2169 CALL_Lightfv(ctx
->Exec
, ( light
, pname
, params
));
2174 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2176 save_Lightfv(light
, pname
, ¶ms
);
2180 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2187 fparam
[0] = INT_TO_FLOAT( params
[0] );
2188 fparam
[1] = INT_TO_FLOAT( params
[1] );
2189 fparam
[2] = INT_TO_FLOAT( params
[2] );
2190 fparam
[3] = INT_TO_FLOAT( params
[3] );
2193 fparam
[0] = (GLfloat
) params
[0];
2194 fparam
[1] = (GLfloat
) params
[1];
2195 fparam
[2] = (GLfloat
) params
[2];
2196 fparam
[3] = (GLfloat
) params
[3];
2198 case GL_SPOT_DIRECTION
:
2199 fparam
[0] = (GLfloat
) params
[0];
2200 fparam
[1] = (GLfloat
) params
[1];
2201 fparam
[2] = (GLfloat
) params
[2];
2203 case GL_SPOT_EXPONENT
:
2204 case GL_SPOT_CUTOFF
:
2205 case GL_CONSTANT_ATTENUATION
:
2206 case GL_LINEAR_ATTENUATION
:
2207 case GL_QUADRATIC_ATTENUATION
:
2208 fparam
[0] = (GLfloat
) params
[0];
2211 /* error will be caught later in gl_Lightfv */
2214 save_Lightfv( light
, pname
, fparam
);
2218 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2220 save_Lightiv( light
, pname
, ¶m
);
2224 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2226 GET_CURRENT_CONTEXT(ctx
);
2228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2229 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2237 if (ctx
->ExecuteFlag
) {
2238 CALL_LightModelfv(ctx
->Exec
, ( pname
, params
));
2243 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2245 save_LightModelfv(pname
, ¶m
);
2249 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2253 case GL_LIGHT_MODEL_AMBIENT
:
2254 fparam
[0] = INT_TO_FLOAT( params
[0] );
2255 fparam
[1] = INT_TO_FLOAT( params
[1] );
2256 fparam
[2] = INT_TO_FLOAT( params
[2] );
2257 fparam
[3] = INT_TO_FLOAT( params
[3] );
2259 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2260 case GL_LIGHT_MODEL_TWO_SIDE
:
2261 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2262 fparam
[0] = (GLfloat
) params
[0];
2265 /* Error will be caught later in gl_LightModelfv */
2268 save_LightModelfv(pname
, fparam
);
2272 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2274 save_LightModeliv(pname
, ¶m
);
2278 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2280 GET_CURRENT_CONTEXT(ctx
);
2282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2283 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2288 if (ctx
->ExecuteFlag
) {
2289 CALL_LineStipple(ctx
->Exec
, ( factor
, pattern
));
2294 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2296 GET_CURRENT_CONTEXT(ctx
);
2298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2299 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2303 if (ctx
->ExecuteFlag
) {
2304 CALL_LineWidth(ctx
->Exec
, ( width
));
2309 static void GLAPIENTRY
save_ListBase( GLuint base
)
2311 GET_CURRENT_CONTEXT(ctx
);
2313 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2314 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_ListBase(ctx
->Exec
, ( base
));
2324 static void GLAPIENTRY
save_LoadIdentity( void )
2326 GET_CURRENT_CONTEXT(ctx
);
2327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2328 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2329 if (ctx
->ExecuteFlag
) {
2330 CALL_LoadIdentity(ctx
->Exec
, ());
2335 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2337 GET_CURRENT_CONTEXT(ctx
);
2339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2340 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2343 for (i
=0;i
<16;i
++) {
2347 if (ctx
->ExecuteFlag
) {
2348 CALL_LoadMatrixf(ctx
->Exec
, ( m
));
2353 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2357 for (i
= 0; i
< 16; i
++) {
2358 f
[i
] = (GLfloat
) m
[i
];
2360 save_LoadMatrixf(f
);
2364 static void GLAPIENTRY
save_LoadName( GLuint name
)
2366 GET_CURRENT_CONTEXT(ctx
);
2368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2369 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2373 if (ctx
->ExecuteFlag
) {
2374 CALL_LoadName(ctx
->Exec
, ( name
));
2379 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2381 GET_CURRENT_CONTEXT(ctx
);
2383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2384 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2388 if (ctx
->ExecuteFlag
) {
2389 CALL_LogicOp(ctx
->Exec
, ( opcode
));
2394 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2395 GLint order
, const GLdouble
*points
)
2397 GET_CURRENT_CONTEXT(ctx
);
2399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2400 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2402 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2404 n
[2].f
= (GLfloat
) u1
;
2405 n
[3].f
= (GLfloat
) u2
;
2406 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2408 n
[6].data
= (void *) pnts
;
2410 if (ctx
->ExecuteFlag
) {
2411 CALL_Map1d(ctx
->Exec
, ( target
, u1
, u2
, stride
, order
, points
));
2415 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2416 GLint order
, const GLfloat
*points
)
2418 GET_CURRENT_CONTEXT(ctx
);
2420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2421 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2423 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2427 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2429 n
[6].data
= (void *) pnts
;
2431 if (ctx
->ExecuteFlag
) {
2432 CALL_Map1f(ctx
->Exec
, ( target
, u1
, u2
, stride
, order
, points
));
2437 static void GLAPIENTRY
save_Map2d( GLenum target
,
2438 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2439 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2440 const GLdouble
*points
)
2442 GET_CURRENT_CONTEXT(ctx
);
2444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2445 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2447 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2448 vstride
, vorder
, points
);
2450 n
[2].f
= (GLfloat
) u1
;
2451 n
[3].f
= (GLfloat
) u2
;
2452 n
[4].f
= (GLfloat
) v1
;
2453 n
[5].f
= (GLfloat
) v2
;
2454 /* XXX verify these strides are correct */
2455 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2456 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2459 n
[10].data
= (void *) pnts
;
2461 if (ctx
->ExecuteFlag
) {
2462 CALL_Map2d(ctx
->Exec
, ( target
,
2463 u1
, u2
, ustride
, uorder
,
2464 v1
, v2
, vstride
, vorder
, points
));
2469 static void GLAPIENTRY
save_Map2f( GLenum target
,
2470 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2471 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2472 const GLfloat
*points
)
2474 GET_CURRENT_CONTEXT(ctx
);
2476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2477 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2479 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2480 vstride
, vorder
, points
);
2486 /* XXX verify these strides are correct */
2487 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2488 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2491 n
[10].data
= (void *) pnts
;
2493 if (ctx
->ExecuteFlag
) {
2494 CALL_Map2f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
2495 v1
, v2
, vstride
, vorder
, points
));
2500 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2502 GET_CURRENT_CONTEXT(ctx
);
2504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2505 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2511 if (ctx
->ExecuteFlag
) {
2512 CALL_MapGrid1f(ctx
->Exec
, ( un
, u1
, u2
));
2517 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2519 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2523 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2524 GLint vn
, GLfloat v1
, GLfloat v2
)
2526 GET_CURRENT_CONTEXT(ctx
);
2528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2529 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2538 if (ctx
->ExecuteFlag
) {
2539 CALL_MapGrid2f(ctx
->Exec
, ( un
, u1
, u2
, vn
, v1
, v2
));
2545 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2546 GLint vn
, GLdouble v1
, GLdouble v2
)
2548 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2549 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2553 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2555 GET_CURRENT_CONTEXT(ctx
);
2557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2558 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_MatrixMode(ctx
->Exec
, ( mode
));
2568 static void GLAPIENTRY
2569 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2571 GET_CURRENT_CONTEXT(ctx
);
2574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2575 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2578 n
[2].e
= internalFormat
;
2581 if (ctx
->ExecuteFlag
) {
2582 CALL_Minmax(ctx
->Exec
, ( target
, internalFormat
, sink
));
2587 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2589 GET_CURRENT_CONTEXT(ctx
);
2591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2592 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2595 for (i
=0;i
<16;i
++) {
2599 if (ctx
->ExecuteFlag
) {
2600 CALL_MultMatrixf(ctx
->Exec
, ( m
));
2605 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2609 for (i
= 0; i
< 16; i
++) {
2610 f
[i
] = (GLfloat
) m
[i
];
2612 save_MultMatrixf(f
);
2616 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2618 GET_CURRENT_CONTEXT(ctx
);
2619 /* It's an error to call this function while building a display list */
2620 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2627 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2628 GLdouble bottom
, GLdouble top
,
2629 GLdouble nearval
, GLdouble farval
)
2631 GET_CURRENT_CONTEXT(ctx
);
2633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2634 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2636 n
[1].f
= (GLfloat
) left
;
2637 n
[2].f
= (GLfloat
) right
;
2638 n
[3].f
= (GLfloat
) bottom
;
2639 n
[4].f
= (GLfloat
) top
;
2640 n
[5].f
= (GLfloat
) nearval
;
2641 n
[6].f
= (GLfloat
) farval
;
2643 if (ctx
->ExecuteFlag
) {
2644 CALL_Ortho(ctx
->Exec
, ( left
, right
, bottom
, top
, nearval
, farval
));
2649 static void GLAPIENTRY
2650 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2652 GET_CURRENT_CONTEXT(ctx
);
2654 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2655 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2659 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2660 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2662 if (ctx
->ExecuteFlag
) {
2663 CALL_PixelMapfv(ctx
->Exec
, ( map
, mapsize
, values
));
2668 static void GLAPIENTRY
2669 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2671 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2673 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2674 for (i
=0;i
<mapsize
;i
++) {
2675 fvalues
[i
] = (GLfloat
) values
[i
];
2679 for (i
=0;i
<mapsize
;i
++) {
2680 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2683 save_PixelMapfv(map
, mapsize
, fvalues
);
2687 static void GLAPIENTRY
2688 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2690 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2692 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2693 for (i
=0;i
<mapsize
;i
++) {
2694 fvalues
[i
] = (GLfloat
) values
[i
];
2698 for (i
=0;i
<mapsize
;i
++) {
2699 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2702 save_PixelMapfv(map
, mapsize
, fvalues
);
2706 static void GLAPIENTRY
2707 save_PixelTransferf( GLenum pname
, GLfloat param
)
2709 GET_CURRENT_CONTEXT(ctx
);
2711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2712 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2717 if (ctx
->ExecuteFlag
) {
2718 CALL_PixelTransferf(ctx
->Exec
, ( pname
, param
));
2723 static void GLAPIENTRY
2724 save_PixelTransferi( GLenum pname
, GLint param
)
2726 save_PixelTransferf( pname
, (GLfloat
) param
);
2730 static void GLAPIENTRY
2731 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2733 GET_CURRENT_CONTEXT(ctx
);
2735 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2736 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2741 if (ctx
->ExecuteFlag
) {
2742 CALL_PixelZoom(ctx
->Exec
, ( xfactor
, yfactor
));
2747 static void GLAPIENTRY
2748 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2750 GET_CURRENT_CONTEXT(ctx
);
2752 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2753 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2760 if (ctx
->ExecuteFlag
) {
2761 CALL_PointParameterfvEXT(ctx
->Exec
, ( pname
, params
));
2766 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2768 save_PointParameterfvEXT(pname
, ¶m
);
2771 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2773 GLfloat p
= (GLfloat
) param
;
2774 save_PointParameterfvEXT(pname
, &p
);
2777 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2779 GLfloat p
= (GLfloat
) param
[0];
2780 save_PointParameterfvEXT(pname
, &p
);
2784 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2786 GET_CURRENT_CONTEXT(ctx
);
2788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2793 if (ctx
->ExecuteFlag
) {
2794 CALL_PointSize(ctx
->Exec
, ( size
));
2799 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2801 GET_CURRENT_CONTEXT(ctx
);
2803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2804 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2809 if (ctx
->ExecuteFlag
) {
2810 CALL_PolygonMode(ctx
->Exec
, ( face
, mode
));
2816 * Polygon stipple must have been upacked already!
2818 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2820 GET_CURRENT_CONTEXT(ctx
);
2822 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2823 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2826 n
[1].data
= MALLOC( 32 * 4 );
2827 data
= n
[1].data
; /* This needed for Acorn compiler */
2828 MEMCPY( data
, pattern
, 32 * 4 );
2830 if (ctx
->ExecuteFlag
) {
2831 CALL_PolygonStipple(ctx
->Exec
, ( (GLubyte
*) pattern
));
2836 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2838 GET_CURRENT_CONTEXT(ctx
);
2840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2841 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2846 if (ctx
->ExecuteFlag
) {
2847 CALL_PolygonOffset(ctx
->Exec
, ( factor
, units
));
2852 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2854 GET_CURRENT_CONTEXT(ctx
);
2855 /* XXX mult by DepthMaxF here??? */
2856 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
2860 static void GLAPIENTRY
save_PopAttrib( void )
2862 GET_CURRENT_CONTEXT(ctx
);
2863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2864 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2865 if (ctx
->ExecuteFlag
) {
2866 CALL_PopAttrib(ctx
->Exec
, ());
2871 static void GLAPIENTRY
save_PopMatrix( void )
2873 GET_CURRENT_CONTEXT(ctx
);
2874 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2875 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2876 if (ctx
->ExecuteFlag
) {
2877 CALL_PopMatrix(ctx
->Exec
, ());
2882 static void GLAPIENTRY
save_PopName( void )
2884 GET_CURRENT_CONTEXT(ctx
);
2885 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2886 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2887 if (ctx
->ExecuteFlag
) {
2888 CALL_PopName(ctx
->Exec
, ());
2893 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2894 const GLclampf
*priorities
)
2896 GET_CURRENT_CONTEXT(ctx
);
2898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2900 for (i
=0;i
<num
;i
++) {
2902 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2904 n
[1].ui
= textures
[i
];
2905 n
[2].f
= priorities
[i
];
2908 if (ctx
->ExecuteFlag
) {
2909 CALL_PrioritizeTextures(ctx
->Exec
, ( num
, textures
, priorities
));
2914 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2916 GET_CURRENT_CONTEXT(ctx
);
2918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2919 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2923 if (ctx
->ExecuteFlag
) {
2924 CALL_PushAttrib(ctx
->Exec
, ( mask
));
2929 static void GLAPIENTRY
save_PushMatrix( void )
2931 GET_CURRENT_CONTEXT(ctx
);
2932 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2933 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2934 if (ctx
->ExecuteFlag
) {
2935 CALL_PushMatrix(ctx
->Exec
, ());
2940 static void GLAPIENTRY
save_PushName( GLuint name
)
2942 GET_CURRENT_CONTEXT(ctx
);
2944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2945 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2949 if (ctx
->ExecuteFlag
) {
2950 CALL_PushName(ctx
->Exec
, ( name
));
2955 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2957 GET_CURRENT_CONTEXT(ctx
);
2959 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2960 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2967 if (ctx
->ExecuteFlag
) {
2968 CALL_RasterPos4f(ctx
->Exec
, ( x
, y
, z
, w
));
2972 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2974 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2977 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2979 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2982 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2984 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2987 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2989 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2992 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2994 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2997 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2999 save_RasterPos4f(x
, y
, z
, 1.0F
);
3002 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3004 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3007 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3009 save_RasterPos4f(x
, y
, z
, 1.0F
);
3012 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3014 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3017 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3019 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3022 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3024 save_RasterPos4f(x
, y
, z
, w
);
3027 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
3029 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3032 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
3034 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3037 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
3039 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3042 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
3044 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3047 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
3049 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3052 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
3054 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3057 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
3059 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3062 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
3064 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3067 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
3069 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3070 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3073 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
3075 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3078 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
3080 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3081 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3084 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3086 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3090 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3092 GET_CURRENT_CONTEXT(ctx
);
3094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3095 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3099 if (ctx
->ExecuteFlag
) {
3100 CALL_PassThrough(ctx
->Exec
, ( token
));
3105 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3107 GET_CURRENT_CONTEXT(ctx
);
3109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3110 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3114 if (ctx
->ExecuteFlag
) {
3115 CALL_ReadBuffer(ctx
->Exec
, ( mode
));
3120 static void GLAPIENTRY
3121 save_ResetHistogram(GLenum target
)
3123 GET_CURRENT_CONTEXT(ctx
);
3125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3126 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3130 if (ctx
->ExecuteFlag
) {
3131 CALL_ResetHistogram(ctx
->Exec
, ( target
));
3136 static void GLAPIENTRY
3137 save_ResetMinmax(GLenum target
)
3139 GET_CURRENT_CONTEXT(ctx
);
3141 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3142 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3146 if (ctx
->ExecuteFlag
) {
3147 CALL_ResetMinmax(ctx
->Exec
, ( target
));
3152 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3154 GET_CURRENT_CONTEXT(ctx
);
3156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3157 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3164 if (ctx
->ExecuteFlag
) {
3165 CALL_Rotatef(ctx
->Exec
, ( angle
, x
, y
, z
));
3170 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3172 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3176 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3178 GET_CURRENT_CONTEXT(ctx
);
3180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3181 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3187 if (ctx
->ExecuteFlag
) {
3188 CALL_Scalef(ctx
->Exec
, ( x
, y
, z
));
3193 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3195 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3199 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3201 GET_CURRENT_CONTEXT(ctx
);
3203 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3204 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3211 if (ctx
->ExecuteFlag
) {
3212 CALL_Scissor(ctx
->Exec
, ( x
, y
, width
, height
));
3217 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3219 GET_CURRENT_CONTEXT(ctx
);
3221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3222 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3226 if (ctx
->ExecuteFlag
) {
3227 CALL_ShadeModel(ctx
->Exec
, ( mode
));
3232 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3234 GET_CURRENT_CONTEXT(ctx
);
3236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3237 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_StencilFunc(ctx
->Exec
, ( func
, ref
, mask
));
3249 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3251 GET_CURRENT_CONTEXT(ctx
);
3253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3254 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3258 if (ctx
->ExecuteFlag
) {
3259 CALL_StencilMask(ctx
->Exec
, ( mask
));
3264 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3266 GET_CURRENT_CONTEXT(ctx
);
3268 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3269 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3275 if (ctx
->ExecuteFlag
) {
3276 CALL_StencilOp(ctx
->Exec
, ( fail
, zfail
, zpass
));
3281 static void GLAPIENTRY
3282 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3284 GET_CURRENT_CONTEXT(ctx
);
3286 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3287 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3294 if (ctx
->ExecuteFlag
) {
3295 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3300 static void GLAPIENTRY
3301 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3303 GET_CURRENT_CONTEXT(ctx
);
3305 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3306 n
= ALLOC_INSTRUCTION(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3311 if (ctx
->ExecuteFlag
) {
3312 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3317 static void GLAPIENTRY
3318 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3320 GET_CURRENT_CONTEXT(ctx
);
3322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3323 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4 );
3330 if (ctx
->ExecuteFlag
) {
3331 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3336 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3338 GET_CURRENT_CONTEXT(ctx
);
3340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3341 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3345 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3353 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3356 if (ctx
->ExecuteFlag
) {
3357 CALL_TexEnvfv(ctx
->Exec
, ( target
, pname
, params
));
3362 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3364 save_TexEnvfv( target
, pname
, ¶m
);
3368 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3371 p
[0] = (GLfloat
) param
;
3372 p
[1] = p
[2] = p
[3] = 0.0;
3373 save_TexEnvfv( target
, pname
, p
);
3377 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3380 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3381 p
[0] = INT_TO_FLOAT( param
[0] );
3382 p
[1] = INT_TO_FLOAT( param
[1] );
3383 p
[2] = INT_TO_FLOAT( param
[2] );
3384 p
[3] = INT_TO_FLOAT( param
[3] );
3387 p
[0] = (GLfloat
) param
[0];
3388 p
[1] = p
[2] = p
[3] = 0.0F
;
3390 save_TexEnvfv( target
, pname
, p
);
3394 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3396 GET_CURRENT_CONTEXT(ctx
);
3398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3399 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3408 if (ctx
->ExecuteFlag
) {
3409 CALL_TexGenfv(ctx
->Exec
, ( coord
, pname
, params
));
3414 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3417 p
[0] = (GLfloat
) params
[0];
3418 p
[1] = (GLfloat
) params
[1];
3419 p
[2] = (GLfloat
) params
[2];
3420 p
[3] = (GLfloat
) params
[3];
3421 save_TexGenfv(coord
, pname
, p
);
3425 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3427 GLfloat p
= (GLfloat
) param
;
3428 save_TexGenfv( coord
, pname
, &p
);
3432 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3435 p
[0] = (GLfloat
) params
[0];
3436 p
[1] = (GLfloat
) params
[1];
3437 p
[2] = (GLfloat
) params
[2];
3438 p
[3] = (GLfloat
) params
[3];
3439 save_TexGenfv( coord
, pname
, p
);
3443 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3445 save_TexGenfv(coord
, pname
, ¶m
);
3449 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3451 save_TexGeniv( coord
, pname
, ¶m
);
3455 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3456 GLenum pname
, const GLfloat
*params
)
3458 GET_CURRENT_CONTEXT(ctx
);
3460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3461 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3470 if (ctx
->ExecuteFlag
) {
3471 CALL_TexParameterfv(ctx
->Exec
, ( target
, pname
, params
));
3476 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3478 save_TexParameterfv(target
, pname
, ¶m
);
3482 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3485 fparam
[0] = (GLfloat
) param
;
3486 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3487 save_TexParameterfv(target
, pname
, fparam
);
3491 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3494 fparam
[0] = (GLfloat
) params
[0];
3495 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3496 save_TexParameterfv(target
, pname
, fparam
);
3500 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3501 GLint level
, GLint components
,
3502 GLsizei width
, GLint border
,
3503 GLenum format
, GLenum type
,
3504 const GLvoid
*pixels
)
3506 GET_CURRENT_CONTEXT(ctx
);
3507 if (target
== GL_PROXY_TEXTURE_1D
) {
3508 /* don't compile, execute immediately */
3509 CALL_TexImage1D(ctx
->Exec
, ( target
, level
, components
, width
,
3510 border
, format
, type
, pixels
));
3513 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3514 pixels
, &ctx
->Unpack
);
3516 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3517 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3521 n
[3].i
= components
;
3522 n
[4].i
= (GLint
) width
;
3531 if (ctx
->ExecuteFlag
) {
3532 CALL_TexImage1D(ctx
->Exec
, ( target
, level
, components
, width
,
3533 border
, format
, type
, pixels
));
3539 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3540 GLint level
, GLint components
,
3541 GLsizei width
, GLsizei height
, GLint border
,
3542 GLenum format
, GLenum type
,
3543 const GLvoid
*pixels
)
3545 GET_CURRENT_CONTEXT(ctx
);
3546 if (target
== GL_PROXY_TEXTURE_2D
) {
3547 /* don't compile, execute immediately */
3548 CALL_TexImage2D(ctx
->Exec
, ( target
, level
, components
, width
,
3549 height
, border
, format
, type
, pixels
));
3552 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3553 pixels
, &ctx
->Unpack
);
3555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3556 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3560 n
[3].i
= components
;
3561 n
[4].i
= (GLint
) width
;
3562 n
[5].i
= (GLint
) height
;
3571 if (ctx
->ExecuteFlag
) {
3572 CALL_TexImage2D(ctx
->Exec
, ( target
, level
, components
, width
,
3573 height
, border
, format
, type
, pixels
));
3579 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3580 GLint level
, GLint internalFormat
,
3581 GLsizei width
, GLsizei height
, GLsizei depth
,
3583 GLenum format
, GLenum type
,
3584 const GLvoid
*pixels
)
3586 GET_CURRENT_CONTEXT(ctx
);
3587 if (target
== GL_PROXY_TEXTURE_3D
) {
3588 /* don't compile, execute immediately */
3589 CALL_TexImage3D(ctx
->Exec
, ( target
, level
, internalFormat
, width
,
3590 height
, depth
, border
, format
, type
, pixels
));
3594 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3595 pixels
, &ctx
->Unpack
);
3596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3597 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3601 n
[3].i
= (GLint
) internalFormat
;
3602 n
[4].i
= (GLint
) width
;
3603 n
[5].i
= (GLint
) height
;
3604 n
[6].i
= (GLint
) depth
;
3613 if (ctx
->ExecuteFlag
) {
3614 CALL_TexImage3D(ctx
->Exec
, ( target
, level
, internalFormat
, width
,
3615 height
, depth
, border
, format
, type
, pixels
));
3621 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3622 GLsizei width
, GLenum format
, GLenum type
,
3623 const GLvoid
*pixels
)
3625 GET_CURRENT_CONTEXT(ctx
);
3627 GLvoid
*image
= unpack_image(1, width
, 1, 1, format
, type
,
3628 pixels
, &ctx
->Unpack
);
3629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3630 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3635 n
[4].i
= (GLint
) width
;
3643 if (ctx
->ExecuteFlag
) {
3644 CALL_TexSubImage1D(ctx
->Exec
, ( target
, level
, xoffset
, width
,
3645 format
, type
, pixels
));
3650 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3651 GLint xoffset
, GLint yoffset
,
3652 GLsizei width
, GLsizei height
,
3653 GLenum format
, GLenum type
,
3654 const GLvoid
*pixels
)
3656 GET_CURRENT_CONTEXT(ctx
);
3658 GLvoid
*image
= unpack_image(2, width
, height
, 1, format
, type
,
3659 pixels
, &ctx
->Unpack
);
3660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3661 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3667 n
[5].i
= (GLint
) width
;
3668 n
[6].i
= (GLint
) height
;
3676 if (ctx
->ExecuteFlag
) {
3677 CALL_TexSubImage2D(ctx
->Exec
, ( target
, level
, xoffset
, yoffset
,
3678 width
, height
, format
, type
, pixels
));
3683 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3684 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3685 GLsizei width
, GLsizei height
, GLsizei depth
,
3686 GLenum format
, GLenum type
,
3687 const GLvoid
*pixels
)
3689 GET_CURRENT_CONTEXT(ctx
);
3691 GLvoid
*image
= unpack_image(3, width
, height
, depth
, format
, type
,
3692 pixels
, &ctx
->Unpack
);
3693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3694 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3701 n
[6].i
= (GLint
) width
;
3702 n
[7].i
= (GLint
) height
;
3703 n
[8].i
= (GLint
) depth
;
3711 if (ctx
->ExecuteFlag
) {
3712 CALL_TexSubImage3D(ctx
->Exec
, ( target
, level
,
3713 xoffset
, yoffset
, zoffset
,
3714 width
, height
, depth
, format
, type
, pixels
));
3719 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3721 GET_CURRENT_CONTEXT(ctx
);
3723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3724 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3730 if (ctx
->ExecuteFlag
) {
3731 CALL_Translatef(ctx
->Exec
, ( x
, y
, z
));
3736 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3738 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3743 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3745 GET_CURRENT_CONTEXT(ctx
);
3747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3748 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3752 n
[3].i
= (GLint
) width
;
3753 n
[4].i
= (GLint
) height
;
3755 if (ctx
->ExecuteFlag
) {
3756 CALL_Viewport(ctx
->Exec
, ( x
, y
, width
, height
));
3761 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3763 GET_CURRENT_CONTEXT(ctx
);
3765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3766 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3773 if (ctx
->ExecuteFlag
) {
3774 CALL_WindowPos4fMESA(ctx
->Exec
, ( x
, y
, z
, w
));
3778 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3780 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3783 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3785 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3788 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3790 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3793 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3795 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3798 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3800 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3803 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3805 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3808 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3810 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3813 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3815 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3818 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3820 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3823 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3825 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3828 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3830 save_WindowPos4fMESA(x
, y
, z
, w
);
3833 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3835 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3838 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3840 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3843 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3845 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3848 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3850 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3853 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3855 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3858 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3860 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3863 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3865 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3868 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3870 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3873 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3875 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3876 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3879 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3881 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3884 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3886 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3887 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3890 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3892 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3897 /* GL_ARB_multitexture */
3898 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3900 GET_CURRENT_CONTEXT(ctx
);
3902 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3903 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3907 if (ctx
->ExecuteFlag
) {
3908 CALL_ActiveTextureARB(ctx
->Exec
, ( target
));
3913 /* GL_ARB_transpose_matrix */
3915 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3918 _math_transposefd(tm
, m
);
3919 save_LoadMatrixf(tm
);
3923 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3926 _math_transposef(tm
, m
);
3927 save_LoadMatrixf(tm
);
3931 static void GLAPIENTRY
3932 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3935 _math_transposefd(tm
, m
);
3936 save_MultMatrixf(tm
);
3940 static void GLAPIENTRY
3941 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3944 _math_transposef(tm
, m
);
3945 save_MultMatrixf(tm
);
3949 static void GLAPIENTRY
3950 save_PixelTexGenSGIX(GLenum mode
)
3952 GET_CURRENT_CONTEXT(ctx
);
3954 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3955 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3959 if (ctx
->ExecuteFlag
) {
3960 CALL_PixelTexGenSGIX(ctx
->Exec
, ( mode
));
3965 /* GL_ARB_texture_compression */
3966 static void GLAPIENTRY
3967 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3968 GLenum internalFormat
, GLsizei width
,
3969 GLint border
, GLsizei imageSize
,
3972 GET_CURRENT_CONTEXT(ctx
);
3973 if (target
== GL_PROXY_TEXTURE_1D
) {
3974 /* don't compile, execute immediately */
3975 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
3976 width
, border
, imageSize
, data
));
3981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3982 /* make copy of image */
3983 image
= MALLOC(imageSize
);
3985 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3988 MEMCPY(image
, data
, imageSize
);
3989 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3993 n
[3].e
= internalFormat
;
3994 n
[4].i
= (GLint
) width
;
4002 if (ctx
->ExecuteFlag
) {
4003 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4004 width
, border
, imageSize
, data
));
4010 static void GLAPIENTRY
4011 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4012 GLenum internalFormat
, GLsizei width
,
4013 GLsizei height
, GLint border
, GLsizei imageSize
,
4016 GET_CURRENT_CONTEXT(ctx
);
4017 if (target
== GL_PROXY_TEXTURE_2D
) {
4018 /* don't compile, execute immediately */
4019 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4020 width
, height
, border
, imageSize
, data
));
4025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4026 /* make copy of image */
4027 image
= MALLOC(imageSize
);
4029 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4032 MEMCPY(image
, data
, imageSize
);
4033 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
4037 n
[3].e
= internalFormat
;
4038 n
[4].i
= (GLint
) width
;
4039 n
[5].i
= (GLint
) height
;
4047 if (ctx
->ExecuteFlag
) {
4048 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4049 width
, height
, border
, imageSize
, data
));
4055 static void GLAPIENTRY
4056 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4057 GLenum internalFormat
, GLsizei width
,
4058 GLsizei height
, GLsizei depth
, GLint border
,
4059 GLsizei imageSize
, const GLvoid
*data
)
4061 GET_CURRENT_CONTEXT(ctx
);
4062 if (target
== GL_PROXY_TEXTURE_3D
) {
4063 /* don't compile, execute immediately */
4064 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4065 width
, height
, depth
, border
, imageSize
, data
));
4070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4071 /* make copy of image */
4072 image
= MALLOC(imageSize
);
4074 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4077 MEMCPY(image
, data
, imageSize
);
4078 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
4082 n
[3].e
= internalFormat
;
4083 n
[4].i
= (GLint
) width
;
4084 n
[5].i
= (GLint
) height
;
4085 n
[6].i
= (GLint
) depth
;
4093 if (ctx
->ExecuteFlag
) {
4094 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4095 width
, height
, depth
, border
, imageSize
, data
));
4101 static void GLAPIENTRY
4102 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4103 GLsizei width
, GLenum format
,
4104 GLsizei imageSize
, const GLvoid
*data
)
4109 GET_CURRENT_CONTEXT(ctx
);
4110 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4112 /* make copy of image */
4113 image
= MALLOC(imageSize
);
4115 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4118 MEMCPY(image
, data
, imageSize
);
4119 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
4124 n
[4].i
= (GLint
) width
;
4132 if (ctx
->ExecuteFlag
) {
4133 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4134 width
, format
, imageSize
, data
));
4139 static void GLAPIENTRY
4140 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4141 GLint yoffset
, GLsizei width
, GLsizei height
,
4142 GLenum format
, GLsizei imageSize
,
4148 GET_CURRENT_CONTEXT(ctx
);
4149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4151 /* make copy of image */
4152 image
= MALLOC(imageSize
);
4154 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4157 MEMCPY(image
, data
, imageSize
);
4158 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4164 n
[5].i
= (GLint
) width
;
4165 n
[6].i
= (GLint
) height
;
4173 if (ctx
->ExecuteFlag
) {
4174 CALL_CompressedTexSubImage2DARB(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4175 width
, height
, format
, imageSize
, data
));
4180 static void GLAPIENTRY
4181 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4182 GLint yoffset
, GLint zoffset
, GLsizei width
,
4183 GLsizei height
, GLsizei depth
, GLenum format
,
4184 GLsizei imageSize
, const GLvoid
*data
)
4189 GET_CURRENT_CONTEXT(ctx
);
4190 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4192 /* make copy of image */
4193 image
= MALLOC(imageSize
);
4195 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4198 MEMCPY(image
, data
, imageSize
);
4199 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4206 n
[6].i
= (GLint
) width
;
4207 n
[7].i
= (GLint
) height
;
4208 n
[8].i
= (GLint
) depth
;
4210 n
[10].i
= imageSize
;
4216 if (ctx
->ExecuteFlag
) {
4217 CALL_CompressedTexSubImage3DARB(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4218 zoffset
, width
, height
, depth
, format
, imageSize
, data
));
4223 /* GL_ARB_multisample */
4224 static void GLAPIENTRY
4225 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4227 GET_CURRENT_CONTEXT(ctx
);
4229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4230 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4235 if (ctx
->ExecuteFlag
) {
4236 CALL_SampleCoverageARB(ctx
->Exec
, ( value
, invert
));
4241 /* GL_SGIS_pixel_texture */
4243 static void GLAPIENTRY
4244 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4246 GET_CURRENT_CONTEXT(ctx
);
4248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4249 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4254 if (ctx
->ExecuteFlag
) {
4255 CALL_PixelTexGenParameteriSGIS(ctx
->Exec
, ( target
, value
));
4260 static void GLAPIENTRY
4261 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4263 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4267 static void GLAPIENTRY
4268 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4270 save_PixelTexGenParameteriSGIS(target
, *value
);
4274 static void GLAPIENTRY
4275 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4277 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4282 * GL_NV_vertex_program
4284 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4285 static void GLAPIENTRY
4286 save_BindProgramNV(GLenum target
, GLuint id
)
4288 GET_CURRENT_CONTEXT(ctx
);
4290 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4291 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4296 if (ctx
->ExecuteFlag
) {
4297 CALL_BindProgramNV(ctx
->Exec
, ( target
, id
));
4300 #endif /* FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4302 #if FEATURE_NV_vertex_program
4303 static void GLAPIENTRY
4304 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4306 GET_CURRENT_CONTEXT(ctx
);
4308 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4309 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4318 if (ctx
->ExecuteFlag
) {
4319 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4324 static void GLAPIENTRY
4325 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4326 GLfloat x
, GLfloat y
,
4327 GLfloat z
, GLfloat w
)
4329 GET_CURRENT_CONTEXT(ctx
);
4331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4332 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4341 if (ctx
->ExecuteFlag
) {
4342 CALL_ProgramParameter4fNV(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4347 static void GLAPIENTRY
4348 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4350 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4351 params
[2], params
[3]);
4355 static void GLAPIENTRY
4356 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4357 GLdouble x
, GLdouble y
,
4358 GLdouble z
, GLdouble w
)
4360 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4361 (GLfloat
) z
, (GLfloat
) w
);
4365 static void GLAPIENTRY
4366 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4367 const GLdouble
*params
)
4369 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4370 (GLfloat
) params
[1], (GLfloat
) params
[2],
4371 (GLfloat
) params
[3]);
4375 static void GLAPIENTRY
4376 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4377 GLuint num
, const GLdouble
*params
)
4380 for (i
= 0; i
< num
; i
++) {
4381 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4386 static void GLAPIENTRY
4387 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4388 GLuint num
, const GLfloat
*params
)
4391 for (i
= 0; i
< num
; i
++) {
4392 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4397 static void GLAPIENTRY
4398 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4399 const GLubyte
*program
)
4401 GET_CURRENT_CONTEXT(ctx
);
4403 GLubyte
*programCopy
;
4405 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4407 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4410 _mesa_memcpy(programCopy
, program
, len
);
4412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4413 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4418 n
[4].data
= programCopy
;
4420 if (ctx
->ExecuteFlag
) {
4421 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4426 static void GLAPIENTRY
4427 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4429 GET_CURRENT_CONTEXT(ctx
);
4431 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4433 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4436 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4438 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4443 if (ctx
->ExecuteFlag
) {
4444 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4449 static void GLAPIENTRY
4450 save_TrackMatrixNV(GLenum target
, GLuint address
,
4451 GLenum matrix
, GLenum transform
)
4453 GET_CURRENT_CONTEXT(ctx
);
4455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4456 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4463 if (ctx
->ExecuteFlag
) {
4464 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4467 #endif /* FEATURE_NV_vertex_program */
4471 * GL_NV_fragment_program
4473 #if FEATURE_NV_fragment_program
4474 static void GLAPIENTRY
4475 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4476 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4478 GET_CURRENT_CONTEXT(ctx
);
4480 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4481 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4490 if (ctx
->ExecuteFlag
) {
4491 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4496 static void GLAPIENTRY
4497 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4498 const GLfloat
*params
)
4500 GET_CURRENT_CONTEXT(ctx
);
4502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4503 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4512 if (ctx
->ExecuteFlag
) {
4513 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4518 static void GLAPIENTRY
4519 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4520 GLdouble x
, GLdouble y
,
4521 GLdouble z
, GLdouble w
)
4523 GET_CURRENT_CONTEXT(ctx
);
4525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4526 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4530 n
[3].f
= (GLfloat
) x
;
4531 n
[4].f
= (GLfloat
) y
;
4532 n
[5].f
= (GLfloat
) z
;
4533 n
[6].f
= (GLfloat
) w
;
4535 if (ctx
->ExecuteFlag
) {
4536 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4541 static void GLAPIENTRY
4542 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4543 const GLdouble
*params
)
4545 GET_CURRENT_CONTEXT(ctx
);
4547 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4548 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4552 n
[3].f
= (GLfloat
) params
[0];
4553 n
[4].f
= (GLfloat
) params
[1];
4554 n
[5].f
= (GLfloat
) params
[2];
4555 n
[6].f
= (GLfloat
) params
[3];
4557 if (ctx
->ExecuteFlag
) {
4558 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4562 static void GLAPIENTRY
4563 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4564 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4566 GET_CURRENT_CONTEXT(ctx
);
4568 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4570 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4573 _mesa_memcpy(nameCopy
, name
, len
);
4575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4576 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4580 n
[3].data
= nameCopy
;
4586 if (ctx
->ExecuteFlag
) {
4587 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4592 static void GLAPIENTRY
4593 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4596 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4600 static void GLAPIENTRY
4601 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4602 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4604 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4605 (GLfloat
) z
,(GLfloat
) w
);
4609 static void GLAPIENTRY
4610 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4613 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4614 (GLfloat
) v
[1], (GLfloat
) v
[2],
4618 #endif /* FEATURE_NV_fragment_program */
4622 /* GL_EXT_stencil_two_side */
4623 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4625 GET_CURRENT_CONTEXT(ctx
);
4627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4628 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4632 if (ctx
->ExecuteFlag
) {
4633 CALL_ActiveStencilFaceEXT(ctx
->Exec
, ( face
));
4638 /* GL_EXT_depth_bounds_test */
4639 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4641 GET_CURRENT_CONTEXT(ctx
);
4643 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4644 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2 );
4646 n
[1].f
= (GLfloat
) zmin
;
4647 n
[2].f
= (GLfloat
) zmax
;
4649 if (ctx
->ExecuteFlag
) {
4650 CALL_DepthBoundsEXT(ctx
->Exec
, ( zmin
, zmax
));
4656 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4658 static void GLAPIENTRY
4659 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4660 const GLvoid
*string
)
4662 GET_CURRENT_CONTEXT(ctx
);
4664 GLubyte
*programCopy
;
4666 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4668 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4671 _mesa_memcpy(programCopy
, string
, len
);
4673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4674 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4679 n
[4].data
= programCopy
;
4681 if (ctx
->ExecuteFlag
) {
4682 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
4687 static void GLAPIENTRY
4688 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4689 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4691 GET_CURRENT_CONTEXT(ctx
);
4693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4694 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4703 if (ctx
->ExecuteFlag
) {
4704 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, ( target
, index
, x
, y
, z
, w
));
4709 static void GLAPIENTRY
4710 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4711 const GLfloat
*params
)
4713 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4714 params
[2], params
[3]);
4718 static void GLAPIENTRY
4719 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4720 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4722 save_ProgramEnvParameter4fARB(target
, index
,
4730 static void GLAPIENTRY
4731 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4732 const GLdouble
*params
)
4734 save_ProgramEnvParameter4fARB(target
, index
,
4735 (GLfloat
) params
[0],
4736 (GLfloat
) params
[1],
4737 (GLfloat
) params
[2],
4738 (GLfloat
) params
[3]);
4741 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4744 #ifdef FEATURE_ARB_occlusion_query
4746 static void GLAPIENTRY
4747 save_BeginQueryARB(GLenum target
, GLuint id
)
4749 GET_CURRENT_CONTEXT(ctx
);
4751 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4752 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN_QUERY_ARB
, 2 );
4757 if (ctx
->ExecuteFlag
) {
4758 CALL_BeginQueryARB(ctx
->Exec
, ( target
, id
));
4763 static void GLAPIENTRY
4764 save_EndQueryARB(GLenum target
)
4766 GET_CURRENT_CONTEXT(ctx
);
4768 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4769 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_END_QUERY_ARB
, 1 );
4773 if (ctx
->ExecuteFlag
) {
4774 CALL_EndQueryARB(ctx
->Exec
, ( target
));
4778 #endif /* FEATURE_ARB_occlusion_query */
4781 static void GLAPIENTRY
4782 save_DrawBuffersARB(GLsizei count
, const GLenum
*buffers
)
4784 GET_CURRENT_CONTEXT(ctx
);
4786 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4787 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
4791 if (count
> MAX_DRAW_BUFFERS
)
4792 count
= MAX_DRAW_BUFFERS
;
4793 for (i
= 0; i
< count
; i
++) {
4794 n
[2 + i
].e
= buffers
[i
];
4797 if (ctx
->ExecuteFlag
) {
4798 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
4802 #if FEATURE_ATI_fragment_shader
4803 static void GLAPIENTRY
4804 save_BindFragmentShaderATI(GLuint id
)
4806 GET_CURRENT_CONTEXT(ctx
);
4809 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
4813 if (ctx
->ExecuteFlag
) {
4814 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
4818 static void GLAPIENTRY
4819 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
4821 GET_CURRENT_CONTEXT(ctx
);
4824 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
4832 if (ctx
->ExecuteFlag
) {
4833 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
4838 static void save_Attr1fNV( GLenum attr
, GLfloat x
)
4840 GET_CURRENT_CONTEXT(ctx
);
4842 SAVE_FLUSH_VERTICES( ctx
);
4843 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F_NV
, 2 );
4849 ASSERT(attr
< VERT_ATTRIB_MAX
);
4850 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4851 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4853 if (ctx
->ExecuteFlag
) {
4854 CALL_VertexAttrib1fNV(ctx
->Exec
, ( attr
, x
));
4858 static void save_Attr2fNV( GLenum attr
, GLfloat x
, GLfloat y
)
4860 GET_CURRENT_CONTEXT(ctx
);
4862 SAVE_FLUSH_VERTICES( ctx
);
4863 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F_NV
, 3 );
4870 ASSERT(attr
< VERT_ATTRIB_MAX
);
4871 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4872 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4874 if (ctx
->ExecuteFlag
) {
4875 CALL_VertexAttrib2fNV(ctx
->Exec
, ( attr
, x
, y
));
4879 static void save_Attr3fNV( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4881 GET_CURRENT_CONTEXT(ctx
);
4883 SAVE_FLUSH_VERTICES( ctx
);
4884 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F_NV
, 4 );
4892 ASSERT(attr
< VERT_ATTRIB_MAX
);
4893 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4894 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4896 if (ctx
->ExecuteFlag
) {
4897 CALL_VertexAttrib3fNV(ctx
->Exec
, ( attr
, x
, y
, z
));
4901 static void save_Attr4fNV( 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_4F_NV
, 5 );
4916 ASSERT(attr
< VERT_ATTRIB_MAX
);
4917 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4918 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4920 if (ctx
->ExecuteFlag
) {
4921 CALL_VertexAttrib4fNV(ctx
->Exec
, ( attr
, x
, y
, z
, w
));
4926 static void save_Attr1fARB( GLenum attr
, GLfloat x
)
4928 GET_CURRENT_CONTEXT(ctx
);
4930 SAVE_FLUSH_VERTICES( ctx
);
4931 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F_ARB
, 2 );
4937 ASSERT(attr
< VERT_ATTRIB_MAX
);
4938 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4939 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4941 if (ctx
->ExecuteFlag
) {
4942 CALL_VertexAttrib1fARB(ctx
->Exec
, ( attr
, x
));
4946 static void save_Attr2fARB( GLenum attr
, GLfloat x
, GLfloat y
)
4948 GET_CURRENT_CONTEXT(ctx
);
4950 SAVE_FLUSH_VERTICES( ctx
);
4951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F_ARB
, 3 );
4958 ASSERT(attr
< VERT_ATTRIB_MAX
);
4959 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4960 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4962 if (ctx
->ExecuteFlag
) {
4963 CALL_VertexAttrib2fARB(ctx
->Exec
, ( attr
, x
, y
));
4967 static void save_Attr3fARB( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4969 GET_CURRENT_CONTEXT(ctx
);
4971 SAVE_FLUSH_VERTICES( ctx
);
4972 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F_ARB
, 4 );
4980 ASSERT(attr
< VERT_ATTRIB_MAX
);
4981 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4982 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4984 if (ctx
->ExecuteFlag
) {
4985 CALL_VertexAttrib3fARB(ctx
->Exec
, ( attr
, x
, y
, z
));
4989 static void save_Attr4fARB( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4992 GET_CURRENT_CONTEXT(ctx
);
4994 SAVE_FLUSH_VERTICES( ctx
);
4995 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F_ARB
, 5 );
5004 ASSERT(attr
< VERT_ATTRIB_MAX
);
5005 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5006 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5008 if (ctx
->ExecuteFlag
) {
5009 CALL_VertexAttrib4fARB(ctx
->Exec
, ( attr
, x
, y
, z
, w
));
5014 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
5016 GET_CURRENT_CONTEXT(ctx
);
5018 SAVE_FLUSH_VERTICES( ctx
);
5019 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
5023 if (ctx
->ExecuteFlag
) {
5024 CALL_EvalCoord1f(ctx
->Exec
, ( x
));
5028 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
5030 save_EvalCoord1f( v
[0] );
5033 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
5035 GET_CURRENT_CONTEXT(ctx
);
5037 SAVE_FLUSH_VERTICES( ctx
);
5038 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
5043 if (ctx
->ExecuteFlag
) {
5044 CALL_EvalCoord2f(ctx
->Exec
, ( x
, y
));
5048 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
5050 save_EvalCoord2f( v
[0], v
[1] );
5054 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
5056 GET_CURRENT_CONTEXT(ctx
);
5058 SAVE_FLUSH_VERTICES( ctx
);
5059 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
5063 if (ctx
->ExecuteFlag
) {
5064 CALL_EvalPoint1(ctx
->Exec
, ( x
));
5068 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
5070 GET_CURRENT_CONTEXT(ctx
);
5072 SAVE_FLUSH_VERTICES( ctx
);
5073 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
5078 if (ctx
->ExecuteFlag
) {
5079 CALL_EvalPoint2(ctx
->Exec
, ( x
, y
));
5083 static void GLAPIENTRY
save_Indexf( GLfloat x
)
5085 GET_CURRENT_CONTEXT(ctx
);
5087 SAVE_FLUSH_VERTICES( ctx
);
5088 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
5093 ctx
->ListState
.ActiveIndex
= 1;
5094 ctx
->ListState
.CurrentIndex
= x
;
5096 if (ctx
->ExecuteFlag
) {
5097 CALL_Indexi(ctx
->Exec
, ( (GLint
) x
));
5101 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
5103 save_Indexf( v
[0] );
5106 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
5108 GET_CURRENT_CONTEXT(ctx
);
5110 SAVE_FLUSH_VERTICES( ctx
);
5111 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
5116 ctx
->ListState
.ActiveEdgeFlag
= 1;
5117 ctx
->ListState
.CurrentEdgeFlag
= x
;
5119 if (ctx
->ExecuteFlag
) {
5120 CALL_EdgeFlag(ctx
->Exec
, ( x
));
5124 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
5126 save_EdgeFlag( v
[0] );
5129 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
5131 GET_CURRENT_CONTEXT(ctx
);
5135 SAVE_FLUSH_VERTICES( ctx
);
5140 case GL_FRONT_AND_BACK
:
5143 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
5152 case GL_AMBIENT_AND_DIFFUSE
:
5158 case GL_COLOR_INDEXES
:
5162 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
5166 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
5170 for (i
= 0 ; i
< args
; i
++)
5171 n
[3+i
].f
= param
[i
];
5175 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, NULL
);
5176 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
5177 if (bitmask
& (1<<i
)) {
5178 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5179 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5183 if (ctx
->ExecuteFlag
) {
5184 CALL_Materialfv(ctx
->Exec
, ( face
, pname
, param
));
5188 static void GLAPIENTRY
save_Begin( GLenum mode
)
5190 GET_CURRENT_CONTEXT(ctx
);
5192 GLboolean error
= GL_FALSE
;
5194 if (/*mode < GL_POINTS ||*/ mode
> GL_POLYGON
) {
5195 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5198 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5199 /* Typically the first begin. This may raise an error on
5200 * playback, depending on whether CallList is issued from inside
5201 * a begin/end or not.
5203 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5205 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5206 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5209 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
5214 /* Give the driver an opportunity to hook in an optimized
5215 * display list compiler.
5217 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
5220 SAVE_FLUSH_VERTICES( ctx
);
5221 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
5227 if (ctx
->ExecuteFlag
) {
5228 CALL_Begin(ctx
->Exec
, ( mode
));
5232 static void GLAPIENTRY
save_End( void )
5234 GET_CURRENT_CONTEXT(ctx
);
5235 SAVE_FLUSH_VERTICES( ctx
);
5236 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
5237 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5238 if (ctx
->ExecuteFlag
) {
5239 CALL_End(ctx
->Exec
, ( ));
5243 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5245 GET_CURRENT_CONTEXT(ctx
);
5247 SAVE_FLUSH_VERTICES( ctx
);
5248 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
5255 if (ctx
->ExecuteFlag
) {
5256 CALL_Rectf(ctx
->Exec
, ( a
, b
, c
, d
));
5261 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
5263 save_Attr2fNV( VERT_ATTRIB_POS
, x
, y
);
5266 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
5268 save_Attr2fNV( VERT_ATTRIB_POS
, v
[0], v
[1] );
5271 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
5273 save_Attr3fNV( VERT_ATTRIB_POS
, x
, y
, z
);
5276 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
5278 save_Attr3fNV( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
5281 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5283 save_Attr4fNV( VERT_ATTRIB_POS
, x
, y
, z
, w
);
5286 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
5288 save_Attr4fNV( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
5291 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
5293 save_Attr1fNV( VERT_ATTRIB_TEX0
, x
);
5296 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
5298 save_Attr1fNV( VERT_ATTRIB_TEX0
, v
[0] );
5301 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
5303 save_Attr2fNV( VERT_ATTRIB_TEX0
, x
, y
);
5306 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
5308 save_Attr2fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
5311 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
5313 save_Attr3fNV( VERT_ATTRIB_TEX0
, x
, y
, z
);
5316 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
5318 save_Attr3fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
5321 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5323 save_Attr4fNV( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5326 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
5328 save_Attr4fNV( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
5331 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
5333 save_Attr3fNV( VERT_ATTRIB_NORMAL
, x
, y
, z
);
5336 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5338 save_Attr3fNV( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5341 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5343 save_Attr1fNV( VERT_ATTRIB_FOG
, x
);
5346 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5348 save_Attr1fNV( VERT_ATTRIB_FOG
, v
[0] );
5351 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5353 save_Attr3fNV( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5356 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5358 save_Attr3fNV( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5361 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5363 save_Attr4fNV( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5366 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5368 save_Attr4fNV( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5371 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5373 save_Attr3fNV( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5376 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5378 save_Attr3fNV( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5382 /* Just call the respective ATTR for texcoord
5384 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5386 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5387 save_Attr1fNV( attr
, x
);
5390 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5392 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5393 save_Attr1fNV( attr
, v
[0] );
5396 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5398 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5399 save_Attr2fNV( attr
, x
, y
);
5402 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5404 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5405 save_Attr2fNV( attr
, v
[0], v
[1] );
5408 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5411 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5412 save_Attr3fNV( attr
, x
, y
, z
);
5415 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5417 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5418 save_Attr3fNV( attr
, v
[0], v
[1], v
[2] );
5421 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5422 GLfloat z
, GLfloat w
)
5424 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5425 save_Attr4fNV( attr
, x
, y
, z
, w
);
5428 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5430 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5431 save_Attr4fNV( attr
, v
[0], v
[1], v
[2], v
[3] );
5435 static void enum_error( void )
5437 GET_CURRENT_CONTEXT( ctx
);
5438 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5441 /* First level for NV_vertex_program:
5443 * Check for errors at compile time?.
5445 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5447 if (index
< VERT_ATTRIB_MAX
)
5448 save_Attr1fNV( index
, x
);
5453 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5455 if (index
< VERT_ATTRIB_MAX
)
5456 save_Attr1fNV( index
, v
[0] );
5461 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5463 if (index
< VERT_ATTRIB_MAX
)
5464 save_Attr2fNV( index
, x
, y
);
5469 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5471 if (index
< VERT_ATTRIB_MAX
)
5472 save_Attr2fNV( index
, v
[0], v
[1] );
5477 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5480 if (index
< VERT_ATTRIB_MAX
)
5481 save_Attr3fNV( index
, x
, y
, z
);
5486 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5488 if (index
< VERT_ATTRIB_MAX
)
5489 save_Attr3fNV( index
, v
[0], v
[1], v
[2] );
5494 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5495 GLfloat z
, GLfloat w
)
5497 if (index
< VERT_ATTRIB_MAX
)
5498 save_Attr4fNV( index
, x
, y
, z
, w
);
5503 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5505 if (index
< VERT_ATTRIB_MAX
)
5506 save_Attr4fNV( index
, v
[0], v
[1], v
[2], v
[3] );
5514 static void GLAPIENTRY
5515 save_VertexAttrib1fARB( GLuint index
, GLfloat x
)
5517 if (index
< VERT_ATTRIB_MAX
)
5518 save_Attr1fARB( index
, x
);
5523 static void GLAPIENTRY
5524 save_VertexAttrib1fvARB( GLuint index
, const GLfloat
*v
)
5526 if (index
< VERT_ATTRIB_MAX
)
5527 save_Attr1fARB( index
, v
[0] );
5532 static void GLAPIENTRY
5533 save_VertexAttrib2fARB( GLuint index
, GLfloat x
, GLfloat y
)
5535 if (index
< VERT_ATTRIB_MAX
)
5536 save_Attr2fARB( index
, x
, y
);
5541 static void GLAPIENTRY
5542 save_VertexAttrib2fvARB( GLuint index
, const GLfloat
*v
)
5544 if (index
< VERT_ATTRIB_MAX
)
5545 save_Attr2fARB( index
, v
[0], v
[1] );
5550 static void GLAPIENTRY
5551 save_VertexAttrib3fARB( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5553 if (index
< VERT_ATTRIB_MAX
)
5554 save_Attr3fARB( index
, x
, y
, z
);
5559 static void GLAPIENTRY
5560 save_VertexAttrib3fvARB( GLuint index
, const GLfloat
*v
)
5562 if (index
< VERT_ATTRIB_MAX
)
5563 save_Attr3fARB( index
, v
[0], v
[1], v
[2] );
5568 static void GLAPIENTRY
5569 save_VertexAttrib4fARB( GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5571 if (index
< VERT_ATTRIB_MAX
)
5572 save_Attr4fARB( index
, x
, y
, z
, w
);
5577 static void GLAPIENTRY
5578 save_VertexAttrib4fvARB( GLuint index
, const GLfloat
*v
)
5580 if (index
< VERT_ATTRIB_MAX
)
5581 save_Attr4fARB( index
, v
[0], v
[1], v
[2], v
[3] );
5590 /* KW: Compile commands
5592 * Will appear in the list before the vertex buffer containing the
5593 * command that provoked the error. I don't see this as a problem.
5596 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5599 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5602 n
[2].data
= (void *) s
;
5604 /* execute already done */
5609 * Compile an error into current display list.
5612 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5614 if (ctx
->CompileFlag
)
5615 _mesa_save_error( ctx
, error
, s
);
5617 if (ctx
->ExecuteFlag
)
5618 _mesa_error( ctx
, error
, s
);
5624 islist(GLcontext
*ctx
, GLuint list
)
5626 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5636 /**********************************************************************/
5637 /* Display list execution */
5638 /**********************************************************************/
5642 * Execute a display list. Note that the ListBase offset must have already
5643 * been added before calling this function. I.e. the list argument is
5644 * the absolute list number, not relative to ListBase.
5645 * \param list - display list number
5647 static void GLAPIENTRY
5648 execute_list( GLcontext
*ctx
, GLuint list
)
5650 struct mesa_display_list
*dlist
;
5654 if (list
== 0 || !islist(ctx
,list
))
5657 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
5658 /* raise an error? */
5663 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5667 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
++] = dlist
;
5669 if (ctx
->Driver
.BeginCallList
)
5670 ctx
->Driver
.BeginCallList( ctx
, dlist
);
5676 OpCode opcode
= n
[0].opcode
;
5677 int i
= (int)n
[0].opcode
- (int)OPCODE_EXT_0
;
5679 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
5680 /* this is a driver-extended opcode */
5681 ctx
->ListExt
.Opcode
[i
].Execute(ctx
, &n
[1]);
5682 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
5687 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5690 CALL_Accum(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
5692 case OPCODE_ALPHA_FUNC
:
5693 CALL_AlphaFunc(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
5695 case OPCODE_BIND_TEXTURE
:
5696 CALL_BindTexture(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
5700 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5701 ctx
->Unpack
= ctx
->DefaultPacking
;
5702 CALL_Bitmap(ctx
->Exec
, ( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5703 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
));
5704 ctx
->Unpack
= save
; /* restore */
5707 case OPCODE_BLEND_COLOR
:
5708 CALL_BlendColor(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5710 case OPCODE_BLEND_EQUATION
:
5711 CALL_BlendEquation(ctx
->Exec
, ( n
[1].e
));
5713 case OPCODE_BLEND_EQUATION_SEPARATE
:
5714 CALL_BlendEquationSeparateEXT(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5716 case OPCODE_BLEND_FUNC_SEPARATE
:
5717 CALL_BlendFuncSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
5719 case OPCODE_CALL_LIST
:
5720 /* Generated by glCallList(), don't add ListBase */
5721 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5722 execute_list( ctx
, n
[1].ui
);
5725 case OPCODE_CALL_LIST_OFFSET
:
5726 /* Generated by glCallLists() so we must add ListBase */
5728 /* user specified a bad data type at compile time */
5729 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5731 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5732 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5736 CALL_Clear(ctx
->Exec
, ( n
[1].bf
));
5738 case OPCODE_CLEAR_COLOR
:
5739 CALL_ClearColor(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5741 case OPCODE_CLEAR_ACCUM
:
5742 CALL_ClearAccum(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
5744 case OPCODE_CLEAR_DEPTH
:
5745 CALL_ClearDepth(ctx
->Exec
, ( (GLclampd
) n
[1].f
));
5747 case OPCODE_CLEAR_INDEX
:
5748 CALL_ClearIndex(ctx
->Exec
, ( (GLfloat
) n
[1].ui
));
5750 case OPCODE_CLEAR_STENCIL
:
5751 CALL_ClearStencil(ctx
->Exec
, ( n
[1].i
));
5753 case OPCODE_CLIP_PLANE
:
5760 CALL_ClipPlane(ctx
->Exec
, ( n
[1].e
, eq
));
5763 case OPCODE_COLOR_MASK
:
5764 CALL_ColorMask(ctx
->Exec
, ( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
5766 case OPCODE_COLOR_MATERIAL
:
5767 CALL_ColorMaterial(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5769 case OPCODE_COLOR_TABLE
:
5771 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5772 ctx
->Unpack
= ctx
->DefaultPacking
;
5773 CALL_ColorTable(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5774 n
[5].e
, n
[6].data
));
5775 ctx
->Unpack
= save
; /* restore */
5778 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5785 CALL_ColorTableParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5788 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5795 CALL_ColorTableParameteriv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5798 case OPCODE_COLOR_SUB_TABLE
:
5800 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5801 ctx
->Unpack
= ctx
->DefaultPacking
;
5802 CALL_ColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5803 n
[4].e
, n
[5].e
, n
[6].data
));
5804 ctx
->Unpack
= save
; /* restore */
5807 case OPCODE_CONVOLUTION_FILTER_1D
:
5809 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5810 ctx
->Unpack
= ctx
->DefaultPacking
;
5811 CALL_ConvolutionFilter1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5812 n
[4].e
, n
[5].e
, n
[6].data
));
5813 ctx
->Unpack
= save
; /* restore */
5816 case OPCODE_CONVOLUTION_FILTER_2D
:
5818 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5819 ctx
->Unpack
= ctx
->DefaultPacking
;
5820 CALL_ConvolutionFilter2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5821 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
));
5822 ctx
->Unpack
= save
; /* restore */
5825 case OPCODE_CONVOLUTION_PARAMETER_I
:
5826 CALL_ConvolutionParameteri(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
));
5828 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5835 CALL_ConvolutionParameteriv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5838 case OPCODE_CONVOLUTION_PARAMETER_F
:
5839 CALL_ConvolutionParameterf(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].f
));
5841 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5848 CALL_ConvolutionParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
5851 case OPCODE_COPY_COLOR_SUB_TABLE
:
5852 CALL_CopyColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
,
5853 n
[3].i
, n
[4].i
, n
[5].i
));
5855 case OPCODE_COPY_COLOR_TABLE
:
5856 CALL_CopyColorSubTable(ctx
->Exec
, ( n
[1].e
, n
[2].i
,
5857 n
[3].i
, n
[4].i
, n
[5].i
));
5859 case OPCODE_COPY_PIXELS
:
5860 CALL_CopyPixels(ctx
->Exec
, ( n
[1].i
, n
[2].i
,
5861 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
));
5863 case OPCODE_COPY_TEX_IMAGE1D
:
5864 CALL_CopyTexImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5865 n
[5].i
, n
[6].i
, n
[7].i
));
5867 case OPCODE_COPY_TEX_IMAGE2D
:
5868 CALL_CopyTexImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5869 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5871 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5872 CALL_CopyTexSubImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5873 n
[4].i
, n
[5].i
, n
[6].i
));
5875 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5876 CALL_CopyTexSubImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5877 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
5879 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5880 CALL_CopyTexSubImage3D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
5881 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
));
5883 case OPCODE_CULL_FACE
:
5884 CALL_CullFace(ctx
->Exec
, ( n
[1].e
));
5886 case OPCODE_DEPTH_FUNC
:
5887 CALL_DepthFunc(ctx
->Exec
, ( n
[1].e
));
5889 case OPCODE_DEPTH_MASK
:
5890 CALL_DepthMask(ctx
->Exec
, ( n
[1].b
));
5892 case OPCODE_DEPTH_RANGE
:
5893 CALL_DepthRange(ctx
->Exec
, ( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
5895 case OPCODE_DISABLE
:
5896 CALL_Disable(ctx
->Exec
, ( n
[1].e
));
5898 case OPCODE_DRAW_BUFFER
:
5899 CALL_DrawBuffer(ctx
->Exec
, ( n
[1].e
));
5901 case OPCODE_DRAW_PIXELS
:
5903 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5904 ctx
->Unpack
= ctx
->DefaultPacking
;
5905 CALL_DrawPixels(ctx
->Exec
, ( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5907 ctx
->Unpack
= save
; /* restore */
5911 CALL_Enable(ctx
->Exec
, ( n
[1].e
));
5913 case OPCODE_EVALMESH1
:
5914 CALL_EvalMesh1(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
));
5916 case OPCODE_EVALMESH2
:
5917 CALL_EvalMesh2(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
5926 CALL_Fogfv(ctx
->Exec
, ( n
[1].e
, p
));
5929 case OPCODE_FRONT_FACE
:
5930 CALL_FrontFace(ctx
->Exec
, ( n
[1].e
));
5932 case OPCODE_FRUSTUM
:
5933 CALL_Frustum(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
5936 CALL_Hint(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
5938 case OPCODE_HISTOGRAM
:
5939 CALL_Histogram(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
5941 case OPCODE_INDEX_MASK
:
5942 CALL_IndexMask(ctx
->Exec
, ( n
[1].ui
));
5944 case OPCODE_INIT_NAMES
:
5945 CALL_InitNames(ctx
->Exec
, ());
5954 CALL_Lightfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, p
));
5957 case OPCODE_LIGHT_MODEL
:
5964 CALL_LightModelfv(ctx
->Exec
, ( n
[1].e
, p
));
5967 case OPCODE_LINE_STIPPLE
:
5968 CALL_LineStipple(ctx
->Exec
, ( n
[1].i
, n
[2].us
));
5970 case OPCODE_LINE_WIDTH
:
5971 CALL_LineWidth(ctx
->Exec
, ( n
[1].f
));
5973 case OPCODE_LIST_BASE
:
5974 CALL_ListBase(ctx
->Exec
, ( n
[1].ui
));
5976 case OPCODE_LOAD_IDENTITY
:
5977 CALL_LoadIdentity(ctx
->Exec
, ());
5979 case OPCODE_LOAD_MATRIX
:
5980 if (sizeof(Node
)==sizeof(GLfloat
)) {
5981 CALL_LoadMatrixf(ctx
->Exec
, ( &n
[1].f
));
5986 for (i
=0;i
<16;i
++) {
5989 CALL_LoadMatrixf(ctx
->Exec
, ( m
));
5992 case OPCODE_LOAD_NAME
:
5993 CALL_LoadName(ctx
->Exec
, ( n
[1].ui
));
5995 case OPCODE_LOGIC_OP
:
5996 CALL_LogicOp(ctx
->Exec
, ( n
[1].e
));
6000 GLenum target
= n
[1].e
;
6001 GLint ustride
= _mesa_evaluator_components(target
);
6002 GLint uorder
= n
[5].i
;
6003 GLfloat u1
= n
[2].f
;
6004 GLfloat u2
= n
[3].f
;
6005 CALL_Map1f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
6006 (GLfloat
*) n
[6].data
));
6011 GLenum target
= n
[1].e
;
6012 GLfloat u1
= n
[2].f
;
6013 GLfloat u2
= n
[3].f
;
6014 GLfloat v1
= n
[4].f
;
6015 GLfloat v2
= n
[5].f
;
6016 GLint ustride
= n
[6].i
;
6017 GLint vstride
= n
[7].i
;
6018 GLint uorder
= n
[8].i
;
6019 GLint vorder
= n
[9].i
;
6020 CALL_Map2f(ctx
->Exec
, ( target
, u1
, u2
, ustride
, uorder
,
6021 v1
, v2
, vstride
, vorder
,
6022 (GLfloat
*) n
[10].data
));
6025 case OPCODE_MAPGRID1
:
6026 CALL_MapGrid1f(ctx
->Exec
, ( n
[1].i
, n
[2].f
, n
[3].f
));
6028 case OPCODE_MAPGRID2
:
6029 CALL_MapGrid2f(ctx
->Exec
, ( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6031 case OPCODE_MATRIX_MODE
:
6032 CALL_MatrixMode(ctx
->Exec
, ( n
[1].e
));
6034 case OPCODE_MIN_MAX
:
6035 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6037 case OPCODE_MULT_MATRIX
:
6038 if (sizeof(Node
)==sizeof(GLfloat
)) {
6039 CALL_MultMatrixf(ctx
->Exec
, ( &n
[1].f
));
6044 for (i
=0;i
<16;i
++) {
6047 CALL_MultMatrixf(ctx
->Exec
, ( m
));
6051 CALL_Ortho(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6053 case OPCODE_PASSTHROUGH
:
6054 CALL_PassThrough(ctx
->Exec
, ( n
[1].f
));
6056 case OPCODE_PIXEL_MAP
:
6057 CALL_PixelMapfv(ctx
->Exec
, ( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
6059 case OPCODE_PIXEL_TRANSFER
:
6060 CALL_PixelTransferf(ctx
->Exec
, ( n
[1].e
, n
[2].f
));
6062 case OPCODE_PIXEL_ZOOM
:
6063 CALL_PixelZoom(ctx
->Exec
, ( n
[1].f
, n
[2].f
));
6065 case OPCODE_POINT_SIZE
:
6066 CALL_PointSize(ctx
->Exec
, ( n
[1].f
));
6068 case OPCODE_POINT_PARAMETERS
:
6074 CALL_PointParameterfvEXT(ctx
->Exec
, ( n
[1].e
, params
));
6077 case OPCODE_POLYGON_MODE
:
6078 CALL_PolygonMode(ctx
->Exec
, ( n
[1].e
, n
[2].e
));
6080 case OPCODE_POLYGON_STIPPLE
:
6081 CALL_PolygonStipple(ctx
->Exec
, ( (GLubyte
*) n
[1].data
));
6083 case OPCODE_POLYGON_OFFSET
:
6084 CALL_PolygonOffset(ctx
->Exec
, ( n
[1].f
, n
[2].f
));
6086 case OPCODE_POP_ATTRIB
:
6087 CALL_PopAttrib(ctx
->Exec
, ());
6089 case OPCODE_POP_MATRIX
:
6090 CALL_PopMatrix(ctx
->Exec
, ());
6092 case OPCODE_POP_NAME
:
6093 CALL_PopName(ctx
->Exec
, ());
6095 case OPCODE_PRIORITIZE_TEXTURE
:
6096 CALL_PrioritizeTextures(ctx
->Exec
, ( 1, &n
[1].ui
, &n
[2].f
));
6098 case OPCODE_PUSH_ATTRIB
:
6099 CALL_PushAttrib(ctx
->Exec
, ( n
[1].bf
));
6101 case OPCODE_PUSH_MATRIX
:
6102 CALL_PushMatrix(ctx
->Exec
, ());
6104 case OPCODE_PUSH_NAME
:
6105 CALL_PushName(ctx
->Exec
, ( n
[1].ui
));
6107 case OPCODE_RASTER_POS
:
6108 CALL_RasterPos4f(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6110 case OPCODE_READ_BUFFER
:
6111 CALL_ReadBuffer(ctx
->Exec
, ( n
[1].e
));
6113 case OPCODE_RESET_HISTOGRAM
:
6114 CALL_ResetHistogram(ctx
->Exec
, ( n
[1].e
));
6116 case OPCODE_RESET_MIN_MAX
:
6117 CALL_ResetMinmax(ctx
->Exec
, ( n
[1].e
));
6120 CALL_Rotatef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6123 CALL_Scalef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6125 case OPCODE_SCISSOR
:
6126 CALL_Scissor(ctx
->Exec
, ( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
6128 case OPCODE_SHADE_MODEL
:
6129 CALL_ShadeModel(ctx
->Exec
, ( n
[1].e
));
6131 case OPCODE_STENCIL_FUNC
:
6132 CALL_StencilFunc(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].ui
));
6134 case OPCODE_STENCIL_MASK
:
6135 CALL_StencilMask(ctx
->Exec
, ( n
[1].ui
));
6137 case OPCODE_STENCIL_OP
:
6138 CALL_StencilOp(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].e
));
6140 case OPCODE_STENCIL_FUNC_SEPARATE
:
6141 CALL_StencilFuncSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
6143 case OPCODE_STENCIL_MASK_SEPARATE
:
6144 CALL_StencilMaskSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
6146 case OPCODE_STENCIL_OP_SEPARATE
:
6147 CALL_StencilOpSeparate(ctx
->Exec
, ( n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6156 CALL_TexEnvfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6166 CALL_TexGenfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6169 case OPCODE_TEXPARAMETER
:
6176 CALL_TexParameterfv(ctx
->Exec
, ( n
[1].e
, n
[2].e
, params
));
6179 case OPCODE_TEX_IMAGE1D
:
6181 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6182 ctx
->Unpack
= ctx
->DefaultPacking
;
6183 CALL_TexImage1D(ctx
->Exec
, (
6184 n
[1].e
, /* target */
6186 n
[3].i
, /* components */
6188 n
[5].e
, /* border */
6189 n
[6].e
, /* format */
6192 ctx
->Unpack
= save
; /* restore */
6195 case OPCODE_TEX_IMAGE2D
:
6197 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6198 ctx
->Unpack
= ctx
->DefaultPacking
;
6199 CALL_TexImage2D(ctx
->Exec
, (
6200 n
[1].e
, /* target */
6202 n
[3].i
, /* components */
6204 n
[5].i
, /* height */
6205 n
[6].e
, /* border */
6206 n
[7].e
, /* format */
6209 ctx
->Unpack
= save
; /* restore */
6212 case OPCODE_TEX_IMAGE3D
:
6214 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6215 ctx
->Unpack
= ctx
->DefaultPacking
;
6216 CALL_TexImage3D(ctx
->Exec
, (
6217 n
[1].e
, /* target */
6219 n
[3].i
, /* components */
6221 n
[5].i
, /* height */
6223 n
[7].e
, /* border */
6224 n
[8].e
, /* format */
6227 ctx
->Unpack
= save
; /* restore */
6230 case OPCODE_TEX_SUB_IMAGE1D
:
6232 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6233 ctx
->Unpack
= ctx
->DefaultPacking
;
6234 CALL_TexSubImage1D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6236 n
[6].e
, n
[7].data
));
6237 ctx
->Unpack
= save
; /* restore */
6240 case OPCODE_TEX_SUB_IMAGE2D
:
6242 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6243 ctx
->Unpack
= ctx
->DefaultPacking
;
6244 CALL_TexSubImage2D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6246 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
));
6247 ctx
->Unpack
= save
; /* restore */
6250 case OPCODE_TEX_SUB_IMAGE3D
:
6252 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6253 ctx
->Unpack
= ctx
->DefaultPacking
;
6254 CALL_TexSubImage3D(ctx
->Exec
, ( n
[1].e
, n
[2].i
, n
[3].i
,
6255 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6256 n
[8].i
, n
[9].e
, n
[10].e
,
6258 ctx
->Unpack
= save
; /* restore */
6261 case OPCODE_TRANSLATE
:
6262 CALL_Translatef(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6264 case OPCODE_VIEWPORT
:
6265 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6266 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
6268 case OPCODE_WINDOW_POS
:
6269 CALL_WindowPos4fMESA(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6271 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
6272 CALL_ActiveTextureARB(ctx
->Exec
, ( n
[1].e
));
6274 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
6275 CALL_PixelTexGenSGIX(ctx
->Exec
, ( n
[1].e
));
6277 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
6278 CALL_PixelTexGenParameteriSGIS(ctx
->Exec
, ( n
[1].e
, n
[2].i
));
6280 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
6281 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6282 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
));
6284 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
6285 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6286 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
));
6288 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
6289 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
6290 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
));
6292 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
6293 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6294 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
));
6296 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
6297 CALL_CompressedTexSubImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6298 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
));
6300 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
6301 CALL_CompressedTexSubImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6302 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
6303 n
[9].e
, n
[10].i
, n
[11].data
));
6305 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
6306 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
6308 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
6309 CALL_WindowPos3fMESA(ctx
->Exec
, ( n
[1].f
, n
[2].f
, n
[3].f
));
6311 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6312 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
6313 CALL_BindProgramNV(ctx
->Exec
, ( n
[1].e
, n
[2].ui
));
6316 #if FEATURE_NV_vertex_program
6317 case OPCODE_EXECUTE_PROGRAM_NV
:
6324 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
6327 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
6328 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
6329 (GLuint
*) n
[2].data
));
6331 case OPCODE_LOAD_PROGRAM_NV
:
6332 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
6333 (const GLubyte
*) n
[4].data
));
6335 case OPCODE_PROGRAM_PARAMETER4F_NV
:
6336 CALL_ProgramParameter4fNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6337 n
[4].f
, n
[5].f
, n
[6].f
));
6339 case OPCODE_TRACK_MATRIX_NV
:
6340 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
6344 #if FEATURE_NV_fragment_program
6345 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
6346 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6347 n
[4].f
, n
[5].f
, n
[6].f
));
6349 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
6350 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
6351 (const GLubyte
*) n
[3].data
,
6352 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
));
6356 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
6357 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
6359 case OPCODE_DEPTH_BOUNDS_EXT
:
6360 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6362 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
6363 case OPCODE_PROGRAM_STRING_ARB
:
6364 CALL_ProgramStringARB(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
6366 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
6367 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
6368 n
[4].f
, n
[5].f
, n
[6].f
));
6371 #if FEATURE_ARB_occlusion_query
6372 case OPCODE_BEGIN_QUERY_ARB
:
6373 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6375 case OPCODE_END_QUERY_ARB
:
6376 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
6379 case OPCODE_DRAW_BUFFERS_ARB
:
6381 GLenum buffers
[MAX_DRAW_BUFFERS
];
6382 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
6383 for (i
= 0; i
< count
; i
++)
6384 buffers
[i
] = n
[2 + i
].e
;
6385 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
6388 #if FEATURE_ATI_fragment_shader
6389 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
6390 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
6392 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
6395 GLuint i
, dst
= n
[1].ui
;
6397 for (i
= 0; i
< 4; i
++)
6398 values
[i
] = n
[1+i
].f
;
6399 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
6403 case OPCODE_ATTR_1F_NV
:
6404 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6406 case OPCODE_ATTR_2F_NV
:
6407 /* Really shouldn't have to do this - the Node structure
6408 * is convenient, but it would be better to store the data
6409 * packed appropriately so that it can be sent directly
6410 * on. With x86_64 becoming common, this will start to
6413 if (sizeof(Node
)==sizeof(GLfloat
))
6414 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6416 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6418 case OPCODE_ATTR_3F_NV
:
6419 if (sizeof(Node
)==sizeof(GLfloat
))
6420 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6422 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6425 case OPCODE_ATTR_4F_NV
:
6426 if (sizeof(Node
)==sizeof(GLfloat
))
6427 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6429 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6432 case OPCODE_ATTR_1F_ARB
:
6433 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6435 case OPCODE_ATTR_2F_ARB
:
6436 /* Really shouldn't have to do this - the Node structure
6437 * is convenient, but it would be better to store the data
6438 * packed appropriately so that it can be sent directly
6439 * on. With x86_64 becoming common, this will start to
6442 if (sizeof(Node
)==sizeof(GLfloat
))
6443 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6445 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
6447 case OPCODE_ATTR_3F_ARB
:
6448 if (sizeof(Node
)==sizeof(GLfloat
))
6449 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6451 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6454 case OPCODE_ATTR_4F_ARB
:
6455 if (sizeof(Node
)==sizeof(GLfloat
))
6456 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
6458 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
6461 case OPCODE_MATERIAL
:
6462 if (sizeof(Node
)==sizeof(GLfloat
))
6463 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
6470 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
6474 CALL_Indexi(ctx
->Exec
, (n
[1].i
));
6476 case OPCODE_EDGEFLAG
:
6477 CALL_EdgeFlag(ctx
->Exec
, (n
[1].b
));
6480 CALL_Begin(ctx
->Exec
, (n
[1].e
));
6483 CALL_End(ctx
->Exec
, ());
6486 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6488 case OPCODE_EVAL_C1
:
6489 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
6491 case OPCODE_EVAL_C2
:
6492 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
6494 case OPCODE_EVAL_P1
:
6495 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
6497 case OPCODE_EVAL_P2
:
6498 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
6504 case OPCODE_CONTINUE
:
6505 n
= (Node
*) n
[1].next
;
6507 case OPCODE_END_OF_LIST
:
6513 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
6514 _mesa_problem(ctx
, msg
);
6519 /* increment n to point to next compiled command */
6520 if (opcode
!=OPCODE_CONTINUE
) {
6521 n
+= InstSize
[opcode
];
6526 if (ctx
->Driver
.EndCallList
)
6527 ctx
->Driver
.EndCallList( ctx
);
6529 ctx
->ListState
.CallStack
[ctx
->ListState
.CallDepth
--] = NULL
;
6536 /**********************************************************************/
6538 /**********************************************************************/
6544 * Test if a display list number is valid.
6546 GLboolean GLAPIENTRY
6547 _mesa_IsList( GLuint list
)
6549 GET_CURRENT_CONTEXT(ctx
);
6550 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6551 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6552 return islist(ctx
, list
);
6557 * Delete a sequence of consecutive display lists.
6560 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6562 GET_CURRENT_CONTEXT(ctx
);
6564 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6565 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6568 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6571 for (i
=list
;i
<list
+range
;i
++) {
6572 _mesa_destroy_list( ctx
, i
);
6579 * Return a display list number, n, such that lists n through n+range-1
6583 _mesa_GenLists(GLsizei range
)
6585 GET_CURRENT_CONTEXT(ctx
);
6587 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6588 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6591 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6599 * Make this an atomic operation
6601 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6603 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6605 /* reserve the list IDs by with empty/dummy lists */
6607 for (i
=0; i
<range
; i
++) {
6608 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_list(base
+i
, 1));
6612 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6620 * Begin a new display list.
6623 _mesa_NewList( GLuint list
, GLenum mode
)
6625 GET_CURRENT_CONTEXT(ctx
);
6628 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6629 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6631 if (MESA_VERBOSE
&VERBOSE_API
)
6632 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6633 _mesa_lookup_enum_by_nr(mode
));
6636 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6640 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6641 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6645 if (ctx
->ListState
.CurrentListPtr
) {
6646 /* already compiling a display list */
6647 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6651 ctx
->CompileFlag
= GL_TRUE
;
6652 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6654 /* Allocate new display list */
6655 ctx
->ListState
.CurrentListNum
= list
;
6656 ctx
->ListState
.CurrentList
= make_list( list
, BLOCK_SIZE
);
6657 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->node
;
6658 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6659 ctx
->ListState
.CurrentPos
= 0;
6661 /* Reset acumulated list state:
6663 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6664 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6666 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6667 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6669 ctx
->ListState
.ActiveIndex
= 0;
6670 ctx
->ListState
.ActiveEdgeFlag
= 0;
6672 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6673 ctx
->Driver
.NewList( ctx
, list
, mode
);
6675 ctx
->CurrentDispatch
= ctx
->Save
;
6676 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6682 * End definition of current display list.
6685 _mesa_EndList( void )
6687 GET_CURRENT_CONTEXT(ctx
);
6688 SAVE_FLUSH_VERTICES(ctx
);
6689 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6691 if (MESA_VERBOSE
&VERBOSE_API
)
6692 _mesa_debug(ctx
, "glEndList\n");
6694 /* Check that a list is under construction */
6695 if (!ctx
->ListState
.CurrentListPtr
) {
6696 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6700 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6702 /* Destroy old list, if any */
6703 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6704 /* Install the list */
6705 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentList
);
6708 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6709 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6711 ctx
->Driver
.EndList( ctx
);
6713 ctx
->ListState
.CurrentList
= NULL
;
6714 ctx
->ListState
.CurrentListNum
= 0;
6715 ctx
->ListState
.CurrentListPtr
= NULL
;
6716 ctx
->ExecuteFlag
= GL_TRUE
;
6717 ctx
->CompileFlag
= GL_FALSE
;
6719 ctx
->CurrentDispatch
= ctx
->Exec
;
6720 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6726 _mesa_CallList( GLuint list
)
6728 GLboolean save_compile_flag
;
6729 GET_CURRENT_CONTEXT(ctx
);
6730 FLUSH_CURRENT(ctx
, 0);
6731 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6732 /* execute the display list, and restore the CompileFlag. */
6734 if (MESA_VERBOSE
& VERBOSE_API
)
6735 _mesa_debug(ctx
, "glCallList %d\n", list
);
6738 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6742 /* mesa_print_display_list( list ); */
6744 save_compile_flag
= ctx
->CompileFlag
;
6745 if (save_compile_flag
) {
6746 ctx
->CompileFlag
= GL_FALSE
;
6749 execute_list( ctx
, list
);
6750 ctx
->CompileFlag
= save_compile_flag
;
6752 /* also restore API function pointers to point to "save" versions */
6753 if (save_compile_flag
) {
6754 ctx
->CurrentDispatch
= ctx
->Save
;
6755 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6762 * Execute glCallLists: call multiple display lists.
6765 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6767 GET_CURRENT_CONTEXT(ctx
);
6770 GLboolean save_compile_flag
;
6772 if (MESA_VERBOSE
& VERBOSE_API
)
6773 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6777 case GL_UNSIGNED_BYTE
:
6779 case GL_UNSIGNED_SHORT
:
6781 case GL_UNSIGNED_INT
:
6789 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6793 /* Save the CompileFlag status, turn it off, execute display list,
6794 * and restore the CompileFlag.
6796 save_compile_flag
= ctx
->CompileFlag
;
6797 ctx
->CompileFlag
= GL_FALSE
;
6800 list
= translate_id( i
, type
, lists
);
6801 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6804 ctx
->CompileFlag
= save_compile_flag
;
6806 /* also restore API function pointers to point to "save" versions */
6807 if (save_compile_flag
) {
6808 ctx
->CurrentDispatch
= ctx
->Save
;
6809 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6816 * Set the offset added to list numbers in glCallLists.
6819 _mesa_ListBase( GLuint base
)
6821 GET_CURRENT_CONTEXT(ctx
);
6822 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6823 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6824 ctx
->List
.ListBase
= base
;
6828 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6830 static void GLAPIENTRY
exec_Finish( void )
6832 GET_CURRENT_CONTEXT(ctx
);
6833 FLUSH_VERTICES(ctx
, 0);
6834 CALL_Finish(ctx
->Exec
, ());
6837 static void GLAPIENTRY
exec_Flush( void )
6839 GET_CURRENT_CONTEXT(ctx
);
6840 FLUSH_VERTICES(ctx
, 0);
6841 CALL_Flush(ctx
->Exec
, ( ));
6844 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6846 GET_CURRENT_CONTEXT(ctx
);
6847 FLUSH_VERTICES(ctx
, 0);
6848 CALL_GetBooleanv(ctx
->Exec
, ( pname
, params
));
6851 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6853 GET_CURRENT_CONTEXT(ctx
);
6854 FLUSH_VERTICES(ctx
, 0);
6855 CALL_GetClipPlane(ctx
->Exec
, ( plane
, equation
));
6858 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6860 GET_CURRENT_CONTEXT(ctx
);
6861 FLUSH_VERTICES(ctx
, 0);
6862 CALL_GetDoublev(ctx
->Exec
, ( pname
, params
));
6865 static GLenum GLAPIENTRY
exec_GetError( void )
6867 GET_CURRENT_CONTEXT(ctx
);
6868 FLUSH_VERTICES(ctx
, 0);
6869 return CALL_GetError(ctx
->Exec
, ( ));
6872 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6874 GET_CURRENT_CONTEXT(ctx
);
6875 FLUSH_VERTICES(ctx
, 0);
6876 CALL_GetFloatv(ctx
->Exec
, ( pname
, params
));
6879 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6881 GET_CURRENT_CONTEXT(ctx
);
6882 FLUSH_VERTICES(ctx
, 0);
6883 CALL_GetIntegerv(ctx
->Exec
, ( pname
, params
));
6886 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6888 GET_CURRENT_CONTEXT(ctx
);
6889 FLUSH_VERTICES(ctx
, 0);
6890 CALL_GetLightfv(ctx
->Exec
, ( light
, pname
, params
));
6893 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6895 GET_CURRENT_CONTEXT(ctx
);
6896 FLUSH_VERTICES(ctx
, 0);
6897 CALL_GetLightiv(ctx
->Exec
, ( light
, pname
, params
));
6900 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6902 GET_CURRENT_CONTEXT(ctx
);
6903 FLUSH_VERTICES(ctx
, 0);
6904 CALL_GetMapdv(ctx
->Exec
, ( target
, query
, v
));
6907 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6909 GET_CURRENT_CONTEXT(ctx
);
6910 FLUSH_VERTICES(ctx
, 0);
6911 CALL_GetMapfv(ctx
->Exec
, ( target
, query
, v
));
6914 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6916 GET_CURRENT_CONTEXT(ctx
);
6917 FLUSH_VERTICES(ctx
, 0);
6918 CALL_GetMapiv(ctx
->Exec
, ( target
, query
, v
));
6921 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6923 GET_CURRENT_CONTEXT(ctx
);
6924 FLUSH_VERTICES(ctx
, 0);
6925 CALL_GetMaterialfv(ctx
->Exec
, ( face
, pname
, params
));
6928 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6930 GET_CURRENT_CONTEXT(ctx
);
6931 FLUSH_VERTICES(ctx
, 0);
6932 CALL_GetMaterialiv(ctx
->Exec
, ( face
, pname
, params
));
6935 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6937 GET_CURRENT_CONTEXT(ctx
);
6938 FLUSH_VERTICES(ctx
, 0);
6939 CALL_GetPixelMapfv(ctx
->Exec
, ( map
, values
));
6942 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6944 GET_CURRENT_CONTEXT(ctx
);
6945 FLUSH_VERTICES(ctx
, 0);
6946 CALL_GetPixelMapuiv(ctx
->Exec
, ( map
, values
));
6949 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6951 GET_CURRENT_CONTEXT(ctx
);
6952 FLUSH_VERTICES(ctx
, 0);
6953 CALL_GetPixelMapusv(ctx
->Exec
, ( map
, values
));
6956 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6958 GET_CURRENT_CONTEXT(ctx
);
6959 FLUSH_VERTICES(ctx
, 0);
6960 CALL_GetPolygonStipple(ctx
->Exec
, ( dest
));
6963 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6965 GET_CURRENT_CONTEXT(ctx
);
6966 FLUSH_VERTICES(ctx
, 0);
6967 return CALL_GetString(ctx
->Exec
, ( name
));
6970 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6972 GET_CURRENT_CONTEXT(ctx
);
6973 FLUSH_VERTICES(ctx
, 0);
6974 CALL_GetTexEnvfv(ctx
->Exec
, ( target
, pname
, params
));
6977 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6979 GET_CURRENT_CONTEXT(ctx
);
6980 FLUSH_VERTICES(ctx
, 0);
6981 CALL_GetTexEnviv(ctx
->Exec
, ( target
, pname
, params
));
6984 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6986 GET_CURRENT_CONTEXT(ctx
);
6987 FLUSH_VERTICES(ctx
, 0);
6988 CALL_GetTexGendv(ctx
->Exec
, ( coord
, pname
, params
));
6991 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6993 GET_CURRENT_CONTEXT(ctx
);
6994 FLUSH_VERTICES(ctx
, 0);
6995 CALL_GetTexGenfv(ctx
->Exec
, ( coord
, pname
, params
));
6998 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
7000 GET_CURRENT_CONTEXT(ctx
);
7001 FLUSH_VERTICES(ctx
, 0);
7002 CALL_GetTexGeniv(ctx
->Exec
, ( coord
, pname
, params
));
7005 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
7006 GLenum type
, GLvoid
*pixels
)
7008 GET_CURRENT_CONTEXT(ctx
);
7009 FLUSH_VERTICES(ctx
, 0);
7010 CALL_GetTexImage(ctx
->Exec
, ( target
, level
, format
, type
, pixels
));
7013 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
7014 GLenum pname
, GLfloat
*params
)
7016 GET_CURRENT_CONTEXT(ctx
);
7017 FLUSH_VERTICES(ctx
, 0);
7018 CALL_GetTexLevelParameterfv(ctx
->Exec
, ( target
, level
, pname
, params
));
7021 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
7022 GLenum pname
, GLint
*params
)
7024 GET_CURRENT_CONTEXT(ctx
);
7025 FLUSH_VERTICES(ctx
, 0);
7026 CALL_GetTexLevelParameteriv(ctx
->Exec
, ( target
, level
, pname
, params
));
7029 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
7032 GET_CURRENT_CONTEXT(ctx
);
7033 FLUSH_VERTICES(ctx
, 0);
7034 CALL_GetTexParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7037 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
7039 GET_CURRENT_CONTEXT(ctx
);
7040 FLUSH_VERTICES(ctx
, 0);
7041 CALL_GetTexParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7044 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
7046 GET_CURRENT_CONTEXT(ctx
);
7047 FLUSH_VERTICES(ctx
, 0);
7048 return CALL_IsEnabled(ctx
->Exec
, ( cap
));
7051 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
7053 GET_CURRENT_CONTEXT(ctx
);
7054 FLUSH_VERTICES(ctx
, 0);
7055 CALL_PixelStoref(ctx
->Exec
, ( pname
, param
));
7058 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
7060 GET_CURRENT_CONTEXT(ctx
);
7061 FLUSH_VERTICES(ctx
, 0);
7062 CALL_PixelStorei(ctx
->Exec
, ( pname
, param
));
7065 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
7066 GLenum format
, GLenum type
, GLvoid
*pixels
)
7068 GET_CURRENT_CONTEXT(ctx
);
7069 FLUSH_VERTICES(ctx
, 0);
7070 CALL_ReadPixels(ctx
->Exec
, ( x
, y
, width
, height
, format
, type
, pixels
));
7073 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
7075 GET_CURRENT_CONTEXT(ctx
);
7076 FLUSH_VERTICES(ctx
, 0);
7077 return CALL_RenderMode(ctx
->Exec
, ( mode
));
7080 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
7082 GET_CURRENT_CONTEXT(ctx
);
7083 FLUSH_VERTICES(ctx
, 0);
7084 CALL_FeedbackBuffer(ctx
->Exec
, ( size
, type
, buffer
));
7087 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
7089 GET_CURRENT_CONTEXT(ctx
);
7090 FLUSH_VERTICES(ctx
, 0);
7091 CALL_SelectBuffer(ctx
->Exec
, ( size
, buffer
));
7094 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
7095 GLboolean
*residences
)
7097 GET_CURRENT_CONTEXT(ctx
);
7098 FLUSH_VERTICES(ctx
, 0);
7099 return CALL_AreTexturesResident(ctx
->Exec
, ( n
, texName
, residences
));
7102 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
7105 GET_CURRENT_CONTEXT(ctx
);
7106 FLUSH_VERTICES(ctx
, 0);
7107 CALL_ColorPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7110 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
7112 GET_CURRENT_CONTEXT(ctx
);
7113 FLUSH_VERTICES(ctx
, 0);
7114 CALL_DeleteTextures(ctx
->Exec
, ( n
, texName
));
7117 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
7119 GET_CURRENT_CONTEXT(ctx
);
7120 FLUSH_VERTICES(ctx
, 0);
7121 CALL_DisableClientState(ctx
->Exec
, ( cap
));
7124 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
7126 GET_CURRENT_CONTEXT(ctx
);
7127 FLUSH_VERTICES(ctx
, 0);
7128 CALL_EdgeFlagPointer(ctx
->Exec
, ( stride
, vptr
));
7131 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
7133 GET_CURRENT_CONTEXT(ctx
);
7134 FLUSH_VERTICES(ctx
, 0);
7135 CALL_EnableClientState(ctx
->Exec
, ( cap
));
7138 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
7140 GET_CURRENT_CONTEXT(ctx
);
7141 FLUSH_VERTICES(ctx
, 0);
7142 CALL_GenTextures(ctx
->Exec
, ( n
, texName
));
7145 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
7147 GET_CURRENT_CONTEXT(ctx
);
7148 FLUSH_VERTICES(ctx
, 0);
7149 CALL_GetPointerv(ctx
->Exec
, ( pname
, params
));
7152 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7154 GET_CURRENT_CONTEXT(ctx
);
7155 FLUSH_VERTICES(ctx
, 0);
7156 CALL_IndexPointer(ctx
->Exec
, ( type
, stride
, ptr
));
7159 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
7160 const GLvoid
*pointer
)
7162 GET_CURRENT_CONTEXT(ctx
);
7163 FLUSH_VERTICES(ctx
, 0);
7164 CALL_InterleavedArrays(ctx
->Exec
, ( format
, stride
, pointer
));
7167 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
7169 GET_CURRENT_CONTEXT(ctx
);
7170 FLUSH_VERTICES(ctx
, 0);
7171 return CALL_IsTexture(ctx
->Exec
, ( texture
));
7174 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
7176 GET_CURRENT_CONTEXT(ctx
);
7177 FLUSH_VERTICES(ctx
, 0);
7178 CALL_NormalPointer(ctx
->Exec
, ( type
, stride
, ptr
));
7181 static void GLAPIENTRY
exec_PopClientAttrib(void)
7183 GET_CURRENT_CONTEXT(ctx
);
7184 FLUSH_VERTICES(ctx
, 0);
7185 CALL_PopClientAttrib(ctx
->Exec
, ());
7188 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
7190 GET_CURRENT_CONTEXT(ctx
);
7191 FLUSH_VERTICES(ctx
, 0);
7192 CALL_PushClientAttrib(ctx
->Exec
, ( mask
));
7195 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
7198 GET_CURRENT_CONTEXT(ctx
);
7199 FLUSH_VERTICES(ctx
, 0);
7200 CALL_TexCoordPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7203 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
7206 GET_CURRENT_CONTEXT(ctx
);
7207 FLUSH_VERTICES(ctx
, 0);
7208 CALL_GetCompressedTexImageARB(ctx
->Exec
, ( target
, level
, img
));
7211 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
7214 GET_CURRENT_CONTEXT(ctx
);
7215 FLUSH_VERTICES(ctx
, 0);
7216 CALL_VertexPointer(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7219 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
7220 GLint x
, GLint y
, GLsizei width
)
7222 GET_CURRENT_CONTEXT(ctx
);
7223 FLUSH_VERTICES(ctx
, 0);
7224 CALL_CopyConvolutionFilter1D(ctx
->Exec
, ( target
, internalFormat
, x
, y
, width
));
7227 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
7228 GLint x
, GLint y
, GLsizei width
,
7231 GET_CURRENT_CONTEXT(ctx
);
7232 FLUSH_VERTICES(ctx
, 0);
7233 CALL_CopyConvolutionFilter2D(ctx
->Exec
, ( target
, internalFormat
, x
, y
, width
,
7237 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
7238 GLenum type
, GLvoid
*data
)
7240 GET_CURRENT_CONTEXT(ctx
);
7241 FLUSH_VERTICES(ctx
, 0);
7242 CALL_GetColorTable(ctx
->Exec
, ( target
, format
, type
, data
));
7245 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
7248 GET_CURRENT_CONTEXT(ctx
);
7249 FLUSH_VERTICES(ctx
, 0);
7250 CALL_GetColorTableParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7253 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
7256 GET_CURRENT_CONTEXT(ctx
);
7257 FLUSH_VERTICES(ctx
, 0);
7258 CALL_GetColorTableParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7261 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
7264 GET_CURRENT_CONTEXT(ctx
);
7265 FLUSH_VERTICES(ctx
, 0);
7266 CALL_GetConvolutionFilter(ctx
->Exec
, ( target
, format
, type
, image
));
7269 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
7272 GET_CURRENT_CONTEXT(ctx
);
7273 FLUSH_VERTICES(ctx
, 0);
7274 CALL_GetConvolutionParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7277 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
7280 GET_CURRENT_CONTEXT(ctx
);
7281 FLUSH_VERTICES(ctx
, 0);
7282 CALL_GetConvolutionParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7285 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
7286 GLenum type
, GLvoid
*values
)
7288 GET_CURRENT_CONTEXT(ctx
);
7289 FLUSH_VERTICES(ctx
, 0);
7290 CALL_GetHistogram(ctx
->Exec
, ( target
, reset
, format
, type
, values
));
7293 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
7296 GET_CURRENT_CONTEXT(ctx
);
7297 FLUSH_VERTICES(ctx
, 0);
7298 CALL_GetHistogramParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7301 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
7304 GET_CURRENT_CONTEXT(ctx
);
7305 FLUSH_VERTICES(ctx
, 0);
7306 CALL_GetHistogramParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7309 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
7310 GLenum type
, GLvoid
*values
)
7312 GET_CURRENT_CONTEXT(ctx
);
7313 FLUSH_VERTICES(ctx
, 0);
7314 CALL_GetMinmax(ctx
->Exec
, ( target
, reset
, format
, type
, values
));
7317 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
7320 GET_CURRENT_CONTEXT(ctx
);
7321 FLUSH_VERTICES(ctx
, 0);
7322 CALL_GetMinmaxParameterfv(ctx
->Exec
, ( target
, pname
, params
));
7325 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
7328 GET_CURRENT_CONTEXT(ctx
);
7329 FLUSH_VERTICES(ctx
, 0);
7330 CALL_GetMinmaxParameteriv(ctx
->Exec
, ( target
, pname
, params
));
7333 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
7334 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
7336 GET_CURRENT_CONTEXT(ctx
);
7337 FLUSH_VERTICES(ctx
, 0);
7338 CALL_GetSeparableFilter(ctx
->Exec
, ( target
, format
, type
, row
, column
, span
));
7341 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
7342 GLsizei width
, GLsizei height
, GLenum format
,
7343 GLenum type
, const GLvoid
*row
,
7344 const GLvoid
*column
)
7346 GET_CURRENT_CONTEXT(ctx
);
7347 FLUSH_VERTICES(ctx
, 0);
7348 CALL_SeparableFilter2D(ctx
->Exec
, ( target
, internalFormat
, width
, height
, format
,
7349 type
, row
, column
));
7352 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
7354 GET_CURRENT_CONTEXT(ctx
);
7355 FLUSH_VERTICES(ctx
, 0);
7356 CALL_GetPixelTexGenParameterivSGIS(ctx
->Exec
, ( target
, value
));
7359 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
7361 GET_CURRENT_CONTEXT(ctx
);
7362 FLUSH_VERTICES(ctx
, 0);
7363 CALL_GetPixelTexGenParameterfvSGIS(ctx
->Exec
, ( target
, value
));
7366 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7367 GLsizei count
, const GLvoid
*ptr
)
7369 GET_CURRENT_CONTEXT(ctx
);
7370 FLUSH_VERTICES(ctx
, 0);
7371 CALL_ColorPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7374 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
7375 const GLboolean
*ptr
)
7377 GET_CURRENT_CONTEXT(ctx
);
7378 FLUSH_VERTICES(ctx
, 0);
7379 CALL_EdgeFlagPointerEXT(ctx
->Exec
, ( stride
, count
, ptr
));
7382 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7385 GET_CURRENT_CONTEXT(ctx
);
7386 FLUSH_VERTICES(ctx
, 0);
7387 CALL_IndexPointerEXT(ctx
->Exec
, ( type
, stride
, count
, ptr
));
7390 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
7393 GET_CURRENT_CONTEXT(ctx
);
7394 FLUSH_VERTICES(ctx
, 0);
7395 CALL_NormalPointerEXT(ctx
->Exec
, ( type
, stride
, count
, ptr
));
7398 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7399 GLsizei count
, const GLvoid
*ptr
)
7401 GET_CURRENT_CONTEXT(ctx
);
7402 FLUSH_VERTICES(ctx
, 0);
7403 CALL_TexCoordPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7406 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
7407 GLsizei count
, const GLvoid
*ptr
)
7409 GET_CURRENT_CONTEXT(ctx
);
7410 FLUSH_VERTICES(ctx
, 0);
7411 CALL_VertexPointerEXT(ctx
->Exec
, ( size
, type
, stride
, count
, ptr
));
7414 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
7416 GET_CURRENT_CONTEXT(ctx
);
7417 FLUSH_VERTICES(ctx
, 0);
7418 CALL_LockArraysEXT(ctx
->Exec
, ( first
, count
));
7421 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
7423 GET_CURRENT_CONTEXT(ctx
);
7424 FLUSH_VERTICES(ctx
, 0);
7425 CALL_UnlockArraysEXT(ctx
->Exec
, ( ));
7428 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
7430 GET_CURRENT_CONTEXT(ctx
);
7431 FLUSH_VERTICES(ctx
, 0);
7432 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
7435 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
7436 GLsizei stride
, const GLvoid
*ptr
)
7438 GET_CURRENT_CONTEXT(ctx
);
7439 FLUSH_VERTICES(ctx
, 0);
7440 CALL_SecondaryColorPointerEXT(ctx
->Exec
, ( size
, type
, stride
, ptr
));
7443 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
7446 GET_CURRENT_CONTEXT(ctx
);
7447 FLUSH_VERTICES(ctx
, 0);
7448 CALL_FogCoordPointerEXT(ctx
->Exec
, ( type
, stride
, ptr
));
7451 /* GL_EXT_multi_draw_arrays */
7452 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
7453 GLsizei
*count
, GLsizei primcount
)
7455 GET_CURRENT_CONTEXT(ctx
);
7456 FLUSH_VERTICES(ctx
, 0);
7457 CALL_MultiDrawArraysEXT(ctx
->Exec
, ( mode
, first
, count
, primcount
));
7460 /* GL_EXT_multi_draw_arrays */
7461 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
7462 GLenum type
, const GLvoid
**indices
,
7465 GET_CURRENT_CONTEXT(ctx
);
7466 FLUSH_VERTICES(ctx
, 0);
7467 CALL_MultiDrawElementsEXT(ctx
->Exec
, (mode
, count
, type
, indices
, primcount
));
7470 /* GL_IBM_multimode_draw_arrays */
7471 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
7472 const GLsizei
*count
, GLsizei primcount
,
7475 GET_CURRENT_CONTEXT(ctx
);
7476 FLUSH_VERTICES(ctx
, 0);
7477 CALL_MultiModeDrawArraysIBM(ctx
->Exec
, (mode
, first
, count
, primcount
, modestride
));
7480 /* GL_IBM_multimode_draw_arrays */
7481 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
7482 const GLsizei
*count
,
7484 const GLvoid
* const *indices
,
7485 GLsizei primcount
, GLint modestride
)
7487 GET_CURRENT_CONTEXT(ctx
);
7488 FLUSH_VERTICES(ctx
, 0);
7489 CALL_MultiModeDrawElementsIBM(ctx
->Exec
, (mode
, count
, type
, indices
, primcount
,
7497 * Setup the given dispatch table to point to Mesa's display list
7498 * building functions.
7500 * This does not include any of the tnl functions - they are
7501 * initialized from _mesa_init_api_defaults and from the active vtxfmt
7505 _mesa_init_dlist_table( struct _glapi_table
*table
)
7507 _mesa_loopback_init_api_table( table
);
7510 SET_Accum(table
, save_Accum
);
7511 SET_AlphaFunc(table
, save_AlphaFunc
);
7512 SET_Bitmap(table
, save_Bitmap
);
7513 SET_BlendFunc(table
, _mesa_BlendFunc
); /* loops-back to BlendFuncSeparate */
7514 SET_CallList(table
, _mesa_save_CallList
);
7515 SET_CallLists(table
, _mesa_save_CallLists
);
7516 SET_Clear(table
, save_Clear
);
7517 SET_ClearAccum(table
, save_ClearAccum
);
7518 SET_ClearColor(table
, save_ClearColor
);
7519 SET_ClearDepth(table
, save_ClearDepth
);
7520 SET_ClearIndex(table
, save_ClearIndex
);
7521 SET_ClearStencil(table
, save_ClearStencil
);
7522 SET_ClipPlane(table
, save_ClipPlane
);
7523 SET_ColorMask(table
, save_ColorMask
);
7524 SET_ColorMaterial(table
, save_ColorMaterial
);
7525 SET_CopyPixels(table
, save_CopyPixels
);
7526 SET_CullFace(table
, save_CullFace
);
7527 SET_DeleteLists(table
, _mesa_DeleteLists
);
7528 SET_DepthFunc(table
, save_DepthFunc
);
7529 SET_DepthMask(table
, save_DepthMask
);
7530 SET_DepthRange(table
, save_DepthRange
);
7531 SET_Disable(table
, save_Disable
);
7532 SET_DrawBuffer(table
, save_DrawBuffer
);
7533 SET_DrawPixels(table
, save_DrawPixels
);
7534 SET_Enable(table
, save_Enable
);
7535 SET_EndList(table
, _mesa_EndList
);
7536 SET_EvalMesh1(table
, _mesa_save_EvalMesh1
);
7537 SET_EvalMesh2(table
, _mesa_save_EvalMesh2
);
7538 SET_Finish(table
, exec_Finish
);
7539 SET_Flush(table
, exec_Flush
);
7540 SET_Fogf(table
, save_Fogf
);
7541 SET_Fogfv(table
, save_Fogfv
);
7542 SET_Fogi(table
, save_Fogi
);
7543 SET_Fogiv(table
, save_Fogiv
);
7544 SET_FrontFace(table
, save_FrontFace
);
7545 SET_Frustum(table
, save_Frustum
);
7546 SET_GenLists(table
, _mesa_GenLists
);
7547 SET_GetBooleanv(table
, exec_GetBooleanv
);
7548 SET_GetClipPlane(table
, exec_GetClipPlane
);
7549 SET_GetDoublev(table
, exec_GetDoublev
);
7550 SET_GetError(table
, exec_GetError
);
7551 SET_GetFloatv(table
, exec_GetFloatv
);
7552 SET_GetIntegerv(table
, exec_GetIntegerv
);
7553 SET_GetLightfv(table
, exec_GetLightfv
);
7554 SET_GetLightiv(table
, exec_GetLightiv
);
7555 SET_GetMapdv(table
, exec_GetMapdv
);
7556 SET_GetMapfv(table
, exec_GetMapfv
);
7557 SET_GetMapiv(table
, exec_GetMapiv
);
7558 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
7559 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
7560 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
7561 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
7562 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
7563 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
7564 SET_GetString(table
, exec_GetString
);
7565 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
7566 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
7567 SET_GetTexGendv(table
, exec_GetTexGendv
);
7568 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
7569 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
7570 SET_GetTexImage(table
, exec_GetTexImage
);
7571 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
7572 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
7573 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
7574 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
7575 SET_Hint(table
, save_Hint
);
7576 SET_IndexMask(table
, save_IndexMask
);
7577 SET_InitNames(table
, save_InitNames
);
7578 SET_IsEnabled(table
, exec_IsEnabled
);
7579 SET_IsList(table
, _mesa_IsList
);
7580 SET_LightModelf(table
, save_LightModelf
);
7581 SET_LightModelfv(table
, save_LightModelfv
);
7582 SET_LightModeli(table
, save_LightModeli
);
7583 SET_LightModeliv(table
, save_LightModeliv
);
7584 SET_Lightf(table
, save_Lightf
);
7585 SET_Lightfv(table
, save_Lightfv
);
7586 SET_Lighti(table
, save_Lighti
);
7587 SET_Lightiv(table
, save_Lightiv
);
7588 SET_LineStipple(table
, save_LineStipple
);
7589 SET_LineWidth(table
, save_LineWidth
);
7590 SET_ListBase(table
, save_ListBase
);
7591 SET_LoadIdentity(table
, save_LoadIdentity
);
7592 SET_LoadMatrixd(table
, save_LoadMatrixd
);
7593 SET_LoadMatrixf(table
, save_LoadMatrixf
);
7594 SET_LoadName(table
, save_LoadName
);
7595 SET_LogicOp(table
, save_LogicOp
);
7596 SET_Map1d(table
, save_Map1d
);
7597 SET_Map1f(table
, save_Map1f
);
7598 SET_Map2d(table
, save_Map2d
);
7599 SET_Map2f(table
, save_Map2f
);
7600 SET_MapGrid1d(table
, save_MapGrid1d
);
7601 SET_MapGrid1f(table
, save_MapGrid1f
);
7602 SET_MapGrid2d(table
, save_MapGrid2d
);
7603 SET_MapGrid2f(table
, save_MapGrid2f
);
7604 SET_MatrixMode(table
, save_MatrixMode
);
7605 SET_MultMatrixd(table
, save_MultMatrixd
);
7606 SET_MultMatrixf(table
, save_MultMatrixf
);
7607 SET_NewList(table
, save_NewList
);
7608 SET_Ortho(table
, save_Ortho
);
7609 SET_PassThrough(table
, save_PassThrough
);
7610 SET_PixelMapfv(table
, save_PixelMapfv
);
7611 SET_PixelMapuiv(table
, save_PixelMapuiv
);
7612 SET_PixelMapusv(table
, save_PixelMapusv
);
7613 SET_PixelStoref(table
, exec_PixelStoref
);
7614 SET_PixelStorei(table
, exec_PixelStorei
);
7615 SET_PixelTransferf(table
, save_PixelTransferf
);
7616 SET_PixelTransferi(table
, save_PixelTransferi
);
7617 SET_PixelZoom(table
, save_PixelZoom
);
7618 SET_PointSize(table
, save_PointSize
);
7619 SET_PolygonMode(table
, save_PolygonMode
);
7620 SET_PolygonOffset(table
, save_PolygonOffset
);
7621 SET_PolygonStipple(table
, save_PolygonStipple
);
7622 SET_PopAttrib(table
, save_PopAttrib
);
7623 SET_PopMatrix(table
, save_PopMatrix
);
7624 SET_PopName(table
, save_PopName
);
7625 SET_PushAttrib(table
, save_PushAttrib
);
7626 SET_PushMatrix(table
, save_PushMatrix
);
7627 SET_PushName(table
, save_PushName
);
7628 SET_RasterPos2d(table
, save_RasterPos2d
);
7629 SET_RasterPos2dv(table
, save_RasterPos2dv
);
7630 SET_RasterPos2f(table
, save_RasterPos2f
);
7631 SET_RasterPos2fv(table
, save_RasterPos2fv
);
7632 SET_RasterPos2i(table
, save_RasterPos2i
);
7633 SET_RasterPos2iv(table
, save_RasterPos2iv
);
7634 SET_RasterPos2s(table
, save_RasterPos2s
);
7635 SET_RasterPos2sv(table
, save_RasterPos2sv
);
7636 SET_RasterPos3d(table
, save_RasterPos3d
);
7637 SET_RasterPos3dv(table
, save_RasterPos3dv
);
7638 SET_RasterPos3f(table
, save_RasterPos3f
);
7639 SET_RasterPos3fv(table
, save_RasterPos3fv
);
7640 SET_RasterPos3i(table
, save_RasterPos3i
);
7641 SET_RasterPos3iv(table
, save_RasterPos3iv
);
7642 SET_RasterPos3s(table
, save_RasterPos3s
);
7643 SET_RasterPos3sv(table
, save_RasterPos3sv
);
7644 SET_RasterPos4d(table
, save_RasterPos4d
);
7645 SET_RasterPos4dv(table
, save_RasterPos4dv
);
7646 SET_RasterPos4f(table
, save_RasterPos4f
);
7647 SET_RasterPos4fv(table
, save_RasterPos4fv
);
7648 SET_RasterPos4i(table
, save_RasterPos4i
);
7649 SET_RasterPos4iv(table
, save_RasterPos4iv
);
7650 SET_RasterPos4s(table
, save_RasterPos4s
);
7651 SET_RasterPos4sv(table
, save_RasterPos4sv
);
7652 SET_ReadBuffer(table
, save_ReadBuffer
);
7653 SET_ReadPixels(table
, exec_ReadPixels
);
7654 SET_RenderMode(table
, exec_RenderMode
);
7655 SET_Rotated(table
, save_Rotated
);
7656 SET_Rotatef(table
, save_Rotatef
);
7657 SET_Scaled(table
, save_Scaled
);
7658 SET_Scalef(table
, save_Scalef
);
7659 SET_Scissor(table
, save_Scissor
);
7660 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
7661 SET_SelectBuffer(table
, exec_SelectBuffer
);
7662 SET_ShadeModel(table
, save_ShadeModel
);
7663 SET_StencilFunc(table
, save_StencilFunc
);
7664 SET_StencilMask(table
, save_StencilMask
);
7665 SET_StencilOp(table
, save_StencilOp
);
7666 SET_TexEnvf(table
, save_TexEnvf
);
7667 SET_TexEnvfv(table
, save_TexEnvfv
);
7668 SET_TexEnvi(table
, save_TexEnvi
);
7669 SET_TexEnviv(table
, save_TexEnviv
);
7670 SET_TexGend(table
, save_TexGend
);
7671 SET_TexGendv(table
, save_TexGendv
);
7672 SET_TexGenf(table
, save_TexGenf
);
7673 SET_TexGenfv(table
, save_TexGenfv
);
7674 SET_TexGeni(table
, save_TexGeni
);
7675 SET_TexGeniv(table
, save_TexGeniv
);
7676 SET_TexImage1D(table
, save_TexImage1D
);
7677 SET_TexImage2D(table
, save_TexImage2D
);
7678 SET_TexParameterf(table
, save_TexParameterf
);
7679 SET_TexParameterfv(table
, save_TexParameterfv
);
7680 SET_TexParameteri(table
, save_TexParameteri
);
7681 SET_TexParameteriv(table
, save_TexParameteriv
);
7682 SET_Translated(table
, save_Translated
);
7683 SET_Translatef(table
, save_Translatef
);
7684 SET_Viewport(table
, save_Viewport
);
7687 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
7688 SET_AreTexturesResidentEXT(table
, exec_AreTexturesResident
);
7689 SET_BindTexture(table
, save_BindTexture
);
7690 SET_ColorPointer(table
, exec_ColorPointer
);
7691 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
7692 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
7693 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
7694 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
7695 SET_DeleteTextures(table
, exec_DeleteTextures
);
7696 SET_DisableClientState(table
, exec_DisableClientState
);
7697 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
7698 SET_EnableClientState(table
, exec_EnableClientState
);
7699 SET_GenTextures(table
, exec_GenTextures
);
7700 SET_GenTexturesEXT(table
, exec_GenTextures
);
7701 SET_GetPointerv(table
, exec_GetPointerv
);
7702 SET_IndexPointer(table
, exec_IndexPointer
);
7703 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
7704 SET_IsTexture(table
, exec_IsTexture
);
7705 SET_IsTextureEXT(table
, exec_IsTexture
);
7706 SET_NormalPointer(table
, exec_NormalPointer
);
7707 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
7708 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
7709 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
7710 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
7711 SET_TexSubImage1D(table
, save_TexSubImage1D
);
7712 SET_TexSubImage2D(table
, save_TexSubImage2D
);
7713 SET_VertexPointer(table
, exec_VertexPointer
);
7716 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
7717 SET_TexImage3D(table
, save_TexImage3D
);
7718 SET_TexSubImage3D(table
, save_TexSubImage3D
);
7721 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
7722 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
7723 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
7725 /* GL_ARB_imaging */
7726 /* Not all are supported */
7727 SET_BlendColor(table
, save_BlendColor
);
7728 SET_BlendEquation(table
, save_BlendEquation
);
7729 SET_ColorSubTable(table
, save_ColorSubTable
);
7730 SET_ColorTable(table
, save_ColorTable
);
7731 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
7732 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
7733 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
7734 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
7735 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
7736 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
7737 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
7738 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
7739 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
7740 SET_CopyColorTable(table
, save_CopyColorTable
);
7741 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
7742 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
7743 SET_GetColorTable(table
, exec_GetColorTable
);
7744 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7745 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
7746 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7747 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
7748 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7749 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
7750 SET_GetConvolutionFilterEXT(table
, exec_GetConvolutionFilter
);
7751 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
7752 SET_GetConvolutionParameterfvEXT(table
, exec_GetConvolutionParameterfv
);
7753 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
7754 SET_GetConvolutionParameterivEXT(table
, exec_GetConvolutionParameteriv
);
7755 SET_GetHistogram(table
, exec_GetHistogram
);
7756 SET_GetHistogramEXT(table
, exec_GetHistogram
);
7757 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
7758 SET_GetHistogramParameterfvEXT(table
, exec_GetHistogramParameterfv
);
7759 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
7760 SET_GetHistogramParameterivEXT(table
, exec_GetHistogramParameteriv
);
7761 SET_GetMinmax(table
, exec_GetMinmax
);
7762 SET_GetMinmaxEXT(table
, exec_GetMinmax
);
7763 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
7764 SET_GetMinmaxParameterfvEXT(table
, exec_GetMinmaxParameterfv
);
7765 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
7766 SET_GetMinmaxParameterivEXT(table
, exec_GetMinmaxParameteriv
);
7767 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
7768 SET_GetSeparableFilterEXT(table
, exec_GetSeparableFilter
);
7769 SET_Histogram(table
, save_Histogram
);
7770 SET_Minmax(table
, save_Minmax
);
7771 SET_ResetHistogram(table
, save_ResetHistogram
);
7772 SET_ResetMinmax(table
, save_ResetMinmax
);
7773 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
7775 /* 2. GL_EXT_blend_color */
7777 SET_BlendColorEXT(table
, save_BlendColorEXT
);
7780 /* 3. GL_EXT_polygon_offset */
7781 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
7783 /* 6. GL_EXT_texture3d */
7785 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
7786 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
7787 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
7790 /* 15. GL_SGIX_pixel_texture */
7791 SET_PixelTexGenSGIX(table
, save_PixelTexGenSGIX
);
7793 /* 15. GL_SGIS_pixel_texture */
7794 SET_PixelTexGenParameteriSGIS(table
, save_PixelTexGenParameteriSGIS
);
7795 SET_PixelTexGenParameterfSGIS(table
, save_PixelTexGenParameterfSGIS
);
7796 SET_PixelTexGenParameterivSGIS(table
, save_PixelTexGenParameterivSGIS
);
7797 SET_PixelTexGenParameterfvSGIS(table
, save_PixelTexGenParameterfvSGIS
);
7798 SET_GetPixelTexGenParameterivSGIS(table
, exec_GetPixelTexGenParameterivSGIS
);
7799 SET_GetPixelTexGenParameterfvSGIS(table
, exec_GetPixelTexGenParameterfvSGIS
);
7801 /* 30. GL_EXT_vertex_array */
7802 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
7803 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
7804 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
7805 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
7806 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
7807 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
7809 /* 37. GL_EXT_blend_minmax */
7811 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
7814 /* 54. GL_EXT_point_parameters */
7815 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
7816 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
7818 /* 78. GL_EXT_paletted_texture */
7820 SET_ColorTableEXT(table
, save_ColorTable
);
7821 SET_ColorSubTableEXT(table
, save_ColorSubTable
);
7823 SET_GetColorTableEXT(table
, exec_GetColorTable
);
7824 SET_GetColorTableParameterfvEXT(table
, exec_GetColorTableParameterfv
);
7825 SET_GetColorTableParameterivEXT(table
, exec_GetColorTableParameteriv
);
7827 /* 97. GL_EXT_compiled_vertex_array */
7828 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
7829 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
7831 /* 145. GL_EXT_secondary_color */
7832 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
7834 /* 148. GL_EXT_multi_draw_arrays */
7835 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
7836 SET_MultiDrawElementsEXT(table
, exec_MultiDrawElementsEXT
);
7838 /* 149. GL_EXT_fog_coord */
7839 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
7841 /* 173. GL_EXT_blend_func_separate */
7842 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
7844 /* 196. GL_MESA_resize_buffers */
7845 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
7847 /* 197. GL_MESA_window_pos */
7848 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
7849 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
7850 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
7851 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
7852 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
7853 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
7854 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
7855 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
7856 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
7857 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
7858 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
7859 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
7860 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
7861 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
7862 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
7863 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
7864 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
7865 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
7866 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
7867 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
7868 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
7869 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
7870 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
7871 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
7873 /* 200. GL_IBM_multimode_draw_arrays */
7874 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
7875 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
7877 #if FEATURE_NV_vertex_program
7878 /* 233. GL_NV_vertex_program */
7879 /* The following commands DO NOT go into display lists:
7880 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7881 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7883 SET_BindProgramNV(table
, save_BindProgramNV
);
7884 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7885 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
7886 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7887 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
7888 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
7889 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
7890 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
7891 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
7892 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
7893 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
7894 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
7895 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
7896 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
7897 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
7898 SET_IsProgramNV(table
, _mesa_IsProgram
);
7899 SET_LoadProgramNV(table
, save_LoadProgramNV
);
7900 SET_ProgramParameter4dNV(table
, save_ProgramParameter4dNV
);
7901 SET_ProgramParameter4dvNV(table
, save_ProgramParameter4dvNV
);
7902 SET_ProgramParameter4fNV(table
, save_ProgramParameter4fNV
);
7903 SET_ProgramParameter4fvNV(table
, save_ProgramParameter4fvNV
);
7904 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
7905 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
7906 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
7907 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
7910 /* 245. GL_ATI_fragment_shader */
7911 #if FEATURE_ATI_fragment_shader
7912 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
7913 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
7916 /* 282. GL_NV_fragment_program */
7917 #if FEATURE_NV_fragment_program
7918 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
7919 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
7920 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
7921 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
7922 SET_GetProgramNamedParameterfvNV(table
, _mesa_GetProgramNamedParameterfvNV
);
7923 SET_GetProgramNamedParameterdvNV(table
, _mesa_GetProgramNamedParameterdvNV
);
7924 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
7925 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
7926 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
7927 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
7928 SET_GetProgramLocalParameterdvARB(table
, _mesa_GetProgramLocalParameterdvARB
);
7929 SET_GetProgramLocalParameterfvARB(table
, _mesa_GetProgramLocalParameterfvARB
);
7932 /* 262. GL_NV_point_sprite */
7933 SET_PointParameteriNV(table
, save_PointParameteriNV
);
7934 SET_PointParameterivNV(table
, save_PointParameterivNV
);
7936 /* 268. GL_EXT_stencil_two_side */
7937 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
7939 /* ???. GL_EXT_depth_bounds_test */
7940 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
7942 /* ARB 1. GL_ARB_multitexture */
7943 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
7944 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
7946 /* ARB 3. GL_ARB_transpose_matrix */
7947 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
7948 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
7949 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
7950 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
7952 /* ARB 5. GL_ARB_multisample */
7953 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
7955 /* ARB 12. GL_ARB_texture_compression */
7956 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
7957 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
7958 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
7959 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
7960 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
7961 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
7962 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
7964 /* ARB 14. GL_ARB_point_parameters */
7965 /* aliased with EXT_point_parameters functions */
7967 /* ARB 25. GL_ARB_window_pos */
7968 /* aliased with MESA_window_pos functions */
7970 /* ARB 26. GL_ARB_vertex_program */
7971 /* ARB 27. GL_ARB_fragment_program */
7972 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7973 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7974 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
7975 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
7976 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
7977 SET_ProgramStringARB(table
, save_ProgramStringARB
);
7978 SET_BindProgramNV(table
, save_BindProgramNV
);
7979 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
7980 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
7981 SET_IsProgramNV(table
, _mesa_IsProgram
);
7982 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
7983 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
7984 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
7985 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
7986 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
7987 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
7988 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
7989 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
7990 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
7991 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
7992 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
7993 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
7994 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
7995 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
7996 SET_GetProgramLocalParameterdvARB(table
, _mesa_GetProgramLocalParameterdvARB
);
7997 SET_GetProgramLocalParameterfvARB(table
, _mesa_GetProgramLocalParameterfvARB
);
7998 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
7999 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
8002 /* ARB 28. GL_ARB_vertex_buffer_object */
8003 #if FEATURE_ARB_vertex_buffer_object
8004 /* None of the extension's functions get compiled */
8005 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
8006 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
8007 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
8008 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
8009 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
8010 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
8011 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
8012 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
8013 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
8014 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
8015 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
8018 #if FEATURE_ARB_occlusion_query
8019 SET_BeginQueryARB(table
, save_BeginQueryARB
);
8020 SET_EndQueryARB(table
, save_EndQueryARB
);
8021 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
8022 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
8023 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
8024 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
8025 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
8026 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
8028 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
8030 /* 299. GL_EXT_blend_equation_separate */
8031 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
8039 static const char *enum_string( GLenum k
)
8041 return _mesa_lookup_enum_by_nr( k
);
8046 * Print the commands in a display list. For debugging only.
8047 * TODO: many commands aren't handled yet.
8049 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
8051 struct mesa_display_list
*dlist
;
8055 if (!CALL_IsList(GET_DISPATCH(), (list
))) {
8056 _mesa_printf("%u is not a display list ID\n", list
);
8060 dlist
= (struct mesa_display_list
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
8066 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
8068 done
= n
? GL_FALSE
: GL_TRUE
;
8070 OpCode opcode
= n
[0].opcode
;
8071 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_EXT_0
;
8073 if (i
>= 0 && i
< (GLint
) ctx
->ListExt
.NumOpcodes
) {
8074 /* this is a driver-extended opcode */
8075 ctx
->ListExt
.Opcode
[i
].Print(ctx
, &n
[1]);
8076 n
+= ctx
->ListExt
.Opcode
[i
].Size
;
8081 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
8084 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
8085 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
8087 case OPCODE_CALL_LIST
:
8088 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
8090 case OPCODE_CALL_LIST_OFFSET
:
8091 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
8092 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
8094 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
8095 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
8096 enum_string(n
[1].e
), enum_string(n
[2].e
),
8097 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8099 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
8100 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
8101 enum_string(n
[1].e
), enum_string(n
[2].e
),
8102 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
8104 case OPCODE_DISABLE
:
8105 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
8108 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
8110 case OPCODE_FRUSTUM
:
8111 _mesa_printf("Frustum %g %g %g %g %g %g\n",
8112 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8114 case OPCODE_LINE_STIPPLE
:
8115 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
8117 case OPCODE_LOAD_IDENTITY
:
8118 _mesa_printf("LoadIdentity\n");
8120 case OPCODE_LOAD_MATRIX
:
8121 _mesa_printf("LoadMatrix\n");
8122 _mesa_printf(" %8f %8f %8f %8f\n",
8123 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8124 _mesa_printf(" %8f %8f %8f %8f\n",
8125 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8126 _mesa_printf(" %8f %8f %8f %8f\n",
8127 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8128 _mesa_printf(" %8f %8f %8f %8f\n",
8129 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8131 case OPCODE_MULT_MATRIX
:
8132 _mesa_printf("MultMatrix (or Rotate)\n");
8133 _mesa_printf(" %8f %8f %8f %8f\n",
8134 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
8135 _mesa_printf(" %8f %8f %8f %8f\n",
8136 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
8137 _mesa_printf(" %8f %8f %8f %8f\n",
8138 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
8139 _mesa_printf(" %8f %8f %8f %8f\n",
8140 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
8143 _mesa_printf("Ortho %g %g %g %g %g %g\n",
8144 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8146 case OPCODE_POP_ATTRIB
:
8147 _mesa_printf("PopAttrib\n");
8149 case OPCODE_POP_MATRIX
:
8150 _mesa_printf("PopMatrix\n");
8152 case OPCODE_POP_NAME
:
8153 _mesa_printf("PopName\n");
8155 case OPCODE_PUSH_ATTRIB
:
8156 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
8158 case OPCODE_PUSH_MATRIX
:
8159 _mesa_printf("PushMatrix\n");
8161 case OPCODE_PUSH_NAME
:
8162 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
8164 case OPCODE_RASTER_POS
:
8165 _mesa_printf("RasterPos %g %g %g %g\n",
8166 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
8169 _mesa_printf("Rotate %g %g %g %g\n",
8170 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8173 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8175 case OPCODE_TRANSLATE
:
8176 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
8178 case OPCODE_BIND_TEXTURE
:
8179 _mesa_printf("BindTexture %s %d\n",
8180 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
8182 case OPCODE_SHADE_MODEL
:
8183 _mesa_printf("ShadeModel %s\n",
8184 _mesa_lookup_enum_by_nr(n
[1].ui
));
8187 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
8188 _mesa_lookup_enum_by_nr(n
[1].ui
),
8189 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
8192 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
8193 _mesa_lookup_enum_by_nr(n
[1].ui
),
8194 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
8195 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
8197 case OPCODE_MAPGRID1
:
8198 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
8199 n
[1].i
, n
[2].f
, n
[3].f
);
8201 case OPCODE_MAPGRID2
:
8202 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
8203 n
[1].i
, n
[2].f
, n
[3].f
,
8204 n
[4].i
, n
[5].f
, n
[6].f
);
8206 case OPCODE_EVALMESH1
:
8207 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
8209 case OPCODE_EVALMESH2
:
8210 _mesa_printf("EvalMesh2 %d %d %d %d\n",
8211 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
8214 case OPCODE_ATTR_1F_NV
:
8215 _mesa_printf("ATTR_1F_NV attr %d: %f\n",
8218 case OPCODE_ATTR_2F_NV
:
8219 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
8220 n
[1].i
, n
[2].f
, n
[3].f
);
8222 case OPCODE_ATTR_3F_NV
:
8223 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
8224 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8226 case OPCODE_ATTR_4F_NV
:
8227 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
8228 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8230 case OPCODE_ATTR_1F_ARB
:
8231 _mesa_printf("ATTR_1F_ARB attr %d: %f\n",
8234 case OPCODE_ATTR_2F_ARB
:
8235 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
8236 n
[1].i
, n
[2].f
, n
[3].f
);
8238 case OPCODE_ATTR_3F_ARB
:
8239 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
8240 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
8242 case OPCODE_ATTR_4F_ARB
:
8243 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
8244 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
8247 case OPCODE_MATERIAL
:
8248 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
8249 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
8252 _mesa_printf("INDEX: %f\n", n
[1].f
);
8254 case OPCODE_EDGEFLAG
:
8255 _mesa_printf("EDGEFLAG: %d\n", n
[1].i
);
8258 _mesa_printf("BEGIN %x\n", n
[1].i
);
8261 _mesa_printf("END\n");
8264 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
8266 case OPCODE_EVAL_C1
:
8267 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
8269 case OPCODE_EVAL_C2
:
8270 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
8272 case OPCODE_EVAL_P1
:
8273 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
8275 case OPCODE_EVAL_P2
:
8276 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
8282 * meta opcodes/commands
8285 _mesa_printf("Error: %s %s\n",
8286 enum_string(n
[1].e
), (const char *)n
[2].data
);
8288 case OPCODE_CONTINUE
:
8289 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
8290 n
= (Node
*) n
[1].next
;
8292 case OPCODE_END_OF_LIST
:
8293 _mesa_printf("END-LIST %u\n", list
);
8297 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
8298 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
8303 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
8306 /* increment n to point to next compiled command */
8307 if (opcode
!=OPCODE_CONTINUE
) {
8308 n
+= InstSize
[opcode
];
8317 * Clients may call this function to help debug display list problems.
8318 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
8319 * changed, or break in the future without notice.
8321 void mesa_print_display_list( GLuint list
)
8323 GET_CURRENT_CONTEXT(ctx
);
8324 print_list( ctx
, list
);
8328 /**********************************************************************/
8329 /***** Initialization *****/
8330 /**********************************************************************/
8333 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
8335 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
8336 vfmt
->Begin
= save_Begin
;
8337 vfmt
->CallList
= _mesa_save_CallList
;
8338 vfmt
->CallLists
= _mesa_save_CallLists
;
8339 vfmt
->Color3f
= save_Color3f
;
8340 vfmt
->Color3fv
= save_Color3fv
;
8341 vfmt
->Color4f
= save_Color4f
;
8342 vfmt
->Color4fv
= save_Color4fv
;
8343 vfmt
->EdgeFlag
= save_EdgeFlag
;
8344 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
8345 vfmt
->End
= save_End
;
8346 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
8347 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
8348 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
8349 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
8350 vfmt
->EvalPoint1
= save_EvalPoint1
;
8351 vfmt
->EvalPoint2
= save_EvalPoint2
;
8352 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
8353 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
8354 vfmt
->Indexf
= save_Indexf
;
8355 vfmt
->Indexfv
= save_Indexfv
;
8356 vfmt
->Materialfv
= save_Materialfv
;
8357 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
8358 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
8359 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
8360 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
8361 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
8362 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
8363 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
8364 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
8365 vfmt
->Normal3f
= save_Normal3f
;
8366 vfmt
->Normal3fv
= save_Normal3fv
;
8367 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
8368 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
8369 vfmt
->TexCoord1f
= save_TexCoord1f
;
8370 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
8371 vfmt
->TexCoord2f
= save_TexCoord2f
;
8372 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
8373 vfmt
->TexCoord3f
= save_TexCoord3f
;
8374 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
8375 vfmt
->TexCoord4f
= save_TexCoord4f
;
8376 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
8377 vfmt
->Vertex2f
= save_Vertex2f
;
8378 vfmt
->Vertex2fv
= save_Vertex2fv
;
8379 vfmt
->Vertex3f
= save_Vertex3f
;
8380 vfmt
->Vertex3fv
= save_Vertex3fv
;
8381 vfmt
->Vertex4f
= save_Vertex4f
;
8382 vfmt
->Vertex4fv
= save_Vertex4fv
;
8383 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
8384 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
8385 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
8386 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
8387 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
8388 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
8389 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
8390 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
8391 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
8392 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
8393 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
8394 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
8395 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
8396 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
8397 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
8398 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
8400 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
8401 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
8402 vfmt
->Rectf
= save_Rectf
;
8404 /* The driver is required to implement these as
8405 * 1) They can probably do a better job.
8406 * 2) A lot of new mechanisms would have to be added to this module
8407 * to support it. That code would probably never get used,
8411 vfmt
->DrawArrays
= 0;
8412 vfmt
->DrawElements
= 0;
8413 vfmt
->DrawRangeElements
= 0;
8419 void _mesa_init_display_list( GLcontext
* ctx
)
8422 ctx
->ListState
.CallDepth
= 0;
8423 ctx
->ExecuteFlag
= GL_TRUE
;
8424 ctx
->CompileFlag
= GL_FALSE
;
8425 ctx
->ListState
.CurrentListPtr
= NULL
;
8426 ctx
->ListState
.CurrentBlock
= NULL
;
8427 ctx
->ListState
.CurrentListNum
= 0;
8428 ctx
->ListState
.CurrentPos
= 0;
8430 /* Display List group */
8431 ctx
->List
.ListBase
= 0;
8433 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);