3 * Display lists management functions.
7 * Mesa 3-D graphics library
10 * Copyright (C) 1999-2004 Brian Paul All Rights Reserved.
12 * Permission is hereby granted, free of charge, to any person obtaining a
13 * copy of this software and associated documentation files (the "Software"),
14 * to deal in the Software without restriction, including without limitation
15 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
16 * and/or sell copies of the Software, and to permit persons to whom the
17 * Software is furnished to do so, subject to the following conditions:
19 * The above copyright notice and this permission notice shall be included
20 * in all copies or substantial portions of the Software.
22 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
23 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
25 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
26 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
27 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
33 #include "api_arrayelt.h"
34 #include "api_loopback.h"
36 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
37 #include "arbprogram.h"
43 #if FEATURE_ARB_vertex_buffer_object
44 #include "bufferobj.h"
56 #include "extensions.h"
61 #include "histogram.h"
77 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
78 #include "nvprogram.h"
82 #include "math/m_matrix.h"
83 #include "math/m_xform.h"
89 * \param ctx GL context.
91 * Checks if dd_function_table::SaveNeedFlush is marked to flush
92 * stored (save) vertices, and calls
93 * dd_function_table::SaveFlushVertices if so.
95 #define SAVE_FLUSH_VERTICES(ctx) \
97 if (ctx->Driver.SaveNeedFlush) \
98 ctx->Driver.SaveFlushVertices(ctx); \
103 * Macro to assert that the API call was made outside the
104 * glBegin()/glEnd() pair, with return value.
106 * \param ctx GL context.
107 * \param retval value to return value in case the assertion fails.
109 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
111 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
112 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
113 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
119 * Macro to assert that the API call was made outside the
120 * glBegin()/glEnd() pair.
122 * \param ctx GL context.
124 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
126 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
127 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
128 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
134 * Macro to assert that the API call was made outside the
135 * glBegin()/glEnd() pair and flush the vertices.
137 * \param ctx GL context.
139 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
141 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
142 SAVE_FLUSH_VERTICES(ctx); \
146 * Macro to assert that the API call was made outside the
147 * glBegin()/glEnd() pair and flush the vertices, with return value.
149 * \param ctx GL context.
150 * \param retval value to return value in case the assertion fails.
152 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
154 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
155 SAVE_FLUSH_VERTICES(ctx); \
161 * Display list opcodes.
163 * The fact that these identifiers are assigned consecutive
164 * integer values starting at 0 is very important, see InstSize array usage)
172 OPCODE_BLEND_EQUATION
,
173 OPCODE_BLEND_EQUATION_SEPARATE
,
174 OPCODE_BLEND_FUNC_SEPARATE
,
176 OPCODE_CALL_LIST_OFFSET
,
182 OPCODE_CLEAR_STENCIL
,
185 OPCODE_COLOR_MATERIAL
,
187 OPCODE_COLOR_TABLE_PARAMETER_FV
,
188 OPCODE_COLOR_TABLE_PARAMETER_IV
,
189 OPCODE_COLOR_SUB_TABLE
,
190 OPCODE_CONVOLUTION_FILTER_1D
,
191 OPCODE_CONVOLUTION_FILTER_2D
,
192 OPCODE_CONVOLUTION_PARAMETER_I
,
193 OPCODE_CONVOLUTION_PARAMETER_IV
,
194 OPCODE_CONVOLUTION_PARAMETER_F
,
195 OPCODE_CONVOLUTION_PARAMETER_FV
,
196 OPCODE_COPY_COLOR_SUB_TABLE
,
197 OPCODE_COPY_COLOR_TABLE
,
199 OPCODE_COPY_TEX_IMAGE1D
,
200 OPCODE_COPY_TEX_IMAGE2D
,
201 OPCODE_COPY_TEX_SUB_IMAGE1D
,
202 OPCODE_COPY_TEX_SUB_IMAGE2D
,
203 OPCODE_COPY_TEX_SUB_IMAGE3D
,
226 OPCODE_LOAD_IDENTITY
,
240 OPCODE_PIXEL_TRANSFER
,
243 OPCODE_POINT_PARAMETERS
,
245 OPCODE_POLYGON_STIPPLE
,
246 OPCODE_POLYGON_OFFSET
,
250 OPCODE_PRIORITIZE_TEXTURE
,
256 OPCODE_RESET_HISTOGRAM
,
257 OPCODE_RESET_MIN_MAX
,
261 OPCODE_SELECT_TEXTURE_SGIS
,
262 OPCODE_SELECT_TEXTURE_COORD_SET
,
273 OPCODE_TEX_SUB_IMAGE1D
,
274 OPCODE_TEX_SUB_IMAGE2D
,
275 OPCODE_TEX_SUB_IMAGE3D
,
279 /* GL_ARB_multitexture */
280 OPCODE_ACTIVE_TEXTURE
,
281 /* GL_SGIX/SGIS_pixel_texture */
282 OPCODE_PIXEL_TEXGEN_SGIX
,
283 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
284 /* GL_ARB_texture_compression */
285 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
286 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
287 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
288 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
289 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
290 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
291 /* GL_ARB_multisample */
292 OPCODE_SAMPLE_COVERAGE
,
293 /* GL_ARB_window_pos */
294 OPCODE_WINDOW_POS_ARB
,
295 /* GL_NV_vertex_program */
296 OPCODE_BIND_PROGRAM_NV
,
297 OPCODE_EXECUTE_PROGRAM_NV
,
298 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
299 OPCODE_LOAD_PROGRAM_NV
,
300 OPCODE_PROGRAM_PARAMETER4F_NV
,
301 OPCODE_TRACK_MATRIX_NV
,
302 /* GL_NV_fragment_program */
303 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
304 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
305 /* GL_EXT_stencil_two_side */
306 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
307 /* GL_EXT_depth_bounds_test */
308 OPCODE_DEPTH_BOUNDS_EXT
,
309 /* GL_ARB_vertex/fragment_program */
310 OPCODE_PROGRAM_STRING_ARB
,
311 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
314 /* Vertex attributes -- fallback for when optimized display
315 * list build isn't active.
333 /* The following three are meta instructions */
334 OPCODE_ERROR
, /* raise compiled-in error */
345 * Display list instructions are stored as sequences of "nodes". Nodes
346 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
347 * are linked together with a pointer.
349 * Each instruction in the display list is stored as a sequence of
350 * contiguous nodes in memory.
351 * Each node is the union of a variety of data types.
365 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
370 * How many nodes to allocate at a time.
372 * \note Reduced now that we hold vertices etc. elsewhere.
374 #define BLOCK_SIZE 256
379 * Number of nodes of storage needed for each instruction.
380 * Sizes for dynamically allocated opcodes are stored in the context struct.
382 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
384 void mesa_print_display_list( GLuint list
);
387 /**********************************************************************/
388 /***** Private *****/
389 /**********************************************************************/
392 * Make an empty display list. This is used by glGenLists() to
393 * reserver display list IDs.
395 static Node
*make_empty_list( void )
397 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
398 n
[0].opcode
= OPCODE_END_OF_LIST
;
405 * Destroy all nodes in a display list.
406 * \param list - display list number
408 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
416 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
419 done
= block
? GL_FALSE
: GL_TRUE
;
422 /* check for extension opcodes first */
424 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
425 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
426 ctx
->listext
.opcode
[i
].destroy(ctx
, &n
[1]);
427 n
+= ctx
->listext
.opcode
[i
].size
;
430 switch (n
[0].opcode
) {
431 /* for some commands, we need to free malloc'd memory */
434 n
+= InstSize
[n
[0].opcode
];
438 n
+= InstSize
[n
[0].opcode
];
440 case OPCODE_DRAW_PIXELS
:
442 n
+= InstSize
[n
[0].opcode
];
446 n
+= InstSize
[n
[0].opcode
];
448 case OPCODE_COLOR_TABLE
:
450 n
+= InstSize
[n
[0].opcode
];
452 case OPCODE_COLOR_SUB_TABLE
:
454 n
+= InstSize
[n
[0].opcode
];
456 case OPCODE_CONVOLUTION_FILTER_1D
:
458 n
+= InstSize
[n
[0].opcode
];
460 case OPCODE_CONVOLUTION_FILTER_2D
:
462 n
+= InstSize
[n
[0].opcode
];
464 case OPCODE_POLYGON_STIPPLE
:
466 n
+= InstSize
[n
[0].opcode
];
468 case OPCODE_TEX_IMAGE1D
:
470 n
+= InstSize
[n
[0].opcode
];
472 case OPCODE_TEX_IMAGE2D
:
474 n
+= InstSize
[n
[0].opcode
];
476 case OPCODE_TEX_IMAGE3D
:
478 n
+= InstSize
[n
[0].opcode
];
480 case OPCODE_TEX_SUB_IMAGE1D
:
482 n
+= InstSize
[n
[0].opcode
];
484 case OPCODE_TEX_SUB_IMAGE2D
:
486 n
+= InstSize
[n
[0].opcode
];
488 case OPCODE_TEX_SUB_IMAGE3D
:
490 n
+= InstSize
[n
[0].opcode
];
492 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
494 n
+= InstSize
[n
[0].opcode
];
496 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
498 n
+= InstSize
[n
[0].opcode
];
500 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
502 n
+= InstSize
[n
[0].opcode
];
504 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
506 n
+= InstSize
[n
[0].opcode
];
508 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
510 n
+= InstSize
[n
[0].opcode
];
512 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
514 n
+= InstSize
[n
[0].opcode
];
516 #if FEATURE_NV_vertex_program
517 case OPCODE_LOAD_PROGRAM_NV
:
518 FREE(n
[4].data
); /* program string */
519 n
+= InstSize
[n
[0].opcode
];
521 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
522 FREE(n
[2].data
); /* array of program ids */
523 n
+= InstSize
[n
[0].opcode
];
526 #if FEATURE_NV_fragment_program
527 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
528 FREE(n
[3].data
); /* parameter name */
529 n
+= InstSize
[n
[0].opcode
];
532 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
533 case OPCODE_PROGRAM_STRING_ARB
:
534 FREE(n
[4].data
); /* program string */
535 n
+= InstSize
[n
[0].opcode
];
538 case OPCODE_CONTINUE
:
539 n
= (Node
*) n
[1].next
;
543 case OPCODE_END_OF_LIST
:
548 /* Most frequent case */
549 n
+= InstSize
[n
[0].opcode
];
555 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
561 * Translate the nth element of list from type to GLuint.
563 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
575 bptr
= (GLbyte
*) list
;
576 return (GLuint
) *(bptr
+n
);
577 case GL_UNSIGNED_BYTE
:
578 ubptr
= (GLubyte
*) list
;
579 return (GLuint
) *(ubptr
+n
);
581 sptr
= (GLshort
*) list
;
582 return (GLuint
) *(sptr
+n
);
583 case GL_UNSIGNED_SHORT
:
584 usptr
= (GLushort
*) list
;
585 return (GLuint
) *(usptr
+n
);
587 iptr
= (GLint
*) list
;
588 return (GLuint
) *(iptr
+n
);
589 case GL_UNSIGNED_INT
:
590 uiptr
= (GLuint
*) list
;
591 return (GLuint
) *(uiptr
+n
);
593 fptr
= (GLfloat
*) list
;
594 return (GLuint
) *(fptr
+n
);
596 ubptr
= ((GLubyte
*) list
) + 2*n
;
597 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
599 ubptr
= ((GLubyte
*) list
) + 3*n
;
600 return (GLuint
) *ubptr
* 65536
601 + (GLuint
) *(ubptr
+1) * 256
602 + (GLuint
) *(ubptr
+2);
604 ubptr
= ((GLubyte
*) list
) + 4*n
;
605 return (GLuint
) *ubptr
* 16777216
606 + (GLuint
) *(ubptr
+1) * 65536
607 + (GLuint
) *(ubptr
+2) * 256
608 + (GLuint
) *(ubptr
+3);
617 /**********************************************************************/
619 /**********************************************************************/
621 void _mesa_init_lists( void )
623 static int init_flag
= 0;
626 InstSize
[OPCODE_ACCUM
] = 3;
627 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
628 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
629 InstSize
[OPCODE_BITMAP
] = 8;
630 InstSize
[OPCODE_BLEND_COLOR
] = 5;
631 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
632 InstSize
[OPCODE_BLEND_EQUATION_SEPARATE
] = 3;
633 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
634 InstSize
[OPCODE_CALL_LIST
] = 2;
635 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
636 InstSize
[OPCODE_CLEAR
] = 2;
637 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
638 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
639 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
640 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
641 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
642 InstSize
[OPCODE_CLIP_PLANE
] = 6;
643 InstSize
[OPCODE_COLOR_MASK
] = 5;
644 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
645 InstSize
[OPCODE_COLOR_TABLE
] = 7;
646 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
647 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
648 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
649 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
650 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
651 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
652 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
653 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
654 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
655 InstSize
[OPCODE_COPY_PIXELS
] = 6;
656 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
657 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
658 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
659 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
660 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
661 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
662 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
663 InstSize
[OPCODE_CULL_FACE
] = 2;
664 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
665 InstSize
[OPCODE_DEPTH_MASK
] = 2;
666 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
667 InstSize
[OPCODE_DISABLE
] = 2;
668 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
669 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
670 InstSize
[OPCODE_ENABLE
] = 2;
671 InstSize
[OPCODE_EVALMESH1
] = 4;
672 InstSize
[OPCODE_EVALMESH2
] = 6;
673 InstSize
[OPCODE_FOG
] = 6;
674 InstSize
[OPCODE_FRONT_FACE
] = 2;
675 InstSize
[OPCODE_FRUSTUM
] = 7;
676 InstSize
[OPCODE_HINT
] = 3;
677 InstSize
[OPCODE_HISTOGRAM
] = 5;
678 InstSize
[OPCODE_INDEX_MASK
] = 2;
679 InstSize
[OPCODE_INIT_NAMES
] = 1;
680 InstSize
[OPCODE_LIGHT
] = 7;
681 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
682 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
683 InstSize
[OPCODE_LINE_WIDTH
] = 2;
684 InstSize
[OPCODE_LIST_BASE
] = 2;
685 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
686 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
687 InstSize
[OPCODE_LOAD_NAME
] = 2;
688 InstSize
[OPCODE_LOGIC_OP
] = 2;
689 InstSize
[OPCODE_MAP1
] = 7;
690 InstSize
[OPCODE_MAP2
] = 11;
691 InstSize
[OPCODE_MAPGRID1
] = 4;
692 InstSize
[OPCODE_MAPGRID2
] = 7;
693 InstSize
[OPCODE_MATRIX_MODE
] = 2;
694 InstSize
[OPCODE_MIN_MAX
] = 4;
695 InstSize
[OPCODE_MULT_MATRIX
] = 17;
696 InstSize
[OPCODE_ORTHO
] = 7;
697 InstSize
[OPCODE_PASSTHROUGH
] = 2;
698 InstSize
[OPCODE_PIXEL_MAP
] = 4;
699 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
700 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
701 InstSize
[OPCODE_POINT_SIZE
] = 2;
702 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
703 InstSize
[OPCODE_POLYGON_MODE
] = 3;
704 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
705 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
706 InstSize
[OPCODE_POP_ATTRIB
] = 1;
707 InstSize
[OPCODE_POP_MATRIX
] = 1;
708 InstSize
[OPCODE_POP_NAME
] = 1;
709 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
710 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
711 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
712 InstSize
[OPCODE_PUSH_NAME
] = 2;
713 InstSize
[OPCODE_RASTER_POS
] = 5;
714 InstSize
[OPCODE_READ_BUFFER
] = 2;
715 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
716 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
717 InstSize
[OPCODE_ROTATE
] = 5;
718 InstSize
[OPCODE_SCALE
] = 4;
719 InstSize
[OPCODE_SCISSOR
] = 5;
720 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
721 InstSize
[OPCODE_STENCIL_MASK
] = 2;
722 InstSize
[OPCODE_STENCIL_OP
] = 4;
723 InstSize
[OPCODE_SHADE_MODEL
] = 2;
724 InstSize
[OPCODE_TEXENV
] = 7;
725 InstSize
[OPCODE_TEXGEN
] = 7;
726 InstSize
[OPCODE_TEXPARAMETER
] = 7;
727 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
728 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
729 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
730 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
731 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
732 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
733 InstSize
[OPCODE_TRANSLATE
] = 4;
734 InstSize
[OPCODE_VIEWPORT
] = 5;
735 InstSize
[OPCODE_WINDOW_POS
] = 5;
736 InstSize
[OPCODE_CONTINUE
] = 2;
737 InstSize
[OPCODE_ERROR
] = 3;
738 InstSize
[OPCODE_END_OF_LIST
] = 1;
739 /* GL_SGIX/SGIS_pixel_texture */
740 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
741 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
742 /* GL_ARB_texture_compression */
743 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
744 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
745 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
746 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
747 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
748 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
749 /* GL_ARB_multisample */
750 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
751 /* GL_ARB_multitexture */
752 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
753 /* GL_ARB_window_pos */
754 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
755 /* GL_NV_vertex_program */
756 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
757 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
758 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
759 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
760 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
761 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
762 /* GL_NV_fragment_program */
763 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
764 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
765 /* GL_EXT_stencil_two_side */
766 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
767 /* GL_EXT_depth_bounds_test */
768 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
769 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
770 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
771 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
773 InstSize
[OPCODE_ATTR_1F
] = 3;
774 InstSize
[OPCODE_ATTR_2F
] = 4;
775 InstSize
[OPCODE_ATTR_3F
] = 5;
776 InstSize
[OPCODE_ATTR_4F
] = 6;
777 InstSize
[OPCODE_MATERIAL
] = 7;
778 InstSize
[OPCODE_INDEX
] = 2;
779 InstSize
[OPCODE_EDGEFLAG
] = 2;
780 InstSize
[OPCODE_BEGIN
] = 2;
781 InstSize
[OPCODE_END
] = 1;
782 InstSize
[OPCODE_RECTF
] = 5;
783 InstSize
[OPCODE_EVAL_C1
] = 2;
784 InstSize
[OPCODE_EVAL_C2
] = 3;
785 InstSize
[OPCODE_EVAL_P1
] = 2;
786 InstSize
[OPCODE_EVAL_P2
] = 3;
793 * Allocate space for a display list instruction.
794 * \param opcode - type of instruction
795 * argcount - size in bytes of data required.
796 * \return pointer to the usable data area (not including the internal
800 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
803 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
806 if (opcode
< (int) OPCODE_DRV_0
) {
807 assert( count
== InstSize
[opcode
] );
811 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
812 /* This block is full. Allocate a new block and chain to it */
813 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
814 n
[0].opcode
= OPCODE_CONTINUE
;
815 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
817 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
820 n
[1].next
= (Node
*) newblock
;
821 ctx
->ListState
.CurrentBlock
= newblock
;
822 ctx
->ListState
.CurrentPos
= 0;
825 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
826 ctx
->ListState
.CurrentPos
+= count
;
828 n
[0].opcode
= (OpCode
) opcode
;
830 return (void *)&n
[1];
834 /* Allow modules and drivers to get their own opcodes.
837 _mesa_alloc_opcode( GLcontext
*ctx
,
839 void (*execute
)( GLcontext
*, void * ),
840 void (*destroy
)( GLcontext
*, void * ),
841 void (*print
)( GLcontext
*, void * ) )
843 if (ctx
->listext
.nr_opcodes
< GL_MAX_EXT_OPCODES
) {
844 GLuint i
= ctx
->listext
.nr_opcodes
++;
845 ctx
->listext
.opcode
[i
].size
= 1 + (sz
+ sizeof(Node
) - 1)/sizeof(Node
);
846 ctx
->listext
.opcode
[i
].execute
= execute
;
847 ctx
->listext
.opcode
[i
].destroy
= destroy
;
848 ctx
->listext
.opcode
[i
].print
= print
;
849 return i
+ OPCODE_DRV_0
;
856 /* Mimic the old behaviour of alloc_instruction:
857 * - sz is in units of sizeof(Node)
858 * - return value a pointer to sizeof(Node) before the actual
861 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
862 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
867 * Display List compilation functions
869 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
871 GET_CURRENT_CONTEXT(ctx
);
873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
874 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
879 if (ctx
->ExecuteFlag
) {
880 (*ctx
->Exec
->Accum
)( op
, value
);
885 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
887 GET_CURRENT_CONTEXT(ctx
);
889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
890 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
893 n
[2].f
= (GLfloat
) ref
;
895 if (ctx
->ExecuteFlag
) {
896 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
901 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
903 GET_CURRENT_CONTEXT(ctx
);
905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
906 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
911 if (ctx
->ExecuteFlag
) {
912 (*ctx
->Exec
->BindTexture
)( target
, texture
);
917 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
918 GLfloat xorig
, GLfloat yorig
,
919 GLfloat xmove
, GLfloat ymove
,
920 const GLubyte
*pixels
)
922 GET_CURRENT_CONTEXT(ctx
);
923 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
926 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
928 n
[1].i
= (GLint
) width
;
929 n
[2].i
= (GLint
) height
;
939 if (ctx
->ExecuteFlag
) {
940 (*ctx
->Exec
->Bitmap
)( width
, height
,
941 xorig
, yorig
, xmove
, ymove
, pixels
);
946 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
948 GET_CURRENT_CONTEXT(ctx
);
950 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
951 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
955 if (ctx
->ExecuteFlag
) {
956 (*ctx
->Exec
->BlendEquation
)( mode
);
961 static void GLAPIENTRY
save_BlendEquationSeparateEXT( GLenum modeRGB
,
964 GET_CURRENT_CONTEXT(ctx
);
966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
967 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2 );
972 if (ctx
->ExecuteFlag
) {
973 (*ctx
->Exec
->BlendEquationSeparateEXT
)( modeRGB
, modeA
);
978 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
979 GLenum sfactorA
, GLenum dfactorA
)
981 GET_CURRENT_CONTEXT(ctx
);
983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
984 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
991 if (ctx
->ExecuteFlag
) {
992 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
998 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
999 GLfloat blue
, GLfloat alpha
)
1001 GET_CURRENT_CONTEXT(ctx
);
1003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1004 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
1011 if (ctx
->ExecuteFlag
) {
1012 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
1017 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1019 GET_CURRENT_CONTEXT(ctx
);
1021 SAVE_FLUSH_VERTICES(ctx
);
1023 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1028 /* After this, we don't know what begin/end state we're in:
1030 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1032 if (ctx
->ExecuteFlag
) {
1033 (*ctx
->Exec
->CallList
)( list
);
1038 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1040 GET_CURRENT_CONTEXT(ctx
);
1042 GLboolean typeErrorFlag
;
1044 SAVE_FLUSH_VERTICES(ctx
);
1048 case GL_UNSIGNED_BYTE
:
1050 case GL_UNSIGNED_SHORT
:
1052 case GL_UNSIGNED_INT
:
1057 typeErrorFlag
= GL_FALSE
;
1060 typeErrorFlag
= GL_TRUE
;
1064 GLuint list
= translate_id( i
, type
, lists
);
1065 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1068 n
[2].b
= typeErrorFlag
;
1072 /* After this, we don't know what begin/end state we're in:
1074 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1076 if (ctx
->ExecuteFlag
) {
1077 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1082 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1084 GET_CURRENT_CONTEXT(ctx
);
1086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1087 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1091 if (ctx
->ExecuteFlag
) {
1092 (*ctx
->Exec
->Clear
)( mask
);
1097 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1098 GLfloat blue
, GLfloat alpha
)
1100 GET_CURRENT_CONTEXT(ctx
);
1102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1103 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1110 if (ctx
->ExecuteFlag
) {
1111 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1116 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1117 GLclampf blue
, GLclampf alpha
)
1119 GET_CURRENT_CONTEXT(ctx
);
1121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1122 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1129 if (ctx
->ExecuteFlag
) {
1130 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1135 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1137 GET_CURRENT_CONTEXT(ctx
);
1139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1140 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1142 n
[1].f
= (GLfloat
) depth
;
1144 if (ctx
->ExecuteFlag
) {
1145 (*ctx
->Exec
->ClearDepth
)( depth
);
1150 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1152 GET_CURRENT_CONTEXT(ctx
);
1154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1155 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1159 if (ctx
->ExecuteFlag
) {
1160 (*ctx
->Exec
->ClearIndex
)( c
);
1165 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1167 GET_CURRENT_CONTEXT(ctx
);
1169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1170 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1174 if (ctx
->ExecuteFlag
) {
1175 (*ctx
->Exec
->ClearStencil
)( s
);
1180 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1182 GET_CURRENT_CONTEXT(ctx
);
1184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1185 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1188 n
[2].f
= (GLfloat
) equ
[0];
1189 n
[3].f
= (GLfloat
) equ
[1];
1190 n
[4].f
= (GLfloat
) equ
[2];
1191 n
[5].f
= (GLfloat
) equ
[3];
1193 if (ctx
->ExecuteFlag
) {
1194 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1200 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1201 GLboolean blue
, GLboolean alpha
)
1203 GET_CURRENT_CONTEXT(ctx
);
1205 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1206 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1213 if (ctx
->ExecuteFlag
) {
1214 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1219 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1221 GET_CURRENT_CONTEXT(ctx
);
1223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1230 if (ctx
->ExecuteFlag
) {
1231 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1236 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1237 GLsizei width
, GLenum format
, GLenum type
,
1238 const GLvoid
*table
)
1240 GET_CURRENT_CONTEXT(ctx
);
1241 if (target
== GL_PROXY_TEXTURE_1D
||
1242 target
== GL_PROXY_TEXTURE_2D
||
1243 target
== GL_PROXY_TEXTURE_3D
||
1244 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1245 /* execute immediately */
1246 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1247 format
, type
, table
);
1250 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, table
,
1253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1254 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1257 n
[2].e
= internalFormat
;
1266 if (ctx
->ExecuteFlag
) {
1267 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1268 format
, type
, table
);
1275 static void GLAPIENTRY
1276 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1278 GET_CURRENT_CONTEXT(ctx
);
1281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1283 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1288 if (pname
== GL_COLOR_TABLE_SGI
||
1289 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1290 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1291 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1298 if (ctx
->ExecuteFlag
) {
1299 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1304 static void GLAPIENTRY
1305 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1307 GET_CURRENT_CONTEXT(ctx
);
1310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1312 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1317 if (pname
== GL_COLOR_TABLE_SGI
||
1318 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1319 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1320 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1327 if (ctx
->ExecuteFlag
) {
1328 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1334 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1335 GLenum format
, GLenum type
,
1336 const GLvoid
*table
)
1338 GET_CURRENT_CONTEXT(ctx
);
1339 GLvoid
*image
= _mesa_unpack_image(count
, 1, 1, format
, type
, table
,
1342 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1343 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1355 if (ctx
->ExecuteFlag
) {
1356 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1361 static void GLAPIENTRY
1362 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1363 GLint x
, GLint y
, GLsizei width
)
1365 GET_CURRENT_CONTEXT(ctx
);
1368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1369 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1377 if (ctx
->ExecuteFlag
) {
1378 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1383 static void GLAPIENTRY
1384 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1385 GLint x
, GLint y
, GLsizei width
)
1387 GET_CURRENT_CONTEXT(ctx
);
1390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1391 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1394 n
[2].e
= internalformat
;
1399 if (ctx
->ExecuteFlag
) {
1400 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1405 static void GLAPIENTRY
1406 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1407 GLenum format
, GLenum type
, const GLvoid
*filter
)
1409 GET_CURRENT_CONTEXT(ctx
);
1410 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, filter
,
1413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1414 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1417 n
[2].e
= internalFormat
;
1426 if (ctx
->ExecuteFlag
) {
1427 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1428 format
, type
, filter
);
1433 static void GLAPIENTRY
1434 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1435 GLsizei width
, GLsizei height
, GLenum format
,
1436 GLenum type
, const GLvoid
*filter
)
1438 GET_CURRENT_CONTEXT(ctx
);
1439 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
, filter
,
1442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1443 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1446 n
[2].e
= internalFormat
;
1456 if (ctx
->ExecuteFlag
) {
1457 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1458 format
, type
, filter
);
1463 static void GLAPIENTRY
1464 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1466 GET_CURRENT_CONTEXT(ctx
);
1468 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1469 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1475 if (ctx
->ExecuteFlag
) {
1476 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1481 static void GLAPIENTRY
1482 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1484 GET_CURRENT_CONTEXT(ctx
);
1486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1487 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1492 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1493 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1494 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1500 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1503 if (ctx
->ExecuteFlag
) {
1504 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1509 static void GLAPIENTRY
1510 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1512 GET_CURRENT_CONTEXT(ctx
);
1514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1515 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1521 if (ctx
->ExecuteFlag
) {
1522 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1527 static void GLAPIENTRY
1528 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1530 GET_CURRENT_CONTEXT(ctx
);
1532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1533 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1538 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1539 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1540 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1546 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1549 if (ctx
->ExecuteFlag
) {
1550 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1555 static void GLAPIENTRY
1556 save_CopyPixels( GLint x
, GLint y
,
1557 GLsizei width
, GLsizei height
, GLenum type
)
1559 GET_CURRENT_CONTEXT(ctx
);
1561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1562 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1566 n
[3].i
= (GLint
) width
;
1567 n
[4].i
= (GLint
) height
;
1570 if (ctx
->ExecuteFlag
) {
1571 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1577 static void GLAPIENTRY
1578 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1579 GLint x
, GLint y
, GLsizei width
, GLint border
)
1581 GET_CURRENT_CONTEXT(ctx
);
1583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1584 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1588 n
[3].e
= internalformat
;
1594 if (ctx
->ExecuteFlag
) {
1595 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1596 x
, y
, width
, border
);
1601 static void GLAPIENTRY
1602 save_CopyTexImage2D( GLenum target
, GLint level
,
1603 GLenum internalformat
,
1604 GLint x
, GLint y
, GLsizei width
,
1605 GLsizei height
, GLint border
)
1607 GET_CURRENT_CONTEXT(ctx
);
1609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1610 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1614 n
[3].e
= internalformat
;
1621 if (ctx
->ExecuteFlag
) {
1622 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1623 x
, y
, width
, height
, border
);
1629 static void GLAPIENTRY
1630 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1631 GLint xoffset
, GLint x
, GLint y
,
1634 GET_CURRENT_CONTEXT(ctx
);
1636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1637 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1646 if (ctx
->ExecuteFlag
) {
1647 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1652 static void GLAPIENTRY
1653 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1654 GLint xoffset
, GLint yoffset
,
1656 GLsizei width
, GLint height
)
1658 GET_CURRENT_CONTEXT(ctx
);
1660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1661 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1672 if (ctx
->ExecuteFlag
) {
1673 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1674 x
, y
, width
, height
);
1679 static void GLAPIENTRY
1680 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1681 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1683 GLsizei width
, GLint height
)
1685 GET_CURRENT_CONTEXT(ctx
);
1687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1688 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1700 if (ctx
->ExecuteFlag
) {
1701 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1702 xoffset
, yoffset
, zoffset
,
1703 x
, y
, width
, height
);
1708 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1710 GET_CURRENT_CONTEXT(ctx
);
1712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1713 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1717 if (ctx
->ExecuteFlag
) {
1718 (*ctx
->Exec
->CullFace
)( mode
);
1723 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1725 GET_CURRENT_CONTEXT(ctx
);
1727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1728 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1732 if (ctx
->ExecuteFlag
) {
1733 (*ctx
->Exec
->DepthFunc
)( func
);
1738 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1740 GET_CURRENT_CONTEXT(ctx
);
1742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1743 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1747 if (ctx
->ExecuteFlag
) {
1748 (*ctx
->Exec
->DepthMask
)( mask
);
1753 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1755 GET_CURRENT_CONTEXT(ctx
);
1757 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1758 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1760 n
[1].f
= (GLfloat
) nearval
;
1761 n
[2].f
= (GLfloat
) farval
;
1763 if (ctx
->ExecuteFlag
) {
1764 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1769 static void GLAPIENTRY
save_Disable( GLenum cap
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1778 if (ctx
->ExecuteFlag
) {
1779 (*ctx
->Exec
->Disable
)( cap
);
1784 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1786 GET_CURRENT_CONTEXT(ctx
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1793 if (ctx
->ExecuteFlag
) {
1794 (*ctx
->Exec
->DrawBuffer
)( mode
);
1799 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1800 GLenum format
, GLenum type
,
1801 const GLvoid
*pixels
)
1803 GET_CURRENT_CONTEXT(ctx
);
1804 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
1805 pixels
, &ctx
->Unpack
);
1807 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1808 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1819 if (ctx
->ExecuteFlag
) {
1820 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1826 static void GLAPIENTRY
save_Enable( GLenum cap
)
1828 GET_CURRENT_CONTEXT(ctx
);
1830 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1831 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1835 if (ctx
->ExecuteFlag
) {
1836 (*ctx
->Exec
->Enable
)( cap
);
1842 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1844 GET_CURRENT_CONTEXT(ctx
);
1846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1847 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1853 if (ctx
->ExecuteFlag
) {
1854 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1859 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1861 GET_CURRENT_CONTEXT(ctx
);
1863 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1864 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1872 if (ctx
->ExecuteFlag
) {
1873 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1880 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1882 GET_CURRENT_CONTEXT(ctx
);
1884 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1885 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1893 if (ctx
->ExecuteFlag
) {
1894 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1899 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1901 save_Fogfv(pname
, ¶m
);
1905 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1910 case GL_FOG_DENSITY
:
1914 p
[0] = (GLfloat
) *params
;
1917 p
[0] = INT_TO_FLOAT( params
[0] );
1918 p
[1] = INT_TO_FLOAT( params
[1] );
1919 p
[2] = INT_TO_FLOAT( params
[2] );
1920 p
[3] = INT_TO_FLOAT( params
[3] );
1923 /* Error will be caught later in gl_Fogfv */
1926 save_Fogfv(pname
, p
);
1930 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1932 save_Fogiv(pname
, ¶m
);
1936 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1938 GET_CURRENT_CONTEXT(ctx
);
1940 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1941 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1945 if (ctx
->ExecuteFlag
) {
1946 (*ctx
->Exec
->FrontFace
)( mode
);
1951 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1952 GLdouble bottom
, GLdouble top
,
1953 GLdouble nearval
, GLdouble farval
)
1955 GET_CURRENT_CONTEXT(ctx
);
1957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1958 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1960 n
[1].f
= (GLfloat
) left
;
1961 n
[2].f
= (GLfloat
) right
;
1962 n
[3].f
= (GLfloat
) bottom
;
1963 n
[4].f
= (GLfloat
) top
;
1964 n
[5].f
= (GLfloat
) nearval
;
1965 n
[6].f
= (GLfloat
) farval
;
1967 if (ctx
->ExecuteFlag
) {
1968 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
1973 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
1975 GET_CURRENT_CONTEXT(ctx
);
1977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1978 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
1983 if (ctx
->ExecuteFlag
) {
1984 (*ctx
->Exec
->Hint
)( target
, mode
);
1989 static void GLAPIENTRY
1990 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
1992 GET_CURRENT_CONTEXT(ctx
);
1995 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1996 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
2000 n
[3].e
= internalFormat
;
2003 if (ctx
->ExecuteFlag
) {
2004 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
2009 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
2011 GET_CURRENT_CONTEXT(ctx
);
2013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2014 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
2018 if (ctx
->ExecuteFlag
) {
2019 (*ctx
->Exec
->IndexMask
)( mask
);
2024 static void GLAPIENTRY
save_InitNames( void )
2026 GET_CURRENT_CONTEXT(ctx
);
2027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2028 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2029 if (ctx
->ExecuteFlag
) {
2030 (*ctx
->Exec
->InitNames
)();
2035 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2037 GET_CURRENT_CONTEXT(ctx
);
2039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2040 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2058 case GL_SPOT_DIRECTION
:
2061 case GL_SPOT_EXPONENT
:
2064 case GL_SPOT_CUTOFF
:
2067 case GL_CONSTANT_ATTENUATION
:
2070 case GL_LINEAR_ATTENUATION
:
2073 case GL_QUADRATIC_ATTENUATION
:
2079 for (i
= 0; i
< nParams
; i
++) {
2080 n
[3+i
].f
= params
[i
];
2083 if (ctx
->ExecuteFlag
) {
2084 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2089 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2091 save_Lightfv(light
, pname
, ¶ms
);
2095 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2102 fparam
[0] = INT_TO_FLOAT( params
[0] );
2103 fparam
[1] = INT_TO_FLOAT( params
[1] );
2104 fparam
[2] = INT_TO_FLOAT( params
[2] );
2105 fparam
[3] = INT_TO_FLOAT( params
[3] );
2108 fparam
[0] = (GLfloat
) params
[0];
2109 fparam
[1] = (GLfloat
) params
[1];
2110 fparam
[2] = (GLfloat
) params
[2];
2111 fparam
[3] = (GLfloat
) params
[3];
2113 case GL_SPOT_DIRECTION
:
2114 fparam
[0] = (GLfloat
) params
[0];
2115 fparam
[1] = (GLfloat
) params
[1];
2116 fparam
[2] = (GLfloat
) params
[2];
2118 case GL_SPOT_EXPONENT
:
2119 case GL_SPOT_CUTOFF
:
2120 case GL_CONSTANT_ATTENUATION
:
2121 case GL_LINEAR_ATTENUATION
:
2122 case GL_QUADRATIC_ATTENUATION
:
2123 fparam
[0] = (GLfloat
) params
[0];
2126 /* error will be caught later in gl_Lightfv */
2129 save_Lightfv( light
, pname
, fparam
);
2133 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2135 save_Lightiv( light
, pname
, ¶m
);
2139 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2141 GET_CURRENT_CONTEXT(ctx
);
2143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2144 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2152 if (ctx
->ExecuteFlag
) {
2153 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2158 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2160 save_LightModelfv(pname
, ¶m
);
2164 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2168 case GL_LIGHT_MODEL_AMBIENT
:
2169 fparam
[0] = INT_TO_FLOAT( params
[0] );
2170 fparam
[1] = INT_TO_FLOAT( params
[1] );
2171 fparam
[2] = INT_TO_FLOAT( params
[2] );
2172 fparam
[3] = INT_TO_FLOAT( params
[3] );
2174 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2175 case GL_LIGHT_MODEL_TWO_SIDE
:
2176 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2177 fparam
[0] = (GLfloat
) params
[0];
2180 /* Error will be caught later in gl_LightModelfv */
2183 save_LightModelfv(pname
, fparam
);
2187 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2189 save_LightModeliv(pname
, ¶m
);
2193 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2195 GET_CURRENT_CONTEXT(ctx
);
2197 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2198 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2203 if (ctx
->ExecuteFlag
) {
2204 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2209 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2211 GET_CURRENT_CONTEXT(ctx
);
2213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2214 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2218 if (ctx
->ExecuteFlag
) {
2219 (*ctx
->Exec
->LineWidth
)( width
);
2224 static void GLAPIENTRY
save_ListBase( GLuint base
)
2226 GET_CURRENT_CONTEXT(ctx
);
2228 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2229 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2233 if (ctx
->ExecuteFlag
) {
2234 (*ctx
->Exec
->ListBase
)( base
);
2239 static void GLAPIENTRY
save_LoadIdentity( void )
2241 GET_CURRENT_CONTEXT(ctx
);
2242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2243 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2244 if (ctx
->ExecuteFlag
) {
2245 (*ctx
->Exec
->LoadIdentity
)();
2250 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2252 GET_CURRENT_CONTEXT(ctx
);
2254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2255 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2258 for (i
=0;i
<16;i
++) {
2262 if (ctx
->ExecuteFlag
) {
2263 (*ctx
->Exec
->LoadMatrixf
)( m
);
2268 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2272 for (i
= 0; i
< 16; i
++) {
2273 f
[i
] = (GLfloat
) m
[i
];
2275 save_LoadMatrixf(f
);
2279 static void GLAPIENTRY
save_LoadName( GLuint name
)
2281 GET_CURRENT_CONTEXT(ctx
);
2283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2284 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2288 if (ctx
->ExecuteFlag
) {
2289 (*ctx
->Exec
->LoadName
)( name
);
2294 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2296 GET_CURRENT_CONTEXT(ctx
);
2298 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2299 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2303 if (ctx
->ExecuteFlag
) {
2304 (*ctx
->Exec
->LogicOp
)( opcode
);
2309 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2310 GLint order
, const GLdouble
*points
)
2312 GET_CURRENT_CONTEXT(ctx
);
2314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2315 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2317 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2319 n
[2].f
= (GLfloat
) u1
;
2320 n
[3].f
= (GLfloat
) u2
;
2321 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2323 n
[6].data
= (void *) pnts
;
2325 if (ctx
->ExecuteFlag
) {
2326 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2330 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2331 GLint order
, const GLfloat
*points
)
2333 GET_CURRENT_CONTEXT(ctx
);
2335 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2336 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2338 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2342 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2344 n
[6].data
= (void *) pnts
;
2346 if (ctx
->ExecuteFlag
) {
2347 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2352 static void GLAPIENTRY
save_Map2d( GLenum target
,
2353 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2354 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2355 const GLdouble
*points
)
2357 GET_CURRENT_CONTEXT(ctx
);
2359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2360 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2362 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2363 vstride
, vorder
, points
);
2365 n
[2].f
= (GLfloat
) u1
;
2366 n
[3].f
= (GLfloat
) u2
;
2367 n
[4].f
= (GLfloat
) v1
;
2368 n
[5].f
= (GLfloat
) v2
;
2369 /* XXX verify these strides are correct */
2370 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2371 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2374 n
[10].data
= (void *) pnts
;
2376 if (ctx
->ExecuteFlag
) {
2377 (*ctx
->Exec
->Map2d
)( target
,
2378 u1
, u2
, ustride
, uorder
,
2379 v1
, v2
, vstride
, vorder
, points
);
2384 static void GLAPIENTRY
save_Map2f( GLenum target
,
2385 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2386 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2387 const GLfloat
*points
)
2389 GET_CURRENT_CONTEXT(ctx
);
2391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2392 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2394 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2395 vstride
, vorder
, points
);
2401 /* XXX verify these strides are correct */
2402 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2403 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2406 n
[10].data
= (void *) pnts
;
2408 if (ctx
->ExecuteFlag
) {
2409 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2410 v1
, v2
, vstride
, vorder
, points
);
2415 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2417 GET_CURRENT_CONTEXT(ctx
);
2419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2420 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2426 if (ctx
->ExecuteFlag
) {
2427 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2432 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2434 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2438 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2439 GLint vn
, GLfloat v1
, GLfloat v2
)
2441 GET_CURRENT_CONTEXT(ctx
);
2443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2444 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2453 if (ctx
->ExecuteFlag
) {
2454 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2460 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2461 GLint vn
, GLdouble v1
, GLdouble v2
)
2463 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2464 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2468 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2470 GET_CURRENT_CONTEXT(ctx
);
2472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2473 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2477 if (ctx
->ExecuteFlag
) {
2478 (*ctx
->Exec
->MatrixMode
)( mode
);
2483 static void GLAPIENTRY
2484 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2486 GET_CURRENT_CONTEXT(ctx
);
2489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2490 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2493 n
[2].e
= internalFormat
;
2496 if (ctx
->ExecuteFlag
) {
2497 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2502 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2504 GET_CURRENT_CONTEXT(ctx
);
2506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2507 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2510 for (i
=0;i
<16;i
++) {
2514 if (ctx
->ExecuteFlag
) {
2515 (*ctx
->Exec
->MultMatrixf
)( m
);
2520 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2524 for (i
= 0; i
< 16; i
++) {
2525 f
[i
] = (GLfloat
) m
[i
];
2527 save_MultMatrixf(f
);
2531 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2533 GET_CURRENT_CONTEXT(ctx
);
2534 /* It's an error to call this function while building a display list */
2535 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2542 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2543 GLdouble bottom
, GLdouble top
,
2544 GLdouble nearval
, GLdouble farval
)
2546 GET_CURRENT_CONTEXT(ctx
);
2548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2549 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2551 n
[1].f
= (GLfloat
) left
;
2552 n
[2].f
= (GLfloat
) right
;
2553 n
[3].f
= (GLfloat
) bottom
;
2554 n
[4].f
= (GLfloat
) top
;
2555 n
[5].f
= (GLfloat
) nearval
;
2556 n
[6].f
= (GLfloat
) farval
;
2558 if (ctx
->ExecuteFlag
) {
2559 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2564 static void GLAPIENTRY
2565 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2567 GET_CURRENT_CONTEXT(ctx
);
2569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2570 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2574 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2575 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2577 if (ctx
->ExecuteFlag
) {
2578 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2583 static void GLAPIENTRY
2584 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2586 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2588 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2589 for (i
=0;i
<mapsize
;i
++) {
2590 fvalues
[i
] = (GLfloat
) values
[i
];
2594 for (i
=0;i
<mapsize
;i
++) {
2595 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2598 save_PixelMapfv(map
, mapsize
, fvalues
);
2602 static void GLAPIENTRY
2603 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2605 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2607 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2608 for (i
=0;i
<mapsize
;i
++) {
2609 fvalues
[i
] = (GLfloat
) values
[i
];
2613 for (i
=0;i
<mapsize
;i
++) {
2614 fvalues
[i
] = USHORT_TO_FLOAT( values
[i
] );
2617 save_PixelMapfv(map
, mapsize
, fvalues
);
2621 static void GLAPIENTRY
2622 save_PixelTransferf( GLenum pname
, GLfloat param
)
2624 GET_CURRENT_CONTEXT(ctx
);
2626 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2627 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2632 if (ctx
->ExecuteFlag
) {
2633 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2638 static void GLAPIENTRY
2639 save_PixelTransferi( GLenum pname
, GLint param
)
2641 save_PixelTransferf( pname
, (GLfloat
) param
);
2645 static void GLAPIENTRY
2646 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2648 GET_CURRENT_CONTEXT(ctx
);
2650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2651 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2656 if (ctx
->ExecuteFlag
) {
2657 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2662 static void GLAPIENTRY
2663 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2665 GET_CURRENT_CONTEXT(ctx
);
2667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2668 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2675 if (ctx
->ExecuteFlag
) {
2676 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2681 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2683 save_PointParameterfvEXT(pname
, ¶m
);
2686 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2688 GLfloat p
= (GLfloat
) param
;
2689 save_PointParameterfvEXT(pname
, &p
);
2692 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2694 GLfloat p
= (GLfloat
) param
[0];
2695 save_PointParameterfvEXT(pname
, &p
);
2699 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2701 GET_CURRENT_CONTEXT(ctx
);
2703 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2704 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2708 if (ctx
->ExecuteFlag
) {
2709 (*ctx
->Exec
->PointSize
)( size
);
2714 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2716 GET_CURRENT_CONTEXT(ctx
);
2718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2719 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2724 if (ctx
->ExecuteFlag
) {
2725 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2731 * Polygon stipple must have been upacked already!
2733 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2735 GET_CURRENT_CONTEXT(ctx
);
2737 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2738 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2741 n
[1].data
= MALLOC( 32 * 4 );
2742 data
= n
[1].data
; /* This needed for Acorn compiler */
2743 MEMCPY( data
, pattern
, 32 * 4 );
2745 if (ctx
->ExecuteFlag
) {
2746 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2751 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2753 GET_CURRENT_CONTEXT(ctx
);
2755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2756 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2761 if (ctx
->ExecuteFlag
) {
2762 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2767 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2769 GET_CURRENT_CONTEXT(ctx
);
2770 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2774 static void GLAPIENTRY
save_PopAttrib( void )
2776 GET_CURRENT_CONTEXT(ctx
);
2777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2778 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2779 if (ctx
->ExecuteFlag
) {
2780 (*ctx
->Exec
->PopAttrib
)();
2785 static void GLAPIENTRY
save_PopMatrix( void )
2787 GET_CURRENT_CONTEXT(ctx
);
2788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2789 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2790 if (ctx
->ExecuteFlag
) {
2791 (*ctx
->Exec
->PopMatrix
)();
2796 static void GLAPIENTRY
save_PopName( void )
2798 GET_CURRENT_CONTEXT(ctx
);
2799 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2800 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2801 if (ctx
->ExecuteFlag
) {
2802 (*ctx
->Exec
->PopName
)();
2807 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2808 const GLclampf
*priorities
)
2810 GET_CURRENT_CONTEXT(ctx
);
2812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2814 for (i
=0;i
<num
;i
++) {
2816 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2818 n
[1].ui
= textures
[i
];
2819 n
[2].f
= priorities
[i
];
2822 if (ctx
->ExecuteFlag
) {
2823 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2828 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2830 GET_CURRENT_CONTEXT(ctx
);
2832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2833 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2837 if (ctx
->ExecuteFlag
) {
2838 (*ctx
->Exec
->PushAttrib
)( mask
);
2843 static void GLAPIENTRY
save_PushMatrix( void )
2845 GET_CURRENT_CONTEXT(ctx
);
2846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2847 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2848 if (ctx
->ExecuteFlag
) {
2849 (*ctx
->Exec
->PushMatrix
)();
2854 static void GLAPIENTRY
save_PushName( GLuint name
)
2856 GET_CURRENT_CONTEXT(ctx
);
2858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2859 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2863 if (ctx
->ExecuteFlag
) {
2864 (*ctx
->Exec
->PushName
)( name
);
2869 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2871 GET_CURRENT_CONTEXT(ctx
);
2873 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2874 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2881 if (ctx
->ExecuteFlag
) {
2882 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2886 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2888 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2891 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2893 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2896 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2898 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2901 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2903 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2906 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2908 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2911 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2913 save_RasterPos4f(x
, y
, z
, 1.0F
);
2916 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2918 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2921 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2923 save_RasterPos4f(x
, y
, z
, 1.0F
);
2926 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2928 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2931 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2933 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2936 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2938 save_RasterPos4f(x
, y
, z
, w
);
2941 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2943 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2946 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2948 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2951 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2953 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2956 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
2958 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2961 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
2963 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2966 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
2968 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2971 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
2973 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2976 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
2978 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2981 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
2983 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2984 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2987 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
2989 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2992 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
2994 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2995 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2998 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
3000 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3004 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
3006 GET_CURRENT_CONTEXT(ctx
);
3008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3009 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
3013 if (ctx
->ExecuteFlag
) {
3014 (*ctx
->Exec
->PassThrough
)( token
);
3019 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3021 GET_CURRENT_CONTEXT(ctx
);
3023 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3024 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3028 if (ctx
->ExecuteFlag
) {
3029 (*ctx
->Exec
->ReadBuffer
)( mode
);
3034 static void GLAPIENTRY
3035 save_ResetHistogram(GLenum target
)
3037 GET_CURRENT_CONTEXT(ctx
);
3039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3040 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3044 if (ctx
->ExecuteFlag
) {
3045 (*ctx
->Exec
->ResetHistogram
)( target
);
3050 static void GLAPIENTRY
3051 save_ResetMinmax(GLenum target
)
3053 GET_CURRENT_CONTEXT(ctx
);
3055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3056 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3060 if (ctx
->ExecuteFlag
) {
3061 (*ctx
->Exec
->ResetMinmax
)( target
);
3066 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3068 GET_CURRENT_CONTEXT(ctx
);
3070 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3071 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3078 if (ctx
->ExecuteFlag
) {
3079 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3084 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3086 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3090 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3092 GET_CURRENT_CONTEXT(ctx
);
3094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3095 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3101 if (ctx
->ExecuteFlag
) {
3102 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3107 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3109 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3113 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3115 GET_CURRENT_CONTEXT(ctx
);
3117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3118 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3125 if (ctx
->ExecuteFlag
) {
3126 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3131 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3133 GET_CURRENT_CONTEXT(ctx
);
3135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3136 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3140 if (ctx
->ExecuteFlag
) {
3141 (*ctx
->Exec
->ShadeModel
)( mode
);
3146 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3157 if (ctx
->ExecuteFlag
) {
3158 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3163 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3165 GET_CURRENT_CONTEXT(ctx
);
3167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3168 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3172 if (ctx
->ExecuteFlag
) {
3173 (*ctx
->Exec
->StencilMask
)( mask
);
3178 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3180 GET_CURRENT_CONTEXT(ctx
);
3182 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3183 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3189 if (ctx
->ExecuteFlag
) {
3190 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3195 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3197 GET_CURRENT_CONTEXT(ctx
);
3199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3200 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3209 if (ctx
->ExecuteFlag
) {
3210 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3215 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3217 save_TexEnvfv( target
, pname
, ¶m
);
3221 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3224 p
[0] = (GLfloat
) param
;
3225 p
[1] = p
[2] = p
[3] = 0.0;
3226 save_TexEnvfv( target
, pname
, p
);
3230 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3233 p
[0] = INT_TO_FLOAT( param
[0] );
3234 p
[1] = INT_TO_FLOAT( param
[1] );
3235 p
[2] = INT_TO_FLOAT( param
[2] );
3236 p
[3] = INT_TO_FLOAT( param
[3] );
3237 save_TexEnvfv( target
, pname
, p
);
3241 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3243 GET_CURRENT_CONTEXT(ctx
);
3245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3246 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3255 if (ctx
->ExecuteFlag
) {
3256 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3261 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3264 p
[0] = (GLfloat
) params
[0];
3265 p
[1] = (GLfloat
) params
[1];
3266 p
[2] = (GLfloat
) params
[2];
3267 p
[3] = (GLfloat
) params
[3];
3268 save_TexGenfv(coord
, pname
, p
);
3272 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3274 GLfloat p
= (GLfloat
) param
;
3275 save_TexGenfv( coord
, pname
, &p
);
3279 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3282 p
[0] = (GLfloat
) params
[0];
3283 p
[1] = (GLfloat
) params
[1];
3284 p
[2] = (GLfloat
) params
[2];
3285 p
[3] = (GLfloat
) params
[3];
3286 save_TexGenfv( coord
, pname
, p
);
3290 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3292 save_TexGenfv(coord
, pname
, ¶m
);
3296 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3298 save_TexGeniv( coord
, pname
, ¶m
);
3302 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3303 GLenum pname
, const GLfloat
*params
)
3305 GET_CURRENT_CONTEXT(ctx
);
3307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3308 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3317 if (ctx
->ExecuteFlag
) {
3318 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3323 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3325 save_TexParameterfv(target
, pname
, ¶m
);
3329 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3332 fparam
[0] = (GLfloat
) param
;
3333 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3334 save_TexParameterfv(target
, pname
, fparam
);
3338 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3341 fparam
[0] = (GLfloat
) params
[0];
3342 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3343 save_TexParameterfv(target
, pname
, fparam
);
3347 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3348 GLint level
, GLint components
,
3349 GLsizei width
, GLint border
,
3350 GLenum format
, GLenum type
,
3351 const GLvoid
*pixels
)
3353 GET_CURRENT_CONTEXT(ctx
);
3354 if (target
== GL_PROXY_TEXTURE_1D
) {
3355 /* don't compile, execute immediately */
3356 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3357 border
, format
, type
, pixels
);
3360 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3361 pixels
, &ctx
->Unpack
);
3363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3364 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3368 n
[3].i
= components
;
3369 n
[4].i
= (GLint
) width
;
3378 if (ctx
->ExecuteFlag
) {
3379 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3380 border
, format
, type
, pixels
);
3386 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3387 GLint level
, GLint components
,
3388 GLsizei width
, GLsizei height
, GLint border
,
3389 GLenum format
, GLenum type
,
3390 const GLvoid
*pixels
)
3392 GET_CURRENT_CONTEXT(ctx
);
3393 if (target
== GL_PROXY_TEXTURE_2D
) {
3394 /* don't compile, execute immediately */
3395 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3396 height
, border
, format
, type
, pixels
);
3399 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3400 pixels
, &ctx
->Unpack
);
3402 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3403 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3407 n
[3].i
= components
;
3408 n
[4].i
= (GLint
) width
;
3409 n
[5].i
= (GLint
) height
;
3418 if (ctx
->ExecuteFlag
) {
3419 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3420 height
, border
, format
, type
, pixels
);
3426 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3427 GLint level
, GLint internalFormat
,
3428 GLsizei width
, GLsizei height
, GLsizei depth
,
3430 GLenum format
, GLenum type
,
3431 const GLvoid
*pixels
)
3433 GET_CURRENT_CONTEXT(ctx
);
3434 if (target
== GL_PROXY_TEXTURE_3D
) {
3435 /* don't compile, execute immediately */
3436 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3437 height
, depth
, border
, format
, type
, pixels
);
3441 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3442 pixels
, &ctx
->Unpack
);
3443 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3444 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3448 n
[3].i
= (GLint
) internalFormat
;
3449 n
[4].i
= (GLint
) width
;
3450 n
[5].i
= (GLint
) height
;
3451 n
[6].i
= (GLint
) depth
;
3460 if (ctx
->ExecuteFlag
) {
3461 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3462 height
, depth
, border
, format
, type
, pixels
);
3468 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3469 GLsizei width
, GLenum format
, GLenum type
,
3470 const GLvoid
*pixels
)
3472 GET_CURRENT_CONTEXT(ctx
);
3474 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3475 pixels
, &ctx
->Unpack
);
3476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3477 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3482 n
[4].i
= (GLint
) width
;
3490 if (ctx
->ExecuteFlag
) {
3491 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3492 format
, type
, pixels
);
3497 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3498 GLint xoffset
, GLint yoffset
,
3499 GLsizei width
, GLsizei height
,
3500 GLenum format
, GLenum type
,
3501 const GLvoid
*pixels
)
3503 GET_CURRENT_CONTEXT(ctx
);
3505 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3506 pixels
, &ctx
->Unpack
);
3507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3508 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3514 n
[5].i
= (GLint
) width
;
3515 n
[6].i
= (GLint
) height
;
3523 if (ctx
->ExecuteFlag
) {
3524 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3525 width
, height
, format
, type
, pixels
);
3530 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3531 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3532 GLsizei width
, GLsizei height
, GLsizei depth
,
3533 GLenum format
, GLenum type
,
3534 const GLvoid
*pixels
)
3536 GET_CURRENT_CONTEXT(ctx
);
3538 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3539 pixels
, &ctx
->Unpack
);
3540 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3541 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3548 n
[6].i
= (GLint
) width
;
3549 n
[7].i
= (GLint
) height
;
3550 n
[8].i
= (GLint
) depth
;
3558 if (ctx
->ExecuteFlag
) {
3559 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3560 xoffset
, yoffset
, zoffset
,
3561 width
, height
, depth
, format
, type
, pixels
);
3566 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3568 GET_CURRENT_CONTEXT(ctx
);
3570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3571 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3577 if (ctx
->ExecuteFlag
) {
3578 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3583 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3585 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3590 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3592 GET_CURRENT_CONTEXT(ctx
);
3594 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3595 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3599 n
[3].i
= (GLint
) width
;
3600 n
[4].i
= (GLint
) height
;
3602 if (ctx
->ExecuteFlag
) {
3603 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3608 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3610 GET_CURRENT_CONTEXT(ctx
);
3612 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3613 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3620 if (ctx
->ExecuteFlag
) {
3621 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3625 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3627 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3630 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3632 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3635 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3637 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3640 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3642 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3645 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3647 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3650 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3652 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3655 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3657 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3660 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3662 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3665 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3667 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3670 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3672 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3675 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3677 save_WindowPos4fMESA(x
, y
, z
, w
);
3680 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3682 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3685 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3687 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3690 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3692 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3695 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3697 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3700 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3702 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3705 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3707 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3710 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3712 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3715 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3717 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3720 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3722 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3723 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3726 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3728 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3731 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3733 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3734 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3737 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3739 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3744 /* GL_ARB_multitexture */
3745 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3747 GET_CURRENT_CONTEXT(ctx
);
3749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3750 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3754 if (ctx
->ExecuteFlag
) {
3755 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3760 /* GL_ARB_transpose_matrix */
3762 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3765 _math_transposefd(tm
, m
);
3766 save_LoadMatrixf(tm
);
3770 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3773 _math_transposef(tm
, m
);
3774 save_LoadMatrixf(tm
);
3778 static void GLAPIENTRY
3779 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3782 _math_transposefd(tm
, m
);
3783 save_MultMatrixf(tm
);
3787 static void GLAPIENTRY
3788 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3791 _math_transposef(tm
, m
);
3792 save_MultMatrixf(tm
);
3796 static void GLAPIENTRY
3797 save_PixelTexGenSGIX(GLenum mode
)
3799 GET_CURRENT_CONTEXT(ctx
);
3801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3802 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3806 if (ctx
->ExecuteFlag
) {
3807 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3812 /* GL_ARB_texture_compression */
3813 static void GLAPIENTRY
3814 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3815 GLenum internalFormat
, GLsizei width
,
3816 GLint border
, GLsizei imageSize
,
3819 GET_CURRENT_CONTEXT(ctx
);
3820 if (target
== GL_PROXY_TEXTURE_1D
) {
3821 /* don't compile, execute immediately */
3822 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3823 width
, border
, imageSize
, data
);
3828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3829 /* make copy of image */
3830 image
= MALLOC(imageSize
);
3832 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3835 MEMCPY(image
, data
, imageSize
);
3836 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3840 n
[3].e
= internalFormat
;
3841 n
[4].i
= (GLint
) width
;
3849 if (ctx
->ExecuteFlag
) {
3850 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3851 width
, border
, imageSize
, data
);
3857 static void GLAPIENTRY
3858 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3859 GLenum internalFormat
, GLsizei width
,
3860 GLsizei height
, GLint border
, GLsizei imageSize
,
3863 GET_CURRENT_CONTEXT(ctx
);
3864 if (target
== GL_PROXY_TEXTURE_2D
) {
3865 /* don't compile, execute immediately */
3866 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3867 width
, height
, border
, imageSize
, data
);
3872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3873 /* make copy of image */
3874 image
= MALLOC(imageSize
);
3876 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3879 MEMCPY(image
, data
, imageSize
);
3880 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3884 n
[3].e
= internalFormat
;
3885 n
[4].i
= (GLint
) width
;
3886 n
[5].i
= (GLint
) height
;
3894 if (ctx
->ExecuteFlag
) {
3895 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3896 width
, height
, border
, imageSize
, data
);
3902 static void GLAPIENTRY
3903 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3904 GLenum internalFormat
, GLsizei width
,
3905 GLsizei height
, GLsizei depth
, GLint border
,
3906 GLsizei imageSize
, const GLvoid
*data
)
3908 GET_CURRENT_CONTEXT(ctx
);
3909 if (target
== GL_PROXY_TEXTURE_3D
) {
3910 /* don't compile, execute immediately */
3911 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3912 width
, height
, depth
, border
, imageSize
, data
);
3917 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3918 /* make copy of image */
3919 image
= MALLOC(imageSize
);
3921 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3924 MEMCPY(image
, data
, imageSize
);
3925 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3929 n
[3].e
= internalFormat
;
3930 n
[4].i
= (GLint
) width
;
3931 n
[5].i
= (GLint
) height
;
3932 n
[6].i
= (GLint
) depth
;
3940 if (ctx
->ExecuteFlag
) {
3941 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3942 width
, height
, depth
, border
, imageSize
, data
);
3948 static void GLAPIENTRY
3949 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3950 GLsizei width
, GLenum format
,
3951 GLsizei imageSize
, const GLvoid
*data
)
3956 GET_CURRENT_CONTEXT(ctx
);
3957 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3959 /* make copy of image */
3960 image
= MALLOC(imageSize
);
3962 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
3965 MEMCPY(image
, data
, imageSize
);
3966 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
3971 n
[4].i
= (GLint
) width
;
3979 if (ctx
->ExecuteFlag
) {
3980 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
3981 width
, format
, imageSize
, data
);
3986 static void GLAPIENTRY
3987 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
3988 GLint yoffset
, GLsizei width
, GLsizei height
,
3989 GLenum format
, GLsizei imageSize
,
3995 GET_CURRENT_CONTEXT(ctx
);
3996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3998 /* make copy of image */
3999 image
= MALLOC(imageSize
);
4001 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4004 MEMCPY(image
, data
, imageSize
);
4005 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
4011 n
[5].i
= (GLint
) width
;
4012 n
[6].i
= (GLint
) height
;
4020 if (ctx
->ExecuteFlag
) {
4021 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4022 width
, height
, format
, imageSize
, data
);
4027 static void GLAPIENTRY
4028 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4029 GLint yoffset
, GLint zoffset
, GLsizei width
,
4030 GLsizei height
, GLsizei depth
, GLenum format
,
4031 GLsizei imageSize
, const GLvoid
*data
)
4036 GET_CURRENT_CONTEXT(ctx
);
4037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4039 /* make copy of image */
4040 image
= MALLOC(imageSize
);
4042 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4045 MEMCPY(image
, data
, imageSize
);
4046 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4053 n
[6].i
= (GLint
) width
;
4054 n
[7].i
= (GLint
) height
;
4055 n
[8].i
= (GLint
) depth
;
4057 n
[10].i
= imageSize
;
4063 if (ctx
->ExecuteFlag
) {
4064 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4065 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4070 /* GL_ARB_multisample */
4071 static void GLAPIENTRY
4072 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4074 GET_CURRENT_CONTEXT(ctx
);
4076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4077 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4082 if (ctx
->ExecuteFlag
) {
4083 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4088 /* GL_SGIS_pixel_texture */
4090 static void GLAPIENTRY
4091 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4093 GET_CURRENT_CONTEXT(ctx
);
4095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4096 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4101 if (ctx
->ExecuteFlag
) {
4102 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4107 static void GLAPIENTRY
4108 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4110 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4114 static void GLAPIENTRY
4115 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4117 save_PixelTexGenParameteriSGIS(target
, *value
);
4121 static void GLAPIENTRY
4122 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4124 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4129 * GL_NV_vertex_program
4131 #if FEATURE_NV_vertex_program
4132 static void GLAPIENTRY
4133 save_BindProgramNV(GLenum target
, GLuint id
)
4135 GET_CURRENT_CONTEXT(ctx
);
4137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4138 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4143 if (ctx
->ExecuteFlag
) {
4144 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4148 static void GLAPIENTRY
4149 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4151 GET_CURRENT_CONTEXT(ctx
);
4153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4154 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4163 if (ctx
->ExecuteFlag
) {
4164 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4169 static void GLAPIENTRY
4170 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4171 GLfloat x
, GLfloat y
,
4172 GLfloat z
, GLfloat w
)
4174 GET_CURRENT_CONTEXT(ctx
);
4176 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4177 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4186 if (ctx
->ExecuteFlag
) {
4187 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4192 static void GLAPIENTRY
4193 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4195 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4196 params
[2], params
[3]);
4200 static void GLAPIENTRY
4201 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4202 GLdouble x
, GLdouble y
,
4203 GLdouble z
, GLdouble w
)
4205 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4206 (GLfloat
) z
, (GLfloat
) w
);
4210 static void GLAPIENTRY
4211 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4212 const GLdouble
*params
)
4214 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4215 (GLfloat
) params
[1], (GLfloat
) params
[2],
4216 (GLfloat
) params
[3]);
4220 static void GLAPIENTRY
4221 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4222 GLuint num
, const GLdouble
*params
)
4225 for (i
= 0; i
< num
; i
++) {
4226 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4231 static void GLAPIENTRY
4232 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4233 GLuint num
, const GLfloat
*params
)
4236 for (i
= 0; i
< num
; i
++) {
4237 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4242 static void GLAPIENTRY
4243 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4244 const GLubyte
*program
)
4246 GET_CURRENT_CONTEXT(ctx
);
4248 GLubyte
*programCopy
;
4250 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4252 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4255 _mesa_memcpy(programCopy
, program
, len
);
4257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4258 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4263 n
[4].data
= programCopy
;
4265 if (ctx
->ExecuteFlag
) {
4266 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4271 static void GLAPIENTRY
4272 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4274 GET_CURRENT_CONTEXT(ctx
);
4276 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4278 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4281 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4282 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4283 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4288 if (ctx
->ExecuteFlag
) {
4289 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4294 static void GLAPIENTRY
4295 save_TrackMatrixNV(GLenum target
, GLuint address
,
4296 GLenum matrix
, GLenum transform
)
4298 GET_CURRENT_CONTEXT(ctx
);
4300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4301 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4308 if (ctx
->ExecuteFlag
) {
4309 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4312 #endif /* FEATURE_NV_vertex_program */
4316 * GL_NV_fragment_program
4318 #if FEATURE_NV_fragment_program
4319 static void GLAPIENTRY
4320 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4321 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4323 GET_CURRENT_CONTEXT(ctx
);
4325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4326 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4335 if (ctx
->ExecuteFlag
) {
4336 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4341 static void GLAPIENTRY
4342 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4343 const GLfloat
*params
)
4345 GET_CURRENT_CONTEXT(ctx
);
4347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4348 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4357 if (ctx
->ExecuteFlag
) {
4358 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4363 static void GLAPIENTRY
4364 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4365 GLdouble x
, GLdouble y
,
4366 GLdouble z
, GLdouble w
)
4368 GET_CURRENT_CONTEXT(ctx
);
4370 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4371 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4375 n
[3].f
= (GLfloat
) x
;
4376 n
[4].f
= (GLfloat
) y
;
4377 n
[5].f
= (GLfloat
) z
;
4378 n
[6].f
= (GLfloat
) w
;
4380 if (ctx
->ExecuteFlag
) {
4381 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4386 static void GLAPIENTRY
4387 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4388 const GLdouble
*params
)
4390 GET_CURRENT_CONTEXT(ctx
);
4392 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4393 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4397 n
[3].f
= (GLfloat
) params
[0];
4398 n
[4].f
= (GLfloat
) params
[1];
4399 n
[5].f
= (GLfloat
) params
[2];
4400 n
[6].f
= (GLfloat
) params
[3];
4402 if (ctx
->ExecuteFlag
) {
4403 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4407 static void GLAPIENTRY
4408 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4409 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4411 GET_CURRENT_CONTEXT(ctx
);
4413 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4415 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4418 _mesa_memcpy(nameCopy
, name
, len
);
4420 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4421 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4425 n
[3].data
= nameCopy
;
4431 if (ctx
->ExecuteFlag
) {
4432 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4437 static void GLAPIENTRY
4438 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4441 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4445 static void GLAPIENTRY
4446 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4447 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4449 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4450 (GLfloat
) z
,(GLfloat
) w
);
4454 static void GLAPIENTRY
4455 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4458 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4459 (GLfloat
) v
[1], (GLfloat
) v
[2],
4463 #endif /* FEATURE_NV_fragment_program */
4467 /* GL_EXT_stencil_two_side */
4468 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4470 GET_CURRENT_CONTEXT(ctx
);
4472 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4473 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4477 if (ctx
->ExecuteFlag
) {
4478 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4483 /* GL_EXT_depth_bounds_test */
4484 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4486 GET_CURRENT_CONTEXT(ctx
);
4488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4489 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4491 n
[1].f
= (GLfloat
) zmin
;
4492 n
[2].f
= (GLfloat
) zmax
;
4494 if (ctx
->ExecuteFlag
) {
4495 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4501 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4503 static void GLAPIENTRY
4504 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4505 const GLvoid
*string
)
4507 GET_CURRENT_CONTEXT(ctx
);
4509 GLubyte
*programCopy
;
4511 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4513 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4516 _mesa_memcpy(programCopy
, string
, len
);
4518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4519 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4524 n
[4].data
= programCopy
;
4526 if (ctx
->ExecuteFlag
) {
4527 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4532 static void GLAPIENTRY
4533 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4534 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4536 GET_CURRENT_CONTEXT(ctx
);
4538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4539 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4548 if (ctx
->ExecuteFlag
) {
4549 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4554 static void GLAPIENTRY
4555 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4556 const GLfloat
*params
)
4558 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4559 params
[2], params
[3]);
4563 static void GLAPIENTRY
4564 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4565 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4567 save_ProgramEnvParameter4fARB(target
, index
,
4575 static void GLAPIENTRY
4576 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4577 const GLdouble
*params
)
4579 save_ProgramEnvParameter4fARB(target
, index
,
4580 (GLfloat
) params
[0],
4581 (GLfloat
) params
[1],
4582 (GLfloat
) params
[2],
4583 (GLfloat
) params
[3]);
4586 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4591 static void save_Attr1f( GLenum attr
, GLfloat x
)
4593 GET_CURRENT_CONTEXT(ctx
);
4595 SAVE_FLUSH_VERTICES( ctx
);
4596 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4602 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4603 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4605 if (ctx
->ExecuteFlag
) {
4606 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4610 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4612 GET_CURRENT_CONTEXT(ctx
);
4614 SAVE_FLUSH_VERTICES( ctx
);
4615 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4622 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4623 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4625 if (ctx
->ExecuteFlag
) {
4626 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4630 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4632 GET_CURRENT_CONTEXT(ctx
);
4634 SAVE_FLUSH_VERTICES( ctx
);
4635 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4643 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4644 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4646 if (ctx
->ExecuteFlag
) {
4647 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4651 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4654 GET_CURRENT_CONTEXT(ctx
);
4656 SAVE_FLUSH_VERTICES( ctx
);
4657 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4666 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4667 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4669 if (ctx
->ExecuteFlag
) {
4670 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4674 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4676 GET_CURRENT_CONTEXT(ctx
);
4678 SAVE_FLUSH_VERTICES( ctx
);
4679 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4683 if (ctx
->ExecuteFlag
) {
4684 (*ctx
->Exec
->EvalCoord1f
)( x
);
4688 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4690 save_EvalCoord1f( v
[0] );
4693 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4695 GET_CURRENT_CONTEXT(ctx
);
4697 SAVE_FLUSH_VERTICES( ctx
);
4698 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4703 if (ctx
->ExecuteFlag
) {
4704 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4708 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4710 save_EvalCoord2f( v
[0], v
[1] );
4714 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4716 GET_CURRENT_CONTEXT(ctx
);
4718 SAVE_FLUSH_VERTICES( ctx
);
4719 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4723 if (ctx
->ExecuteFlag
) {
4724 (*ctx
->Exec
->EvalPoint1
)( x
);
4728 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4730 GET_CURRENT_CONTEXT(ctx
);
4732 SAVE_FLUSH_VERTICES( ctx
);
4733 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4738 if (ctx
->ExecuteFlag
) {
4739 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4743 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4745 GET_CURRENT_CONTEXT(ctx
);
4747 SAVE_FLUSH_VERTICES( ctx
);
4748 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4753 ctx
->ListState
.ActiveIndex
= 1;
4754 ctx
->ListState
.CurrentIndex
= x
;
4756 if (ctx
->ExecuteFlag
) {
4757 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4761 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4763 save_Indexf( v
[0] );
4766 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4768 GET_CURRENT_CONTEXT(ctx
);
4770 SAVE_FLUSH_VERTICES( ctx
);
4771 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4776 ctx
->ListState
.ActiveEdgeFlag
= 1;
4777 ctx
->ListState
.CurrentEdgeFlag
= x
;
4779 if (ctx
->ExecuteFlag
) {
4780 (*ctx
->Exec
->EdgeFlag
)( x
);
4784 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4786 save_EdgeFlag( v
[0] );
4789 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4791 GET_CURRENT_CONTEXT(ctx
);
4795 SAVE_FLUSH_VERTICES( ctx
);
4800 case GL_FRONT_AND_BACK
:
4803 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4812 case GL_AMBIENT_AND_DIFFUSE
:
4818 case GL_COLOR_INDEXES
:
4822 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4826 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4830 for (i
= 0 ; i
< args
; i
++)
4831 n
[3+i
].f
= param
[i
];
4835 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4836 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4837 if (bitmask
& (1<<i
)) {
4838 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4839 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4843 if (ctx
->ExecuteFlag
) {
4844 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4848 static void GLAPIENTRY
save_Begin( GLenum mode
)
4850 GET_CURRENT_CONTEXT(ctx
);
4852 GLboolean error
= GL_FALSE
;
4854 if (mode
< GL_POINTS
|| mode
> GL_POLYGON
) {
4855 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4858 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4859 /* Typically the first begin. This may raise an error on
4860 * playback, depending on whether CallList is issued from inside
4861 * a begin/end or not.
4863 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4865 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4866 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4869 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4874 /* Give the driver an opportunity to hook in an optimized
4875 * display list compiler.
4877 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4880 SAVE_FLUSH_VERTICES( ctx
);
4881 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4887 if (ctx
->ExecuteFlag
) {
4888 (*ctx
->Exec
->Begin
)( mode
);
4892 static void GLAPIENTRY
save_End( void )
4894 GET_CURRENT_CONTEXT(ctx
);
4895 SAVE_FLUSH_VERTICES( ctx
);
4896 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4897 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4898 if (ctx
->ExecuteFlag
) {
4899 (*ctx
->Exec
->End
)( );
4903 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
4904 GLfloat c
, GLfloat d
)
4906 GET_CURRENT_CONTEXT(ctx
);
4908 SAVE_FLUSH_VERTICES( ctx
);
4909 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
4916 if (ctx
->ExecuteFlag
) {
4917 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
4923 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
4925 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
4928 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
4930 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
4933 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
4935 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
4938 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
4940 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
4943 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4945 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
4948 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
4950 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
4953 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
4955 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
4958 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
4960 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
4963 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
4965 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
4968 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
4970 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
4973 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
4975 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
4978 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
4980 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
4983 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4985 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
4988 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
4990 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
4993 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
4995 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
4998 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
5000 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
5003 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
5005 save_Attr1f( VERT_ATTRIB_FOG
, x
);
5008 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
5010 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
5013 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
5015 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
5018 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5020 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5023 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5025 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5028 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5030 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5033 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5035 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5038 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5040 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5044 /* Just call the respective ATTR for texcoord
5046 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5048 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5049 save_Attr1f( attr
, x
);
5052 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5054 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5055 save_Attr1f( attr
, v
[0] );
5058 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5060 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5061 save_Attr2f( attr
, x
, y
);
5064 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5066 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5067 save_Attr2f( attr
, v
[0], v
[1] );
5070 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5073 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5074 save_Attr3f( attr
, x
, y
, z
);
5077 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5079 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5080 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5083 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5084 GLfloat z
, GLfloat w
)
5086 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5087 save_Attr4f( attr
, x
, y
, z
, w
);
5090 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5092 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5093 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5097 static void enum_error( void )
5099 GET_CURRENT_CONTEXT( ctx
);
5100 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5103 /* First level for NV_vertex_program:
5105 * Check for errors at compile time?.
5107 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5109 if (index
< VERT_ATTRIB_MAX
)
5110 save_Attr1f( index
, x
);
5115 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5117 if (index
< VERT_ATTRIB_MAX
)
5118 save_Attr1f( index
, v
[0] );
5123 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5125 if (index
< VERT_ATTRIB_MAX
)
5126 save_Attr2f( index
, x
, y
);
5131 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5133 if (index
< VERT_ATTRIB_MAX
)
5134 save_Attr2f( index
, v
[0], v
[1] );
5139 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5142 if (index
< VERT_ATTRIB_MAX
)
5143 save_Attr3f( index
, x
, y
, z
);
5148 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5150 if (index
< VERT_ATTRIB_MAX
)
5151 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5156 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5157 GLfloat z
, GLfloat w
)
5159 if (index
< VERT_ATTRIB_MAX
)
5160 save_Attr4f( index
, x
, y
, z
, w
);
5165 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5167 if (index
< VERT_ATTRIB_MAX
)
5168 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5177 /* KW: Compile commands
5179 * Will appear in the list before the vertex buffer containing the
5180 * command that provoked the error. I don't see this as a problem.
5183 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5186 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5189 n
[2].data
= (void *) s
;
5191 /* execute already done */
5196 * Compile an error into current display list.
5199 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5201 if (ctx
->CompileFlag
)
5202 _mesa_save_error( ctx
, error
, s
);
5204 if (ctx
->ExecuteFlag
)
5205 _mesa_error( ctx
, error
, s
);
5211 islist(GLcontext
*ctx
, GLuint list
)
5213 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5223 /**********************************************************************/
5224 /* Display list execution */
5225 /**********************************************************************/
5229 * Execute a display list. Note that the ListBase offset must have already
5230 * been added before calling this function. I.e. the list argument is
5231 * the absolute list number, not relative to ListBase.
5232 * \param list - display list number
5234 static void GLAPIENTRY
5235 execute_list( GLcontext
*ctx
, GLuint list
)
5240 if (list
== 0 || !islist(ctx
,list
))
5243 if (ctx
->Driver
.BeginCallList
)
5244 ctx
->Driver
.BeginCallList( ctx
, list
);
5246 ctx
->ListState
.CallDepth
++;
5248 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5252 OpCode opcode
= n
[0].opcode
;
5253 int i
= (int)n
[0].opcode
- (int)OPCODE_DRV_0
;
5255 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
5256 ctx
->listext
.opcode
[i
].execute(ctx
, &n
[1]);
5257 n
+= ctx
->listext
.opcode
[i
].size
;
5262 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5265 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5267 case OPCODE_ALPHA_FUNC
:
5268 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5270 case OPCODE_BIND_TEXTURE
:
5271 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5275 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5276 ctx
->Unpack
= _mesa_native_packing
;
5277 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5278 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5279 ctx
->Unpack
= save
; /* restore */
5282 case OPCODE_BLEND_COLOR
:
5283 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5285 case OPCODE_BLEND_EQUATION
:
5286 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5288 case OPCODE_BLEND_EQUATION_SEPARATE
:
5289 (*ctx
->Exec
->BlendEquationSeparateEXT
)( n
[1].e
, n
[2].e
);
5291 case OPCODE_BLEND_FUNC_SEPARATE
:
5292 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5294 case OPCODE_CALL_LIST
:
5295 /* Generated by glCallList(), don't add ListBase */
5296 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5297 execute_list( ctx
, n
[1].ui
);
5300 case OPCODE_CALL_LIST_OFFSET
:
5301 /* Generated by glCallLists() so we must add ListBase */
5303 /* user specified a bad data type at compile time */
5304 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5306 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5307 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5311 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5313 case OPCODE_CLEAR_COLOR
:
5314 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5316 case OPCODE_CLEAR_ACCUM
:
5317 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5319 case OPCODE_CLEAR_DEPTH
:
5320 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5322 case OPCODE_CLEAR_INDEX
:
5323 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5325 case OPCODE_CLEAR_STENCIL
:
5326 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5328 case OPCODE_CLIP_PLANE
:
5335 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5338 case OPCODE_COLOR_MASK
:
5339 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5341 case OPCODE_COLOR_MATERIAL
:
5342 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5344 case OPCODE_COLOR_TABLE
:
5346 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5347 ctx
->Unpack
= _mesa_native_packing
;
5348 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5349 n
[5].e
, n
[6].data
);
5350 ctx
->Unpack
= save
; /* restore */
5353 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5360 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5363 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5370 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5373 case OPCODE_COLOR_SUB_TABLE
:
5375 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5376 ctx
->Unpack
= _mesa_native_packing
;
5377 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5378 n
[4].e
, n
[5].e
, n
[6].data
);
5379 ctx
->Unpack
= save
; /* restore */
5382 case OPCODE_CONVOLUTION_FILTER_1D
:
5384 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5385 ctx
->Unpack
= _mesa_native_packing
;
5386 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5387 n
[4].e
, n
[5].e
, n
[6].data
);
5388 ctx
->Unpack
= save
; /* restore */
5391 case OPCODE_CONVOLUTION_FILTER_2D
:
5393 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5394 ctx
->Unpack
= _mesa_native_packing
;
5395 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5396 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5397 ctx
->Unpack
= save
; /* restore */
5400 case OPCODE_CONVOLUTION_PARAMETER_I
:
5401 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5403 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5410 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5413 case OPCODE_CONVOLUTION_PARAMETER_F
:
5414 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5416 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5423 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5426 case OPCODE_COPY_COLOR_SUB_TABLE
:
5427 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5428 n
[3].i
, n
[4].i
, n
[5].i
);
5430 case OPCODE_COPY_COLOR_TABLE
:
5431 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5432 n
[3].i
, n
[4].i
, n
[5].i
);
5434 case OPCODE_COPY_PIXELS
:
5435 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5436 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5438 case OPCODE_COPY_TEX_IMAGE1D
:
5439 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5440 n
[5].i
, n
[6].i
, n
[7].i
);
5442 case OPCODE_COPY_TEX_IMAGE2D
:
5443 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5444 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5446 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5447 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5448 n
[4].i
, n
[5].i
, n
[6].i
);
5450 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5451 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5452 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5454 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5455 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5456 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5458 case OPCODE_CULL_FACE
:
5459 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5461 case OPCODE_DEPTH_FUNC
:
5462 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5464 case OPCODE_DEPTH_MASK
:
5465 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5467 case OPCODE_DEPTH_RANGE
:
5468 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5470 case OPCODE_DISABLE
:
5471 (*ctx
->Exec
->Disable
)( n
[1].e
);
5473 case OPCODE_DRAW_BUFFER
:
5474 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5476 case OPCODE_DRAW_PIXELS
:
5478 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5479 ctx
->Unpack
= _mesa_native_packing
;
5480 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5482 ctx
->Unpack
= save
; /* restore */
5486 (*ctx
->Exec
->Enable
)( n
[1].e
);
5488 case OPCODE_EVALMESH1
:
5489 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5491 case OPCODE_EVALMESH2
:
5492 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5501 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5504 case OPCODE_FRONT_FACE
:
5505 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5507 case OPCODE_FRUSTUM
:
5508 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5511 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5513 case OPCODE_HISTOGRAM
:
5514 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5516 case OPCODE_INDEX_MASK
:
5517 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5519 case OPCODE_INIT_NAMES
:
5520 (*ctx
->Exec
->InitNames
)();
5529 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5532 case OPCODE_LIGHT_MODEL
:
5539 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5542 case OPCODE_LINE_STIPPLE
:
5543 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5545 case OPCODE_LINE_WIDTH
:
5546 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5548 case OPCODE_LIST_BASE
:
5549 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5551 case OPCODE_LOAD_IDENTITY
:
5552 (*ctx
->Exec
->LoadIdentity
)();
5554 case OPCODE_LOAD_MATRIX
:
5555 if (sizeof(Node
)==sizeof(GLfloat
)) {
5556 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5561 for (i
=0;i
<16;i
++) {
5564 (*ctx
->Exec
->LoadMatrixf
)( m
);
5567 case OPCODE_LOAD_NAME
:
5568 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5570 case OPCODE_LOGIC_OP
:
5571 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5575 GLenum target
= n
[1].e
;
5576 GLint ustride
= _mesa_evaluator_components(target
);
5577 GLint uorder
= n
[5].i
;
5578 GLfloat u1
= n
[2].f
;
5579 GLfloat u2
= n
[3].f
;
5580 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5581 (GLfloat
*) n
[6].data
);
5586 GLenum target
= n
[1].e
;
5587 GLfloat u1
= n
[2].f
;
5588 GLfloat u2
= n
[3].f
;
5589 GLfloat v1
= n
[4].f
;
5590 GLfloat v2
= n
[5].f
;
5591 GLint ustride
= n
[6].i
;
5592 GLint vstride
= n
[7].i
;
5593 GLint uorder
= n
[8].i
;
5594 GLint vorder
= n
[9].i
;
5595 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5596 v1
, v2
, vstride
, vorder
,
5597 (GLfloat
*) n
[10].data
);
5600 case OPCODE_MAPGRID1
:
5601 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5603 case OPCODE_MAPGRID2
:
5604 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5606 case OPCODE_MATRIX_MODE
:
5607 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5609 case OPCODE_MIN_MAX
:
5610 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5612 case OPCODE_MULT_MATRIX
:
5613 if (sizeof(Node
)==sizeof(GLfloat
)) {
5614 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5619 for (i
=0;i
<16;i
++) {
5622 (*ctx
->Exec
->MultMatrixf
)( m
);
5626 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5628 case OPCODE_PASSTHROUGH
:
5629 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5631 case OPCODE_PIXEL_MAP
:
5632 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5634 case OPCODE_PIXEL_TRANSFER
:
5635 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5637 case OPCODE_PIXEL_ZOOM
:
5638 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5640 case OPCODE_POINT_SIZE
:
5641 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5643 case OPCODE_POINT_PARAMETERS
:
5649 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5652 case OPCODE_POLYGON_MODE
:
5653 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5655 case OPCODE_POLYGON_STIPPLE
:
5656 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5658 case OPCODE_POLYGON_OFFSET
:
5659 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5661 case OPCODE_POP_ATTRIB
:
5662 (*ctx
->Exec
->PopAttrib
)();
5664 case OPCODE_POP_MATRIX
:
5665 (*ctx
->Exec
->PopMatrix
)();
5667 case OPCODE_POP_NAME
:
5668 (*ctx
->Exec
->PopName
)();
5670 case OPCODE_PRIORITIZE_TEXTURE
:
5671 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5673 case OPCODE_PUSH_ATTRIB
:
5674 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5676 case OPCODE_PUSH_MATRIX
:
5677 (*ctx
->Exec
->PushMatrix
)();
5679 case OPCODE_PUSH_NAME
:
5680 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5682 case OPCODE_RASTER_POS
:
5683 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5685 case OPCODE_READ_BUFFER
:
5686 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5688 case OPCODE_RESET_HISTOGRAM
:
5689 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5691 case OPCODE_RESET_MIN_MAX
:
5692 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5695 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5698 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5700 case OPCODE_SCISSOR
:
5701 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5703 case OPCODE_SHADE_MODEL
:
5704 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5706 case OPCODE_STENCIL_FUNC
:
5707 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5709 case OPCODE_STENCIL_MASK
:
5710 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5712 case OPCODE_STENCIL_OP
:
5713 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5722 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5732 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5735 case OPCODE_TEXPARAMETER
:
5742 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5745 case OPCODE_TEX_IMAGE1D
:
5747 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5748 ctx
->Unpack
= _mesa_native_packing
;
5749 (*ctx
->Exec
->TexImage1D
)(
5750 n
[1].e
, /* target */
5752 n
[3].i
, /* components */
5754 n
[5].e
, /* border */
5755 n
[6].e
, /* format */
5758 ctx
->Unpack
= save
; /* restore */
5761 case OPCODE_TEX_IMAGE2D
:
5763 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5764 ctx
->Unpack
= _mesa_native_packing
;
5765 (*ctx
->Exec
->TexImage2D
)(
5766 n
[1].e
, /* target */
5768 n
[3].i
, /* components */
5770 n
[5].i
, /* height */
5771 n
[6].e
, /* border */
5772 n
[7].e
, /* format */
5775 ctx
->Unpack
= save
; /* restore */
5778 case OPCODE_TEX_IMAGE3D
:
5780 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5781 ctx
->Unpack
= _mesa_native_packing
;
5782 (*ctx
->Exec
->TexImage3D
)(
5783 n
[1].e
, /* target */
5785 n
[3].i
, /* components */
5787 n
[5].i
, /* height */
5789 n
[7].e
, /* border */
5790 n
[8].e
, /* format */
5793 ctx
->Unpack
= save
; /* restore */
5796 case OPCODE_TEX_SUB_IMAGE1D
:
5798 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5799 ctx
->Unpack
= _mesa_native_packing
;
5800 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5802 n
[6].e
, n
[7].data
);
5803 ctx
->Unpack
= save
; /* restore */
5806 case OPCODE_TEX_SUB_IMAGE2D
:
5808 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5809 ctx
->Unpack
= _mesa_native_packing
;
5810 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5812 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5813 ctx
->Unpack
= save
; /* restore */
5816 case OPCODE_TEX_SUB_IMAGE3D
:
5818 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5819 ctx
->Unpack
= _mesa_native_packing
;
5820 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5821 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5822 n
[8].i
, n
[9].e
, n
[10].e
,
5824 ctx
->Unpack
= save
; /* restore */
5827 case OPCODE_TRANSLATE
:
5828 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5830 case OPCODE_VIEWPORT
:
5831 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5832 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5834 case OPCODE_WINDOW_POS
:
5835 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5837 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5838 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5840 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5841 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5843 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5844 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5846 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5847 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5848 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5850 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5851 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5852 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5854 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5855 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5856 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5858 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5859 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5860 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5862 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5863 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5864 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5866 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5867 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5868 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5869 n
[9].e
, n
[10].i
, n
[11].data
);
5871 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5872 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5874 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5875 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5877 #if FEATURE_NV_vertex_program
5878 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5879 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5881 case OPCODE_EXECUTE_PROGRAM_NV
:
5888 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5891 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5892 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5893 (GLuint
*) n
[2].data
);
5895 case OPCODE_LOAD_PROGRAM_NV
:
5896 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5897 (const GLubyte
*) n
[4].data
);
5899 case OPCODE_PROGRAM_PARAMETER4F_NV
:
5900 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5901 n
[4].f
, n
[5].f
, n
[6].f
);
5903 case OPCODE_TRACK_MATRIX_NV
:
5904 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
5908 #if FEATURE_NV_fragment_program
5909 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
5910 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5911 n
[4].f
, n
[5].f
, n
[6].f
);
5913 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
5914 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
5915 (const GLubyte
*) n
[3].data
,
5916 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
5920 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
5921 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
5923 case OPCODE_DEPTH_BOUNDS_EXT
:
5924 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
5926 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5927 case OPCODE_PROGRAM_STRING_ARB
:
5928 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
5930 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
5931 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5932 n
[4].f
, n
[5].f
, n
[6].f
);
5936 case OPCODE_ATTR_1F
:
5937 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
5939 case OPCODE_ATTR_2F
:
5940 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
5942 case OPCODE_ATTR_3F
:
5943 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
5945 case OPCODE_ATTR_4F
:
5946 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
5948 case OPCODE_MATERIAL
:
5949 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
5952 (*ctx
->Exec
->Indexi
)(n
[1].i
);
5954 case OPCODE_EDGEFLAG
:
5955 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
5958 (*ctx
->Exec
->Begin
)(n
[1].e
);
5961 (*ctx
->Exec
->End
)();
5964 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5966 case OPCODE_EVAL_C1
:
5967 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
5969 case OPCODE_EVAL_C2
:
5970 (*ctx
->Exec
->EvalCoord2fv
)(&n
[1].f
);
5972 case OPCODE_EVAL_P1
:
5973 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
5975 case OPCODE_EVAL_P2
:
5976 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
5982 case OPCODE_CONTINUE
:
5983 n
= (Node
*) n
[1].next
;
5985 case OPCODE_END_OF_LIST
:
5991 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
5992 _mesa_problem(ctx
, msg
);
5997 /* increment n to point to next compiled command */
5998 if (opcode
!=OPCODE_CONTINUE
) {
5999 n
+= InstSize
[opcode
];
6003 ctx
->ListState
.CallDepth
--;
6005 if (ctx
->Driver
.EndCallList
)
6006 ctx
->Driver
.EndCallList( ctx
);
6013 /**********************************************************************/
6015 /**********************************************************************/
6021 * Test if a display list number is valid.
6023 GLboolean GLAPIENTRY
6024 _mesa_IsList( GLuint list
)
6026 GET_CURRENT_CONTEXT(ctx
);
6027 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6028 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6029 return islist(ctx
, list
);
6034 * Delete a sequence of consecutive display lists.
6037 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6039 GET_CURRENT_CONTEXT(ctx
);
6041 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6042 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6045 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6048 for (i
=list
;i
<list
+range
;i
++) {
6049 _mesa_destroy_list( ctx
, i
);
6056 * Return a display list number, n, such that lists n through n+range-1
6060 _mesa_GenLists(GLsizei range
)
6062 GET_CURRENT_CONTEXT(ctx
);
6064 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6065 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6068 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6076 * Make this an atomic operation
6078 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6080 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6082 /* reserve the list IDs by with empty/dummy lists */
6084 for (i
=0; i
<range
; i
++) {
6085 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6089 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6097 * Begin a new display list.
6100 _mesa_NewList( GLuint list
, GLenum mode
)
6102 GET_CURRENT_CONTEXT(ctx
);
6105 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6106 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6108 if (MESA_VERBOSE
&VERBOSE_API
)
6109 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6110 _mesa_lookup_enum_by_nr(mode
));
6113 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6117 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6118 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6122 if (ctx
->ListState
.CurrentListPtr
) {
6123 /* already compiling a display list */
6124 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6128 ctx
->CompileFlag
= GL_TRUE
;
6129 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6131 /* Allocate new display list */
6132 ctx
->ListState
.CurrentListNum
= list
;
6133 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6134 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6135 ctx
->ListState
.CurrentPos
= 0;
6137 /* Reset acumulated list state:
6139 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6140 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6142 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6143 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6145 ctx
->ListState
.ActiveIndex
= 0;
6146 ctx
->ListState
.ActiveEdgeFlag
= 0;
6148 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6149 ctx
->Driver
.NewList( ctx
, list
, mode
);
6151 ctx
->CurrentDispatch
= ctx
->Save
;
6152 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6158 * End definition of current display list.
6161 _mesa_EndList( void )
6163 GET_CURRENT_CONTEXT(ctx
);
6164 SAVE_FLUSH_VERTICES(ctx
);
6165 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6167 if (MESA_VERBOSE
&VERBOSE_API
)
6168 _mesa_debug(ctx
, "glEndList\n");
6170 /* Check that a list is under construction */
6171 if (!ctx
->ListState
.CurrentListPtr
) {
6172 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6176 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6178 /* Destroy old list, if any */
6179 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6180 /* Install the list */
6181 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6184 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6185 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6187 ctx
->ListState
.CurrentListNum
= 0;
6188 ctx
->ListState
.CurrentListPtr
= NULL
;
6189 ctx
->ExecuteFlag
= GL_TRUE
;
6190 ctx
->CompileFlag
= GL_FALSE
;
6192 ctx
->Driver
.EndList( ctx
);
6194 ctx
->CurrentDispatch
= ctx
->Exec
;
6195 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6201 _mesa_CallList( GLuint list
)
6203 GLboolean save_compile_flag
;
6204 GET_CURRENT_CONTEXT(ctx
);
6205 FLUSH_CURRENT(ctx
, 0);
6206 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6207 /* execute the display list, and restore the CompileFlag. */
6209 if (MESA_VERBOSE
& VERBOSE_API
)
6210 _mesa_debug(ctx
, "glCallList %d\n", list
);
6213 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6217 /* mesa_print_display_list( list ); */
6219 save_compile_flag
= ctx
->CompileFlag
;
6220 if (save_compile_flag
) {
6221 ctx
->CompileFlag
= GL_FALSE
;
6224 execute_list( ctx
, list
);
6225 ctx
->CompileFlag
= save_compile_flag
;
6227 /* also restore API function pointers to point to "save" versions */
6228 if (save_compile_flag
) {
6229 ctx
->CurrentDispatch
= ctx
->Save
;
6230 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6237 * Execute glCallLists: call multiple display lists.
6240 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6242 GET_CURRENT_CONTEXT(ctx
);
6245 GLboolean save_compile_flag
;
6247 if (MESA_VERBOSE
& VERBOSE_API
)
6248 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6252 case GL_UNSIGNED_BYTE
:
6254 case GL_UNSIGNED_SHORT
:
6256 case GL_UNSIGNED_INT
:
6264 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6268 /* Save the CompileFlag status, turn it off, execute display list,
6269 * and restore the CompileFlag.
6271 save_compile_flag
= ctx
->CompileFlag
;
6272 ctx
->CompileFlag
= GL_FALSE
;
6275 list
= translate_id( i
, type
, lists
);
6276 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6279 ctx
->CompileFlag
= save_compile_flag
;
6281 /* also restore API function pointers to point to "save" versions */
6282 if (save_compile_flag
) {
6283 ctx
->CurrentDispatch
= ctx
->Save
;
6284 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6291 * Set the offset added to list numbers in glCallLists.
6294 _mesa_ListBase( GLuint base
)
6296 GET_CURRENT_CONTEXT(ctx
);
6297 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6298 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6299 ctx
->List
.ListBase
= base
;
6303 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6305 static void GLAPIENTRY
exec_Finish( void )
6307 GET_CURRENT_CONTEXT(ctx
);
6308 FLUSH_VERTICES(ctx
, 0);
6309 ctx
->Exec
->Finish();
6312 static void GLAPIENTRY
exec_Flush( void )
6314 GET_CURRENT_CONTEXT(ctx
);
6315 FLUSH_VERTICES(ctx
, 0);
6316 ctx
->Exec
->Flush( );
6319 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6321 GET_CURRENT_CONTEXT(ctx
);
6322 FLUSH_VERTICES(ctx
, 0);
6323 ctx
->Exec
->GetBooleanv( pname
, params
);
6326 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6328 GET_CURRENT_CONTEXT(ctx
);
6329 FLUSH_VERTICES(ctx
, 0);
6330 ctx
->Exec
->GetClipPlane( plane
, equation
);
6333 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6335 GET_CURRENT_CONTEXT(ctx
);
6336 FLUSH_VERTICES(ctx
, 0);
6337 ctx
->Exec
->GetDoublev( pname
, params
);
6340 static GLenum GLAPIENTRY
exec_GetError( void )
6342 GET_CURRENT_CONTEXT(ctx
);
6343 FLUSH_VERTICES(ctx
, 0);
6344 return ctx
->Exec
->GetError( );
6347 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6349 GET_CURRENT_CONTEXT(ctx
);
6350 FLUSH_VERTICES(ctx
, 0);
6351 ctx
->Exec
->GetFloatv( pname
, params
);
6354 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6356 GET_CURRENT_CONTEXT(ctx
);
6357 FLUSH_VERTICES(ctx
, 0);
6358 ctx
->Exec
->GetIntegerv( pname
, params
);
6361 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6363 GET_CURRENT_CONTEXT(ctx
);
6364 FLUSH_VERTICES(ctx
, 0);
6365 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6368 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6370 GET_CURRENT_CONTEXT(ctx
);
6371 FLUSH_VERTICES(ctx
, 0);
6372 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6375 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6377 GET_CURRENT_CONTEXT(ctx
);
6378 FLUSH_VERTICES(ctx
, 0);
6379 ctx
->Exec
->GetMapdv( target
, query
, v
);
6382 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6384 GET_CURRENT_CONTEXT(ctx
);
6385 FLUSH_VERTICES(ctx
, 0);
6386 ctx
->Exec
->GetMapfv( target
, query
, v
);
6389 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6391 GET_CURRENT_CONTEXT(ctx
);
6392 FLUSH_VERTICES(ctx
, 0);
6393 ctx
->Exec
->GetMapiv( target
, query
, v
);
6396 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6398 GET_CURRENT_CONTEXT(ctx
);
6399 FLUSH_VERTICES(ctx
, 0);
6400 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6403 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6405 GET_CURRENT_CONTEXT(ctx
);
6406 FLUSH_VERTICES(ctx
, 0);
6407 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6410 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6412 GET_CURRENT_CONTEXT(ctx
);
6413 FLUSH_VERTICES(ctx
, 0);
6414 ctx
->Exec
->GetPixelMapfv( map
, values
);
6417 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6419 GET_CURRENT_CONTEXT(ctx
);
6420 FLUSH_VERTICES(ctx
, 0);
6421 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6424 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6426 GET_CURRENT_CONTEXT(ctx
);
6427 FLUSH_VERTICES(ctx
, 0);
6428 ctx
->Exec
->GetPixelMapusv( map
, values
);
6431 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6433 GET_CURRENT_CONTEXT(ctx
);
6434 FLUSH_VERTICES(ctx
, 0);
6435 ctx
->Exec
->GetPolygonStipple( dest
);
6438 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6440 GET_CURRENT_CONTEXT(ctx
);
6441 FLUSH_VERTICES(ctx
, 0);
6442 return ctx
->Exec
->GetString( name
);
6445 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6447 GET_CURRENT_CONTEXT(ctx
);
6448 FLUSH_VERTICES(ctx
, 0);
6449 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6452 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6454 GET_CURRENT_CONTEXT(ctx
);
6455 FLUSH_VERTICES(ctx
, 0);
6456 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6459 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6461 GET_CURRENT_CONTEXT(ctx
);
6462 FLUSH_VERTICES(ctx
, 0);
6463 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6466 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6468 GET_CURRENT_CONTEXT(ctx
);
6469 FLUSH_VERTICES(ctx
, 0);
6470 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6473 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6475 GET_CURRENT_CONTEXT(ctx
);
6476 FLUSH_VERTICES(ctx
, 0);
6477 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6480 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6481 GLenum type
, GLvoid
*pixels
)
6483 GET_CURRENT_CONTEXT(ctx
);
6484 FLUSH_VERTICES(ctx
, 0);
6485 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6488 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6489 GLenum pname
, GLfloat
*params
)
6491 GET_CURRENT_CONTEXT(ctx
);
6492 FLUSH_VERTICES(ctx
, 0);
6493 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6496 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6497 GLenum pname
, GLint
*params
)
6499 GET_CURRENT_CONTEXT(ctx
);
6500 FLUSH_VERTICES(ctx
, 0);
6501 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6504 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6507 GET_CURRENT_CONTEXT(ctx
);
6508 FLUSH_VERTICES(ctx
, 0);
6509 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6512 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6514 GET_CURRENT_CONTEXT(ctx
);
6515 FLUSH_VERTICES(ctx
, 0);
6516 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6519 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6521 GET_CURRENT_CONTEXT(ctx
);
6522 FLUSH_VERTICES(ctx
, 0);
6523 return ctx
->Exec
->IsEnabled( cap
);
6526 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6528 GET_CURRENT_CONTEXT(ctx
);
6529 FLUSH_VERTICES(ctx
, 0);
6530 ctx
->Exec
->PixelStoref( pname
, param
);
6533 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6535 GET_CURRENT_CONTEXT(ctx
);
6536 FLUSH_VERTICES(ctx
, 0);
6537 ctx
->Exec
->PixelStorei( pname
, param
);
6540 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6541 GLenum format
, GLenum type
, GLvoid
*pixels
)
6543 GET_CURRENT_CONTEXT(ctx
);
6544 FLUSH_VERTICES(ctx
, 0);
6545 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6548 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6550 GET_CURRENT_CONTEXT(ctx
);
6551 FLUSH_VERTICES(ctx
, 0);
6552 return ctx
->Exec
->RenderMode( mode
);
6555 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6557 GET_CURRENT_CONTEXT(ctx
);
6558 FLUSH_VERTICES(ctx
, 0);
6559 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6562 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6564 GET_CURRENT_CONTEXT(ctx
);
6565 FLUSH_VERTICES(ctx
, 0);
6566 ctx
->Exec
->SelectBuffer( size
, buffer
);
6569 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6570 GLboolean
*residences
)
6572 GET_CURRENT_CONTEXT(ctx
);
6573 FLUSH_VERTICES(ctx
, 0);
6574 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6577 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6580 GET_CURRENT_CONTEXT(ctx
);
6581 FLUSH_VERTICES(ctx
, 0);
6582 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6585 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6587 GET_CURRENT_CONTEXT(ctx
);
6588 FLUSH_VERTICES(ctx
, 0);
6589 ctx
->Exec
->DeleteTextures( n
, texName
);
6592 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6594 GET_CURRENT_CONTEXT(ctx
);
6595 FLUSH_VERTICES(ctx
, 0);
6596 ctx
->Exec
->DisableClientState( cap
);
6599 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6601 GET_CURRENT_CONTEXT(ctx
);
6602 FLUSH_VERTICES(ctx
, 0);
6603 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6606 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6608 GET_CURRENT_CONTEXT(ctx
);
6609 FLUSH_VERTICES(ctx
, 0);
6610 ctx
->Exec
->EnableClientState( cap
);
6613 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6615 GET_CURRENT_CONTEXT(ctx
);
6616 FLUSH_VERTICES(ctx
, 0);
6617 ctx
->Exec
->GenTextures( n
, texName
);
6620 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6622 GET_CURRENT_CONTEXT(ctx
);
6623 FLUSH_VERTICES(ctx
, 0);
6624 ctx
->Exec
->GetPointerv( pname
, params
);
6627 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6629 GET_CURRENT_CONTEXT(ctx
);
6630 FLUSH_VERTICES(ctx
, 0);
6631 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6634 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6635 const GLvoid
*pointer
)
6637 GET_CURRENT_CONTEXT(ctx
);
6638 FLUSH_VERTICES(ctx
, 0);
6639 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6642 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6644 GET_CURRENT_CONTEXT(ctx
);
6645 FLUSH_VERTICES(ctx
, 0);
6646 return ctx
->Exec
->IsTexture( texture
);
6649 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6651 GET_CURRENT_CONTEXT(ctx
);
6652 FLUSH_VERTICES(ctx
, 0);
6653 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6656 static void GLAPIENTRY
exec_PopClientAttrib(void)
6658 GET_CURRENT_CONTEXT(ctx
);
6659 FLUSH_VERTICES(ctx
, 0);
6660 ctx
->Exec
->PopClientAttrib();
6663 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6665 GET_CURRENT_CONTEXT(ctx
);
6666 FLUSH_VERTICES(ctx
, 0);
6667 ctx
->Exec
->PushClientAttrib( mask
);
6670 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6673 GET_CURRENT_CONTEXT(ctx
);
6674 FLUSH_VERTICES(ctx
, 0);
6675 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6678 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6681 GET_CURRENT_CONTEXT(ctx
);
6682 FLUSH_VERTICES(ctx
, 0);
6683 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6686 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6689 GET_CURRENT_CONTEXT(ctx
);
6690 FLUSH_VERTICES(ctx
, 0);
6691 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6694 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6695 GLint x
, GLint y
, GLsizei width
)
6697 GET_CURRENT_CONTEXT(ctx
);
6698 FLUSH_VERTICES(ctx
, 0);
6699 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6702 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6703 GLint x
, GLint y
, GLsizei width
,
6706 GET_CURRENT_CONTEXT(ctx
);
6707 FLUSH_VERTICES(ctx
, 0);
6708 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6712 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6713 GLenum type
, GLvoid
*data
)
6715 GET_CURRENT_CONTEXT(ctx
);
6716 FLUSH_VERTICES(ctx
, 0);
6717 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6720 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6723 GET_CURRENT_CONTEXT(ctx
);
6724 FLUSH_VERTICES(ctx
, 0);
6725 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6728 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6731 GET_CURRENT_CONTEXT(ctx
);
6732 FLUSH_VERTICES(ctx
, 0);
6733 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6736 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6739 GET_CURRENT_CONTEXT(ctx
);
6740 FLUSH_VERTICES(ctx
, 0);
6741 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6744 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6747 GET_CURRENT_CONTEXT(ctx
);
6748 FLUSH_VERTICES(ctx
, 0);
6749 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6752 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6755 GET_CURRENT_CONTEXT(ctx
);
6756 FLUSH_VERTICES(ctx
, 0);
6757 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6760 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6761 GLenum type
, GLvoid
*values
)
6763 GET_CURRENT_CONTEXT(ctx
);
6764 FLUSH_VERTICES(ctx
, 0);
6765 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6768 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6771 GET_CURRENT_CONTEXT(ctx
);
6772 FLUSH_VERTICES(ctx
, 0);
6773 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6776 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6779 GET_CURRENT_CONTEXT(ctx
);
6780 FLUSH_VERTICES(ctx
, 0);
6781 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6784 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6785 GLenum type
, GLvoid
*values
)
6787 GET_CURRENT_CONTEXT(ctx
);
6788 FLUSH_VERTICES(ctx
, 0);
6789 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6792 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6795 GET_CURRENT_CONTEXT(ctx
);
6796 FLUSH_VERTICES(ctx
, 0);
6797 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6800 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6803 GET_CURRENT_CONTEXT(ctx
);
6804 FLUSH_VERTICES(ctx
, 0);
6805 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6808 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6809 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6811 GET_CURRENT_CONTEXT(ctx
);
6812 FLUSH_VERTICES(ctx
, 0);
6813 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6816 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6817 GLsizei width
, GLsizei height
, GLenum format
,
6818 GLenum type
, const GLvoid
*row
,
6819 const GLvoid
*column
)
6821 GET_CURRENT_CONTEXT(ctx
);
6822 FLUSH_VERTICES(ctx
, 0);
6823 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6827 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6829 GET_CURRENT_CONTEXT(ctx
);
6830 FLUSH_VERTICES(ctx
, 0);
6831 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6834 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6836 GET_CURRENT_CONTEXT(ctx
);
6837 FLUSH_VERTICES(ctx
, 0);
6838 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6841 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6842 GLsizei count
, const GLvoid
*ptr
)
6844 GET_CURRENT_CONTEXT(ctx
);
6845 FLUSH_VERTICES(ctx
, 0);
6846 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6849 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6850 const GLboolean
*ptr
)
6852 GET_CURRENT_CONTEXT(ctx
);
6853 FLUSH_VERTICES(ctx
, 0);
6854 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6857 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6860 GET_CURRENT_CONTEXT(ctx
);
6861 FLUSH_VERTICES(ctx
, 0);
6862 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
6865 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6868 GET_CURRENT_CONTEXT(ctx
);
6869 FLUSH_VERTICES(ctx
, 0);
6870 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
6873 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6874 GLsizei count
, const GLvoid
*ptr
)
6876 GET_CURRENT_CONTEXT(ctx
);
6877 FLUSH_VERTICES(ctx
, 0);
6878 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
6881 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6882 GLsizei count
, const GLvoid
*ptr
)
6884 GET_CURRENT_CONTEXT(ctx
);
6885 FLUSH_VERTICES(ctx
, 0);
6886 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
6889 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
6891 GET_CURRENT_CONTEXT(ctx
);
6892 FLUSH_VERTICES(ctx
, 0);
6893 ctx
->Exec
->LockArraysEXT( first
, count
);
6896 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
6898 GET_CURRENT_CONTEXT(ctx
);
6899 FLUSH_VERTICES(ctx
, 0);
6900 ctx
->Exec
->UnlockArraysEXT( );
6903 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
6905 GET_CURRENT_CONTEXT(ctx
);
6906 FLUSH_VERTICES(ctx
, 0);
6907 ctx
->Exec
->ResizeBuffersMESA( );
6911 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
6913 GET_CURRENT_CONTEXT(ctx
);
6914 FLUSH_VERTICES(ctx
, 0);
6915 ctx
->Exec
->ClientActiveTextureARB(target
);
6918 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
6919 GLsizei stride
, const GLvoid
*ptr
)
6921 GET_CURRENT_CONTEXT(ctx
);
6922 FLUSH_VERTICES(ctx
, 0);
6923 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
6926 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
6929 GET_CURRENT_CONTEXT(ctx
);
6930 FLUSH_VERTICES(ctx
, 0);
6931 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
6934 /* GL_EXT_multi_draw_arrays */
6935 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
6936 GLsizei
*count
, GLsizei primcount
)
6938 GET_CURRENT_CONTEXT(ctx
);
6939 FLUSH_VERTICES(ctx
, 0);
6940 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
6943 /* GL_EXT_multi_draw_arrays */
6944 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
6945 GLenum type
, const GLvoid
**indices
,
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
6953 /* GL_IBM_multimode_draw_arrays */
6954 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
6955 const GLsizei
*count
, GLsizei primcount
,
6958 GET_CURRENT_CONTEXT(ctx
);
6959 FLUSH_VERTICES(ctx
, 0);
6960 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
6963 /* GL_IBM_multimode_draw_arrays */
6964 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
6965 const GLsizei
*count
,
6967 const GLvoid
* const *indices
,
6968 GLsizei primcount
, GLint modestride
)
6970 GET_CURRENT_CONTEXT(ctx
);
6971 FLUSH_VERTICES(ctx
, 0);
6972 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
6980 * Setup the given dispatch table to point to Mesa's display list
6981 * building functions.
6983 * This does not include any of the tnl functions - they are
6984 * initialized from _mesa_init_api_defaults and from the active vtxfmt
6988 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
6990 _mesa_init_no_op_table(table
, tableSize
);
6992 _mesa_loopback_init_api_table( table
);
6995 table
->Accum
= save_Accum
;
6996 table
->AlphaFunc
= save_AlphaFunc
;
6997 table
->Bitmap
= save_Bitmap
;
6998 table
->CallList
= _mesa_save_CallList
;
6999 table
->CallLists
= _mesa_save_CallLists
;
7000 table
->Clear
= save_Clear
;
7001 table
->ClearAccum
= save_ClearAccum
;
7002 table
->ClearColor
= save_ClearColor
;
7003 table
->ClearDepth
= save_ClearDepth
;
7004 table
->ClearIndex
= save_ClearIndex
;
7005 table
->ClearStencil
= save_ClearStencil
;
7006 table
->ClipPlane
= save_ClipPlane
;
7007 table
->ColorMask
= save_ColorMask
;
7008 table
->ColorMaterial
= save_ColorMaterial
;
7009 table
->CopyPixels
= save_CopyPixels
;
7010 table
->CullFace
= save_CullFace
;
7011 table
->DeleteLists
= _mesa_DeleteLists
;
7012 table
->DepthFunc
= save_DepthFunc
;
7013 table
->DepthMask
= save_DepthMask
;
7014 table
->DepthRange
= save_DepthRange
;
7015 table
->Disable
= save_Disable
;
7016 table
->DrawBuffer
= save_DrawBuffer
;
7017 table
->DrawPixels
= save_DrawPixels
;
7018 table
->Enable
= save_Enable
;
7019 table
->EndList
= _mesa_EndList
;
7020 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
7021 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7022 table
->Finish
= exec_Finish
;
7023 table
->Flush
= exec_Flush
;
7024 table
->Fogf
= save_Fogf
;
7025 table
->Fogfv
= save_Fogfv
;
7026 table
->Fogi
= save_Fogi
;
7027 table
->Fogiv
= save_Fogiv
;
7028 table
->FrontFace
= save_FrontFace
;
7029 table
->Frustum
= save_Frustum
;
7030 table
->GenLists
= _mesa_GenLists
;
7031 table
->GetBooleanv
= exec_GetBooleanv
;
7032 table
->GetClipPlane
= exec_GetClipPlane
;
7033 table
->GetDoublev
= exec_GetDoublev
;
7034 table
->GetError
= exec_GetError
;
7035 table
->GetFloatv
= exec_GetFloatv
;
7036 table
->GetIntegerv
= exec_GetIntegerv
;
7037 table
->GetLightfv
= exec_GetLightfv
;
7038 table
->GetLightiv
= exec_GetLightiv
;
7039 table
->GetMapdv
= exec_GetMapdv
;
7040 table
->GetMapfv
= exec_GetMapfv
;
7041 table
->GetMapiv
= exec_GetMapiv
;
7042 table
->GetMaterialfv
= exec_GetMaterialfv
;
7043 table
->GetMaterialiv
= exec_GetMaterialiv
;
7044 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7045 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7046 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7047 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7048 table
->GetString
= exec_GetString
;
7049 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7050 table
->GetTexEnviv
= exec_GetTexEnviv
;
7051 table
->GetTexGendv
= exec_GetTexGendv
;
7052 table
->GetTexGenfv
= exec_GetTexGenfv
;
7053 table
->GetTexGeniv
= exec_GetTexGeniv
;
7054 table
->GetTexImage
= exec_GetTexImage
;
7055 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7056 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7057 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7058 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7059 table
->Hint
= save_Hint
;
7060 table
->IndexMask
= save_IndexMask
;
7061 table
->InitNames
= save_InitNames
;
7062 table
->IsEnabled
= exec_IsEnabled
;
7063 table
->IsList
= _mesa_IsList
;
7064 table
->LightModelf
= save_LightModelf
;
7065 table
->LightModelfv
= save_LightModelfv
;
7066 table
->LightModeli
= save_LightModeli
;
7067 table
->LightModeliv
= save_LightModeliv
;
7068 table
->Lightf
= save_Lightf
;
7069 table
->Lightfv
= save_Lightfv
;
7070 table
->Lighti
= save_Lighti
;
7071 table
->Lightiv
= save_Lightiv
;
7072 table
->LineStipple
= save_LineStipple
;
7073 table
->LineWidth
= save_LineWidth
;
7074 table
->ListBase
= save_ListBase
;
7075 table
->LoadIdentity
= save_LoadIdentity
;
7076 table
->LoadMatrixd
= save_LoadMatrixd
;
7077 table
->LoadMatrixf
= save_LoadMatrixf
;
7078 table
->LoadName
= save_LoadName
;
7079 table
->LogicOp
= save_LogicOp
;
7080 table
->Map1d
= save_Map1d
;
7081 table
->Map1f
= save_Map1f
;
7082 table
->Map2d
= save_Map2d
;
7083 table
->Map2f
= save_Map2f
;
7084 table
->MapGrid1d
= save_MapGrid1d
;
7085 table
->MapGrid1f
= save_MapGrid1f
;
7086 table
->MapGrid2d
= save_MapGrid2d
;
7087 table
->MapGrid2f
= save_MapGrid2f
;
7088 table
->MatrixMode
= save_MatrixMode
;
7089 table
->MultMatrixd
= save_MultMatrixd
;
7090 table
->MultMatrixf
= save_MultMatrixf
;
7091 table
->NewList
= save_NewList
;
7092 table
->Ortho
= save_Ortho
;
7093 table
->PassThrough
= save_PassThrough
;
7094 table
->PixelMapfv
= save_PixelMapfv
;
7095 table
->PixelMapuiv
= save_PixelMapuiv
;
7096 table
->PixelMapusv
= save_PixelMapusv
;
7097 table
->PixelStoref
= exec_PixelStoref
;
7098 table
->PixelStorei
= exec_PixelStorei
;
7099 table
->PixelTransferf
= save_PixelTransferf
;
7100 table
->PixelTransferi
= save_PixelTransferi
;
7101 table
->PixelZoom
= save_PixelZoom
;
7102 table
->PointSize
= save_PointSize
;
7103 table
->PolygonMode
= save_PolygonMode
;
7104 table
->PolygonOffset
= save_PolygonOffset
;
7105 table
->PolygonStipple
= save_PolygonStipple
;
7106 table
->PopAttrib
= save_PopAttrib
;
7107 table
->PopMatrix
= save_PopMatrix
;
7108 table
->PopName
= save_PopName
;
7109 table
->PushAttrib
= save_PushAttrib
;
7110 table
->PushMatrix
= save_PushMatrix
;
7111 table
->PushName
= save_PushName
;
7112 table
->RasterPos2d
= save_RasterPos2d
;
7113 table
->RasterPos2dv
= save_RasterPos2dv
;
7114 table
->RasterPos2f
= save_RasterPos2f
;
7115 table
->RasterPos2fv
= save_RasterPos2fv
;
7116 table
->RasterPos2i
= save_RasterPos2i
;
7117 table
->RasterPos2iv
= save_RasterPos2iv
;
7118 table
->RasterPos2s
= save_RasterPos2s
;
7119 table
->RasterPos2sv
= save_RasterPos2sv
;
7120 table
->RasterPos3d
= save_RasterPos3d
;
7121 table
->RasterPos3dv
= save_RasterPos3dv
;
7122 table
->RasterPos3f
= save_RasterPos3f
;
7123 table
->RasterPos3fv
= save_RasterPos3fv
;
7124 table
->RasterPos3i
= save_RasterPos3i
;
7125 table
->RasterPos3iv
= save_RasterPos3iv
;
7126 table
->RasterPos3s
= save_RasterPos3s
;
7127 table
->RasterPos3sv
= save_RasterPos3sv
;
7128 table
->RasterPos4d
= save_RasterPos4d
;
7129 table
->RasterPos4dv
= save_RasterPos4dv
;
7130 table
->RasterPos4f
= save_RasterPos4f
;
7131 table
->RasterPos4fv
= save_RasterPos4fv
;
7132 table
->RasterPos4i
= save_RasterPos4i
;
7133 table
->RasterPos4iv
= save_RasterPos4iv
;
7134 table
->RasterPos4s
= save_RasterPos4s
;
7135 table
->RasterPos4sv
= save_RasterPos4sv
;
7136 table
->ReadBuffer
= save_ReadBuffer
;
7137 table
->ReadPixels
= exec_ReadPixels
;
7138 table
->RenderMode
= exec_RenderMode
;
7139 table
->Rotated
= save_Rotated
;
7140 table
->Rotatef
= save_Rotatef
;
7141 table
->Scaled
= save_Scaled
;
7142 table
->Scalef
= save_Scalef
;
7143 table
->Scissor
= save_Scissor
;
7144 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7145 table
->SelectBuffer
= exec_SelectBuffer
;
7146 table
->ShadeModel
= save_ShadeModel
;
7147 table
->StencilFunc
= save_StencilFunc
;
7148 table
->StencilMask
= save_StencilMask
;
7149 table
->StencilOp
= save_StencilOp
;
7150 table
->TexEnvf
= save_TexEnvf
;
7151 table
->TexEnvfv
= save_TexEnvfv
;
7152 table
->TexEnvi
= save_TexEnvi
;
7153 table
->TexEnviv
= save_TexEnviv
;
7154 table
->TexGend
= save_TexGend
;
7155 table
->TexGendv
= save_TexGendv
;
7156 table
->TexGenf
= save_TexGenf
;
7157 table
->TexGenfv
= save_TexGenfv
;
7158 table
->TexGeni
= save_TexGeni
;
7159 table
->TexGeniv
= save_TexGeniv
;
7160 table
->TexImage1D
= save_TexImage1D
;
7161 table
->TexImage2D
= save_TexImage2D
;
7162 table
->TexParameterf
= save_TexParameterf
;
7163 table
->TexParameterfv
= save_TexParameterfv
;
7164 table
->TexParameteri
= save_TexParameteri
;
7165 table
->TexParameteriv
= save_TexParameteriv
;
7166 table
->Translated
= save_Translated
;
7167 table
->Translatef
= save_Translatef
;
7168 table
->Viewport
= save_Viewport
;
7171 table
->AreTexturesResident
= exec_AreTexturesResident
;
7172 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7173 table
->BindTexture
= save_BindTexture
;
7174 table
->ColorPointer
= exec_ColorPointer
;
7175 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7176 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7177 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7178 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7179 table
->DeleteTextures
= exec_DeleteTextures
;
7180 table
->DisableClientState
= exec_DisableClientState
;
7181 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7182 table
->EnableClientState
= exec_EnableClientState
;
7183 table
->GenTextures
= exec_GenTextures
;
7184 table
->GenTexturesEXT
= exec_GenTextures
;
7185 table
->GetPointerv
= exec_GetPointerv
;
7186 table
->IndexPointer
= exec_IndexPointer
;
7187 table
->InterleavedArrays
= exec_InterleavedArrays
;
7188 table
->IsTexture
= exec_IsTexture
;
7189 table
->IsTextureEXT
= exec_IsTexture
;
7190 table
->NormalPointer
= exec_NormalPointer
;
7191 table
->PopClientAttrib
= exec_PopClientAttrib
;
7192 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7193 table
->PushClientAttrib
= exec_PushClientAttrib
;
7194 table
->TexCoordPointer
= exec_TexCoordPointer
;
7195 table
->TexSubImage1D
= save_TexSubImage1D
;
7196 table
->TexSubImage2D
= save_TexSubImage2D
;
7197 table
->VertexPointer
= exec_VertexPointer
;
7200 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7201 table
->TexImage3D
= save_TexImage3D
;
7202 table
->TexSubImage3D
= save_TexSubImage3D
;
7204 /* GL_ARB_imaging */
7205 /* Not all are supported */
7206 table
->BlendColor
= save_BlendColor
;
7207 table
->BlendEquation
= save_BlendEquation
;
7208 table
->ColorSubTable
= save_ColorSubTable
;
7209 table
->ColorTable
= save_ColorTable
;
7210 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7211 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7212 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7213 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7214 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7215 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7216 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7217 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7218 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7219 table
->CopyColorTable
= save_CopyColorTable
;
7220 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7221 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7222 table
->GetColorTable
= exec_GetColorTable
;
7223 table
->GetColorTableEXT
= exec_GetColorTable
;
7224 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7225 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7226 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7227 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7228 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7229 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7230 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7231 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7232 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7233 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7234 table
->GetHistogram
= exec_GetHistogram
;
7235 table
->GetHistogramEXT
= exec_GetHistogram
;
7236 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7237 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7238 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7239 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7240 table
->GetMinmax
= exec_GetMinmax
;
7241 table
->GetMinmaxEXT
= exec_GetMinmax
;
7242 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7243 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7244 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7245 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7246 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7247 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7248 table
->Histogram
= save_Histogram
;
7249 table
->Minmax
= save_Minmax
;
7250 table
->ResetHistogram
= save_ResetHistogram
;
7251 table
->ResetMinmax
= save_ResetMinmax
;
7252 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7254 /* 2. GL_EXT_blend_color */
7256 table
->BlendColorEXT
= save_BlendColorEXT
;
7259 /* 3. GL_EXT_polygon_offset */
7260 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7262 /* 6. GL_EXT_texture3d */
7264 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7265 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7266 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7269 /* 15. GL_SGIX_pixel_texture */
7270 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7272 /* 15. GL_SGIS_pixel_texture */
7273 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7274 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7275 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7276 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7277 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7278 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7280 /* 30. GL_EXT_vertex_array */
7281 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7282 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7283 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7284 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7285 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7286 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7288 /* 37. GL_EXT_blend_minmax */
7290 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7293 /* 54. GL_EXT_point_parameters */
7294 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7295 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7297 /* 78. GL_EXT_paletted_texture */
7299 table
->ColorTableEXT
= save_ColorTable
;
7300 table
->ColorSubTableEXT
= save_ColorSubTable
;
7302 table
->GetColorTableEXT
= exec_GetColorTable
;
7303 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7304 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7306 /* 97. GL_EXT_compiled_vertex_array */
7307 table
->LockArraysEXT
= exec_LockArraysEXT
;
7308 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7310 /* 145. GL_EXT_secondary_color */
7311 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7313 /* 148. GL_EXT_multi_draw_arrays */
7314 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7315 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7317 /* 149. GL_EXT_fog_coord */
7318 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7320 /* 173. GL_EXT_blend_func_separate */
7321 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7323 /* 196. GL_MESA_resize_buffers */
7324 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7326 /* 197. GL_MESA_window_pos */
7327 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7328 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7329 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7330 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7331 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7332 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7333 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7334 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7335 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7336 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7337 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7338 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7339 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7340 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7341 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7342 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7343 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7344 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7345 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7346 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7347 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7348 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7349 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7350 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7352 /* 200. GL_IBM_multimode_draw_arrays */
7353 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7354 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7356 #if FEATURE_NV_vertex_program
7357 /* 233. GL_NV_vertex_program */
7358 /* The following commands DO NOT go into display lists:
7359 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7360 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7362 table
->BindProgramNV
= save_BindProgramNV
;
7363 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7364 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7365 table
->GenProgramsNV
= _mesa_GenPrograms
;
7366 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7367 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7368 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7369 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7370 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7371 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7372 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7373 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7374 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7375 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7376 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7377 table
->IsProgramNV
= _mesa_IsProgram
;
7378 table
->LoadProgramNV
= save_LoadProgramNV
;
7379 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7380 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7381 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7382 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7383 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7384 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7385 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7386 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7389 /* 282. GL_NV_fragment_program */
7390 #if FEATURE_NV_fragment_program
7391 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7392 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7393 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7394 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7395 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7396 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7397 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7398 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7399 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7400 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7401 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7402 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7405 /* 262. GL_NV_point_sprite */
7406 table
->PointParameteriNV
= save_PointParameteriNV
;
7407 table
->PointParameterivNV
= save_PointParameterivNV
;
7409 /* 268. GL_EXT_stencil_two_side */
7410 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7412 /* ???. GL_EXT_depth_bounds_test */
7413 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7415 /* ARB 1. GL_ARB_multitexture */
7416 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7417 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7419 /* ARB 3. GL_ARB_transpose_matrix */
7420 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7421 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7422 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7423 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7425 /* ARB 5. GL_ARB_multisample */
7426 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7428 /* ARB 12. GL_ARB_texture_compression */
7429 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7430 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7431 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7432 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7433 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7434 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7435 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7437 /* ARB 14. GL_ARB_point_parameters */
7438 /* aliased with EXT_point_parameters functions */
7440 /* ARB 25. GL_ARB_window_pos */
7441 /* aliased with MESA_window_pos functions */
7443 /* ARB 26. GL_ARB_vertex_program */
7444 /* ARB 27. GL_ARB_fragment_program */
7445 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7446 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7447 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7448 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7449 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7450 table
->ProgramStringARB
= save_ProgramStringARB
;
7451 table
->BindProgramNV
= _mesa_BindProgram
;
7452 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7453 table
->GenProgramsNV
= _mesa_GenPrograms
;
7454 table
->IsProgramNV
= _mesa_IsProgram
;
7455 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7456 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7457 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7458 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7459 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7460 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7461 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7462 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7463 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7464 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7465 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7466 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7467 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7468 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7469 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7470 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7471 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7472 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7475 /* ARB 28. GL_ARB_vertex_buffer_object */
7476 #if FEATURE_ARB_vertex_buffer_object
7477 /* None of the extension's functions get compiled */
7478 table
->BindBufferARB
= _mesa_BindBufferARB
;
7479 table
->BufferDataARB
= _mesa_BufferDataARB
;
7480 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7481 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7482 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7483 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7484 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7485 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7486 table
->IsBufferARB
= _mesa_IsBufferARB
;
7487 table
->MapBufferARB
= _mesa_MapBufferARB
;
7488 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7491 /* 299. GL_EXT_blend_equation_separate */
7492 table
->BlendEquationSeparateEXT
= save_BlendEquationSeparateEXT
;
7500 static const char *enum_string( GLenum k
)
7502 return _mesa_lookup_enum_by_nr( k
);
7507 * Print the commands in a display list. For debugging only.
7508 * TODO: many commands aren't handled yet.
7510 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7515 if (!glIsList(list
)) {
7516 _mesa_printf("%u is not a display list ID\n", list
);
7520 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7522 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7524 done
= n
? GL_FALSE
: GL_TRUE
;
7526 OpCode opcode
= n
[0].opcode
;
7527 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
7529 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
7530 ctx
->listext
.opcode
[i
].print(ctx
, &n
[1]);
7531 n
+= ctx
->listext
.opcode
[i
].size
;
7536 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7539 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7540 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7542 case OPCODE_CALL_LIST
:
7543 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7545 case OPCODE_CALL_LIST_OFFSET
:
7546 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7547 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7549 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7550 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7551 enum_string(n
[1].e
), enum_string(n
[2].e
),
7552 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7554 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7555 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7556 enum_string(n
[1].e
), enum_string(n
[2].e
),
7557 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7559 case OPCODE_DISABLE
:
7560 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7563 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7565 case OPCODE_FRUSTUM
:
7566 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7567 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7569 case OPCODE_LINE_STIPPLE
:
7570 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7572 case OPCODE_LOAD_IDENTITY
:
7573 _mesa_printf("LoadIdentity\n");
7575 case OPCODE_LOAD_MATRIX
:
7576 _mesa_printf("LoadMatrix\n");
7577 _mesa_printf(" %8f %8f %8f %8f\n",
7578 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7579 _mesa_printf(" %8f %8f %8f %8f\n",
7580 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7581 _mesa_printf(" %8f %8f %8f %8f\n",
7582 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7583 _mesa_printf(" %8f %8f %8f %8f\n",
7584 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7586 case OPCODE_MULT_MATRIX
:
7587 _mesa_printf("MultMatrix (or Rotate)\n");
7588 _mesa_printf(" %8f %8f %8f %8f\n",
7589 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7590 _mesa_printf(" %8f %8f %8f %8f\n",
7591 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7592 _mesa_printf(" %8f %8f %8f %8f\n",
7593 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7594 _mesa_printf(" %8f %8f %8f %8f\n",
7595 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7598 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7599 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7601 case OPCODE_POP_ATTRIB
:
7602 _mesa_printf("PopAttrib\n");
7604 case OPCODE_POP_MATRIX
:
7605 _mesa_printf("PopMatrix\n");
7607 case OPCODE_POP_NAME
:
7608 _mesa_printf("PopName\n");
7610 case OPCODE_PUSH_ATTRIB
:
7611 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7613 case OPCODE_PUSH_MATRIX
:
7614 _mesa_printf("PushMatrix\n");
7616 case OPCODE_PUSH_NAME
:
7617 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7619 case OPCODE_RASTER_POS
:
7620 _mesa_printf("RasterPos %g %g %g %g\n",
7621 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7624 _mesa_printf("Rotate %g %g %g %g\n",
7625 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7628 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7630 case OPCODE_TRANSLATE
:
7631 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7633 case OPCODE_BIND_TEXTURE
:
7634 _mesa_printf("BindTexture %s %d\n",
7635 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7637 case OPCODE_SHADE_MODEL
:
7638 _mesa_printf("ShadeModel %s\n",
7639 _mesa_lookup_enum_by_nr(n
[1].ui
));
7642 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7643 _mesa_lookup_enum_by_nr(n
[1].ui
),
7644 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7647 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7648 _mesa_lookup_enum_by_nr(n
[1].ui
),
7649 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7650 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7652 case OPCODE_MAPGRID1
:
7653 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7654 n
[1].i
, n
[2].f
, n
[3].f
);
7656 case OPCODE_MAPGRID2
:
7657 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7658 n
[1].i
, n
[2].f
, n
[3].f
,
7659 n
[4].i
, n
[5].f
, n
[6].f
);
7661 case OPCODE_EVALMESH1
:
7662 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7664 case OPCODE_EVALMESH2
:
7665 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7666 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7670 * meta opcodes/commands
7673 _mesa_printf("Error: %s %s\n",
7674 enum_string(n
[1].e
), (const char *)n
[2].data
);
7676 case OPCODE_CONTINUE
:
7677 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7678 n
= (Node
*) n
[1].next
;
7680 case OPCODE_END_OF_LIST
:
7681 _mesa_printf("END-LIST %u\n", list
);
7685 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7686 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7691 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7694 /* increment n to point to next compiled command */
7695 if (opcode
!=OPCODE_CONTINUE
) {
7696 n
+= InstSize
[opcode
];
7705 * Clients may call this function to help debug display list problems.
7706 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7707 * changed, or break in the future without notice.
7709 void mesa_print_display_list( GLuint list
)
7711 GET_CURRENT_CONTEXT(ctx
);
7712 print_list( ctx
, list
);
7716 /**********************************************************************/
7717 /***** Initialization *****/
7718 /**********************************************************************/
7721 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7723 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7724 vfmt
->Begin
= save_Begin
;
7725 vfmt
->CallList
= _mesa_save_CallList
;
7726 vfmt
->CallLists
= _mesa_save_CallLists
;
7727 vfmt
->Color3f
= save_Color3f
;
7728 vfmt
->Color3fv
= save_Color3fv
;
7729 vfmt
->Color4f
= save_Color4f
;
7730 vfmt
->Color4fv
= save_Color4fv
;
7731 vfmt
->EdgeFlag
= save_EdgeFlag
;
7732 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7733 vfmt
->End
= save_End
;
7734 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7735 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7736 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7737 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7738 vfmt
->EvalPoint1
= save_EvalPoint1
;
7739 vfmt
->EvalPoint2
= save_EvalPoint2
;
7740 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7741 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7742 vfmt
->Indexf
= save_Indexf
;
7743 vfmt
->Indexfv
= save_Indexfv
;
7744 vfmt
->Materialfv
= save_Materialfv
;
7745 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7746 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7747 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7748 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7749 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7750 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7751 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7752 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7753 vfmt
->Normal3f
= save_Normal3f
;
7754 vfmt
->Normal3fv
= save_Normal3fv
;
7755 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7756 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7757 vfmt
->TexCoord1f
= save_TexCoord1f
;
7758 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7759 vfmt
->TexCoord2f
= save_TexCoord2f
;
7760 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7761 vfmt
->TexCoord3f
= save_TexCoord3f
;
7762 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7763 vfmt
->TexCoord4f
= save_TexCoord4f
;
7764 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7765 vfmt
->Vertex2f
= save_Vertex2f
;
7766 vfmt
->Vertex2fv
= save_Vertex2fv
;
7767 vfmt
->Vertex3f
= save_Vertex3f
;
7768 vfmt
->Vertex3fv
= save_Vertex3fv
;
7769 vfmt
->Vertex4f
= save_Vertex4f
;
7770 vfmt
->Vertex4fv
= save_Vertex4fv
;
7771 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7772 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7773 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7774 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7775 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7776 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7777 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7778 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7780 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7781 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7782 vfmt
->Rectf
= save_Rectf
;
7784 /* The driver is required to implement these as
7785 * 1) They can probably do a better job.
7786 * 2) A lot of new mechanisms would have to be added to this module
7787 * to support it. That code would probably never get used,
7791 vfmt
->DrawArrays
= 0;
7792 vfmt
->DrawElements
= 0;
7793 vfmt
->DrawRangeElements
= 0;
7799 void _mesa_init_display_list( GLcontext
* ctx
)
7802 ctx
->ListState
.CallDepth
= 0;
7803 ctx
->ExecuteFlag
= GL_TRUE
;
7804 ctx
->CompileFlag
= GL_FALSE
;
7805 ctx
->ListState
.CurrentListPtr
= NULL
;
7806 ctx
->ListState
.CurrentBlock
= NULL
;
7807 ctx
->ListState
.CurrentListNum
= 0;
7808 ctx
->ListState
.CurrentPos
= 0;
7810 /* Display List group */
7811 ctx
->List
.ListBase
= 0;
7813 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);