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_FUNC_SEPARATE
,
175 OPCODE_CALL_LIST_OFFSET
,
181 OPCODE_CLEAR_STENCIL
,
184 OPCODE_COLOR_MATERIAL
,
186 OPCODE_COLOR_TABLE_PARAMETER_FV
,
187 OPCODE_COLOR_TABLE_PARAMETER_IV
,
188 OPCODE_COLOR_SUB_TABLE
,
189 OPCODE_CONVOLUTION_FILTER_1D
,
190 OPCODE_CONVOLUTION_FILTER_2D
,
191 OPCODE_CONVOLUTION_PARAMETER_I
,
192 OPCODE_CONVOLUTION_PARAMETER_IV
,
193 OPCODE_CONVOLUTION_PARAMETER_F
,
194 OPCODE_CONVOLUTION_PARAMETER_FV
,
195 OPCODE_COPY_COLOR_SUB_TABLE
,
196 OPCODE_COPY_COLOR_TABLE
,
198 OPCODE_COPY_TEX_IMAGE1D
,
199 OPCODE_COPY_TEX_IMAGE2D
,
200 OPCODE_COPY_TEX_SUB_IMAGE1D
,
201 OPCODE_COPY_TEX_SUB_IMAGE2D
,
202 OPCODE_COPY_TEX_SUB_IMAGE3D
,
225 OPCODE_LOAD_IDENTITY
,
239 OPCODE_PIXEL_TRANSFER
,
242 OPCODE_POINT_PARAMETERS
,
244 OPCODE_POLYGON_STIPPLE
,
245 OPCODE_POLYGON_OFFSET
,
249 OPCODE_PRIORITIZE_TEXTURE
,
255 OPCODE_RESET_HISTOGRAM
,
256 OPCODE_RESET_MIN_MAX
,
260 OPCODE_SELECT_TEXTURE_SGIS
,
261 OPCODE_SELECT_TEXTURE_COORD_SET
,
272 OPCODE_TEX_SUB_IMAGE1D
,
273 OPCODE_TEX_SUB_IMAGE2D
,
274 OPCODE_TEX_SUB_IMAGE3D
,
278 /* GL_ARB_multitexture */
279 OPCODE_ACTIVE_TEXTURE
,
280 /* GL_SGIX/SGIS_pixel_texture */
281 OPCODE_PIXEL_TEXGEN_SGIX
,
282 OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
,
283 /* GL_ARB_texture_compression */
284 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
285 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
286 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
287 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
288 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
289 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
290 /* GL_ARB_multisample */
291 OPCODE_SAMPLE_COVERAGE
,
292 /* GL_ARB_window_pos */
293 OPCODE_WINDOW_POS_ARB
,
294 /* GL_NV_vertex_program */
295 OPCODE_BIND_PROGRAM_NV
,
296 OPCODE_EXECUTE_PROGRAM_NV
,
297 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
298 OPCODE_LOAD_PROGRAM_NV
,
299 OPCODE_PROGRAM_PARAMETER4F_NV
,
300 OPCODE_TRACK_MATRIX_NV
,
301 /* GL_NV_fragment_program */
302 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
303 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
304 /* GL_EXT_stencil_two_side */
305 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
306 /* GL_EXT_depth_bounds_test */
307 OPCODE_DEPTH_BOUNDS_EXT
,
308 /* GL_ARB_vertex/fragment_program */
309 OPCODE_PROGRAM_STRING_ARB
,
310 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
313 /* Vertex attributes -- fallback for when optimized display
314 * list build isn't active.
332 /* The following three are meta instructions */
333 OPCODE_ERROR
, /* raise compiled-in error */
344 * Display list instructions are stored as sequences of "nodes". Nodes
345 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
346 * are linked together with a pointer.
348 * Each instruction in the display list is stored as a sequence of
349 * contiguous nodes in memory.
350 * Each node is the union of a variety of data types.
364 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
369 * How many nodes to allocate at a time.
371 * \note Reduced now that we hold vertices etc. elsewhere.
373 #define BLOCK_SIZE 256
378 * Number of nodes of storage needed for each instruction.
379 * Sizes for dynamically allocated opcodes are stored in the context struct.
381 static GLuint InstSize
[ OPCODE_END_OF_LIST
+1 ];
383 void mesa_print_display_list( GLuint list
);
386 /**********************************************************************/
387 /***** Private *****/
388 /**********************************************************************/
391 * Make an empty display list. This is used by glGenLists() to
392 * reserver display list IDs.
394 static Node
*make_empty_list( void )
396 Node
*n
= (Node
*) MALLOC( sizeof(Node
) );
397 n
[0].opcode
= OPCODE_END_OF_LIST
;
404 * Destroy all nodes in a display list.
405 * \param list - display list number
407 void _mesa_destroy_list( GLcontext
*ctx
, GLuint list
)
415 block
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
418 done
= block
? GL_FALSE
: GL_TRUE
;
421 /* check for extension opcodes first */
423 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
424 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
425 ctx
->listext
.opcode
[i
].destroy(ctx
, &n
[1]);
426 n
+= ctx
->listext
.opcode
[i
].size
;
429 switch (n
[0].opcode
) {
430 /* for some commands, we need to free malloc'd memory */
433 n
+= InstSize
[n
[0].opcode
];
437 n
+= InstSize
[n
[0].opcode
];
439 case OPCODE_DRAW_PIXELS
:
441 n
+= InstSize
[n
[0].opcode
];
445 n
+= InstSize
[n
[0].opcode
];
447 case OPCODE_COLOR_TABLE
:
449 n
+= InstSize
[n
[0].opcode
];
451 case OPCODE_COLOR_SUB_TABLE
:
453 n
+= InstSize
[n
[0].opcode
];
455 case OPCODE_CONVOLUTION_FILTER_1D
:
457 n
+= InstSize
[n
[0].opcode
];
459 case OPCODE_CONVOLUTION_FILTER_2D
:
461 n
+= InstSize
[n
[0].opcode
];
463 case OPCODE_POLYGON_STIPPLE
:
465 n
+= InstSize
[n
[0].opcode
];
467 case OPCODE_TEX_IMAGE1D
:
469 n
+= InstSize
[n
[0].opcode
];
471 case OPCODE_TEX_IMAGE2D
:
473 n
+= InstSize
[n
[0].opcode
];
475 case OPCODE_TEX_IMAGE3D
:
477 n
+= InstSize
[n
[0].opcode
];
479 case OPCODE_TEX_SUB_IMAGE1D
:
481 n
+= InstSize
[n
[0].opcode
];
483 case OPCODE_TEX_SUB_IMAGE2D
:
485 n
+= InstSize
[n
[0].opcode
];
487 case OPCODE_TEX_SUB_IMAGE3D
:
489 n
+= InstSize
[n
[0].opcode
];
491 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
493 n
+= InstSize
[n
[0].opcode
];
495 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
497 n
+= InstSize
[n
[0].opcode
];
499 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
501 n
+= InstSize
[n
[0].opcode
];
503 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
505 n
+= InstSize
[n
[0].opcode
];
507 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
509 n
+= InstSize
[n
[0].opcode
];
511 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
513 n
+= InstSize
[n
[0].opcode
];
515 #if FEATURE_NV_vertex_program
516 case OPCODE_LOAD_PROGRAM_NV
:
517 FREE(n
[4].data
); /* program string */
518 n
+= InstSize
[n
[0].opcode
];
520 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
521 FREE(n
[2].data
); /* array of program ids */
522 n
+= InstSize
[n
[0].opcode
];
525 #if FEATURE_NV_fragment_program
526 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
527 FREE(n
[3].data
); /* parameter name */
528 n
+= InstSize
[n
[0].opcode
];
531 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
532 case OPCODE_PROGRAM_STRING_ARB
:
533 FREE(n
[4].data
); /* program string */
534 n
+= InstSize
[n
[0].opcode
];
537 case OPCODE_CONTINUE
:
538 n
= (Node
*) n
[1].next
;
542 case OPCODE_END_OF_LIST
:
547 /* Most frequent case */
548 n
+= InstSize
[n
[0].opcode
];
554 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
560 * Translate the nth element of list from type to GLuint.
562 static GLuint
translate_id( GLsizei n
, GLenum type
, const GLvoid
*list
)
574 bptr
= (GLbyte
*) list
;
575 return (GLuint
) *(bptr
+n
);
576 case GL_UNSIGNED_BYTE
:
577 ubptr
= (GLubyte
*) list
;
578 return (GLuint
) *(ubptr
+n
);
580 sptr
= (GLshort
*) list
;
581 return (GLuint
) *(sptr
+n
);
582 case GL_UNSIGNED_SHORT
:
583 usptr
= (GLushort
*) list
;
584 return (GLuint
) *(usptr
+n
);
586 iptr
= (GLint
*) list
;
587 return (GLuint
) *(iptr
+n
);
588 case GL_UNSIGNED_INT
:
589 uiptr
= (GLuint
*) list
;
590 return (GLuint
) *(uiptr
+n
);
592 fptr
= (GLfloat
*) list
;
593 return (GLuint
) *(fptr
+n
);
595 ubptr
= ((GLubyte
*) list
) + 2*n
;
596 return (GLuint
) *ubptr
* 256 + (GLuint
) *(ubptr
+1);
598 ubptr
= ((GLubyte
*) list
) + 3*n
;
599 return (GLuint
) *ubptr
* 65536
600 + (GLuint
) *(ubptr
+1) * 256
601 + (GLuint
) *(ubptr
+2);
603 ubptr
= ((GLubyte
*) list
) + 4*n
;
604 return (GLuint
) *ubptr
* 16777216
605 + (GLuint
) *(ubptr
+1) * 65536
606 + (GLuint
) *(ubptr
+2) * 256
607 + (GLuint
) *(ubptr
+3);
616 /**********************************************************************/
618 /**********************************************************************/
620 void _mesa_init_lists( void )
622 static int init_flag
= 0;
625 InstSize
[OPCODE_ACCUM
] = 3;
626 InstSize
[OPCODE_ALPHA_FUNC
] = 3;
627 InstSize
[OPCODE_BIND_TEXTURE
] = 3;
628 InstSize
[OPCODE_BITMAP
] = 8;
629 InstSize
[OPCODE_BLEND_COLOR
] = 5;
630 InstSize
[OPCODE_BLEND_EQUATION
] = 2;
631 InstSize
[OPCODE_BLEND_FUNC_SEPARATE
] = 5;
632 InstSize
[OPCODE_CALL_LIST
] = 2;
633 InstSize
[OPCODE_CALL_LIST_OFFSET
] = 3;
634 InstSize
[OPCODE_CLEAR
] = 2;
635 InstSize
[OPCODE_CLEAR_ACCUM
] = 5;
636 InstSize
[OPCODE_CLEAR_COLOR
] = 5;
637 InstSize
[OPCODE_CLEAR_DEPTH
] = 2;
638 InstSize
[OPCODE_CLEAR_INDEX
] = 2;
639 InstSize
[OPCODE_CLEAR_STENCIL
] = 2;
640 InstSize
[OPCODE_CLIP_PLANE
] = 6;
641 InstSize
[OPCODE_COLOR_MASK
] = 5;
642 InstSize
[OPCODE_COLOR_MATERIAL
] = 3;
643 InstSize
[OPCODE_COLOR_TABLE
] = 7;
644 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_FV
] = 7;
645 InstSize
[OPCODE_COLOR_TABLE_PARAMETER_IV
] = 7;
646 InstSize
[OPCODE_COLOR_SUB_TABLE
] = 7;
647 InstSize
[OPCODE_CONVOLUTION_FILTER_1D
] = 7;
648 InstSize
[OPCODE_CONVOLUTION_FILTER_2D
] = 8;
649 InstSize
[OPCODE_CONVOLUTION_PARAMETER_I
] = 4;
650 InstSize
[OPCODE_CONVOLUTION_PARAMETER_IV
] = 7;
651 InstSize
[OPCODE_CONVOLUTION_PARAMETER_F
] = 4;
652 InstSize
[OPCODE_CONVOLUTION_PARAMETER_FV
] = 7;
653 InstSize
[OPCODE_COPY_PIXELS
] = 6;
654 InstSize
[OPCODE_COPY_COLOR_SUB_TABLE
] = 6;
655 InstSize
[OPCODE_COPY_COLOR_TABLE
] = 6;
656 InstSize
[OPCODE_COPY_TEX_IMAGE1D
] = 8;
657 InstSize
[OPCODE_COPY_TEX_IMAGE2D
] = 9;
658 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE1D
] = 7;
659 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE2D
] = 9;
660 InstSize
[OPCODE_COPY_TEX_SUB_IMAGE3D
] = 10;
661 InstSize
[OPCODE_CULL_FACE
] = 2;
662 InstSize
[OPCODE_DEPTH_FUNC
] = 2;
663 InstSize
[OPCODE_DEPTH_MASK
] = 2;
664 InstSize
[OPCODE_DEPTH_RANGE
] = 3;
665 InstSize
[OPCODE_DISABLE
] = 2;
666 InstSize
[OPCODE_DRAW_BUFFER
] = 2;
667 InstSize
[OPCODE_DRAW_PIXELS
] = 6;
668 InstSize
[OPCODE_ENABLE
] = 2;
669 InstSize
[OPCODE_EVALMESH1
] = 4;
670 InstSize
[OPCODE_EVALMESH2
] = 6;
671 InstSize
[OPCODE_FOG
] = 6;
672 InstSize
[OPCODE_FRONT_FACE
] = 2;
673 InstSize
[OPCODE_FRUSTUM
] = 7;
674 InstSize
[OPCODE_HINT
] = 3;
675 InstSize
[OPCODE_HISTOGRAM
] = 5;
676 InstSize
[OPCODE_INDEX_MASK
] = 2;
677 InstSize
[OPCODE_INIT_NAMES
] = 1;
678 InstSize
[OPCODE_LIGHT
] = 7;
679 InstSize
[OPCODE_LIGHT_MODEL
] = 6;
680 InstSize
[OPCODE_LINE_STIPPLE
] = 3;
681 InstSize
[OPCODE_LINE_WIDTH
] = 2;
682 InstSize
[OPCODE_LIST_BASE
] = 2;
683 InstSize
[OPCODE_LOAD_IDENTITY
] = 1;
684 InstSize
[OPCODE_LOAD_MATRIX
] = 17;
685 InstSize
[OPCODE_LOAD_NAME
] = 2;
686 InstSize
[OPCODE_LOGIC_OP
] = 2;
687 InstSize
[OPCODE_MAP1
] = 7;
688 InstSize
[OPCODE_MAP2
] = 11;
689 InstSize
[OPCODE_MAPGRID1
] = 4;
690 InstSize
[OPCODE_MAPGRID2
] = 7;
691 InstSize
[OPCODE_MATRIX_MODE
] = 2;
692 InstSize
[OPCODE_MIN_MAX
] = 4;
693 InstSize
[OPCODE_MULT_MATRIX
] = 17;
694 InstSize
[OPCODE_ORTHO
] = 7;
695 InstSize
[OPCODE_PASSTHROUGH
] = 2;
696 InstSize
[OPCODE_PIXEL_MAP
] = 4;
697 InstSize
[OPCODE_PIXEL_TRANSFER
] = 3;
698 InstSize
[OPCODE_PIXEL_ZOOM
] = 3;
699 InstSize
[OPCODE_POINT_SIZE
] = 2;
700 InstSize
[OPCODE_POINT_PARAMETERS
] = 5;
701 InstSize
[OPCODE_POLYGON_MODE
] = 3;
702 InstSize
[OPCODE_POLYGON_STIPPLE
] = 2;
703 InstSize
[OPCODE_POLYGON_OFFSET
] = 3;
704 InstSize
[OPCODE_POP_ATTRIB
] = 1;
705 InstSize
[OPCODE_POP_MATRIX
] = 1;
706 InstSize
[OPCODE_POP_NAME
] = 1;
707 InstSize
[OPCODE_PRIORITIZE_TEXTURE
] = 3;
708 InstSize
[OPCODE_PUSH_ATTRIB
] = 2;
709 InstSize
[OPCODE_PUSH_MATRIX
] = 1;
710 InstSize
[OPCODE_PUSH_NAME
] = 2;
711 InstSize
[OPCODE_RASTER_POS
] = 5;
712 InstSize
[OPCODE_READ_BUFFER
] = 2;
713 InstSize
[OPCODE_RESET_HISTOGRAM
] = 2;
714 InstSize
[OPCODE_RESET_MIN_MAX
] = 2;
715 InstSize
[OPCODE_ROTATE
] = 5;
716 InstSize
[OPCODE_SCALE
] = 4;
717 InstSize
[OPCODE_SCISSOR
] = 5;
718 InstSize
[OPCODE_STENCIL_FUNC
] = 4;
719 InstSize
[OPCODE_STENCIL_MASK
] = 2;
720 InstSize
[OPCODE_STENCIL_OP
] = 4;
721 InstSize
[OPCODE_SHADE_MODEL
] = 2;
722 InstSize
[OPCODE_TEXENV
] = 7;
723 InstSize
[OPCODE_TEXGEN
] = 7;
724 InstSize
[OPCODE_TEXPARAMETER
] = 7;
725 InstSize
[OPCODE_TEX_IMAGE1D
] = 9;
726 InstSize
[OPCODE_TEX_IMAGE2D
] = 10;
727 InstSize
[OPCODE_TEX_IMAGE3D
] = 11;
728 InstSize
[OPCODE_TEX_SUB_IMAGE1D
] = 8;
729 InstSize
[OPCODE_TEX_SUB_IMAGE2D
] = 10;
730 InstSize
[OPCODE_TEX_SUB_IMAGE3D
] = 12;
731 InstSize
[OPCODE_TRANSLATE
] = 4;
732 InstSize
[OPCODE_VIEWPORT
] = 5;
733 InstSize
[OPCODE_WINDOW_POS
] = 5;
734 InstSize
[OPCODE_CONTINUE
] = 2;
735 InstSize
[OPCODE_ERROR
] = 3;
736 InstSize
[OPCODE_END_OF_LIST
] = 1;
737 /* GL_SGIX/SGIS_pixel_texture */
738 InstSize
[OPCODE_PIXEL_TEXGEN_SGIX
] = 2;
739 InstSize
[OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
] = 3;
740 /* GL_ARB_texture_compression */
741 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_1D
] = 8;
742 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_2D
] = 9;
743 InstSize
[OPCODE_COMPRESSED_TEX_IMAGE_3D
] = 10;
744 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
] = 8;
745 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
] = 10;
746 InstSize
[OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
] = 12;
747 /* GL_ARB_multisample */
748 InstSize
[OPCODE_SAMPLE_COVERAGE
] = 3;
749 /* GL_ARB_multitexture */
750 InstSize
[OPCODE_ACTIVE_TEXTURE
] = 2;
751 /* GL_ARB_window_pos */
752 InstSize
[OPCODE_WINDOW_POS_ARB
] = 4;
753 /* GL_NV_vertex_program */
754 InstSize
[OPCODE_BIND_PROGRAM_NV
] = 3;
755 InstSize
[OPCODE_EXECUTE_PROGRAM_NV
] = 7;
756 InstSize
[OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
] = 2;
757 InstSize
[OPCODE_LOAD_PROGRAM_NV
] = 5;
758 InstSize
[OPCODE_PROGRAM_PARAMETER4F_NV
] = 7;
759 InstSize
[OPCODE_TRACK_MATRIX_NV
] = 5;
760 /* GL_NV_fragment_program */
761 InstSize
[OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
] = 7;
762 InstSize
[OPCODE_PROGRAM_NAMED_PARAMETER_NV
] = 8;
763 /* GL_EXT_stencil_two_side */
764 InstSize
[OPCODE_ACTIVE_STENCIL_FACE_EXT
] = 2;
765 /* GL_EXT_depth_bounds_test */
766 InstSize
[OPCODE_DEPTH_BOUNDS_EXT
] = 3;
767 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
768 InstSize
[OPCODE_PROGRAM_STRING_ARB
] = 5;
769 InstSize
[OPCODE_PROGRAM_ENV_PARAMETER_ARB
] = 7;
771 InstSize
[OPCODE_ATTR_1F
] = 3;
772 InstSize
[OPCODE_ATTR_2F
] = 4;
773 InstSize
[OPCODE_ATTR_3F
] = 5;
774 InstSize
[OPCODE_ATTR_4F
] = 6;
775 InstSize
[OPCODE_MATERIAL
] = 7;
776 InstSize
[OPCODE_INDEX
] = 2;
777 InstSize
[OPCODE_EDGEFLAG
] = 2;
778 InstSize
[OPCODE_BEGIN
] = 2;
779 InstSize
[OPCODE_END
] = 1;
780 InstSize
[OPCODE_RECTF
] = 5;
781 InstSize
[OPCODE_EVAL_C1
] = 2;
782 InstSize
[OPCODE_EVAL_C2
] = 3;
783 InstSize
[OPCODE_EVAL_P1
] = 2;
784 InstSize
[OPCODE_EVAL_P2
] = 3;
791 * Allocate space for a display list instruction.
792 * \param opcode - type of instruction
793 * argcount - size in bytes of data required.
794 * \return pointer to the usable data area (not including the internal
798 _mesa_alloc_instruction( GLcontext
*ctx
, int opcode
, GLint sz
)
801 GLuint count
= 1 + (sz
+ sizeof(Node
) - 1) / sizeof(Node
);
804 if (opcode
< (int) OPCODE_DRV_0
) {
805 assert( count
== InstSize
[opcode
] );
809 if (ctx
->ListState
.CurrentPos
+ count
+ 2 > BLOCK_SIZE
) {
810 /* This block is full. Allocate a new block and chain to it */
811 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
812 n
[0].opcode
= OPCODE_CONTINUE
;
813 newblock
= (Node
*) MALLOC( sizeof(Node
) * BLOCK_SIZE
);
815 _mesa_error( ctx
, GL_OUT_OF_MEMORY
, "Building display list" );
818 n
[1].next
= (Node
*) newblock
;
819 ctx
->ListState
.CurrentBlock
= newblock
;
820 ctx
->ListState
.CurrentPos
= 0;
823 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
824 ctx
->ListState
.CurrentPos
+= count
;
826 n
[0].opcode
= (OpCode
) opcode
;
828 return (void *)&n
[1];
832 /* Allow modules and drivers to get their own opcodes.
835 _mesa_alloc_opcode( GLcontext
*ctx
,
837 void (*execute
)( GLcontext
*, void * ),
838 void (*destroy
)( GLcontext
*, void * ),
839 void (*print
)( GLcontext
*, void * ) )
841 if (ctx
->listext
.nr_opcodes
< GL_MAX_EXT_OPCODES
) {
842 GLuint i
= ctx
->listext
.nr_opcodes
++;
843 ctx
->listext
.opcode
[i
].size
= 1 + (sz
+ sizeof(Node
) - 1)/sizeof(Node
);
844 ctx
->listext
.opcode
[i
].execute
= execute
;
845 ctx
->listext
.opcode
[i
].destroy
= destroy
;
846 ctx
->listext
.opcode
[i
].print
= print
;
847 return i
+ OPCODE_DRV_0
;
854 /* Mimic the old behaviour of alloc_instruction:
855 * - sz is in units of sizeof(Node)
856 * - return value a pointer to sizeof(Node) before the actual
859 #define ALLOC_INSTRUCTION(ctx, opcode, sz) \
860 ((Node *)_mesa_alloc_instruction(ctx, opcode, sz*sizeof(Node)) - 1)
865 * Display List compilation functions
867 static void GLAPIENTRY
save_Accum( GLenum op
, GLfloat value
)
869 GET_CURRENT_CONTEXT(ctx
);
871 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
872 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACCUM
, 2 );
877 if (ctx
->ExecuteFlag
) {
878 (*ctx
->Exec
->Accum
)( op
, value
);
883 static void GLAPIENTRY
save_AlphaFunc( GLenum func
, GLclampf ref
)
885 GET_CURRENT_CONTEXT(ctx
);
887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
888 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ALPHA_FUNC
, 2 );
891 n
[2].f
= (GLfloat
) ref
;
893 if (ctx
->ExecuteFlag
) {
894 (*ctx
->Exec
->AlphaFunc
)( func
, ref
);
899 static void GLAPIENTRY
save_BindTexture( GLenum target
, GLuint texture
)
901 GET_CURRENT_CONTEXT(ctx
);
903 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
904 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_TEXTURE
, 2 );
909 if (ctx
->ExecuteFlag
) {
910 (*ctx
->Exec
->BindTexture
)( target
, texture
);
915 static void GLAPIENTRY
save_Bitmap( GLsizei width
, GLsizei height
,
916 GLfloat xorig
, GLfloat yorig
,
917 GLfloat xmove
, GLfloat ymove
,
918 const GLubyte
*pixels
)
920 GET_CURRENT_CONTEXT(ctx
);
921 GLvoid
*image
= _mesa_unpack_bitmap( width
, height
, pixels
, &ctx
->Unpack
);
923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
924 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BITMAP
, 7 );
926 n
[1].i
= (GLint
) width
;
927 n
[2].i
= (GLint
) height
;
937 if (ctx
->ExecuteFlag
) {
938 (*ctx
->Exec
->Bitmap
)( width
, height
,
939 xorig
, yorig
, xmove
, ymove
, pixels
);
944 static void GLAPIENTRY
save_BlendEquation( GLenum mode
)
946 GET_CURRENT_CONTEXT(ctx
);
948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
949 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_EQUATION
, 1 );
953 if (ctx
->ExecuteFlag
) {
954 (*ctx
->Exec
->BlendEquation
)( mode
);
959 static void GLAPIENTRY
save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
960 GLenum sfactorA
, GLenum dfactorA
)
962 GET_CURRENT_CONTEXT(ctx
);
964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
965 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4 );
972 if (ctx
->ExecuteFlag
) {
973 (*ctx
->Exec
->BlendFuncSeparateEXT
)( sfactorRGB
, dfactorRGB
,
979 static void GLAPIENTRY
save_BlendColor( GLfloat red
, GLfloat green
,
980 GLfloat blue
, GLfloat alpha
)
982 GET_CURRENT_CONTEXT(ctx
);
984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
985 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BLEND_COLOR
, 4 );
992 if (ctx
->ExecuteFlag
) {
993 (*ctx
->Exec
->BlendColor
)( red
, green
, blue
, alpha
);
998 void GLAPIENTRY
_mesa_save_CallList( GLuint list
)
1000 GET_CURRENT_CONTEXT(ctx
);
1002 SAVE_FLUSH_VERTICES(ctx
);
1004 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST
, 1 );
1009 /* After this, we don't know what begin/end state we're in:
1011 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1013 if (ctx
->ExecuteFlag
) {
1014 (*ctx
->Exec
->CallList
)( list
);
1019 void GLAPIENTRY
_mesa_save_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
1021 GET_CURRENT_CONTEXT(ctx
);
1023 GLboolean typeErrorFlag
;
1025 SAVE_FLUSH_VERTICES(ctx
);
1029 case GL_UNSIGNED_BYTE
:
1031 case GL_UNSIGNED_SHORT
:
1033 case GL_UNSIGNED_INT
:
1038 typeErrorFlag
= GL_FALSE
;
1041 typeErrorFlag
= GL_TRUE
;
1045 GLuint list
= translate_id( i
, type
, lists
);
1046 Node
*n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CALL_LIST_OFFSET
, 2 );
1049 n
[2].b
= typeErrorFlag
;
1053 /* After this, we don't know what begin/end state we're in:
1055 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1057 if (ctx
->ExecuteFlag
) {
1058 (*ctx
->Exec
->CallLists
)( n
, type
, lists
);
1063 static void GLAPIENTRY
save_Clear( GLbitfield mask
)
1065 GET_CURRENT_CONTEXT(ctx
);
1067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1068 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR
, 1 );
1072 if (ctx
->ExecuteFlag
) {
1073 (*ctx
->Exec
->Clear
)( mask
);
1078 static void GLAPIENTRY
save_ClearAccum( GLfloat red
, GLfloat green
,
1079 GLfloat blue
, GLfloat alpha
)
1081 GET_CURRENT_CONTEXT(ctx
);
1083 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1084 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_ACCUM
, 4 );
1091 if (ctx
->ExecuteFlag
) {
1092 (*ctx
->Exec
->ClearAccum
)( red
, green
, blue
, alpha
);
1097 static void GLAPIENTRY
save_ClearColor( GLclampf red
, GLclampf green
,
1098 GLclampf blue
, GLclampf alpha
)
1100 GET_CURRENT_CONTEXT(ctx
);
1102 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1103 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_COLOR
, 4 );
1110 if (ctx
->ExecuteFlag
) {
1111 (*ctx
->Exec
->ClearColor
)( red
, green
, blue
, alpha
);
1116 static void GLAPIENTRY
save_ClearDepth( GLclampd depth
)
1118 GET_CURRENT_CONTEXT(ctx
);
1120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1121 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_DEPTH
, 1 );
1123 n
[1].f
= (GLfloat
) depth
;
1125 if (ctx
->ExecuteFlag
) {
1126 (*ctx
->Exec
->ClearDepth
)( depth
);
1131 static void GLAPIENTRY
save_ClearIndex( GLfloat c
)
1133 GET_CURRENT_CONTEXT(ctx
);
1135 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1136 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_INDEX
, 1 );
1140 if (ctx
->ExecuteFlag
) {
1141 (*ctx
->Exec
->ClearIndex
)( c
);
1146 static void GLAPIENTRY
save_ClearStencil( GLint s
)
1148 GET_CURRENT_CONTEXT(ctx
);
1150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1151 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLEAR_STENCIL
, 1 );
1155 if (ctx
->ExecuteFlag
) {
1156 (*ctx
->Exec
->ClearStencil
)( s
);
1161 static void GLAPIENTRY
save_ClipPlane( GLenum plane
, const GLdouble
*equ
)
1163 GET_CURRENT_CONTEXT(ctx
);
1165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1166 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CLIP_PLANE
, 5 );
1169 n
[2].f
= (GLfloat
) equ
[0];
1170 n
[3].f
= (GLfloat
) equ
[1];
1171 n
[4].f
= (GLfloat
) equ
[2];
1172 n
[5].f
= (GLfloat
) equ
[3];
1174 if (ctx
->ExecuteFlag
) {
1175 (*ctx
->Exec
->ClipPlane
)( plane
, equ
);
1181 static void GLAPIENTRY
save_ColorMask( GLboolean red
, GLboolean green
,
1182 GLboolean blue
, GLboolean alpha
)
1184 GET_CURRENT_CONTEXT(ctx
);
1186 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1187 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MASK
, 4 );
1194 if (ctx
->ExecuteFlag
) {
1195 (*ctx
->Exec
->ColorMask
)( red
, green
, blue
, alpha
);
1200 static void GLAPIENTRY
save_ColorMaterial( GLenum face
, GLenum mode
)
1202 GET_CURRENT_CONTEXT(ctx
);
1204 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1206 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_MATERIAL
, 2 );
1211 if (ctx
->ExecuteFlag
) {
1212 (*ctx
->Exec
->ColorMaterial
)( face
, mode
);
1217 static void GLAPIENTRY
save_ColorTable( GLenum target
, GLenum internalFormat
,
1218 GLsizei width
, GLenum format
, GLenum type
,
1219 const GLvoid
*table
)
1221 GET_CURRENT_CONTEXT(ctx
);
1222 if (target
== GL_PROXY_TEXTURE_1D
||
1223 target
== GL_PROXY_TEXTURE_2D
||
1224 target
== GL_PROXY_TEXTURE_3D
||
1225 target
== GL_PROXY_TEXTURE_CUBE_MAP_ARB
) {
1226 /* execute immediately */
1227 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1228 format
, type
, table
);
1231 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, table
,
1234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1235 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE
, 6 );
1238 n
[2].e
= internalFormat
;
1247 if (ctx
->ExecuteFlag
) {
1248 (*ctx
->Exec
->ColorTable
)( target
, internalFormat
, width
,
1249 format
, type
, table
);
1256 static void GLAPIENTRY
1257 save_ColorTableParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1259 GET_CURRENT_CONTEXT(ctx
);
1262 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1264 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6 );
1269 if (pname
== GL_COLOR_TABLE_SGI
||
1270 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1271 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1272 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1279 if (ctx
->ExecuteFlag
) {
1280 (*ctx
->Exec
->ColorTableParameterfv
)( target
, pname
, params
);
1285 static void GLAPIENTRY
1286 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1288 GET_CURRENT_CONTEXT(ctx
);
1291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1293 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6 );
1298 if (pname
== GL_COLOR_TABLE_SGI
||
1299 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1300 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1301 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1308 if (ctx
->ExecuteFlag
) {
1309 (*ctx
->Exec
->ColorTableParameteriv
)( target
, pname
, params
);
1315 static void GLAPIENTRY
save_ColorSubTable( GLenum target
, GLsizei start
, GLsizei count
,
1316 GLenum format
, GLenum type
,
1317 const GLvoid
*table
)
1319 GET_CURRENT_CONTEXT(ctx
);
1320 GLvoid
*image
= _mesa_unpack_image(count
, 1, 1, format
, type
, table
,
1323 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1324 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COLOR_SUB_TABLE
, 6 );
1336 if (ctx
->ExecuteFlag
) {
1337 (*ctx
->Exec
->ColorSubTable
)(target
, start
, count
, format
, type
, table
);
1342 static void GLAPIENTRY
1343 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1344 GLint x
, GLint y
, GLsizei width
)
1346 GET_CURRENT_CONTEXT(ctx
);
1349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5 );
1358 if (ctx
->ExecuteFlag
) {
1359 (*ctx
->Exec
->CopyColorSubTable
)(target
, start
, x
, y
, width
);
1364 static void GLAPIENTRY
1365 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1366 GLint x
, GLint y
, GLsizei width
)
1368 GET_CURRENT_CONTEXT(ctx
);
1371 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1372 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_COLOR_TABLE
, 5 );
1375 n
[2].e
= internalformat
;
1380 if (ctx
->ExecuteFlag
) {
1381 (*ctx
->Exec
->CopyColorTable
)(target
, internalformat
, x
, y
, width
);
1386 static void GLAPIENTRY
1387 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1388 GLenum format
, GLenum type
, const GLvoid
*filter
)
1390 GET_CURRENT_CONTEXT(ctx
);
1391 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
, filter
,
1394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1395 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6 );
1398 n
[2].e
= internalFormat
;
1407 if (ctx
->ExecuteFlag
) {
1408 (*ctx
->Exec
->ConvolutionFilter1D
)( target
, internalFormat
, width
,
1409 format
, type
, filter
);
1414 static void GLAPIENTRY
1415 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1416 GLsizei width
, GLsizei height
, GLenum format
,
1417 GLenum type
, const GLvoid
*filter
)
1419 GET_CURRENT_CONTEXT(ctx
);
1420 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
, filter
,
1423 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1424 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7 );
1427 n
[2].e
= internalFormat
;
1437 if (ctx
->ExecuteFlag
) {
1438 (*ctx
->Exec
->ConvolutionFilter2D
)( target
, internalFormat
, width
, height
,
1439 format
, type
, filter
);
1444 static void GLAPIENTRY
1445 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1447 GET_CURRENT_CONTEXT(ctx
);
1449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1450 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3 );
1456 if (ctx
->ExecuteFlag
) {
1457 (*ctx
->Exec
->ConvolutionParameteri
)( target
, pname
, param
);
1462 static void GLAPIENTRY
1463 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1465 GET_CURRENT_CONTEXT(ctx
);
1467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1468 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6 );
1473 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1474 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1475 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1481 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1484 if (ctx
->ExecuteFlag
) {
1485 (*ctx
->Exec
->ConvolutionParameteriv
)( target
, pname
, params
);
1490 static void GLAPIENTRY
1491 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1493 GET_CURRENT_CONTEXT(ctx
);
1495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1496 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3 );
1502 if (ctx
->ExecuteFlag
) {
1503 (*ctx
->Exec
->ConvolutionParameterf
)( target
, pname
, param
);
1508 static void GLAPIENTRY
1509 save_ConvolutionParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
1511 GET_CURRENT_CONTEXT(ctx
);
1513 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1514 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6 );
1519 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1520 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1521 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1527 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1530 if (ctx
->ExecuteFlag
) {
1531 (*ctx
->Exec
->ConvolutionParameterfv
)( target
, pname
, params
);
1536 static void GLAPIENTRY
1537 save_CopyPixels( GLint x
, GLint y
,
1538 GLsizei width
, GLsizei height
, GLenum type
)
1540 GET_CURRENT_CONTEXT(ctx
);
1542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1543 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_PIXELS
, 5 );
1547 n
[3].i
= (GLint
) width
;
1548 n
[4].i
= (GLint
) height
;
1551 if (ctx
->ExecuteFlag
) {
1552 (*ctx
->Exec
->CopyPixels
)( x
, y
, width
, height
, type
);
1558 static void GLAPIENTRY
1559 save_CopyTexImage1D( GLenum target
, GLint level
, GLenum internalformat
,
1560 GLint x
, GLint y
, GLsizei width
, GLint border
)
1562 GET_CURRENT_CONTEXT(ctx
);
1564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1565 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7 );
1569 n
[3].e
= internalformat
;
1575 if (ctx
->ExecuteFlag
) {
1576 (*ctx
->Exec
->CopyTexImage1D
)( target
, level
, internalformat
,
1577 x
, y
, width
, border
);
1582 static void GLAPIENTRY
1583 save_CopyTexImage2D( GLenum target
, GLint level
,
1584 GLenum internalformat
,
1585 GLint x
, GLint y
, GLsizei width
,
1586 GLsizei height
, GLint border
)
1588 GET_CURRENT_CONTEXT(ctx
);
1590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1591 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8 );
1595 n
[3].e
= internalformat
;
1602 if (ctx
->ExecuteFlag
) {
1603 (*ctx
->Exec
->CopyTexImage2D
)( target
, level
, internalformat
,
1604 x
, y
, width
, height
, border
);
1610 static void GLAPIENTRY
1611 save_CopyTexSubImage1D( GLenum target
, GLint level
,
1612 GLint xoffset
, GLint x
, GLint y
,
1615 GET_CURRENT_CONTEXT(ctx
);
1617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1618 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6 );
1627 if (ctx
->ExecuteFlag
) {
1628 (*ctx
->Exec
->CopyTexSubImage1D
)( target
, level
, xoffset
, x
, y
, width
);
1633 static void GLAPIENTRY
1634 save_CopyTexSubImage2D( GLenum target
, GLint level
,
1635 GLint xoffset
, GLint yoffset
,
1637 GLsizei width
, GLint height
)
1639 GET_CURRENT_CONTEXT(ctx
);
1641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1642 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8 );
1653 if (ctx
->ExecuteFlag
) {
1654 (*ctx
->Exec
->CopyTexSubImage2D
)( target
, level
, xoffset
, yoffset
,
1655 x
, y
, width
, height
);
1660 static void GLAPIENTRY
1661 save_CopyTexSubImage3D( GLenum target
, GLint level
,
1662 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1664 GLsizei width
, GLint height
)
1666 GET_CURRENT_CONTEXT(ctx
);
1668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1669 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9 );
1681 if (ctx
->ExecuteFlag
) {
1682 (*ctx
->Exec
->CopyTexSubImage3D
)( target
, level
,
1683 xoffset
, yoffset
, zoffset
,
1684 x
, y
, width
, height
);
1689 static void GLAPIENTRY
save_CullFace( GLenum mode
)
1691 GET_CURRENT_CONTEXT(ctx
);
1693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1694 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_CULL_FACE
, 1 );
1698 if (ctx
->ExecuteFlag
) {
1699 (*ctx
->Exec
->CullFace
)( mode
);
1704 static void GLAPIENTRY
save_DepthFunc( GLenum func
)
1706 GET_CURRENT_CONTEXT(ctx
);
1708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1709 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_FUNC
, 1 );
1713 if (ctx
->ExecuteFlag
) {
1714 (*ctx
->Exec
->DepthFunc
)( func
);
1719 static void GLAPIENTRY
save_DepthMask( GLboolean mask
)
1721 GET_CURRENT_CONTEXT(ctx
);
1723 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1724 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_MASK
, 1 );
1728 if (ctx
->ExecuteFlag
) {
1729 (*ctx
->Exec
->DepthMask
)( mask
);
1734 static void GLAPIENTRY
save_DepthRange( GLclampd nearval
, GLclampd farval
)
1736 GET_CURRENT_CONTEXT(ctx
);
1738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1739 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DEPTH_RANGE
, 2 );
1741 n
[1].f
= (GLfloat
) nearval
;
1742 n
[2].f
= (GLfloat
) farval
;
1744 if (ctx
->ExecuteFlag
) {
1745 (*ctx
->Exec
->DepthRange
)( nearval
, farval
);
1750 static void GLAPIENTRY
save_Disable( GLenum cap
)
1752 GET_CURRENT_CONTEXT(ctx
);
1754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1755 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DISABLE
, 1 );
1759 if (ctx
->ExecuteFlag
) {
1760 (*ctx
->Exec
->Disable
)( cap
);
1765 static void GLAPIENTRY
save_DrawBuffer( GLenum mode
)
1767 GET_CURRENT_CONTEXT(ctx
);
1769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1770 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_BUFFER
, 1 );
1774 if (ctx
->ExecuteFlag
) {
1775 (*ctx
->Exec
->DrawBuffer
)( mode
);
1780 static void GLAPIENTRY
save_DrawPixels( GLsizei width
, GLsizei height
,
1781 GLenum format
, GLenum type
,
1782 const GLvoid
*pixels
)
1784 GET_CURRENT_CONTEXT(ctx
);
1785 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
1786 pixels
, &ctx
->Unpack
);
1788 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1789 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_DRAW_PIXELS
, 5 );
1800 if (ctx
->ExecuteFlag
) {
1801 (*ctx
->Exec
->DrawPixels
)( width
, height
, format
, type
, pixels
);
1807 static void GLAPIENTRY
save_Enable( GLenum cap
)
1809 GET_CURRENT_CONTEXT(ctx
);
1811 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1812 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ENABLE
, 1 );
1816 if (ctx
->ExecuteFlag
) {
1817 (*ctx
->Exec
->Enable
)( cap
);
1823 void GLAPIENTRY
_mesa_save_EvalMesh1( GLenum mode
, GLint i1
, GLint i2
)
1825 GET_CURRENT_CONTEXT(ctx
);
1827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1828 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH1
, 3 );
1834 if (ctx
->ExecuteFlag
) {
1835 (*ctx
->Exec
->EvalMesh1
)( mode
, i1
, i2
);
1840 void GLAPIENTRY
_mesa_save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
1842 GET_CURRENT_CONTEXT(ctx
);
1844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1845 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVALMESH2
, 5 );
1853 if (ctx
->ExecuteFlag
) {
1854 (*ctx
->Exec
->EvalMesh2
)( mode
, i1
, i2
, j1
, j2
);
1861 static void GLAPIENTRY
save_Fogfv( GLenum pname
, const GLfloat
*params
)
1863 GET_CURRENT_CONTEXT(ctx
);
1865 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1866 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FOG
, 5 );
1874 if (ctx
->ExecuteFlag
) {
1875 (*ctx
->Exec
->Fogfv
)( pname
, params
);
1880 static void GLAPIENTRY
save_Fogf( GLenum pname
, GLfloat param
)
1882 save_Fogfv(pname
, ¶m
);
1886 static void GLAPIENTRY
save_Fogiv(GLenum pname
, const GLint
*params
)
1891 case GL_FOG_DENSITY
:
1895 p
[0] = (GLfloat
) *params
;
1898 p
[0] = INT_TO_FLOAT( params
[0] );
1899 p
[1] = INT_TO_FLOAT( params
[1] );
1900 p
[2] = INT_TO_FLOAT( params
[2] );
1901 p
[3] = INT_TO_FLOAT( params
[3] );
1904 /* Error will be caught later in gl_Fogfv */
1907 save_Fogfv(pname
, p
);
1911 static void GLAPIENTRY
save_Fogi(GLenum pname
, GLint param
)
1913 save_Fogiv(pname
, ¶m
);
1917 static void GLAPIENTRY
save_FrontFace( GLenum mode
)
1919 GET_CURRENT_CONTEXT(ctx
);
1921 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1922 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRONT_FACE
, 1 );
1926 if (ctx
->ExecuteFlag
) {
1927 (*ctx
->Exec
->FrontFace
)( mode
);
1932 static void GLAPIENTRY
save_Frustum( GLdouble left
, GLdouble right
,
1933 GLdouble bottom
, GLdouble top
,
1934 GLdouble nearval
, GLdouble farval
)
1936 GET_CURRENT_CONTEXT(ctx
);
1938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1939 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_FRUSTUM
, 6 );
1941 n
[1].f
= (GLfloat
) left
;
1942 n
[2].f
= (GLfloat
) right
;
1943 n
[3].f
= (GLfloat
) bottom
;
1944 n
[4].f
= (GLfloat
) top
;
1945 n
[5].f
= (GLfloat
) nearval
;
1946 n
[6].f
= (GLfloat
) farval
;
1948 if (ctx
->ExecuteFlag
) {
1949 (*ctx
->Exec
->Frustum
)( left
, right
, bottom
, top
, nearval
, farval
);
1954 static void GLAPIENTRY
save_Hint( GLenum target
, GLenum mode
)
1956 GET_CURRENT_CONTEXT(ctx
);
1958 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1959 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HINT
, 2 );
1964 if (ctx
->ExecuteFlag
) {
1965 (*ctx
->Exec
->Hint
)( target
, mode
);
1970 static void GLAPIENTRY
1971 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
, GLboolean sink
)
1973 GET_CURRENT_CONTEXT(ctx
);
1976 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1977 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_HISTOGRAM
, 4 );
1981 n
[3].e
= internalFormat
;
1984 if (ctx
->ExecuteFlag
) {
1985 (*ctx
->Exec
->Histogram
)( target
, width
, internalFormat
, sink
);
1990 static void GLAPIENTRY
save_IndexMask( GLuint mask
)
1992 GET_CURRENT_CONTEXT(ctx
);
1994 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1995 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX_MASK
, 1 );
1999 if (ctx
->ExecuteFlag
) {
2000 (*ctx
->Exec
->IndexMask
)( mask
);
2005 static void GLAPIENTRY
save_InitNames( void )
2007 GET_CURRENT_CONTEXT(ctx
);
2008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2009 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_INIT_NAMES
, 0 );
2010 if (ctx
->ExecuteFlag
) {
2011 (*ctx
->Exec
->InitNames
)();
2016 static void GLAPIENTRY
save_Lightfv( GLenum light
, GLenum pname
, const GLfloat
*params
)
2018 GET_CURRENT_CONTEXT(ctx
);
2020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2021 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT
, 6 );
2039 case GL_SPOT_DIRECTION
:
2042 case GL_SPOT_EXPONENT
:
2045 case GL_SPOT_CUTOFF
:
2048 case GL_CONSTANT_ATTENUATION
:
2051 case GL_LINEAR_ATTENUATION
:
2054 case GL_QUADRATIC_ATTENUATION
:
2060 for (i
= 0; i
< nParams
; i
++) {
2061 n
[3+i
].f
= params
[i
];
2064 if (ctx
->ExecuteFlag
) {
2065 (*ctx
->Exec
->Lightfv
)( light
, pname
, params
);
2070 static void GLAPIENTRY
save_Lightf( GLenum light
, GLenum pname
, GLfloat params
)
2072 save_Lightfv(light
, pname
, ¶ms
);
2076 static void GLAPIENTRY
save_Lightiv( GLenum light
, GLenum pname
, const GLint
*params
)
2083 fparam
[0] = INT_TO_FLOAT( params
[0] );
2084 fparam
[1] = INT_TO_FLOAT( params
[1] );
2085 fparam
[2] = INT_TO_FLOAT( params
[2] );
2086 fparam
[3] = INT_TO_FLOAT( params
[3] );
2089 fparam
[0] = (GLfloat
) params
[0];
2090 fparam
[1] = (GLfloat
) params
[1];
2091 fparam
[2] = (GLfloat
) params
[2];
2092 fparam
[3] = (GLfloat
) params
[3];
2094 case GL_SPOT_DIRECTION
:
2095 fparam
[0] = (GLfloat
) params
[0];
2096 fparam
[1] = (GLfloat
) params
[1];
2097 fparam
[2] = (GLfloat
) params
[2];
2099 case GL_SPOT_EXPONENT
:
2100 case GL_SPOT_CUTOFF
:
2101 case GL_CONSTANT_ATTENUATION
:
2102 case GL_LINEAR_ATTENUATION
:
2103 case GL_QUADRATIC_ATTENUATION
:
2104 fparam
[0] = (GLfloat
) params
[0];
2107 /* error will be caught later in gl_Lightfv */
2110 save_Lightfv( light
, pname
, fparam
);
2114 static void GLAPIENTRY
save_Lighti( GLenum light
, GLenum pname
, GLint param
)
2116 save_Lightiv( light
, pname
, ¶m
);
2120 static void GLAPIENTRY
save_LightModelfv( GLenum pname
, const GLfloat
*params
)
2122 GET_CURRENT_CONTEXT(ctx
);
2124 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2125 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIGHT_MODEL
, 5 );
2133 if (ctx
->ExecuteFlag
) {
2134 (*ctx
->Exec
->LightModelfv
)( pname
, params
);
2139 static void GLAPIENTRY
save_LightModelf( GLenum pname
, GLfloat param
)
2141 save_LightModelfv(pname
, ¶m
);
2145 static void GLAPIENTRY
save_LightModeliv( GLenum pname
, const GLint
*params
)
2149 case GL_LIGHT_MODEL_AMBIENT
:
2150 fparam
[0] = INT_TO_FLOAT( params
[0] );
2151 fparam
[1] = INT_TO_FLOAT( params
[1] );
2152 fparam
[2] = INT_TO_FLOAT( params
[2] );
2153 fparam
[3] = INT_TO_FLOAT( params
[3] );
2155 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2156 case GL_LIGHT_MODEL_TWO_SIDE
:
2157 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2158 fparam
[0] = (GLfloat
) params
[0];
2161 /* Error will be caught later in gl_LightModelfv */
2164 save_LightModelfv(pname
, fparam
);
2168 static void GLAPIENTRY
save_LightModeli( GLenum pname
, GLint param
)
2170 save_LightModeliv(pname
, ¶m
);
2174 static void GLAPIENTRY
save_LineStipple( GLint factor
, GLushort pattern
)
2176 GET_CURRENT_CONTEXT(ctx
);
2178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2179 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_STIPPLE
, 2 );
2184 if (ctx
->ExecuteFlag
) {
2185 (*ctx
->Exec
->LineStipple
)( factor
, pattern
);
2190 static void GLAPIENTRY
save_LineWidth( GLfloat width
)
2192 GET_CURRENT_CONTEXT(ctx
);
2194 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2195 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LINE_WIDTH
, 1 );
2199 if (ctx
->ExecuteFlag
) {
2200 (*ctx
->Exec
->LineWidth
)( width
);
2205 static void GLAPIENTRY
save_ListBase( GLuint base
)
2207 GET_CURRENT_CONTEXT(ctx
);
2209 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2210 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LIST_BASE
, 1 );
2214 if (ctx
->ExecuteFlag
) {
2215 (*ctx
->Exec
->ListBase
)( base
);
2220 static void GLAPIENTRY
save_LoadIdentity( void )
2222 GET_CURRENT_CONTEXT(ctx
);
2223 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2224 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_IDENTITY
, 0 );
2225 if (ctx
->ExecuteFlag
) {
2226 (*ctx
->Exec
->LoadIdentity
)();
2231 static void GLAPIENTRY
save_LoadMatrixf( const GLfloat
*m
)
2233 GET_CURRENT_CONTEXT(ctx
);
2235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2236 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_MATRIX
, 16 );
2239 for (i
=0;i
<16;i
++) {
2243 if (ctx
->ExecuteFlag
) {
2244 (*ctx
->Exec
->LoadMatrixf
)( m
);
2249 static void GLAPIENTRY
save_LoadMatrixd( const GLdouble
*m
)
2253 for (i
= 0; i
< 16; i
++) {
2254 f
[i
] = (GLfloat
) m
[i
];
2256 save_LoadMatrixf(f
);
2260 static void GLAPIENTRY
save_LoadName( GLuint name
)
2262 GET_CURRENT_CONTEXT(ctx
);
2264 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2265 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_NAME
, 1 );
2269 if (ctx
->ExecuteFlag
) {
2270 (*ctx
->Exec
->LoadName
)( name
);
2275 static void GLAPIENTRY
save_LogicOp( GLenum opcode
)
2277 GET_CURRENT_CONTEXT(ctx
);
2279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2280 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOGIC_OP
, 1 );
2284 if (ctx
->ExecuteFlag
) {
2285 (*ctx
->Exec
->LogicOp
)( opcode
);
2290 static void GLAPIENTRY
save_Map1d( GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2291 GLint order
, const GLdouble
*points
)
2293 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2298 GLfloat
*pnts
= _mesa_copy_map_points1d( target
, stride
, order
, points
);
2300 n
[2].f
= (GLfloat
) u1
;
2301 n
[3].f
= (GLfloat
) u2
;
2302 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2304 n
[6].data
= (void *) pnts
;
2306 if (ctx
->ExecuteFlag
) {
2307 (*ctx
->Exec
->Map1d
)( target
, u1
, u2
, stride
, order
, points
);
2311 static void GLAPIENTRY
save_Map1f( GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2312 GLint order
, const GLfloat
*points
)
2314 GET_CURRENT_CONTEXT(ctx
);
2316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2317 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP1
, 6 );
2319 GLfloat
*pnts
= _mesa_copy_map_points1f( target
, stride
, order
, points
);
2323 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2325 n
[6].data
= (void *) pnts
;
2327 if (ctx
->ExecuteFlag
) {
2328 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, stride
, order
, points
);
2333 static void GLAPIENTRY
save_Map2d( GLenum target
,
2334 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2335 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2336 const GLdouble
*points
)
2338 GET_CURRENT_CONTEXT(ctx
);
2340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2341 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2343 GLfloat
*pnts
= _mesa_copy_map_points2d( target
, ustride
, uorder
,
2344 vstride
, vorder
, points
);
2346 n
[2].f
= (GLfloat
) u1
;
2347 n
[3].f
= (GLfloat
) u2
;
2348 n
[4].f
= (GLfloat
) v1
;
2349 n
[5].f
= (GLfloat
) v2
;
2350 /* XXX verify these strides are correct */
2351 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2352 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2355 n
[10].data
= (void *) pnts
;
2357 if (ctx
->ExecuteFlag
) {
2358 (*ctx
->Exec
->Map2d
)( target
,
2359 u1
, u2
, ustride
, uorder
,
2360 v1
, v2
, vstride
, vorder
, points
);
2365 static void GLAPIENTRY
save_Map2f( GLenum target
,
2366 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2367 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2368 const GLfloat
*points
)
2370 GET_CURRENT_CONTEXT(ctx
);
2372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2373 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAP2
, 10 );
2375 GLfloat
*pnts
= _mesa_copy_map_points2f( target
, ustride
, uorder
,
2376 vstride
, vorder
, points
);
2382 /* XXX verify these strides are correct */
2383 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride*/
2384 n
[7].i
= _mesa_evaluator_components(target
); /*vstride*/
2387 n
[10].data
= (void *) pnts
;
2389 if (ctx
->ExecuteFlag
) {
2390 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
2391 v1
, v2
, vstride
, vorder
, points
);
2396 static void GLAPIENTRY
save_MapGrid1f( GLint un
, GLfloat u1
, GLfloat u2
)
2398 GET_CURRENT_CONTEXT(ctx
);
2400 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2401 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID1
, 3 );
2407 if (ctx
->ExecuteFlag
) {
2408 (*ctx
->Exec
->MapGrid1f
)( un
, u1
, u2
);
2413 static void GLAPIENTRY
save_MapGrid1d( GLint un
, GLdouble u1
, GLdouble u2
)
2415 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2419 static void GLAPIENTRY
save_MapGrid2f( GLint un
, GLfloat u1
, GLfloat u2
,
2420 GLint vn
, GLfloat v1
, GLfloat v2
)
2422 GET_CURRENT_CONTEXT(ctx
);
2424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2425 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MAPGRID2
, 6 );
2434 if (ctx
->ExecuteFlag
) {
2435 (*ctx
->Exec
->MapGrid2f
)( un
, u1
, u2
, vn
, v1
, v2
);
2441 static void GLAPIENTRY
save_MapGrid2d( GLint un
, GLdouble u1
, GLdouble u2
,
2442 GLint vn
, GLdouble v1
, GLdouble v2
)
2444 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2445 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2449 static void GLAPIENTRY
save_MatrixMode( GLenum mode
)
2451 GET_CURRENT_CONTEXT(ctx
);
2453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2454 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATRIX_MODE
, 1 );
2458 if (ctx
->ExecuteFlag
) {
2459 (*ctx
->Exec
->MatrixMode
)( mode
);
2464 static void GLAPIENTRY
2465 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2467 GET_CURRENT_CONTEXT(ctx
);
2470 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2471 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MIN_MAX
, 3 );
2474 n
[2].e
= internalFormat
;
2477 if (ctx
->ExecuteFlag
) {
2478 (*ctx
->Exec
->Minmax
)( target
, internalFormat
, sink
);
2483 static void GLAPIENTRY
save_MultMatrixf( const GLfloat
*m
)
2485 GET_CURRENT_CONTEXT(ctx
);
2487 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2488 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MULT_MATRIX
, 16 );
2491 for (i
=0;i
<16;i
++) {
2495 if (ctx
->ExecuteFlag
) {
2496 (*ctx
->Exec
->MultMatrixf
)( m
);
2501 static void GLAPIENTRY
save_MultMatrixd( const GLdouble
*m
)
2505 for (i
= 0; i
< 16; i
++) {
2506 f
[i
] = (GLfloat
) m
[i
];
2508 save_MultMatrixf(f
);
2512 static void GLAPIENTRY
save_NewList( GLuint list
, GLenum mode
)
2514 GET_CURRENT_CONTEXT(ctx
);
2515 /* It's an error to call this function while building a display list */
2516 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
2523 static void GLAPIENTRY
save_Ortho( GLdouble left
, GLdouble right
,
2524 GLdouble bottom
, GLdouble top
,
2525 GLdouble nearval
, GLdouble farval
)
2527 GET_CURRENT_CONTEXT(ctx
);
2529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2530 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ORTHO
, 6 );
2532 n
[1].f
= (GLfloat
) left
;
2533 n
[2].f
= (GLfloat
) right
;
2534 n
[3].f
= (GLfloat
) bottom
;
2535 n
[4].f
= (GLfloat
) top
;
2536 n
[5].f
= (GLfloat
) nearval
;
2537 n
[6].f
= (GLfloat
) farval
;
2539 if (ctx
->ExecuteFlag
) {
2540 (*ctx
->Exec
->Ortho
)( left
, right
, bottom
, top
, nearval
, farval
);
2545 static void GLAPIENTRY
2546 save_PixelMapfv( GLenum map
, GLint mapsize
, const GLfloat
*values
)
2548 GET_CURRENT_CONTEXT(ctx
);
2550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2551 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_MAP
, 3 );
2555 n
[3].data
= (void *) MALLOC( mapsize
* sizeof(GLfloat
) );
2556 MEMCPY( n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
) );
2558 if (ctx
->ExecuteFlag
) {
2559 (*ctx
->Exec
->PixelMapfv
)( map
, mapsize
, values
);
2564 static void GLAPIENTRY
2565 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2567 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2569 if (map
==GL_PIXEL_MAP_I_TO_I
|| map
==GL_PIXEL_MAP_S_TO_S
) {
2570 for (i
=0;i
<mapsize
;i
++) {
2571 fvalues
[i
] = (GLfloat
) values
[i
];
2575 for (i
=0;i
<mapsize
;i
++) {
2576 fvalues
[i
] = UINT_TO_FLOAT( values
[i
] );
2579 save_PixelMapfv(map
, mapsize
, fvalues
);
2583 static void GLAPIENTRY
2584 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*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
] = USHORT_TO_FLOAT( values
[i
] );
2598 save_PixelMapfv(map
, mapsize
, fvalues
);
2602 static void GLAPIENTRY
2603 save_PixelTransferf( GLenum pname
, GLfloat param
)
2605 GET_CURRENT_CONTEXT(ctx
);
2607 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2608 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TRANSFER
, 2 );
2613 if (ctx
->ExecuteFlag
) {
2614 (*ctx
->Exec
->PixelTransferf
)( pname
, param
);
2619 static void GLAPIENTRY
2620 save_PixelTransferi( GLenum pname
, GLint param
)
2622 save_PixelTransferf( pname
, (GLfloat
) param
);
2626 static void GLAPIENTRY
2627 save_PixelZoom( GLfloat xfactor
, GLfloat yfactor
)
2629 GET_CURRENT_CONTEXT(ctx
);
2631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2632 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_ZOOM
, 2 );
2637 if (ctx
->ExecuteFlag
) {
2638 (*ctx
->Exec
->PixelZoom
)( xfactor
, yfactor
);
2643 static void GLAPIENTRY
2644 save_PointParameterfvEXT( GLenum pname
, const GLfloat
*params
)
2646 GET_CURRENT_CONTEXT(ctx
);
2648 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2649 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_PARAMETERS
, 4 );
2656 if (ctx
->ExecuteFlag
) {
2657 (*ctx
->Exec
->PointParameterfvEXT
)( pname
, params
);
2662 static void GLAPIENTRY
save_PointParameterfEXT( GLenum pname
, GLfloat param
)
2664 save_PointParameterfvEXT(pname
, ¶m
);
2667 static void GLAPIENTRY
save_PointParameteriNV( GLenum pname
, GLint param
)
2669 GLfloat p
= (GLfloat
) param
;
2670 save_PointParameterfvEXT(pname
, &p
);
2673 static void GLAPIENTRY
save_PointParameterivNV( GLenum pname
, const GLint
*param
)
2675 GLfloat p
= (GLfloat
) param
[0];
2676 save_PointParameterfvEXT(pname
, &p
);
2680 static void GLAPIENTRY
save_PointSize( GLfloat size
)
2682 GET_CURRENT_CONTEXT(ctx
);
2684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2685 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POINT_SIZE
, 1 );
2689 if (ctx
->ExecuteFlag
) {
2690 (*ctx
->Exec
->PointSize
)( size
);
2695 static void GLAPIENTRY
save_PolygonMode( GLenum face
, GLenum mode
)
2697 GET_CURRENT_CONTEXT(ctx
);
2699 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2700 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_MODE
, 2 );
2705 if (ctx
->ExecuteFlag
) {
2706 (*ctx
->Exec
->PolygonMode
)( face
, mode
);
2712 * Polygon stipple must have been upacked already!
2714 static void GLAPIENTRY
save_PolygonStipple( const GLubyte
*pattern
)
2716 GET_CURRENT_CONTEXT(ctx
);
2718 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2719 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_STIPPLE
, 1 );
2722 n
[1].data
= MALLOC( 32 * 4 );
2723 data
= n
[1].data
; /* This needed for Acorn compiler */
2724 MEMCPY( data
, pattern
, 32 * 4 );
2726 if (ctx
->ExecuteFlag
) {
2727 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) pattern
);
2732 static void GLAPIENTRY
save_PolygonOffset( GLfloat factor
, GLfloat units
)
2734 GET_CURRENT_CONTEXT(ctx
);
2736 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2737 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_POLYGON_OFFSET
, 2 );
2742 if (ctx
->ExecuteFlag
) {
2743 (*ctx
->Exec
->PolygonOffset
)( factor
, units
);
2748 static void GLAPIENTRY
save_PolygonOffsetEXT( GLfloat factor
, GLfloat bias
)
2750 GET_CURRENT_CONTEXT(ctx
);
2751 save_PolygonOffset(factor
, ctx
->DepthMaxF
* bias
);
2755 static void GLAPIENTRY
save_PopAttrib( void )
2757 GET_CURRENT_CONTEXT(ctx
);
2758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2759 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_ATTRIB
, 0 );
2760 if (ctx
->ExecuteFlag
) {
2761 (*ctx
->Exec
->PopAttrib
)();
2766 static void GLAPIENTRY
save_PopMatrix( void )
2768 GET_CURRENT_CONTEXT(ctx
);
2769 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2770 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_MATRIX
, 0 );
2771 if (ctx
->ExecuteFlag
) {
2772 (*ctx
->Exec
->PopMatrix
)();
2777 static void GLAPIENTRY
save_PopName( void )
2779 GET_CURRENT_CONTEXT(ctx
);
2780 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2781 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_POP_NAME
, 0 );
2782 if (ctx
->ExecuteFlag
) {
2783 (*ctx
->Exec
->PopName
)();
2788 static void GLAPIENTRY
save_PrioritizeTextures( GLsizei num
, const GLuint
*textures
,
2789 const GLclampf
*priorities
)
2791 GET_CURRENT_CONTEXT(ctx
);
2793 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2795 for (i
=0;i
<num
;i
++) {
2797 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2 );
2799 n
[1].ui
= textures
[i
];
2800 n
[2].f
= priorities
[i
];
2803 if (ctx
->ExecuteFlag
) {
2804 (*ctx
->Exec
->PrioritizeTextures
)( num
, textures
, priorities
);
2809 static void GLAPIENTRY
save_PushAttrib( GLbitfield mask
)
2811 GET_CURRENT_CONTEXT(ctx
);
2813 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2814 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_ATTRIB
, 1 );
2818 if (ctx
->ExecuteFlag
) {
2819 (*ctx
->Exec
->PushAttrib
)( mask
);
2824 static void GLAPIENTRY
save_PushMatrix( void )
2826 GET_CURRENT_CONTEXT(ctx
);
2827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2828 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_MATRIX
, 0 );
2829 if (ctx
->ExecuteFlag
) {
2830 (*ctx
->Exec
->PushMatrix
)();
2835 static void GLAPIENTRY
save_PushName( GLuint name
)
2837 GET_CURRENT_CONTEXT(ctx
);
2839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2840 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PUSH_NAME
, 1 );
2844 if (ctx
->ExecuteFlag
) {
2845 (*ctx
->Exec
->PushName
)( name
);
2850 static void GLAPIENTRY
save_RasterPos4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
2852 GET_CURRENT_CONTEXT(ctx
);
2854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2855 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RASTER_POS
, 4 );
2862 if (ctx
->ExecuteFlag
) {
2863 (*ctx
->Exec
->RasterPos4f
)( x
, y
, z
, w
);
2867 static void GLAPIENTRY
save_RasterPos2d(GLdouble x
, GLdouble y
)
2869 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2872 static void GLAPIENTRY
save_RasterPos2f(GLfloat x
, GLfloat y
)
2874 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2877 static void GLAPIENTRY
save_RasterPos2i(GLint x
, GLint y
)
2879 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
2882 static void GLAPIENTRY
save_RasterPos2s(GLshort x
, GLshort y
)
2884 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
2887 static void GLAPIENTRY
save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
2889 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2892 static void GLAPIENTRY
save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
2894 save_RasterPos4f(x
, y
, z
, 1.0F
);
2897 static void GLAPIENTRY
save_RasterPos3i(GLint x
, GLint y
, GLint z
)
2899 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
2902 static void GLAPIENTRY
save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
2904 save_RasterPos4f(x
, y
, z
, 1.0F
);
2907 static void GLAPIENTRY
save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
2909 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2912 static void GLAPIENTRY
save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
2914 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
2917 static void GLAPIENTRY
save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
2919 save_RasterPos4f(x
, y
, z
, w
);
2922 static void GLAPIENTRY
save_RasterPos2dv(const GLdouble
*v
)
2924 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2927 static void GLAPIENTRY
save_RasterPos2fv(const GLfloat
*v
)
2929 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2932 static void GLAPIENTRY
save_RasterPos2iv(const GLint
*v
)
2934 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
2937 static void GLAPIENTRY
save_RasterPos2sv(const GLshort
*v
)
2939 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
2942 static void GLAPIENTRY
save_RasterPos3dv(const GLdouble
*v
)
2944 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2947 static void GLAPIENTRY
save_RasterPos3fv(const GLfloat
*v
)
2949 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2952 static void GLAPIENTRY
save_RasterPos3iv(const GLint
*v
)
2954 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
2957 static void GLAPIENTRY
save_RasterPos3sv(const GLshort
*v
)
2959 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
2962 static void GLAPIENTRY
save_RasterPos4dv(const GLdouble
*v
)
2964 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2965 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2968 static void GLAPIENTRY
save_RasterPos4fv(const GLfloat
*v
)
2970 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2973 static void GLAPIENTRY
save_RasterPos4iv(const GLint
*v
)
2975 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
2976 (GLfloat
) v
[2], (GLfloat
) v
[3]);
2979 static void GLAPIENTRY
save_RasterPos4sv(const GLshort
*v
)
2981 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
2985 static void GLAPIENTRY
save_PassThrough( GLfloat token
)
2987 GET_CURRENT_CONTEXT(ctx
);
2989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2990 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PASSTHROUGH
, 1 );
2994 if (ctx
->ExecuteFlag
) {
2995 (*ctx
->Exec
->PassThrough
)( token
);
3000 static void GLAPIENTRY
save_ReadBuffer( GLenum mode
)
3002 GET_CURRENT_CONTEXT(ctx
);
3004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3005 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_READ_BUFFER
, 1 );
3009 if (ctx
->ExecuteFlag
) {
3010 (*ctx
->Exec
->ReadBuffer
)( mode
);
3015 static void GLAPIENTRY
3016 save_ResetHistogram(GLenum target
)
3018 GET_CURRENT_CONTEXT(ctx
);
3020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3021 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_HISTOGRAM
, 1 );
3025 if (ctx
->ExecuteFlag
) {
3026 (*ctx
->Exec
->ResetHistogram
)( target
);
3031 static void GLAPIENTRY
3032 save_ResetMinmax(GLenum target
)
3034 GET_CURRENT_CONTEXT(ctx
);
3036 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3037 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RESET_MIN_MAX
, 1 );
3041 if (ctx
->ExecuteFlag
) {
3042 (*ctx
->Exec
->ResetMinmax
)( target
);
3047 static void GLAPIENTRY
save_Rotatef( GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3049 GET_CURRENT_CONTEXT(ctx
);
3051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3052 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ROTATE
, 4 );
3059 if (ctx
->ExecuteFlag
) {
3060 (*ctx
->Exec
->Rotatef
)( angle
, x
, y
, z
);
3065 static void GLAPIENTRY
save_Rotated( GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3067 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3071 static void GLAPIENTRY
save_Scalef( GLfloat x
, GLfloat y
, GLfloat z
)
3073 GET_CURRENT_CONTEXT(ctx
);
3075 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3076 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCALE
, 3 );
3082 if (ctx
->ExecuteFlag
) {
3083 (*ctx
->Exec
->Scalef
)( x
, y
, z
);
3088 static void GLAPIENTRY
save_Scaled( GLdouble x
, GLdouble y
, GLdouble z
)
3090 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3094 static void GLAPIENTRY
save_Scissor( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3096 GET_CURRENT_CONTEXT(ctx
);
3098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3099 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SCISSOR
, 4 );
3106 if (ctx
->ExecuteFlag
) {
3107 (*ctx
->Exec
->Scissor
)( x
, y
, width
, height
);
3112 static void GLAPIENTRY
save_ShadeModel( GLenum mode
)
3114 GET_CURRENT_CONTEXT(ctx
);
3116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3117 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SHADE_MODEL
, 1 );
3121 if (ctx
->ExecuteFlag
) {
3122 (*ctx
->Exec
->ShadeModel
)( mode
);
3127 static void GLAPIENTRY
save_StencilFunc( GLenum func
, GLint ref
, GLuint mask
)
3129 GET_CURRENT_CONTEXT(ctx
);
3131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3132 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_FUNC
, 3 );
3138 if (ctx
->ExecuteFlag
) {
3139 (*ctx
->Exec
->StencilFunc
)( func
, ref
, mask
);
3144 static void GLAPIENTRY
save_StencilMask( GLuint mask
)
3146 GET_CURRENT_CONTEXT(ctx
);
3148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3149 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_MASK
, 1 );
3153 if (ctx
->ExecuteFlag
) {
3154 (*ctx
->Exec
->StencilMask
)( mask
);
3159 static void GLAPIENTRY
save_StencilOp( GLenum fail
, GLenum zfail
, GLenum zpass
)
3161 GET_CURRENT_CONTEXT(ctx
);
3163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3164 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_STENCIL_OP
, 3 );
3170 if (ctx
->ExecuteFlag
) {
3171 (*ctx
->Exec
->StencilOp
)( fail
, zfail
, zpass
);
3176 static void GLAPIENTRY
save_TexEnvfv( GLenum target
, GLenum pname
, const GLfloat
*params
)
3178 GET_CURRENT_CONTEXT(ctx
);
3180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3181 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXENV
, 6 );
3190 if (ctx
->ExecuteFlag
) {
3191 (*ctx
->Exec
->TexEnvfv
)( target
, pname
, params
);
3196 static void GLAPIENTRY
save_TexEnvf( GLenum target
, GLenum pname
, GLfloat param
)
3198 save_TexEnvfv( target
, pname
, ¶m
);
3202 static void GLAPIENTRY
save_TexEnvi( GLenum target
, GLenum pname
, GLint param
)
3205 p
[0] = (GLfloat
) param
;
3206 p
[1] = p
[2] = p
[3] = 0.0;
3207 save_TexEnvfv( target
, pname
, p
);
3211 static void GLAPIENTRY
save_TexEnviv( GLenum target
, GLenum pname
, const GLint
*param
)
3214 p
[0] = INT_TO_FLOAT( param
[0] );
3215 p
[1] = INT_TO_FLOAT( param
[1] );
3216 p
[2] = INT_TO_FLOAT( param
[2] );
3217 p
[3] = INT_TO_FLOAT( param
[3] );
3218 save_TexEnvfv( target
, pname
, p
);
3222 static void GLAPIENTRY
save_TexGenfv( GLenum coord
, GLenum pname
, const GLfloat
*params
)
3224 GET_CURRENT_CONTEXT(ctx
);
3226 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3227 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXGEN
, 6 );
3236 if (ctx
->ExecuteFlag
) {
3237 (*ctx
->Exec
->TexGenfv
)( coord
, pname
, params
);
3242 static void GLAPIENTRY
save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3245 p
[0] = (GLfloat
) params
[0];
3246 p
[1] = (GLfloat
) params
[1];
3247 p
[2] = (GLfloat
) params
[2];
3248 p
[3] = (GLfloat
) params
[3];
3249 save_TexGenfv(coord
, pname
, p
);
3253 static void GLAPIENTRY
save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3255 GLfloat p
= (GLfloat
) param
;
3256 save_TexGenfv( coord
, pname
, &p
);
3260 static void GLAPIENTRY
save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3263 p
[0] = (GLfloat
) params
[0];
3264 p
[1] = (GLfloat
) params
[1];
3265 p
[2] = (GLfloat
) params
[2];
3266 p
[3] = (GLfloat
) params
[3];
3267 save_TexGenfv( coord
, pname
, p
);
3271 static void GLAPIENTRY
save_TexGenf( GLenum coord
, GLenum pname
, GLfloat param
)
3273 save_TexGenfv(coord
, pname
, ¶m
);
3277 static void GLAPIENTRY
save_TexGeni( GLenum coord
, GLenum pname
, GLint param
)
3279 save_TexGeniv( coord
, pname
, ¶m
);
3283 static void GLAPIENTRY
save_TexParameterfv( GLenum target
,
3284 GLenum pname
, const GLfloat
*params
)
3286 GET_CURRENT_CONTEXT(ctx
);
3288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3289 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEXPARAMETER
, 6 );
3298 if (ctx
->ExecuteFlag
) {
3299 (*ctx
->Exec
->TexParameterfv
)( target
, pname
, params
);
3304 static void GLAPIENTRY
save_TexParameterf( GLenum target
, GLenum pname
, GLfloat param
)
3306 save_TexParameterfv(target
, pname
, ¶m
);
3310 static void GLAPIENTRY
save_TexParameteri( GLenum target
, GLenum pname
, GLint param
)
3313 fparam
[0] = (GLfloat
) param
;
3314 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3315 save_TexParameterfv(target
, pname
, fparam
);
3319 static void GLAPIENTRY
save_TexParameteriv( GLenum target
, GLenum pname
, const GLint
*params
)
3322 fparam
[0] = (GLfloat
) params
[0];
3323 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3324 save_TexParameterfv(target
, pname
, fparam
);
3328 static void GLAPIENTRY
save_TexImage1D( GLenum target
,
3329 GLint level
, GLint components
,
3330 GLsizei width
, GLint border
,
3331 GLenum format
, GLenum type
,
3332 const GLvoid
*pixels
)
3334 GET_CURRENT_CONTEXT(ctx
);
3335 if (target
== GL_PROXY_TEXTURE_1D
) {
3336 /* don't compile, execute immediately */
3337 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3338 border
, format
, type
, pixels
);
3341 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3342 pixels
, &ctx
->Unpack
);
3344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3345 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE1D
, 8 );
3349 n
[3].i
= components
;
3350 n
[4].i
= (GLint
) width
;
3359 if (ctx
->ExecuteFlag
) {
3360 (*ctx
->Exec
->TexImage1D
)( target
, level
, components
, width
,
3361 border
, format
, type
, pixels
);
3367 static void GLAPIENTRY
save_TexImage2D( GLenum target
,
3368 GLint level
, GLint components
,
3369 GLsizei width
, GLsizei height
, GLint border
,
3370 GLenum format
, GLenum type
,
3371 const GLvoid
*pixels
)
3373 GET_CURRENT_CONTEXT(ctx
);
3374 if (target
== GL_PROXY_TEXTURE_2D
) {
3375 /* don't compile, execute immediately */
3376 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3377 height
, border
, format
, type
, pixels
);
3380 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3381 pixels
, &ctx
->Unpack
);
3383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3384 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE2D
, 9 );
3388 n
[3].i
= components
;
3389 n
[4].i
= (GLint
) width
;
3390 n
[5].i
= (GLint
) height
;
3399 if (ctx
->ExecuteFlag
) {
3400 (*ctx
->Exec
->TexImage2D
)( target
, level
, components
, width
,
3401 height
, border
, format
, type
, pixels
);
3407 static void GLAPIENTRY
save_TexImage3D( GLenum target
,
3408 GLint level
, GLint internalFormat
,
3409 GLsizei width
, GLsizei height
, GLsizei depth
,
3411 GLenum format
, GLenum type
,
3412 const GLvoid
*pixels
)
3414 GET_CURRENT_CONTEXT(ctx
);
3415 if (target
== GL_PROXY_TEXTURE_3D
) {
3416 /* don't compile, execute immediately */
3417 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3418 height
, depth
, border
, format
, type
, pixels
);
3422 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3423 pixels
, &ctx
->Unpack
);
3424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3425 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_IMAGE3D
, 10 );
3429 n
[3].i
= (GLint
) internalFormat
;
3430 n
[4].i
= (GLint
) width
;
3431 n
[5].i
= (GLint
) height
;
3432 n
[6].i
= (GLint
) depth
;
3441 if (ctx
->ExecuteFlag
) {
3442 (*ctx
->Exec
->TexImage3D
)( target
, level
, internalFormat
, width
,
3443 height
, depth
, border
, format
, type
, pixels
);
3449 static void GLAPIENTRY
save_TexSubImage1D( GLenum target
, GLint level
, GLint xoffset
,
3450 GLsizei width
, GLenum format
, GLenum type
,
3451 const GLvoid
*pixels
)
3453 GET_CURRENT_CONTEXT(ctx
);
3455 GLvoid
*image
= _mesa_unpack_image(width
, 1, 1, format
, type
,
3456 pixels
, &ctx
->Unpack
);
3457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3458 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7 );
3463 n
[4].i
= (GLint
) width
;
3471 if (ctx
->ExecuteFlag
) {
3472 (*ctx
->Exec
->TexSubImage1D
)( target
, level
, xoffset
, width
,
3473 format
, type
, pixels
);
3478 static void GLAPIENTRY
save_TexSubImage2D( GLenum target
, GLint level
,
3479 GLint xoffset
, GLint yoffset
,
3480 GLsizei width
, GLsizei height
,
3481 GLenum format
, GLenum type
,
3482 const GLvoid
*pixels
)
3484 GET_CURRENT_CONTEXT(ctx
);
3486 GLvoid
*image
= _mesa_unpack_image(width
, height
, 1, format
, type
,
3487 pixels
, &ctx
->Unpack
);
3488 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3489 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9 );
3495 n
[5].i
= (GLint
) width
;
3496 n
[6].i
= (GLint
) height
;
3504 if (ctx
->ExecuteFlag
) {
3505 (*ctx
->Exec
->TexSubImage2D
)( target
, level
, xoffset
, yoffset
,
3506 width
, height
, format
, type
, pixels
);
3511 static void GLAPIENTRY
save_TexSubImage3D( GLenum target
, GLint level
,
3512 GLint xoffset
, GLint yoffset
,GLint zoffset
,
3513 GLsizei width
, GLsizei height
, GLsizei depth
,
3514 GLenum format
, GLenum type
,
3515 const GLvoid
*pixels
)
3517 GET_CURRENT_CONTEXT(ctx
);
3519 GLvoid
*image
= _mesa_unpack_image(width
, height
, depth
, format
, type
,
3520 pixels
, &ctx
->Unpack
);
3521 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3522 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11 );
3529 n
[6].i
= (GLint
) width
;
3530 n
[7].i
= (GLint
) height
;
3531 n
[8].i
= (GLint
) depth
;
3539 if (ctx
->ExecuteFlag
) {
3540 (*ctx
->Exec
->TexSubImage3D
)( target
, level
,
3541 xoffset
, yoffset
, zoffset
,
3542 width
, height
, depth
, format
, type
, pixels
);
3547 static void GLAPIENTRY
save_Translatef( GLfloat x
, GLfloat y
, GLfloat z
)
3549 GET_CURRENT_CONTEXT(ctx
);
3551 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3552 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRANSLATE
, 3 );
3558 if (ctx
->ExecuteFlag
) {
3559 (*ctx
->Exec
->Translatef
)( x
, y
, z
);
3564 static void GLAPIENTRY
save_Translated( GLdouble x
, GLdouble y
, GLdouble z
)
3566 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3571 static void GLAPIENTRY
save_Viewport( GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3573 GET_CURRENT_CONTEXT(ctx
);
3575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3576 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_VIEWPORT
, 4 );
3580 n
[3].i
= (GLint
) width
;
3581 n
[4].i
= (GLint
) height
;
3583 if (ctx
->ExecuteFlag
) {
3584 (*ctx
->Exec
->Viewport
)( x
, y
, width
, height
);
3589 static void GLAPIENTRY
save_WindowPos4fMESA( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3591 GET_CURRENT_CONTEXT(ctx
);
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_WINDOW_POS
, 4 );
3601 if (ctx
->ExecuteFlag
) {
3602 (*ctx
->Exec
->WindowPos4fMESA
)( x
, y
, z
, w
);
3606 static void GLAPIENTRY
save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
3608 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3611 static void GLAPIENTRY
save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
3613 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3616 static void GLAPIENTRY
save_WindowPos2iMESA(GLint x
, GLint y
)
3618 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3621 static void GLAPIENTRY
save_WindowPos2sMESA(GLshort x
, GLshort y
)
3623 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
3626 static void GLAPIENTRY
save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
3628 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3631 static void GLAPIENTRY
save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
3633 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3636 static void GLAPIENTRY
save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
3638 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3641 static void GLAPIENTRY
save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
3643 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
3646 static void GLAPIENTRY
save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3648 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3651 static void GLAPIENTRY
save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
3653 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3656 static void GLAPIENTRY
save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3658 save_WindowPos4fMESA(x
, y
, z
, w
);
3661 static void GLAPIENTRY
save_WindowPos2dvMESA(const GLdouble
*v
)
3663 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3666 static void GLAPIENTRY
save_WindowPos2fvMESA(const GLfloat
*v
)
3668 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3671 static void GLAPIENTRY
save_WindowPos2ivMESA(const GLint
*v
)
3673 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3676 static void GLAPIENTRY
save_WindowPos2svMESA(const GLshort
*v
)
3678 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
3681 static void GLAPIENTRY
save_WindowPos3dvMESA(const GLdouble
*v
)
3683 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3686 static void GLAPIENTRY
save_WindowPos3fvMESA(const GLfloat
*v
)
3688 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3691 static void GLAPIENTRY
save_WindowPos3ivMESA(const GLint
*v
)
3693 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3696 static void GLAPIENTRY
save_WindowPos3svMESA(const GLshort
*v
)
3698 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
3701 static void GLAPIENTRY
save_WindowPos4dvMESA(const GLdouble
*v
)
3703 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3704 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3707 static void GLAPIENTRY
save_WindowPos4fvMESA(const GLfloat
*v
)
3709 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3712 static void GLAPIENTRY
save_WindowPos4ivMESA(const GLint
*v
)
3714 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
3715 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3718 static void GLAPIENTRY
save_WindowPos4svMESA(const GLshort
*v
)
3720 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
3725 /* GL_ARB_multitexture */
3726 static void GLAPIENTRY
save_ActiveTextureARB( GLenum target
)
3728 GET_CURRENT_CONTEXT(ctx
);
3730 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3731 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_TEXTURE
, 1 );
3735 if (ctx
->ExecuteFlag
) {
3736 (*ctx
->Exec
->ActiveTextureARB
)( target
);
3741 /* GL_ARB_transpose_matrix */
3743 static void GLAPIENTRY
save_LoadTransposeMatrixdARB( const GLdouble m
[16] )
3746 _math_transposefd(tm
, m
);
3747 save_LoadMatrixf(tm
);
3751 static void GLAPIENTRY
save_LoadTransposeMatrixfARB( const GLfloat m
[16] )
3754 _math_transposef(tm
, m
);
3755 save_LoadMatrixf(tm
);
3759 static void GLAPIENTRY
3760 save_MultTransposeMatrixdARB( const GLdouble m
[16] )
3763 _math_transposefd(tm
, m
);
3764 save_MultMatrixf(tm
);
3768 static void GLAPIENTRY
3769 save_MultTransposeMatrixfARB( const GLfloat m
[16] )
3772 _math_transposef(tm
, m
);
3773 save_MultMatrixf(tm
);
3777 static void GLAPIENTRY
3778 save_PixelTexGenSGIX(GLenum mode
)
3780 GET_CURRENT_CONTEXT(ctx
);
3782 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3783 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_SGIX
, 1 );
3787 if (ctx
->ExecuteFlag
) {
3788 (*ctx
->Exec
->PixelTexGenSGIX
)( mode
);
3793 /* GL_ARB_texture_compression */
3794 static void GLAPIENTRY
3795 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
3796 GLenum internalFormat
, GLsizei width
,
3797 GLint border
, GLsizei imageSize
,
3800 GET_CURRENT_CONTEXT(ctx
);
3801 if (target
== GL_PROXY_TEXTURE_1D
) {
3802 /* don't compile, execute immediately */
3803 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3804 width
, border
, imageSize
, data
);
3809 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3810 /* make copy of image */
3811 image
= MALLOC(imageSize
);
3813 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
3816 MEMCPY(image
, data
, imageSize
);
3817 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7 );
3821 n
[3].e
= internalFormat
;
3822 n
[4].i
= (GLint
) width
;
3830 if (ctx
->ExecuteFlag
) {
3831 (*ctx
->Exec
->CompressedTexImage1DARB
)(target
, level
, internalFormat
,
3832 width
, border
, imageSize
, data
);
3838 static void GLAPIENTRY
3839 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
3840 GLenum internalFormat
, GLsizei width
,
3841 GLsizei height
, GLint border
, GLsizei imageSize
,
3844 GET_CURRENT_CONTEXT(ctx
);
3845 if (target
== GL_PROXY_TEXTURE_2D
) {
3846 /* don't compile, execute immediately */
3847 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3848 width
, height
, border
, imageSize
, data
);
3853 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3854 /* make copy of image */
3855 image
= MALLOC(imageSize
);
3857 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
3860 MEMCPY(image
, data
, imageSize
);
3861 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8 );
3865 n
[3].e
= internalFormat
;
3866 n
[4].i
= (GLint
) width
;
3867 n
[5].i
= (GLint
) height
;
3875 if (ctx
->ExecuteFlag
) {
3876 (*ctx
->Exec
->CompressedTexImage2DARB
)(target
, level
, internalFormat
,
3877 width
, height
, border
, imageSize
, data
);
3883 static void GLAPIENTRY
3884 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
3885 GLenum internalFormat
, GLsizei width
,
3886 GLsizei height
, GLsizei depth
, GLint border
,
3887 GLsizei imageSize
, const GLvoid
*data
)
3889 GET_CURRENT_CONTEXT(ctx
);
3890 if (target
== GL_PROXY_TEXTURE_3D
) {
3891 /* don't compile, execute immediately */
3892 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3893 width
, height
, depth
, border
, imageSize
, data
);
3898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3899 /* make copy of image */
3900 image
= MALLOC(imageSize
);
3902 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
3905 MEMCPY(image
, data
, imageSize
);
3906 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9 );
3910 n
[3].e
= internalFormat
;
3911 n
[4].i
= (GLint
) width
;
3912 n
[5].i
= (GLint
) height
;
3913 n
[6].i
= (GLint
) depth
;
3921 if (ctx
->ExecuteFlag
) {
3922 (*ctx
->Exec
->CompressedTexImage3DARB
)(target
, level
, internalFormat
,
3923 width
, height
, depth
, border
, imageSize
, data
);
3929 static void GLAPIENTRY
3930 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
3931 GLsizei width
, GLenum format
,
3932 GLsizei imageSize
, const GLvoid
*data
)
3937 GET_CURRENT_CONTEXT(ctx
);
3938 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3940 /* make copy of image */
3941 image
= MALLOC(imageSize
);
3943 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
3946 MEMCPY(image
, data
, imageSize
);
3947 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7 );
3952 n
[4].i
= (GLint
) width
;
3960 if (ctx
->ExecuteFlag
) {
3961 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(target
, level
, xoffset
,
3962 width
, format
, imageSize
, data
);
3967 static void GLAPIENTRY
3968 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
3969 GLint yoffset
, GLsizei width
, GLsizei height
,
3970 GLenum format
, GLsizei imageSize
,
3976 GET_CURRENT_CONTEXT(ctx
);
3977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3979 /* make copy of image */
3980 image
= MALLOC(imageSize
);
3982 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
3985 MEMCPY(image
, data
, imageSize
);
3986 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9 );
3992 n
[5].i
= (GLint
) width
;
3993 n
[6].i
= (GLint
) height
;
4001 if (ctx
->ExecuteFlag
) {
4002 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(target
, level
, xoffset
, yoffset
,
4003 width
, height
, format
, imageSize
, data
);
4008 static void GLAPIENTRY
4009 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4010 GLint yoffset
, GLint zoffset
, GLsizei width
,
4011 GLsizei height
, GLsizei depth
, GLenum format
,
4012 GLsizei imageSize
, const GLvoid
*data
)
4017 GET_CURRENT_CONTEXT(ctx
);
4018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4020 /* make copy of image */
4021 image
= MALLOC(imageSize
);
4023 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4026 MEMCPY(image
, data
, imageSize
);
4027 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11 );
4034 n
[6].i
= (GLint
) width
;
4035 n
[7].i
= (GLint
) height
;
4036 n
[8].i
= (GLint
) depth
;
4038 n
[10].i
= imageSize
;
4044 if (ctx
->ExecuteFlag
) {
4045 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(target
, level
, xoffset
, yoffset
,
4046 zoffset
, width
, height
, depth
, format
, imageSize
, data
);
4051 /* GL_ARB_multisample */
4052 static void GLAPIENTRY
4053 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4055 GET_CURRENT_CONTEXT(ctx
);
4057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4058 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_SAMPLE_COVERAGE
, 2 );
4063 if (ctx
->ExecuteFlag
) {
4064 (*ctx
->Exec
->SampleCoverageARB
)( value
, invert
);
4069 /* GL_SGIS_pixel_texture */
4071 static void GLAPIENTRY
4072 save_PixelTexGenParameteriSGIS(GLenum target
, GLint value
)
4074 GET_CURRENT_CONTEXT(ctx
);
4076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4077 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
, 2 );
4082 if (ctx
->ExecuteFlag
) {
4083 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( target
, value
);
4088 static void GLAPIENTRY
4089 save_PixelTexGenParameterfSGIS(GLenum target
, GLfloat value
)
4091 save_PixelTexGenParameteriSGIS(target
, (GLint
) value
);
4095 static void GLAPIENTRY
4096 save_PixelTexGenParameterivSGIS(GLenum target
, const GLint
*value
)
4098 save_PixelTexGenParameteriSGIS(target
, *value
);
4102 static void GLAPIENTRY
4103 save_PixelTexGenParameterfvSGIS(GLenum target
, const GLfloat
*value
)
4105 save_PixelTexGenParameteriSGIS(target
, (GLint
) *value
);
4110 * GL_NV_vertex_program
4112 #if FEATURE_NV_vertex_program
4113 static void GLAPIENTRY
4114 save_BindProgramNV(GLenum target
, GLuint id
)
4116 GET_CURRENT_CONTEXT(ctx
);
4118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4119 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BIND_PROGRAM_NV
, 2 );
4124 if (ctx
->ExecuteFlag
) {
4125 (*ctx
->Exec
->BindProgramNV
)( target
, id
);
4129 static void GLAPIENTRY
4130 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4132 GET_CURRENT_CONTEXT(ctx
);
4134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4135 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6 );
4144 if (ctx
->ExecuteFlag
) {
4145 (*ctx
->Exec
->ExecuteProgramNV
)(target
, id
, params
);
4150 static void GLAPIENTRY
4151 save_ProgramParameter4fNV(GLenum target
, GLuint index
,
4152 GLfloat x
, GLfloat y
,
4153 GLfloat z
, GLfloat w
)
4155 GET_CURRENT_CONTEXT(ctx
);
4157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4158 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_PARAMETER4F_NV
, 6 );
4167 if (ctx
->ExecuteFlag
) {
4168 (*ctx
->Exec
->ProgramParameter4fNV
)(target
, index
, x
, y
, z
, w
);
4173 static void GLAPIENTRY
4174 save_ProgramParameter4fvNV(GLenum target
, GLuint index
, const GLfloat
*params
)
4176 save_ProgramParameter4fNV(target
, index
, params
[0], params
[1],
4177 params
[2], params
[3]);
4181 static void GLAPIENTRY
4182 save_ProgramParameter4dNV(GLenum target
, GLuint index
,
4183 GLdouble x
, GLdouble y
,
4184 GLdouble z
, GLdouble w
)
4186 save_ProgramParameter4fNV(target
, index
, (GLfloat
) x
, (GLfloat
) y
,
4187 (GLfloat
) z
, (GLfloat
) w
);
4191 static void GLAPIENTRY
4192 save_ProgramParameter4dvNV(GLenum target
, GLuint index
,
4193 const GLdouble
*params
)
4195 save_ProgramParameter4fNV(target
, index
, (GLfloat
) params
[0],
4196 (GLfloat
) params
[1], (GLfloat
) params
[2],
4197 (GLfloat
) params
[3]);
4201 static void GLAPIENTRY
4202 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4203 GLuint num
, const GLdouble
*params
)
4206 for (i
= 0; i
< num
; i
++) {
4207 save_ProgramParameter4dvNV(target
, index
+ i
, params
+ 4 * i
);
4212 static void GLAPIENTRY
4213 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4214 GLuint num
, const GLfloat
*params
)
4217 for (i
= 0; i
< num
; i
++) {
4218 save_ProgramParameter4fvNV(target
, index
+ i
, params
+ 4 * i
);
4223 static void GLAPIENTRY
4224 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4225 const GLubyte
*program
)
4227 GET_CURRENT_CONTEXT(ctx
);
4229 GLubyte
*programCopy
;
4231 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4233 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4236 _mesa_memcpy(programCopy
, program
, len
);
4238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4239 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_LOAD_PROGRAM_NV
, 4 );
4244 n
[4].data
= programCopy
;
4246 if (ctx
->ExecuteFlag
) {
4247 (*ctx
->Exec
->LoadProgramNV
)(target
, id
, len
, program
);
4252 static void GLAPIENTRY
4253 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
*ids
)
4255 GET_CURRENT_CONTEXT(ctx
);
4257 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4259 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4262 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4264 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 2 );
4269 if (ctx
->ExecuteFlag
) {
4270 (*ctx
->Exec
->RequestResidentProgramsNV
)(num
, ids
);
4275 static void GLAPIENTRY
4276 save_TrackMatrixNV(GLenum target
, GLuint address
,
4277 GLenum matrix
, GLenum transform
)
4279 GET_CURRENT_CONTEXT(ctx
);
4281 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4282 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_TRACK_MATRIX_NV
, 4 );
4289 if (ctx
->ExecuteFlag
) {
4290 (*ctx
->Exec
->TrackMatrixNV
)(target
, address
, matrix
, transform
);
4293 #endif /* FEATURE_NV_vertex_program */
4297 * GL_NV_fragment_program
4299 #if FEATURE_NV_fragment_program
4300 static void GLAPIENTRY
4301 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4302 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4304 GET_CURRENT_CONTEXT(ctx
);
4306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4307 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4316 if (ctx
->ExecuteFlag
) {
4317 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(target
, index
, x
, y
, z
, w
);
4322 static void GLAPIENTRY
4323 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4324 const GLfloat
*params
)
4326 GET_CURRENT_CONTEXT(ctx
);
4328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4329 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4338 if (ctx
->ExecuteFlag
) {
4339 (*ctx
->Exec
->ProgramLocalParameter4fvARB
)(target
, index
, params
);
4344 static void GLAPIENTRY
4345 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4346 GLdouble x
, GLdouble y
,
4347 GLdouble z
, GLdouble w
)
4349 GET_CURRENT_CONTEXT(ctx
);
4351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4352 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4356 n
[3].f
= (GLfloat
) x
;
4357 n
[4].f
= (GLfloat
) y
;
4358 n
[5].f
= (GLfloat
) z
;
4359 n
[6].f
= (GLfloat
) w
;
4361 if (ctx
->ExecuteFlag
) {
4362 (*ctx
->Exec
->ProgramLocalParameter4dARB
)(target
, index
, x
, y
, z
, w
);
4367 static void GLAPIENTRY
4368 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4369 const GLdouble
*params
)
4371 GET_CURRENT_CONTEXT(ctx
);
4373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4374 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6 );
4378 n
[3].f
= (GLfloat
) params
[0];
4379 n
[4].f
= (GLfloat
) params
[1];
4380 n
[5].f
= (GLfloat
) params
[2];
4381 n
[6].f
= (GLfloat
) params
[3];
4383 if (ctx
->ExecuteFlag
) {
4384 (*ctx
->Exec
->ProgramLocalParameter4dvARB
)(target
, index
, params
);
4388 static void GLAPIENTRY
4389 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4390 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4392 GET_CURRENT_CONTEXT(ctx
);
4394 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4396 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4399 _mesa_memcpy(nameCopy
, name
, len
);
4401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4402 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6 );
4406 n
[3].data
= nameCopy
;
4412 if (ctx
->ExecuteFlag
) {
4413 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(id
, len
, name
, x
, y
, z
, w
);
4418 static void GLAPIENTRY
4419 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4422 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4426 static void GLAPIENTRY
4427 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4428 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4430 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4431 (GLfloat
) z
,(GLfloat
) w
);
4435 static void GLAPIENTRY
4436 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
*name
,
4439 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4440 (GLfloat
) v
[1], (GLfloat
) v
[2],
4444 #endif /* FEATURE_NV_fragment_program */
4448 /* GL_EXT_stencil_two_side */
4449 static void GLAPIENTRY
save_ActiveStencilFaceEXT( GLenum face
)
4451 GET_CURRENT_CONTEXT(ctx
);
4453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4454 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1 );
4458 if (ctx
->ExecuteFlag
) {
4459 (*ctx
->Exec
->ActiveStencilFaceEXT
)( face
);
4464 /* GL_EXT_depth_bounds_test */
4465 static void GLAPIENTRY
save_DepthBoundsEXT( GLclampd zmin
, GLclampd zmax
)
4467 GET_CURRENT_CONTEXT(ctx
);
4469 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4470 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 2 );
4472 n
[1].f
= (GLfloat
) zmin
;
4473 n
[2].f
= (GLfloat
) zmax
;
4475 if (ctx
->ExecuteFlag
) {
4476 (*ctx
->Exec
->DepthBoundsEXT
)( zmin
, zmax
);
4482 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4484 static void GLAPIENTRY
4485 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4486 const GLvoid
*string
)
4488 GET_CURRENT_CONTEXT(ctx
);
4490 GLubyte
*programCopy
;
4492 programCopy
= (GLubyte
*) _mesa_malloc(len
);
4494 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
4497 _mesa_memcpy(programCopy
, string
, len
);
4499 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4500 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_STRING_ARB
, 4 );
4505 n
[4].data
= programCopy
;
4507 if (ctx
->ExecuteFlag
) {
4508 (*ctx
->Exec
->ProgramStringARB
)(target
, format
, len
, string
);
4513 static void GLAPIENTRY
4514 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4515 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4517 GET_CURRENT_CONTEXT(ctx
);
4519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4520 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6 );
4529 if (ctx
->ExecuteFlag
) {
4530 (*ctx
->Exec
->ProgramEnvParameter4fARB
)( target
, index
, x
, y
, z
, w
);
4535 static void GLAPIENTRY
4536 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4537 const GLfloat
*params
)
4539 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4540 params
[2], params
[3]);
4544 static void GLAPIENTRY
4545 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4546 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4548 save_ProgramEnvParameter4fARB(target
, index
,
4556 static void GLAPIENTRY
4557 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4558 const GLdouble
*params
)
4560 save_ProgramEnvParameter4fARB(target
, index
,
4561 (GLfloat
) params
[0],
4562 (GLfloat
) params
[1],
4563 (GLfloat
) params
[2],
4564 (GLfloat
) params
[3]);
4567 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
4572 static void save_Attr1f( GLenum attr
, GLfloat x
)
4574 GET_CURRENT_CONTEXT(ctx
);
4576 SAVE_FLUSH_VERTICES( ctx
);
4577 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_1F
, 2 );
4583 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
4584 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
4586 if (ctx
->ExecuteFlag
) {
4587 (*ctx
->Exec
->VertexAttrib1fNV
)( attr
, x
);
4591 static void save_Attr2f( GLenum attr
, GLfloat x
, GLfloat y
)
4593 GET_CURRENT_CONTEXT(ctx
);
4595 SAVE_FLUSH_VERTICES( ctx
);
4596 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_2F
, 3 );
4603 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
4604 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
4606 if (ctx
->ExecuteFlag
) {
4607 (*ctx
->Exec
->VertexAttrib2fNV
)( attr
, x
, y
);
4611 static void save_Attr3f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
4613 GET_CURRENT_CONTEXT(ctx
);
4615 SAVE_FLUSH_VERTICES( ctx
);
4616 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_3F
, 4 );
4624 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
4625 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
4627 if (ctx
->ExecuteFlag
) {
4628 (*ctx
->Exec
->VertexAttrib3fNV
)( attr
, x
, y
, z
);
4632 static void save_Attr4f( GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
,
4635 GET_CURRENT_CONTEXT(ctx
);
4637 SAVE_FLUSH_VERTICES( ctx
);
4638 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ATTR_4F
, 5 );
4647 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
4648 ASSIGN_4V( ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
4650 if (ctx
->ExecuteFlag
) {
4651 (*ctx
->Exec
->VertexAttrib4fNV
)( attr
, x
, y
, z
, w
);
4655 static void GLAPIENTRY
save_EvalCoord1f( GLfloat x
)
4657 GET_CURRENT_CONTEXT(ctx
);
4659 SAVE_FLUSH_VERTICES( ctx
);
4660 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C1
, 1 );
4664 if (ctx
->ExecuteFlag
) {
4665 (*ctx
->Exec
->EvalCoord1f
)( x
);
4669 static void GLAPIENTRY
save_EvalCoord1fv( const GLfloat
*v
)
4671 save_EvalCoord1f( v
[0] );
4674 static void GLAPIENTRY
save_EvalCoord2f( GLfloat x
, GLfloat y
)
4676 GET_CURRENT_CONTEXT(ctx
);
4678 SAVE_FLUSH_VERTICES( ctx
);
4679 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_C2
, 2 );
4684 if (ctx
->ExecuteFlag
) {
4685 (*ctx
->Exec
->EvalCoord2f
)( x
, y
);
4689 static void GLAPIENTRY
save_EvalCoord2fv( const GLfloat
*v
)
4691 save_EvalCoord2f( v
[0], v
[1] );
4695 static void GLAPIENTRY
save_EvalPoint1( GLint x
)
4697 GET_CURRENT_CONTEXT(ctx
);
4699 SAVE_FLUSH_VERTICES( ctx
);
4700 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P1
, 1 );
4704 if (ctx
->ExecuteFlag
) {
4705 (*ctx
->Exec
->EvalPoint1
)( x
);
4709 static void GLAPIENTRY
save_EvalPoint2( GLint x
, GLint y
)
4711 GET_CURRENT_CONTEXT(ctx
);
4713 SAVE_FLUSH_VERTICES( ctx
);
4714 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EVAL_P2
, 2 );
4719 if (ctx
->ExecuteFlag
) {
4720 (*ctx
->Exec
->EvalPoint2
)( x
, y
);
4724 static void GLAPIENTRY
save_Indexf( GLfloat x
)
4726 GET_CURRENT_CONTEXT(ctx
);
4728 SAVE_FLUSH_VERTICES( ctx
);
4729 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_INDEX
, 1 );
4734 ctx
->ListState
.ActiveIndex
= 1;
4735 ctx
->ListState
.CurrentIndex
= x
;
4737 if (ctx
->ExecuteFlag
) {
4738 (*ctx
->Exec
->Indexi
)( (GLint
) x
);
4742 static void GLAPIENTRY
save_Indexfv( const GLfloat
*v
)
4744 save_Indexf( v
[0] );
4747 static void GLAPIENTRY
save_EdgeFlag( GLboolean x
)
4749 GET_CURRENT_CONTEXT(ctx
);
4751 SAVE_FLUSH_VERTICES( ctx
);
4752 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_EDGEFLAG
, 1 );
4757 ctx
->ListState
.ActiveEdgeFlag
= 1;
4758 ctx
->ListState
.CurrentEdgeFlag
= x
;
4760 if (ctx
->ExecuteFlag
) {
4761 (*ctx
->Exec
->EdgeFlag
)( x
);
4765 static void GLAPIENTRY
save_EdgeFlagv( const GLboolean
*v
)
4767 save_EdgeFlag( v
[0] );
4770 static void GLAPIENTRY
save_Materialfv( GLenum face
, GLenum pname
, const GLfloat
*param
)
4772 GET_CURRENT_CONTEXT(ctx
);
4776 SAVE_FLUSH_VERTICES( ctx
);
4781 case GL_FRONT_AND_BACK
:
4784 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(face)" );
4793 case GL_AMBIENT_AND_DIFFUSE
:
4799 case GL_COLOR_INDEXES
:
4803 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "material(pname)" );
4807 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_MATERIAL
, 6 );
4811 for (i
= 0 ; i
< args
; i
++)
4812 n
[3+i
].f
= param
[i
];
4816 GLuint bitmask
= _mesa_material_bitmask( ctx
, face
, pname
, ~0, 0 );
4817 for (i
= 0 ; i
< MAT_ATTRIB_MAX
; i
++)
4818 if (bitmask
& (1<<i
)) {
4819 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
4820 COPY_SZ_4V( ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
4824 if (ctx
->ExecuteFlag
) {
4825 (*ctx
->Exec
->Materialfv
)( face
, pname
, param
);
4829 static void GLAPIENTRY
save_Begin( GLenum mode
)
4831 GET_CURRENT_CONTEXT(ctx
);
4833 GLboolean error
= GL_FALSE
;
4835 if (mode
< GL_POINTS
|| mode
> GL_POLYGON
) {
4836 _mesa_compile_error( ctx
, GL_INVALID_ENUM
, "Begin (mode)");
4839 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
4840 /* Typically the first begin. This may raise an error on
4841 * playback, depending on whether CallList is issued from inside
4842 * a begin/end or not.
4844 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
4846 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
4847 ctx
->Driver
.CurrentSavePrimitive
= mode
;
4850 _mesa_compile_error( ctx
, GL_INVALID_OPERATION
, "recursive begin" );
4855 /* Give the driver an opportunity to hook in an optimized
4856 * display list compiler.
4858 if (ctx
->Driver
.NotifySaveBegin( ctx
, mode
))
4861 SAVE_FLUSH_VERTICES( ctx
);
4862 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_BEGIN
, 1 );
4868 if (ctx
->ExecuteFlag
) {
4869 (*ctx
->Exec
->Begin
)( mode
);
4873 static void GLAPIENTRY
save_End( void )
4875 GET_CURRENT_CONTEXT(ctx
);
4876 SAVE_FLUSH_VERTICES( ctx
);
4877 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END
, 0 );
4878 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
4879 if (ctx
->ExecuteFlag
) {
4880 (*ctx
->Exec
->End
)( );
4884 static void GLAPIENTRY
save_Rectf( GLfloat a
, GLfloat b
,
4885 GLfloat c
, GLfloat d
)
4887 GET_CURRENT_CONTEXT(ctx
);
4889 SAVE_FLUSH_VERTICES( ctx
);
4890 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_RECTF
, 4 );
4897 if (ctx
->ExecuteFlag
) {
4898 (*ctx
->Exec
->Rectf
)( a
, b
, c
, d
);
4904 static void GLAPIENTRY
save_Vertex2f( GLfloat x
, GLfloat y
)
4906 save_Attr2f( VERT_ATTRIB_POS
, x
, y
);
4909 static void GLAPIENTRY
save_Vertex2fv( const GLfloat
*v
)
4911 save_Attr2f( VERT_ATTRIB_POS
, v
[0], v
[1] );
4914 static void GLAPIENTRY
save_Vertex3f( GLfloat x
, GLfloat y
, GLfloat z
)
4916 save_Attr3f( VERT_ATTRIB_POS
, x
, y
, z
);
4919 static void GLAPIENTRY
save_Vertex3fv( const GLfloat
*v
)
4921 save_Attr3f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2] );
4924 static void GLAPIENTRY
save_Vertex4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4926 save_Attr4f( VERT_ATTRIB_POS
, x
, y
, z
, w
);
4929 static void GLAPIENTRY
save_Vertex4fv( const GLfloat
*v
)
4931 save_Attr4f( VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3] );
4934 static void GLAPIENTRY
save_TexCoord1f( GLfloat x
)
4936 save_Attr1f( VERT_ATTRIB_TEX0
, x
);
4939 static void GLAPIENTRY
save_TexCoord1fv( const GLfloat
*v
)
4941 save_Attr1f( VERT_ATTRIB_TEX0
, v
[0] );
4944 static void GLAPIENTRY
save_TexCoord2f( GLfloat x
, GLfloat y
)
4946 save_Attr2f( VERT_ATTRIB_TEX0
, x
, y
);
4949 static void GLAPIENTRY
save_TexCoord2fv( const GLfloat
*v
)
4951 save_Attr2f( VERT_ATTRIB_TEX0
, v
[0], v
[1] );
4954 static void GLAPIENTRY
save_TexCoord3f( GLfloat x
, GLfloat y
, GLfloat z
)
4956 save_Attr3f( VERT_ATTRIB_TEX0
, x
, y
, z
);
4959 static void GLAPIENTRY
save_TexCoord3fv( const GLfloat
*v
)
4961 save_Attr3f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2] );
4964 static void GLAPIENTRY
save_TexCoord4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4966 save_Attr4f( VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
4969 static void GLAPIENTRY
save_TexCoord4fv( const GLfloat
*v
)
4971 save_Attr4f( VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3] );
4974 static void GLAPIENTRY
save_Normal3f( GLfloat x
, GLfloat y
, GLfloat z
)
4976 save_Attr3f( VERT_ATTRIB_NORMAL
, x
, y
, z
);
4979 static void GLAPIENTRY
save_Normal3fv( const GLfloat
*v
)
4981 save_Attr3f( VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2] );
4984 static void GLAPIENTRY
save_FogCoordfEXT( GLfloat x
)
4986 save_Attr1f( VERT_ATTRIB_FOG
, x
);
4989 static void GLAPIENTRY
save_FogCoordfvEXT( const GLfloat
*v
)
4991 save_Attr1f( VERT_ATTRIB_FOG
, v
[0] );
4994 static void GLAPIENTRY
save_Color3f( GLfloat x
, GLfloat y
, GLfloat z
)
4996 save_Attr3f( VERT_ATTRIB_COLOR0
, x
, y
, z
);
4999 static void GLAPIENTRY
save_Color3fv( const GLfloat
*v
)
5001 save_Attr3f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2] );
5004 static void GLAPIENTRY
save_Color4f( GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5006 save_Attr4f( VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5009 static void GLAPIENTRY
save_Color4fv( const GLfloat
*v
)
5011 save_Attr4f( VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3] );
5014 static void GLAPIENTRY
save_SecondaryColor3fEXT( GLfloat x
, GLfloat y
, GLfloat z
)
5016 save_Attr3f( VERT_ATTRIB_COLOR1
, x
, y
, z
);
5019 static void GLAPIENTRY
save_SecondaryColor3fvEXT( const GLfloat
*v
)
5021 save_Attr3f( VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2] );
5025 /* Just call the respective ATTR for texcoord
5027 static void GLAPIENTRY
save_MultiTexCoord1f( GLenum target
, GLfloat x
)
5029 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5030 save_Attr1f( attr
, x
);
5033 static void GLAPIENTRY
save_MultiTexCoord1fv( GLenum target
, const GLfloat
*v
)
5035 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5036 save_Attr1f( attr
, v
[0] );
5039 static void GLAPIENTRY
save_MultiTexCoord2f( GLenum target
, GLfloat x
, GLfloat y
)
5041 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5042 save_Attr2f( attr
, x
, y
);
5045 static void GLAPIENTRY
save_MultiTexCoord2fv( GLenum target
, const GLfloat
*v
)
5047 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5048 save_Attr2f( attr
, v
[0], v
[1] );
5051 static void GLAPIENTRY
save_MultiTexCoord3f( GLenum target
, GLfloat x
, GLfloat y
,
5054 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5055 save_Attr3f( attr
, x
, y
, z
);
5058 static void GLAPIENTRY
save_MultiTexCoord3fv( GLenum target
, const GLfloat
*v
)
5060 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5061 save_Attr3f( attr
, v
[0], v
[1], v
[2] );
5064 static void GLAPIENTRY
save_MultiTexCoord4f( GLenum target
, GLfloat x
, GLfloat y
,
5065 GLfloat z
, GLfloat w
)
5067 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5068 save_Attr4f( attr
, x
, y
, z
, w
);
5071 static void GLAPIENTRY
save_MultiTexCoord4fv( GLenum target
, const GLfloat
*v
)
5073 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5074 save_Attr4f( attr
, v
[0], v
[1], v
[2], v
[3] );
5078 static void enum_error( void )
5080 GET_CURRENT_CONTEXT( ctx
);
5081 _mesa_error( ctx
, GL_INVALID_ENUM
, "VertexAttribfNV" );
5084 /* First level for NV_vertex_program:
5086 * Check for errors at compile time?.
5088 static void GLAPIENTRY
save_VertexAttrib1fNV( GLuint index
, GLfloat x
)
5090 if (index
< VERT_ATTRIB_MAX
)
5091 save_Attr1f( index
, x
);
5096 static void GLAPIENTRY
save_VertexAttrib1fvNV( GLuint index
, const GLfloat
*v
)
5098 if (index
< VERT_ATTRIB_MAX
)
5099 save_Attr1f( index
, v
[0] );
5104 static void GLAPIENTRY
save_VertexAttrib2fNV( GLuint index
, GLfloat x
, GLfloat y
)
5106 if (index
< VERT_ATTRIB_MAX
)
5107 save_Attr2f( index
, x
, y
);
5112 static void GLAPIENTRY
save_VertexAttrib2fvNV( GLuint index
, const GLfloat
*v
)
5114 if (index
< VERT_ATTRIB_MAX
)
5115 save_Attr2f( index
, v
[0], v
[1] );
5120 static void GLAPIENTRY
save_VertexAttrib3fNV( GLuint index
, GLfloat x
, GLfloat y
,
5123 if (index
< VERT_ATTRIB_MAX
)
5124 save_Attr3f( index
, x
, y
, z
);
5129 static void GLAPIENTRY
save_VertexAttrib3fvNV( GLuint index
, const GLfloat
*v
)
5131 if (index
< VERT_ATTRIB_MAX
)
5132 save_Attr3f( index
, v
[0], v
[1], v
[2] );
5137 static void GLAPIENTRY
save_VertexAttrib4fNV( GLuint index
, GLfloat x
, GLfloat y
,
5138 GLfloat z
, GLfloat w
)
5140 if (index
< VERT_ATTRIB_MAX
)
5141 save_Attr4f( index
, x
, y
, z
, w
);
5146 static void GLAPIENTRY
save_VertexAttrib4fvNV( GLuint index
, const GLfloat
*v
)
5148 if (index
< VERT_ATTRIB_MAX
)
5149 save_Attr4f( index
, v
[0], v
[1], v
[2], v
[3] );
5158 /* KW: Compile commands
5160 * Will appear in the list before the vertex buffer containing the
5161 * command that provoked the error. I don't see this as a problem.
5164 _mesa_save_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5167 n
= ALLOC_INSTRUCTION( ctx
, OPCODE_ERROR
, 2 );
5170 n
[2].data
= (void *) s
;
5172 /* execute already done */
5177 * Compile an error into current display list.
5180 _mesa_compile_error( GLcontext
*ctx
, GLenum error
, const char *s
)
5182 if (ctx
->CompileFlag
)
5183 _mesa_save_error( ctx
, error
, s
);
5185 if (ctx
->ExecuteFlag
)
5186 _mesa_error( ctx
, error
, s
);
5192 islist(GLcontext
*ctx
, GLuint list
)
5194 if (list
> 0 && _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
)) {
5204 /**********************************************************************/
5205 /* Display list execution */
5206 /**********************************************************************/
5210 * Execute a display list. Note that the ListBase offset must have already
5211 * been added before calling this function. I.e. the list argument is
5212 * the absolute list number, not relative to ListBase.
5213 * \param list - display list number
5215 static void GLAPIENTRY
5216 execute_list( GLcontext
*ctx
, GLuint list
)
5221 if (list
== 0 || !islist(ctx
,list
))
5224 if (ctx
->Driver
.BeginCallList
)
5225 ctx
->Driver
.BeginCallList( ctx
, list
);
5227 ctx
->ListState
.CallDepth
++;
5229 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
5233 OpCode opcode
= n
[0].opcode
;
5234 int i
= (int)n
[0].opcode
- (int)OPCODE_DRV_0
;
5236 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
5237 ctx
->listext
.opcode
[i
].execute(ctx
, &n
[1]);
5238 n
+= ctx
->listext
.opcode
[i
].size
;
5243 _mesa_error( ctx
, n
[1].e
, (const char *) n
[2].data
);
5246 (*ctx
->Exec
->Accum
)( n
[1].e
, n
[2].f
);
5248 case OPCODE_ALPHA_FUNC
:
5249 (*ctx
->Exec
->AlphaFunc
)( n
[1].e
, n
[2].f
);
5251 case OPCODE_BIND_TEXTURE
:
5252 (*ctx
->Exec
->BindTexture
)( n
[1].e
, n
[2].ui
);
5256 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5257 ctx
->Unpack
= _mesa_native_packing
;
5258 (*ctx
->Exec
->Bitmap
)( (GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
5259 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (const GLubyte
*) n
[7].data
);
5260 ctx
->Unpack
= save
; /* restore */
5263 case OPCODE_BLEND_COLOR
:
5264 (*ctx
->Exec
->BlendColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5266 case OPCODE_BLEND_EQUATION
:
5267 (*ctx
->Exec
->BlendEquation
)( n
[1].e
);
5269 case OPCODE_BLEND_FUNC_SEPARATE
:
5270 (*ctx
->Exec
->BlendFuncSeparateEXT
)(n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
);
5272 case OPCODE_CALL_LIST
:
5273 /* Generated by glCallList(), don't add ListBase */
5274 if (ctx
->ListState
.CallDepth
<MAX_LIST_NESTING
) {
5275 execute_list( ctx
, n
[1].ui
);
5278 case OPCODE_CALL_LIST_OFFSET
:
5279 /* Generated by glCallLists() so we must add ListBase */
5281 /* user specified a bad data type at compile time */
5282 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
5284 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
5285 execute_list( ctx
, ctx
->List
.ListBase
+ n
[1].ui
);
5289 (*ctx
->Exec
->Clear
)( n
[1].bf
);
5291 case OPCODE_CLEAR_COLOR
:
5292 (*ctx
->Exec
->ClearColor
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5294 case OPCODE_CLEAR_ACCUM
:
5295 (*ctx
->Exec
->ClearAccum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5297 case OPCODE_CLEAR_DEPTH
:
5298 (*ctx
->Exec
->ClearDepth
)( (GLclampd
) n
[1].f
);
5300 case OPCODE_CLEAR_INDEX
:
5301 (*ctx
->Exec
->ClearIndex
)( (GLfloat
) n
[1].ui
);
5303 case OPCODE_CLEAR_STENCIL
:
5304 (*ctx
->Exec
->ClearStencil
)( n
[1].i
);
5306 case OPCODE_CLIP_PLANE
:
5313 (*ctx
->Exec
->ClipPlane
)( n
[1].e
, eq
);
5316 case OPCODE_COLOR_MASK
:
5317 (*ctx
->Exec
->ColorMask
)( n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
);
5319 case OPCODE_COLOR_MATERIAL
:
5320 (*ctx
->Exec
->ColorMaterial
)( n
[1].e
, n
[2].e
);
5322 case OPCODE_COLOR_TABLE
:
5324 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5325 ctx
->Unpack
= _mesa_native_packing
;
5326 (*ctx
->Exec
->ColorTable
)( n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
5327 n
[5].e
, n
[6].data
);
5328 ctx
->Unpack
= save
; /* restore */
5331 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
5338 (*ctx
->Exec
->ColorTableParameterfv
)( n
[1].e
, n
[2].e
, params
);
5341 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
5348 (*ctx
->Exec
->ColorTableParameteriv
)( n
[1].e
, n
[2].e
, params
);
5351 case OPCODE_COLOR_SUB_TABLE
:
5353 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5354 ctx
->Unpack
= _mesa_native_packing
;
5355 (*ctx
->Exec
->ColorSubTable
)( n
[1].e
, n
[2].i
, n
[3].i
,
5356 n
[4].e
, n
[5].e
, n
[6].data
);
5357 ctx
->Unpack
= save
; /* restore */
5360 case OPCODE_CONVOLUTION_FILTER_1D
:
5362 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5363 ctx
->Unpack
= _mesa_native_packing
;
5364 (*ctx
->Exec
->ConvolutionFilter1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5365 n
[4].e
, n
[5].e
, n
[6].data
);
5366 ctx
->Unpack
= save
; /* restore */
5369 case OPCODE_CONVOLUTION_FILTER_2D
:
5371 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5372 ctx
->Unpack
= _mesa_native_packing
;
5373 (*ctx
->Exec
->ConvolutionFilter2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5374 n
[4].i
, n
[5].e
, n
[6].e
, n
[7].data
);
5375 ctx
->Unpack
= save
; /* restore */
5378 case OPCODE_CONVOLUTION_PARAMETER_I
:
5379 (*ctx
->Exec
->ConvolutionParameteri
)( n
[1].e
, n
[2].e
, n
[3].i
);
5381 case OPCODE_CONVOLUTION_PARAMETER_IV
:
5388 (*ctx
->Exec
->ConvolutionParameteriv
)( n
[1].e
, n
[2].e
, params
);
5391 case OPCODE_CONVOLUTION_PARAMETER_F
:
5392 (*ctx
->Exec
->ConvolutionParameterf
)( n
[1].e
, n
[2].e
, n
[3].f
);
5394 case OPCODE_CONVOLUTION_PARAMETER_FV
:
5401 (*ctx
->Exec
->ConvolutionParameterfv
)( n
[1].e
, n
[2].e
, params
);
5404 case OPCODE_COPY_COLOR_SUB_TABLE
:
5405 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5406 n
[3].i
, n
[4].i
, n
[5].i
);
5408 case OPCODE_COPY_COLOR_TABLE
:
5409 (*ctx
->Exec
->CopyColorSubTable
)( n
[1].e
, n
[2].i
,
5410 n
[3].i
, n
[4].i
, n
[5].i
);
5412 case OPCODE_COPY_PIXELS
:
5413 (*ctx
->Exec
->CopyPixels
)( n
[1].i
, n
[2].i
,
5414 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
, n
[5].e
);
5416 case OPCODE_COPY_TEX_IMAGE1D
:
5417 (*ctx
->Exec
->CopyTexImage1D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5418 n
[5].i
, n
[6].i
, n
[7].i
);
5420 case OPCODE_COPY_TEX_IMAGE2D
:
5421 (*ctx
->Exec
->CopyTexImage2D
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
5422 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5424 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
5425 (*ctx
->Exec
->CopyTexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5426 n
[4].i
, n
[5].i
, n
[6].i
);
5428 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
5429 (*ctx
->Exec
->CopyTexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5430 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
);
5432 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
5433 (*ctx
->Exec
->CopyTexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5434 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
5436 case OPCODE_CULL_FACE
:
5437 (*ctx
->Exec
->CullFace
)( n
[1].e
);
5439 case OPCODE_DEPTH_FUNC
:
5440 (*ctx
->Exec
->DepthFunc
)( n
[1].e
);
5442 case OPCODE_DEPTH_MASK
:
5443 (*ctx
->Exec
->DepthMask
)( n
[1].b
);
5445 case OPCODE_DEPTH_RANGE
:
5446 (*ctx
->Exec
->DepthRange
)( (GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
);
5448 case OPCODE_DISABLE
:
5449 (*ctx
->Exec
->Disable
)( n
[1].e
);
5451 case OPCODE_DRAW_BUFFER
:
5452 (*ctx
->Exec
->DrawBuffer
)( n
[1].e
);
5454 case OPCODE_DRAW_PIXELS
:
5456 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5457 ctx
->Unpack
= _mesa_native_packing
;
5458 (*ctx
->Exec
->DrawPixels
)( n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
5460 ctx
->Unpack
= save
; /* restore */
5464 (*ctx
->Exec
->Enable
)( n
[1].e
);
5466 case OPCODE_EVALMESH1
:
5467 (*ctx
->Exec
->EvalMesh1
)( n
[1].e
, n
[2].i
, n
[3].i
);
5469 case OPCODE_EVALMESH2
:
5470 (*ctx
->Exec
->EvalMesh2
)( n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
);
5479 (*ctx
->Exec
->Fogfv
)( n
[1].e
, p
);
5482 case OPCODE_FRONT_FACE
:
5483 (*ctx
->Exec
->FrontFace
)( n
[1].e
);
5485 case OPCODE_FRUSTUM
:
5486 (*ctx
->Exec
->Frustum
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5489 (*ctx
->Exec
->Hint
)( n
[1].e
, n
[2].e
);
5491 case OPCODE_HISTOGRAM
:
5492 (*ctx
->Exec
->Histogram
)( n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
);
5494 case OPCODE_INDEX_MASK
:
5495 (*ctx
->Exec
->IndexMask
)( n
[1].ui
);
5497 case OPCODE_INIT_NAMES
:
5498 (*ctx
->Exec
->InitNames
)();
5507 (*ctx
->Exec
->Lightfv
)( n
[1].e
, n
[2].e
, p
);
5510 case OPCODE_LIGHT_MODEL
:
5517 (*ctx
->Exec
->LightModelfv
)( n
[1].e
, p
);
5520 case OPCODE_LINE_STIPPLE
:
5521 (*ctx
->Exec
->LineStipple
)( n
[1].i
, n
[2].us
);
5523 case OPCODE_LINE_WIDTH
:
5524 (*ctx
->Exec
->LineWidth
)( n
[1].f
);
5526 case OPCODE_LIST_BASE
:
5527 (*ctx
->Exec
->ListBase
)( n
[1].ui
);
5529 case OPCODE_LOAD_IDENTITY
:
5530 (*ctx
->Exec
->LoadIdentity
)();
5532 case OPCODE_LOAD_MATRIX
:
5533 if (sizeof(Node
)==sizeof(GLfloat
)) {
5534 (*ctx
->Exec
->LoadMatrixf
)( &n
[1].f
);
5539 for (i
=0;i
<16;i
++) {
5542 (*ctx
->Exec
->LoadMatrixf
)( m
);
5545 case OPCODE_LOAD_NAME
:
5546 (*ctx
->Exec
->LoadName
)( n
[1].ui
);
5548 case OPCODE_LOGIC_OP
:
5549 (*ctx
->Exec
->LogicOp
)( n
[1].e
);
5553 GLenum target
= n
[1].e
;
5554 GLint ustride
= _mesa_evaluator_components(target
);
5555 GLint uorder
= n
[5].i
;
5556 GLfloat u1
= n
[2].f
;
5557 GLfloat u2
= n
[3].f
;
5558 (*ctx
->Exec
->Map1f
)( target
, u1
, u2
, ustride
, uorder
,
5559 (GLfloat
*) n
[6].data
);
5564 GLenum target
= n
[1].e
;
5565 GLfloat u1
= n
[2].f
;
5566 GLfloat u2
= n
[3].f
;
5567 GLfloat v1
= n
[4].f
;
5568 GLfloat v2
= n
[5].f
;
5569 GLint ustride
= n
[6].i
;
5570 GLint vstride
= n
[7].i
;
5571 GLint uorder
= n
[8].i
;
5572 GLint vorder
= n
[9].i
;
5573 (*ctx
->Exec
->Map2f
)( target
, u1
, u2
, ustride
, uorder
,
5574 v1
, v2
, vstride
, vorder
,
5575 (GLfloat
*) n
[10].data
);
5578 case OPCODE_MAPGRID1
:
5579 (*ctx
->Exec
->MapGrid1f
)( n
[1].i
, n
[2].f
, n
[3].f
);
5581 case OPCODE_MAPGRID2
:
5582 (*ctx
->Exec
->MapGrid2f
)( n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
5584 case OPCODE_MATRIX_MODE
:
5585 (*ctx
->Exec
->MatrixMode
)( n
[1].e
);
5587 case OPCODE_MIN_MAX
:
5588 (*ctx
->Exec
->Minmax
)(n
[1].e
, n
[2].e
, n
[3].b
);
5590 case OPCODE_MULT_MATRIX
:
5591 if (sizeof(Node
)==sizeof(GLfloat
)) {
5592 (*ctx
->Exec
->MultMatrixf
)( &n
[1].f
);
5597 for (i
=0;i
<16;i
++) {
5600 (*ctx
->Exec
->MultMatrixf
)( m
);
5604 (*ctx
->Exec
->Ortho
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
5606 case OPCODE_PASSTHROUGH
:
5607 (*ctx
->Exec
->PassThrough
)( n
[1].f
);
5609 case OPCODE_PIXEL_MAP
:
5610 (*ctx
->Exec
->PixelMapfv
)( n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
);
5612 case OPCODE_PIXEL_TRANSFER
:
5613 (*ctx
->Exec
->PixelTransferf
)( n
[1].e
, n
[2].f
);
5615 case OPCODE_PIXEL_ZOOM
:
5616 (*ctx
->Exec
->PixelZoom
)( n
[1].f
, n
[2].f
);
5618 case OPCODE_POINT_SIZE
:
5619 (*ctx
->Exec
->PointSize
)( n
[1].f
);
5621 case OPCODE_POINT_PARAMETERS
:
5627 (*ctx
->Exec
->PointParameterfvEXT
)( n
[1].e
, params
);
5630 case OPCODE_POLYGON_MODE
:
5631 (*ctx
->Exec
->PolygonMode
)( n
[1].e
, n
[2].e
);
5633 case OPCODE_POLYGON_STIPPLE
:
5634 (*ctx
->Exec
->PolygonStipple
)( (GLubyte
*) n
[1].data
);
5636 case OPCODE_POLYGON_OFFSET
:
5637 (*ctx
->Exec
->PolygonOffset
)( n
[1].f
, n
[2].f
);
5639 case OPCODE_POP_ATTRIB
:
5640 (*ctx
->Exec
->PopAttrib
)();
5642 case OPCODE_POP_MATRIX
:
5643 (*ctx
->Exec
->PopMatrix
)();
5645 case OPCODE_POP_NAME
:
5646 (*ctx
->Exec
->PopName
)();
5648 case OPCODE_PRIORITIZE_TEXTURE
:
5649 (*ctx
->Exec
->PrioritizeTextures
)( 1, &n
[1].ui
, &n
[2].f
);
5651 case OPCODE_PUSH_ATTRIB
:
5652 (*ctx
->Exec
->PushAttrib
)( n
[1].bf
);
5654 case OPCODE_PUSH_MATRIX
:
5655 (*ctx
->Exec
->PushMatrix
)();
5657 case OPCODE_PUSH_NAME
:
5658 (*ctx
->Exec
->PushName
)( n
[1].ui
);
5660 case OPCODE_RASTER_POS
:
5661 (*ctx
->Exec
->RasterPos4f
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5663 case OPCODE_READ_BUFFER
:
5664 (*ctx
->Exec
->ReadBuffer
)( n
[1].e
);
5666 case OPCODE_RESET_HISTOGRAM
:
5667 (*ctx
->Exec
->ResetHistogram
)( n
[1].e
);
5669 case OPCODE_RESET_MIN_MAX
:
5670 (*ctx
->Exec
->ResetMinmax
)( n
[1].e
);
5673 (*ctx
->Exec
->Rotatef
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5676 (*ctx
->Exec
->Scalef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5678 case OPCODE_SCISSOR
:
5679 (*ctx
->Exec
->Scissor
)( n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
5681 case OPCODE_SHADE_MODEL
:
5682 (*ctx
->Exec
->ShadeModel
)( n
[1].e
);
5684 case OPCODE_STENCIL_FUNC
:
5685 (*ctx
->Exec
->StencilFunc
)( n
[1].e
, n
[2].i
, n
[3].ui
);
5687 case OPCODE_STENCIL_MASK
:
5688 (*ctx
->Exec
->StencilMask
)( n
[1].ui
);
5690 case OPCODE_STENCIL_OP
:
5691 (*ctx
->Exec
->StencilOp
)( n
[1].e
, n
[2].e
, n
[3].e
);
5700 (*ctx
->Exec
->TexEnvfv
)( n
[1].e
, n
[2].e
, params
);
5710 (*ctx
->Exec
->TexGenfv
)( n
[1].e
, n
[2].e
, params
);
5713 case OPCODE_TEXPARAMETER
:
5720 (*ctx
->Exec
->TexParameterfv
)( n
[1].e
, n
[2].e
, params
);
5723 case OPCODE_TEX_IMAGE1D
:
5725 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5726 ctx
->Unpack
= _mesa_native_packing
;
5727 (*ctx
->Exec
->TexImage1D
)(
5728 n
[1].e
, /* target */
5730 n
[3].i
, /* components */
5732 n
[5].e
, /* border */
5733 n
[6].e
, /* format */
5736 ctx
->Unpack
= save
; /* restore */
5739 case OPCODE_TEX_IMAGE2D
:
5741 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5742 ctx
->Unpack
= _mesa_native_packing
;
5743 (*ctx
->Exec
->TexImage2D
)(
5744 n
[1].e
, /* target */
5746 n
[3].i
, /* components */
5748 n
[5].i
, /* height */
5749 n
[6].e
, /* border */
5750 n
[7].e
, /* format */
5753 ctx
->Unpack
= save
; /* restore */
5756 case OPCODE_TEX_IMAGE3D
:
5758 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5759 ctx
->Unpack
= _mesa_native_packing
;
5760 (*ctx
->Exec
->TexImage3D
)(
5761 n
[1].e
, /* target */
5763 n
[3].i
, /* components */
5765 n
[5].i
, /* height */
5767 n
[7].e
, /* border */
5768 n
[8].e
, /* format */
5771 ctx
->Unpack
= save
; /* restore */
5774 case OPCODE_TEX_SUB_IMAGE1D
:
5776 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5777 ctx
->Unpack
= _mesa_native_packing
;
5778 (*ctx
->Exec
->TexSubImage1D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5780 n
[6].e
, n
[7].data
);
5781 ctx
->Unpack
= save
; /* restore */
5784 case OPCODE_TEX_SUB_IMAGE2D
:
5786 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5787 ctx
->Unpack
= _mesa_native_packing
;
5788 (*ctx
->Exec
->TexSubImage2D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5790 n
[6].i
, n
[7].e
, n
[8].e
, n
[9].data
);
5791 ctx
->Unpack
= save
; /* restore */
5794 case OPCODE_TEX_SUB_IMAGE3D
:
5796 struct gl_pixelstore_attrib save
= ctx
->Unpack
;
5797 ctx
->Unpack
= _mesa_native_packing
;
5798 (*ctx
->Exec
->TexSubImage3D
)( n
[1].e
, n
[2].i
, n
[3].i
,
5799 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
5800 n
[8].i
, n
[9].e
, n
[10].e
,
5802 ctx
->Unpack
= save
; /* restore */
5805 case OPCODE_TRANSLATE
:
5806 (*ctx
->Exec
->Translatef
)( n
[1].f
, n
[2].f
, n
[3].f
);
5808 case OPCODE_VIEWPORT
:
5809 (*ctx
->Exec
->Viewport
)(n
[1].i
, n
[2].i
,
5810 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
);
5812 case OPCODE_WINDOW_POS
:
5813 (*ctx
->Exec
->WindowPos4fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5815 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
5816 (*ctx
->Exec
->ActiveTextureARB
)( n
[1].e
);
5818 case OPCODE_PIXEL_TEXGEN_SGIX
: /* GL_SGIX_pixel_texture */
5819 (*ctx
->Exec
->PixelTexGenSGIX
)( n
[1].e
);
5821 case OPCODE_PIXEL_TEXGEN_PARAMETER_SGIS
: /* GL_SGIS_pixel_texture */
5822 (*ctx
->Exec
->PixelTexGenParameteriSGIS
)( n
[1].e
, n
[2].i
);
5824 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
5825 (*ctx
->Exec
->CompressedTexImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5826 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].data
);
5828 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
5829 (*ctx
->Exec
->CompressedTexImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5830 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].data
);
5832 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
5833 (*ctx
->Exec
->CompressedTexImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].e
,
5834 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
, n
[9].data
);
5836 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
5837 (*ctx
->Exec
->CompressedTexSubImage1DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5838 n
[4].i
, n
[5].e
, n
[6].i
, n
[7].data
);
5840 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
5841 (*ctx
->Exec
->CompressedTexSubImage2DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5842 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
, n
[9].data
);
5844 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
5845 (*ctx
->Exec
->CompressedTexSubImage3DARB
)(n
[1].e
, n
[2].i
, n
[3].i
,
5846 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
5847 n
[9].e
, n
[10].i
, n
[11].data
);
5849 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
5850 (*ctx
->Exec
->SampleCoverageARB
)(n
[1].f
, n
[2].b
);
5852 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
5853 (*ctx
->Exec
->WindowPos3fMESA
)( n
[1].f
, n
[2].f
, n
[3].f
);
5855 #if FEATURE_NV_vertex_program
5856 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
5857 (*ctx
->Exec
->BindProgramNV
)( n
[1].e
, n
[2].ui
);
5859 case OPCODE_EXECUTE_PROGRAM_NV
:
5866 (*ctx
->Exec
->ExecuteProgramNV
)(n
[1].e
, n
[2].ui
, v
);
5869 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
5870 (*ctx
->Exec
->RequestResidentProgramsNV
)(n
[1].ui
,
5871 (GLuint
*) n
[2].data
);
5873 case OPCODE_LOAD_PROGRAM_NV
:
5874 (*ctx
->Exec
->LoadProgramNV
)(n
[1].e
, n
[2].ui
, n
[3].i
,
5875 (const GLubyte
*) n
[4].data
);
5877 case OPCODE_PROGRAM_PARAMETER4F_NV
:
5878 (*ctx
->Exec
->ProgramParameter4fNV
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5879 n
[4].f
, n
[5].f
, n
[6].f
);
5881 case OPCODE_TRACK_MATRIX_NV
:
5882 (*ctx
->Exec
->TrackMatrixNV
)(n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
);
5886 #if FEATURE_NV_fragment_program
5887 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
5888 (*ctx
->Exec
->ProgramLocalParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5889 n
[4].f
, n
[5].f
, n
[6].f
);
5891 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
5892 (*ctx
->Exec
->ProgramNamedParameter4fNV
)(n
[1].ui
, n
[2].i
,
5893 (const GLubyte
*) n
[3].data
,
5894 n
[4].f
, n
[5].f
, n
[6].f
, n
[7].f
);
5898 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
5899 (*ctx
->Exec
->ActiveStencilFaceEXT
)(n
[1].e
);
5901 case OPCODE_DEPTH_BOUNDS_EXT
:
5902 (*ctx
->Exec
->DepthBoundsEXT
)(n
[1].f
, n
[2].f
);
5904 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5905 case OPCODE_PROGRAM_STRING_ARB
:
5906 (*ctx
->Exec
->ProgramStringARB
)(n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
);
5908 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
5909 (*ctx
->Exec
->ProgramEnvParameter4fARB
)(n
[1].e
, n
[2].ui
, n
[3].f
,
5910 n
[4].f
, n
[5].f
, n
[6].f
);
5914 case OPCODE_ATTR_1F
:
5915 (*ctx
->Exec
->VertexAttrib1fNV
)(n
[1].e
, n
[2].f
);
5917 case OPCODE_ATTR_2F
:
5918 (*ctx
->Exec
->VertexAttrib2fvNV
)(n
[1].e
, &n
[2].f
);
5920 case OPCODE_ATTR_3F
:
5921 (*ctx
->Exec
->VertexAttrib3fvNV
)(n
[1].e
, &n
[2].f
);
5923 case OPCODE_ATTR_4F
:
5924 (*ctx
->Exec
->VertexAttrib4fvNV
)(n
[1].e
, &n
[2].f
);
5926 case OPCODE_MATERIAL
:
5927 (*ctx
->Exec
->Materialfv
)(n
[1].e
, n
[2].e
, &n
[3].f
);
5930 (*ctx
->Exec
->Indexi
)(n
[1].i
);
5932 case OPCODE_EDGEFLAG
:
5933 (*ctx
->Exec
->EdgeFlag
)(n
[1].b
);
5936 (*ctx
->Exec
->Begin
)(n
[1].e
);
5939 (*ctx
->Exec
->End
)();
5942 (*ctx
->Exec
->Rectf
)(n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
5944 case OPCODE_EVAL_C1
:
5945 (*ctx
->Exec
->EvalCoord1f
)(n
[1].f
);
5947 case OPCODE_EVAL_C2
:
5948 (*ctx
->Exec
->EvalCoord2fv
)(&n
[1].f
);
5950 case OPCODE_EVAL_P1
:
5951 (*ctx
->Exec
->EvalPoint1
)(n
[1].i
);
5953 case OPCODE_EVAL_P2
:
5954 (*ctx
->Exec
->EvalPoint2
)(n
[1].i
, n
[2].i
);
5960 case OPCODE_CONTINUE
:
5961 n
= (Node
*) n
[1].next
;
5963 case OPCODE_END_OF_LIST
:
5969 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d", (int) opcode
);
5970 _mesa_problem(ctx
, msg
);
5975 /* increment n to point to next compiled command */
5976 if (opcode
!=OPCODE_CONTINUE
) {
5977 n
+= InstSize
[opcode
];
5981 ctx
->ListState
.CallDepth
--;
5983 if (ctx
->Driver
.EndCallList
)
5984 ctx
->Driver
.EndCallList( ctx
);
5991 /**********************************************************************/
5993 /**********************************************************************/
5999 * Test if a display list number is valid.
6001 GLboolean GLAPIENTRY
6002 _mesa_IsList( GLuint list
)
6004 GET_CURRENT_CONTEXT(ctx
);
6005 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6006 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
6007 return islist(ctx
, list
);
6012 * Delete a sequence of consecutive display lists.
6015 _mesa_DeleteLists( GLuint list
, GLsizei range
)
6017 GET_CURRENT_CONTEXT(ctx
);
6019 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6020 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6023 _mesa_error( ctx
, GL_INVALID_VALUE
, "glDeleteLists" );
6026 for (i
=list
;i
<list
+range
;i
++) {
6027 _mesa_destroy_list( ctx
, i
);
6034 * Return a display list number, n, such that lists n through n+range-1
6038 _mesa_GenLists(GLsizei range
)
6040 GET_CURRENT_CONTEXT(ctx
);
6042 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6043 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
6046 _mesa_error( ctx
, GL_INVALID_VALUE
, "glGenLists" );
6054 * Make this an atomic operation
6056 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
6058 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
6060 /* reserve the list IDs by with empty/dummy lists */
6062 for (i
=0; i
<range
; i
++) {
6063 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+i
, make_empty_list());
6067 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
6075 * Begin a new display list.
6078 _mesa_NewList( GLuint list
, GLenum mode
)
6080 GET_CURRENT_CONTEXT(ctx
);
6083 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
6084 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6086 if (MESA_VERBOSE
&VERBOSE_API
)
6087 _mesa_debug(ctx
, "glNewList %u %s\n", list
,
6088 _mesa_lookup_enum_by_nr(mode
));
6091 _mesa_error( ctx
, GL_INVALID_VALUE
, "glNewList" );
6095 if (mode
!=GL_COMPILE
&& mode
!=GL_COMPILE_AND_EXECUTE
) {
6096 _mesa_error( ctx
, GL_INVALID_ENUM
, "glNewList" );
6100 if (ctx
->ListState
.CurrentListPtr
) {
6101 /* already compiling a display list */
6102 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glNewList" );
6106 ctx
->CompileFlag
= GL_TRUE
;
6107 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
6109 /* Allocate new display list */
6110 ctx
->ListState
.CurrentListNum
= list
;
6111 ctx
->ListState
.CurrentBlock
= (Node
*) CALLOC( sizeof(Node
) * BLOCK_SIZE
);
6112 ctx
->ListState
.CurrentListPtr
= ctx
->ListState
.CurrentBlock
;
6113 ctx
->ListState
.CurrentPos
= 0;
6115 /* Reset acumulated list state:
6117 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
6118 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
6120 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
6121 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
6123 ctx
->ListState
.ActiveIndex
= 0;
6124 ctx
->ListState
.ActiveEdgeFlag
= 0;
6126 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
6127 ctx
->Driver
.NewList( ctx
, list
, mode
);
6129 ctx
->CurrentDispatch
= ctx
->Save
;
6130 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6136 * End definition of current display list.
6139 _mesa_EndList( void )
6141 GET_CURRENT_CONTEXT(ctx
);
6142 SAVE_FLUSH_VERTICES(ctx
);
6143 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
6145 if (MESA_VERBOSE
&VERBOSE_API
)
6146 _mesa_debug(ctx
, "glEndList\n");
6148 /* Check that a list is under construction */
6149 if (!ctx
->ListState
.CurrentListPtr
) {
6150 _mesa_error( ctx
, GL_INVALID_OPERATION
, "glEndList" );
6154 (void) ALLOC_INSTRUCTION( ctx
, OPCODE_END_OF_LIST
, 0 );
6156 /* Destroy old list, if any */
6157 _mesa_destroy_list(ctx
, ctx
->ListState
.CurrentListNum
);
6158 /* Install the list */
6159 _mesa_HashInsert(ctx
->Shared
->DisplayList
, ctx
->ListState
.CurrentListNum
, ctx
->ListState
.CurrentListPtr
);
6162 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
6163 mesa_print_display_list(ctx
->ListState
.CurrentListNum
);
6165 ctx
->ListState
.CurrentListNum
= 0;
6166 ctx
->ListState
.CurrentListPtr
= NULL
;
6167 ctx
->ExecuteFlag
= GL_TRUE
;
6168 ctx
->CompileFlag
= GL_FALSE
;
6170 ctx
->Driver
.EndList( ctx
);
6172 ctx
->CurrentDispatch
= ctx
->Exec
;
6173 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6179 _mesa_CallList( GLuint list
)
6181 GLboolean save_compile_flag
;
6182 GET_CURRENT_CONTEXT(ctx
);
6183 FLUSH_CURRENT(ctx
, 0);
6184 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
6185 /* execute the display list, and restore the CompileFlag. */
6187 if (MESA_VERBOSE
& VERBOSE_API
)
6188 _mesa_debug(ctx
, "glCallList %d\n", list
);
6191 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
6195 /* mesa_print_display_list( list ); */
6197 save_compile_flag
= ctx
->CompileFlag
;
6198 if (save_compile_flag
) {
6199 ctx
->CompileFlag
= GL_FALSE
;
6202 execute_list( ctx
, list
);
6203 ctx
->CompileFlag
= save_compile_flag
;
6205 /* also restore API function pointers to point to "save" versions */
6206 if (save_compile_flag
) {
6207 ctx
->CurrentDispatch
= ctx
->Save
;
6208 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6215 * Execute glCallLists: call multiple display lists.
6218 _mesa_CallLists( GLsizei n
, GLenum type
, const GLvoid
*lists
)
6220 GET_CURRENT_CONTEXT(ctx
);
6223 GLboolean save_compile_flag
;
6225 if (MESA_VERBOSE
& VERBOSE_API
)
6226 _mesa_debug(ctx
, "glCallLists %d\n", n
);
6230 case GL_UNSIGNED_BYTE
:
6232 case GL_UNSIGNED_SHORT
:
6234 case GL_UNSIGNED_INT
:
6242 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6246 /* Save the CompileFlag status, turn it off, execute display list,
6247 * and restore the CompileFlag.
6249 save_compile_flag
= ctx
->CompileFlag
;
6250 ctx
->CompileFlag
= GL_FALSE
;
6253 list
= translate_id( i
, type
, lists
);
6254 execute_list( ctx
, ctx
->List
.ListBase
+ list
);
6257 ctx
->CompileFlag
= save_compile_flag
;
6259 /* also restore API function pointers to point to "save" versions */
6260 if (save_compile_flag
) {
6261 ctx
->CurrentDispatch
= ctx
->Save
;
6262 _glapi_set_dispatch( ctx
->CurrentDispatch
);
6269 * Set the offset added to list numbers in glCallLists.
6272 _mesa_ListBase( GLuint base
)
6274 GET_CURRENT_CONTEXT(ctx
);
6275 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
6276 ASSERT_OUTSIDE_BEGIN_END(ctx
);
6277 ctx
->List
.ListBase
= base
;
6281 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
6283 static void GLAPIENTRY
exec_Finish( void )
6285 GET_CURRENT_CONTEXT(ctx
);
6286 FLUSH_VERTICES(ctx
, 0);
6287 ctx
->Exec
->Finish();
6290 static void GLAPIENTRY
exec_Flush( void )
6292 GET_CURRENT_CONTEXT(ctx
);
6293 FLUSH_VERTICES(ctx
, 0);
6294 ctx
->Exec
->Flush( );
6297 static void GLAPIENTRY
exec_GetBooleanv( GLenum pname
, GLboolean
*params
)
6299 GET_CURRENT_CONTEXT(ctx
);
6300 FLUSH_VERTICES(ctx
, 0);
6301 ctx
->Exec
->GetBooleanv( pname
, params
);
6304 static void GLAPIENTRY
exec_GetClipPlane( GLenum plane
, GLdouble
*equation
)
6306 GET_CURRENT_CONTEXT(ctx
);
6307 FLUSH_VERTICES(ctx
, 0);
6308 ctx
->Exec
->GetClipPlane( plane
, equation
);
6311 static void GLAPIENTRY
exec_GetDoublev( GLenum pname
, GLdouble
*params
)
6313 GET_CURRENT_CONTEXT(ctx
);
6314 FLUSH_VERTICES(ctx
, 0);
6315 ctx
->Exec
->GetDoublev( pname
, params
);
6318 static GLenum GLAPIENTRY
exec_GetError( void )
6320 GET_CURRENT_CONTEXT(ctx
);
6321 FLUSH_VERTICES(ctx
, 0);
6322 return ctx
->Exec
->GetError( );
6325 static void GLAPIENTRY
exec_GetFloatv( GLenum pname
, GLfloat
*params
)
6327 GET_CURRENT_CONTEXT(ctx
);
6328 FLUSH_VERTICES(ctx
, 0);
6329 ctx
->Exec
->GetFloatv( pname
, params
);
6332 static void GLAPIENTRY
exec_GetIntegerv( GLenum pname
, GLint
*params
)
6334 GET_CURRENT_CONTEXT(ctx
);
6335 FLUSH_VERTICES(ctx
, 0);
6336 ctx
->Exec
->GetIntegerv( pname
, params
);
6339 static void GLAPIENTRY
exec_GetLightfv( GLenum light
, GLenum pname
, GLfloat
*params
)
6341 GET_CURRENT_CONTEXT(ctx
);
6342 FLUSH_VERTICES(ctx
, 0);
6343 ctx
->Exec
->GetLightfv( light
, pname
, params
);
6346 static void GLAPIENTRY
exec_GetLightiv( GLenum light
, GLenum pname
, GLint
*params
)
6348 GET_CURRENT_CONTEXT(ctx
);
6349 FLUSH_VERTICES(ctx
, 0);
6350 ctx
->Exec
->GetLightiv( light
, pname
, params
);
6353 static void GLAPIENTRY
exec_GetMapdv( GLenum target
, GLenum query
, GLdouble
*v
)
6355 GET_CURRENT_CONTEXT(ctx
);
6356 FLUSH_VERTICES(ctx
, 0);
6357 ctx
->Exec
->GetMapdv( target
, query
, v
);
6360 static void GLAPIENTRY
exec_GetMapfv( GLenum target
, GLenum query
, GLfloat
*v
)
6362 GET_CURRENT_CONTEXT(ctx
);
6363 FLUSH_VERTICES(ctx
, 0);
6364 ctx
->Exec
->GetMapfv( target
, query
, v
);
6367 static void GLAPIENTRY
exec_GetMapiv( GLenum target
, GLenum query
, GLint
*v
)
6369 GET_CURRENT_CONTEXT(ctx
);
6370 FLUSH_VERTICES(ctx
, 0);
6371 ctx
->Exec
->GetMapiv( target
, query
, v
);
6374 static void GLAPIENTRY
exec_GetMaterialfv( GLenum face
, GLenum pname
, GLfloat
*params
)
6376 GET_CURRENT_CONTEXT(ctx
);
6377 FLUSH_VERTICES(ctx
, 0);
6378 ctx
->Exec
->GetMaterialfv( face
, pname
, params
);
6381 static void GLAPIENTRY
exec_GetMaterialiv( GLenum face
, GLenum pname
, GLint
*params
)
6383 GET_CURRENT_CONTEXT(ctx
);
6384 FLUSH_VERTICES(ctx
, 0);
6385 ctx
->Exec
->GetMaterialiv( face
, pname
, params
);
6388 static void GLAPIENTRY
exec_GetPixelMapfv( GLenum map
, GLfloat
*values
)
6390 GET_CURRENT_CONTEXT(ctx
);
6391 FLUSH_VERTICES(ctx
, 0);
6392 ctx
->Exec
->GetPixelMapfv( map
, values
);
6395 static void GLAPIENTRY
exec_GetPixelMapuiv( GLenum map
, GLuint
*values
)
6397 GET_CURRENT_CONTEXT(ctx
);
6398 FLUSH_VERTICES(ctx
, 0);
6399 ctx
->Exec
->GetPixelMapuiv( map
, values
);
6402 static void GLAPIENTRY
exec_GetPixelMapusv( GLenum map
, GLushort
*values
)
6404 GET_CURRENT_CONTEXT(ctx
);
6405 FLUSH_VERTICES(ctx
, 0);
6406 ctx
->Exec
->GetPixelMapusv( map
, values
);
6409 static void GLAPIENTRY
exec_GetPolygonStipple( GLubyte
*dest
)
6411 GET_CURRENT_CONTEXT(ctx
);
6412 FLUSH_VERTICES(ctx
, 0);
6413 ctx
->Exec
->GetPolygonStipple( dest
);
6416 static const GLubyte
* GLAPIENTRY
exec_GetString( GLenum name
)
6418 GET_CURRENT_CONTEXT(ctx
);
6419 FLUSH_VERTICES(ctx
, 0);
6420 return ctx
->Exec
->GetString( name
);
6423 static void GLAPIENTRY
exec_GetTexEnvfv( GLenum target
, GLenum pname
, GLfloat
*params
)
6425 GET_CURRENT_CONTEXT(ctx
);
6426 FLUSH_VERTICES(ctx
, 0);
6427 ctx
->Exec
->GetTexEnvfv( target
, pname
, params
);
6430 static void GLAPIENTRY
exec_GetTexEnviv( GLenum target
, GLenum pname
, GLint
*params
)
6432 GET_CURRENT_CONTEXT(ctx
);
6433 FLUSH_VERTICES(ctx
, 0);
6434 ctx
->Exec
->GetTexEnviv( target
, pname
, params
);
6437 static void GLAPIENTRY
exec_GetTexGendv( GLenum coord
, GLenum pname
, GLdouble
*params
)
6439 GET_CURRENT_CONTEXT(ctx
);
6440 FLUSH_VERTICES(ctx
, 0);
6441 ctx
->Exec
->GetTexGendv( coord
, pname
, params
);
6444 static void GLAPIENTRY
exec_GetTexGenfv( GLenum coord
, GLenum pname
, GLfloat
*params
)
6446 GET_CURRENT_CONTEXT(ctx
);
6447 FLUSH_VERTICES(ctx
, 0);
6448 ctx
->Exec
->GetTexGenfv( coord
, pname
, params
);
6451 static void GLAPIENTRY
exec_GetTexGeniv( GLenum coord
, GLenum pname
, GLint
*params
)
6453 GET_CURRENT_CONTEXT(ctx
);
6454 FLUSH_VERTICES(ctx
, 0);
6455 ctx
->Exec
->GetTexGeniv( coord
, pname
, params
);
6458 static void GLAPIENTRY
exec_GetTexImage( GLenum target
, GLint level
, GLenum format
,
6459 GLenum type
, GLvoid
*pixels
)
6461 GET_CURRENT_CONTEXT(ctx
);
6462 FLUSH_VERTICES(ctx
, 0);
6463 ctx
->Exec
->GetTexImage( target
, level
, format
, type
, pixels
);
6466 static void GLAPIENTRY
exec_GetTexLevelParameterfv( GLenum target
, GLint level
,
6467 GLenum pname
, GLfloat
*params
)
6469 GET_CURRENT_CONTEXT(ctx
);
6470 FLUSH_VERTICES(ctx
, 0);
6471 ctx
->Exec
->GetTexLevelParameterfv( target
, level
, pname
, params
);
6474 static void GLAPIENTRY
exec_GetTexLevelParameteriv( GLenum target
, GLint level
,
6475 GLenum pname
, GLint
*params
)
6477 GET_CURRENT_CONTEXT(ctx
);
6478 FLUSH_VERTICES(ctx
, 0);
6479 ctx
->Exec
->GetTexLevelParameteriv( target
, level
, pname
, params
);
6482 static void GLAPIENTRY
exec_GetTexParameterfv( GLenum target
, GLenum pname
,
6485 GET_CURRENT_CONTEXT(ctx
);
6486 FLUSH_VERTICES(ctx
, 0);
6487 ctx
->Exec
->GetTexParameterfv( target
, pname
, params
);
6490 static void GLAPIENTRY
exec_GetTexParameteriv( GLenum target
, GLenum pname
, GLint
*params
)
6492 GET_CURRENT_CONTEXT(ctx
);
6493 FLUSH_VERTICES(ctx
, 0);
6494 ctx
->Exec
->GetTexParameteriv( target
, pname
, params
);
6497 static GLboolean GLAPIENTRY
exec_IsEnabled( GLenum cap
)
6499 GET_CURRENT_CONTEXT(ctx
);
6500 FLUSH_VERTICES(ctx
, 0);
6501 return ctx
->Exec
->IsEnabled( cap
);
6504 static void GLAPIENTRY
exec_PixelStoref( GLenum pname
, GLfloat param
)
6506 GET_CURRENT_CONTEXT(ctx
);
6507 FLUSH_VERTICES(ctx
, 0);
6508 ctx
->Exec
->PixelStoref( pname
, param
);
6511 static void GLAPIENTRY
exec_PixelStorei( GLenum pname
, GLint param
)
6513 GET_CURRENT_CONTEXT(ctx
);
6514 FLUSH_VERTICES(ctx
, 0);
6515 ctx
->Exec
->PixelStorei( pname
, param
);
6518 static void GLAPIENTRY
exec_ReadPixels( GLint x
, GLint y
, GLsizei width
, GLsizei height
,
6519 GLenum format
, GLenum type
, GLvoid
*pixels
)
6521 GET_CURRENT_CONTEXT(ctx
);
6522 FLUSH_VERTICES(ctx
, 0);
6523 ctx
->Exec
->ReadPixels( x
, y
, width
, height
, format
, type
, pixels
);
6526 static GLint GLAPIENTRY
exec_RenderMode( GLenum mode
)
6528 GET_CURRENT_CONTEXT(ctx
);
6529 FLUSH_VERTICES(ctx
, 0);
6530 return ctx
->Exec
->RenderMode( mode
);
6533 static void GLAPIENTRY
exec_FeedbackBuffer( GLsizei size
, GLenum type
, GLfloat
*buffer
)
6535 GET_CURRENT_CONTEXT(ctx
);
6536 FLUSH_VERTICES(ctx
, 0);
6537 ctx
->Exec
->FeedbackBuffer( size
, type
, buffer
);
6540 static void GLAPIENTRY
exec_SelectBuffer( GLsizei size
, GLuint
*buffer
)
6542 GET_CURRENT_CONTEXT(ctx
);
6543 FLUSH_VERTICES(ctx
, 0);
6544 ctx
->Exec
->SelectBuffer( size
, buffer
);
6547 static GLboolean GLAPIENTRY
exec_AreTexturesResident(GLsizei n
, const GLuint
*texName
,
6548 GLboolean
*residences
)
6550 GET_CURRENT_CONTEXT(ctx
);
6551 FLUSH_VERTICES(ctx
, 0);
6552 return ctx
->Exec
->AreTexturesResident( n
, texName
, residences
);
6555 static void GLAPIENTRY
exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
,
6558 GET_CURRENT_CONTEXT(ctx
);
6559 FLUSH_VERTICES(ctx
, 0);
6560 ctx
->Exec
->ColorPointer( size
, type
, stride
, ptr
);
6563 static void GLAPIENTRY
exec_DeleteTextures( GLsizei n
, const GLuint
*texName
)
6565 GET_CURRENT_CONTEXT(ctx
);
6566 FLUSH_VERTICES(ctx
, 0);
6567 ctx
->Exec
->DeleteTextures( n
, texName
);
6570 static void GLAPIENTRY
exec_DisableClientState( GLenum cap
)
6572 GET_CURRENT_CONTEXT(ctx
);
6573 FLUSH_VERTICES(ctx
, 0);
6574 ctx
->Exec
->DisableClientState( cap
);
6577 static void GLAPIENTRY
exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
*vptr
)
6579 GET_CURRENT_CONTEXT(ctx
);
6580 FLUSH_VERTICES(ctx
, 0);
6581 ctx
->Exec
->EdgeFlagPointer( stride
, vptr
);
6584 static void GLAPIENTRY
exec_EnableClientState( GLenum cap
)
6586 GET_CURRENT_CONTEXT(ctx
);
6587 FLUSH_VERTICES(ctx
, 0);
6588 ctx
->Exec
->EnableClientState( cap
);
6591 static void GLAPIENTRY
exec_GenTextures( GLsizei n
, GLuint
*texName
)
6593 GET_CURRENT_CONTEXT(ctx
);
6594 FLUSH_VERTICES(ctx
, 0);
6595 ctx
->Exec
->GenTextures( n
, texName
);
6598 static void GLAPIENTRY
exec_GetPointerv( GLenum pname
, GLvoid
**params
)
6600 GET_CURRENT_CONTEXT(ctx
);
6601 FLUSH_VERTICES(ctx
, 0);
6602 ctx
->Exec
->GetPointerv( pname
, params
);
6605 static void GLAPIENTRY
exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6607 GET_CURRENT_CONTEXT(ctx
);
6608 FLUSH_VERTICES(ctx
, 0);
6609 ctx
->Exec
->IndexPointer( type
, stride
, ptr
);
6612 static void GLAPIENTRY
exec_InterleavedArrays(GLenum format
, GLsizei stride
,
6613 const GLvoid
*pointer
)
6615 GET_CURRENT_CONTEXT(ctx
);
6616 FLUSH_VERTICES(ctx
, 0);
6617 ctx
->Exec
->InterleavedArrays( format
, stride
, pointer
);
6620 static GLboolean GLAPIENTRY
exec_IsTexture( GLuint texture
)
6622 GET_CURRENT_CONTEXT(ctx
);
6623 FLUSH_VERTICES(ctx
, 0);
6624 return ctx
->Exec
->IsTexture( texture
);
6627 static void GLAPIENTRY
exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
6629 GET_CURRENT_CONTEXT(ctx
);
6630 FLUSH_VERTICES(ctx
, 0);
6631 ctx
->Exec
->NormalPointer( type
, stride
, ptr
);
6634 static void GLAPIENTRY
exec_PopClientAttrib(void)
6636 GET_CURRENT_CONTEXT(ctx
);
6637 FLUSH_VERTICES(ctx
, 0);
6638 ctx
->Exec
->PopClientAttrib();
6641 static void GLAPIENTRY
exec_PushClientAttrib(GLbitfield mask
)
6643 GET_CURRENT_CONTEXT(ctx
);
6644 FLUSH_VERTICES(ctx
, 0);
6645 ctx
->Exec
->PushClientAttrib( mask
);
6648 static void GLAPIENTRY
exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
6651 GET_CURRENT_CONTEXT(ctx
);
6652 FLUSH_VERTICES(ctx
, 0);
6653 ctx
->Exec
->TexCoordPointer( size
, type
, stride
, ptr
);
6656 static void GLAPIENTRY
exec_GetCompressedTexImageARB(GLenum target
, GLint level
,
6659 GET_CURRENT_CONTEXT(ctx
);
6660 FLUSH_VERTICES(ctx
, 0);
6661 ctx
->Exec
->GetCompressedTexImageARB( target
, level
, img
);
6664 static void GLAPIENTRY
exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
6667 GET_CURRENT_CONTEXT(ctx
);
6668 FLUSH_VERTICES(ctx
, 0);
6669 ctx
->Exec
->VertexPointer( size
, type
, stride
, ptr
);
6672 static void GLAPIENTRY
exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
6673 GLint x
, GLint y
, GLsizei width
)
6675 GET_CURRENT_CONTEXT(ctx
);
6676 FLUSH_VERTICES(ctx
, 0);
6677 ctx
->Exec
->CopyConvolutionFilter1D( target
, internalFormat
, x
, y
, width
);
6680 static void GLAPIENTRY
exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
6681 GLint x
, GLint y
, GLsizei width
,
6684 GET_CURRENT_CONTEXT(ctx
);
6685 FLUSH_VERTICES(ctx
, 0);
6686 ctx
->Exec
->CopyConvolutionFilter2D( target
, internalFormat
, x
, y
, width
,
6690 static void GLAPIENTRY
exec_GetColorTable( GLenum target
, GLenum format
,
6691 GLenum type
, GLvoid
*data
)
6693 GET_CURRENT_CONTEXT(ctx
);
6694 FLUSH_VERTICES(ctx
, 0);
6695 ctx
->Exec
->GetColorTable( target
, format
, type
, data
);
6698 static void GLAPIENTRY
exec_GetColorTableParameterfv( GLenum target
, GLenum pname
,
6701 GET_CURRENT_CONTEXT(ctx
);
6702 FLUSH_VERTICES(ctx
, 0);
6703 ctx
->Exec
->GetColorTableParameterfv( target
, pname
, params
);
6706 static void GLAPIENTRY
exec_GetColorTableParameteriv( GLenum target
, GLenum pname
,
6709 GET_CURRENT_CONTEXT(ctx
);
6710 FLUSH_VERTICES(ctx
, 0);
6711 ctx
->Exec
->GetColorTableParameteriv( target
, pname
, params
);
6714 static void GLAPIENTRY
exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
6717 GET_CURRENT_CONTEXT(ctx
);
6718 FLUSH_VERTICES(ctx
, 0);
6719 ctx
->Exec
->GetConvolutionFilter( target
, format
, type
, image
);
6722 static void GLAPIENTRY
exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
,
6725 GET_CURRENT_CONTEXT(ctx
);
6726 FLUSH_VERTICES(ctx
, 0);
6727 ctx
->Exec
->GetConvolutionParameterfv( target
, pname
, params
);
6730 static void GLAPIENTRY
exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
,
6733 GET_CURRENT_CONTEXT(ctx
);
6734 FLUSH_VERTICES(ctx
, 0);
6735 ctx
->Exec
->GetConvolutionParameteriv( target
, pname
, params
);
6738 static void GLAPIENTRY
exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
6739 GLenum type
, GLvoid
*values
)
6741 GET_CURRENT_CONTEXT(ctx
);
6742 FLUSH_VERTICES(ctx
, 0);
6743 ctx
->Exec
->GetHistogram( target
, reset
, format
, type
, values
);
6746 static void GLAPIENTRY
exec_GetHistogramParameterfv(GLenum target
, GLenum pname
,
6749 GET_CURRENT_CONTEXT(ctx
);
6750 FLUSH_VERTICES(ctx
, 0);
6751 ctx
->Exec
->GetHistogramParameterfv( target
, pname
, params
);
6754 static void GLAPIENTRY
exec_GetHistogramParameteriv(GLenum target
, GLenum pname
,
6757 GET_CURRENT_CONTEXT(ctx
);
6758 FLUSH_VERTICES(ctx
, 0);
6759 ctx
->Exec
->GetHistogramParameteriv( target
, pname
, params
);
6762 static void GLAPIENTRY
exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
6763 GLenum type
, GLvoid
*values
)
6765 GET_CURRENT_CONTEXT(ctx
);
6766 FLUSH_VERTICES(ctx
, 0);
6767 ctx
->Exec
->GetMinmax( target
, reset
, format
, type
, values
);
6770 static void GLAPIENTRY
exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
,
6773 GET_CURRENT_CONTEXT(ctx
);
6774 FLUSH_VERTICES(ctx
, 0);
6775 ctx
->Exec
->GetMinmaxParameterfv( target
, pname
, params
);
6778 static void GLAPIENTRY
exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
,
6781 GET_CURRENT_CONTEXT(ctx
);
6782 FLUSH_VERTICES(ctx
, 0);
6783 ctx
->Exec
->GetMinmaxParameteriv( target
, pname
, params
);
6786 static void GLAPIENTRY
exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
6787 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
6789 GET_CURRENT_CONTEXT(ctx
);
6790 FLUSH_VERTICES(ctx
, 0);
6791 ctx
->Exec
->GetSeparableFilter( target
, format
, type
, row
, column
, span
);
6794 static void GLAPIENTRY
exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
6795 GLsizei width
, GLsizei height
, GLenum format
,
6796 GLenum type
, const GLvoid
*row
,
6797 const GLvoid
*column
)
6799 GET_CURRENT_CONTEXT(ctx
);
6800 FLUSH_VERTICES(ctx
, 0);
6801 ctx
->Exec
->SeparableFilter2D( target
, internalFormat
, width
, height
, format
,
6805 static void GLAPIENTRY
exec_GetPixelTexGenParameterivSGIS(GLenum target
, GLint
*value
)
6807 GET_CURRENT_CONTEXT(ctx
);
6808 FLUSH_VERTICES(ctx
, 0);
6809 ctx
->Exec
->GetPixelTexGenParameterivSGIS( target
, value
);
6812 static void GLAPIENTRY
exec_GetPixelTexGenParameterfvSGIS(GLenum target
, GLfloat
*value
)
6814 GET_CURRENT_CONTEXT(ctx
);
6815 FLUSH_VERTICES(ctx
, 0);
6816 ctx
->Exec
->GetPixelTexGenParameterfvSGIS( target
, value
);
6819 static void GLAPIENTRY
exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6820 GLsizei count
, const GLvoid
*ptr
)
6822 GET_CURRENT_CONTEXT(ctx
);
6823 FLUSH_VERTICES(ctx
, 0);
6824 ctx
->Exec
->ColorPointerEXT( size
, type
, stride
, count
, ptr
);
6827 static void GLAPIENTRY
exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
,
6828 const GLboolean
*ptr
)
6830 GET_CURRENT_CONTEXT(ctx
);
6831 FLUSH_VERTICES(ctx
, 0);
6832 ctx
->Exec
->EdgeFlagPointerEXT( stride
, count
, ptr
);
6835 static void GLAPIENTRY
exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6838 GET_CURRENT_CONTEXT(ctx
);
6839 FLUSH_VERTICES(ctx
, 0);
6840 ctx
->Exec
->IndexPointerEXT( type
, stride
, count
, ptr
);
6843 static void GLAPIENTRY
exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
6846 GET_CURRENT_CONTEXT(ctx
);
6847 FLUSH_VERTICES(ctx
, 0);
6848 ctx
->Exec
->NormalPointerEXT( type
, stride
, count
, ptr
);
6851 static void GLAPIENTRY
exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6852 GLsizei count
, const GLvoid
*ptr
)
6854 GET_CURRENT_CONTEXT(ctx
);
6855 FLUSH_VERTICES(ctx
, 0);
6856 ctx
->Exec
->TexCoordPointerEXT( size
, type
, stride
, count
, ptr
);
6859 static void GLAPIENTRY
exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
6860 GLsizei count
, const GLvoid
*ptr
)
6862 GET_CURRENT_CONTEXT(ctx
);
6863 FLUSH_VERTICES(ctx
, 0);
6864 ctx
->Exec
->VertexPointerEXT( size
, type
, stride
, count
, ptr
);
6867 static void GLAPIENTRY
exec_LockArraysEXT(GLint first
, GLsizei count
)
6869 GET_CURRENT_CONTEXT(ctx
);
6870 FLUSH_VERTICES(ctx
, 0);
6871 ctx
->Exec
->LockArraysEXT( first
, count
);
6874 static void GLAPIENTRY
exec_UnlockArraysEXT( void )
6876 GET_CURRENT_CONTEXT(ctx
);
6877 FLUSH_VERTICES(ctx
, 0);
6878 ctx
->Exec
->UnlockArraysEXT( );
6881 static void GLAPIENTRY
exec_ResizeBuffersMESA( void )
6883 GET_CURRENT_CONTEXT(ctx
);
6884 FLUSH_VERTICES(ctx
, 0);
6885 ctx
->Exec
->ResizeBuffersMESA( );
6889 static void GLAPIENTRY
exec_ClientActiveTextureARB( GLenum target
)
6891 GET_CURRENT_CONTEXT(ctx
);
6892 FLUSH_VERTICES(ctx
, 0);
6893 ctx
->Exec
->ClientActiveTextureARB(target
);
6896 static void GLAPIENTRY
exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
6897 GLsizei stride
, const GLvoid
*ptr
)
6899 GET_CURRENT_CONTEXT(ctx
);
6900 FLUSH_VERTICES(ctx
, 0);
6901 ctx
->Exec
->SecondaryColorPointerEXT( size
, type
, stride
, ptr
);
6904 static void GLAPIENTRY
exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
,
6907 GET_CURRENT_CONTEXT(ctx
);
6908 FLUSH_VERTICES(ctx
, 0);
6909 ctx
->Exec
->FogCoordPointerEXT( type
, stride
, ptr
);
6912 /* GL_EXT_multi_draw_arrays */
6913 static void GLAPIENTRY
exec_MultiDrawArraysEXT(GLenum mode
, GLint
*first
,
6914 GLsizei
*count
, GLsizei primcount
)
6916 GET_CURRENT_CONTEXT(ctx
);
6917 FLUSH_VERTICES(ctx
, 0);
6918 ctx
->Exec
->MultiDrawArraysEXT( mode
, first
, count
, primcount
);
6921 /* GL_EXT_multi_draw_arrays */
6922 static void GLAPIENTRY
exec_MultiDrawElementsEXT(GLenum mode
, const GLsizei
*count
,
6923 GLenum type
, const GLvoid
**indices
,
6926 GET_CURRENT_CONTEXT(ctx
);
6927 FLUSH_VERTICES(ctx
, 0);
6928 ctx
->Exec
->MultiDrawElementsEXT(mode
, count
, type
, indices
, primcount
);
6931 /* GL_IBM_multimode_draw_arrays */
6932 static void GLAPIENTRY
exec_MultiModeDrawArraysIBM(const GLenum
*mode
, const GLint
*first
,
6933 const GLsizei
*count
, GLsizei primcount
,
6936 GET_CURRENT_CONTEXT(ctx
);
6937 FLUSH_VERTICES(ctx
, 0);
6938 ctx
->Exec
->MultiModeDrawArraysIBM(mode
, first
, count
, primcount
, modestride
);
6941 /* GL_IBM_multimode_draw_arrays */
6942 static void GLAPIENTRY
exec_MultiModeDrawElementsIBM(const GLenum
*mode
,
6943 const GLsizei
*count
,
6945 const GLvoid
* const *indices
,
6946 GLsizei primcount
, GLint modestride
)
6948 GET_CURRENT_CONTEXT(ctx
);
6949 FLUSH_VERTICES(ctx
, 0);
6950 ctx
->Exec
->MultiModeDrawElementsIBM(mode
, count
, type
, indices
, primcount
,
6958 * Setup the given dispatch table to point to Mesa's display list
6959 * building functions.
6961 * This does not include any of the tnl functions - they are
6962 * initialized from _mesa_init_api_defaults and from the active vtxfmt
6966 _mesa_init_dlist_table( struct _glapi_table
*table
, GLuint tableSize
)
6968 _mesa_init_no_op_table(table
, tableSize
);
6970 _mesa_loopback_init_api_table( table
);
6973 table
->Accum
= save_Accum
;
6974 table
->AlphaFunc
= save_AlphaFunc
;
6975 table
->Bitmap
= save_Bitmap
;
6976 table
->CallList
= _mesa_save_CallList
;
6977 table
->CallLists
= _mesa_save_CallLists
;
6978 table
->Clear
= save_Clear
;
6979 table
->ClearAccum
= save_ClearAccum
;
6980 table
->ClearColor
= save_ClearColor
;
6981 table
->ClearDepth
= save_ClearDepth
;
6982 table
->ClearIndex
= save_ClearIndex
;
6983 table
->ClearStencil
= save_ClearStencil
;
6984 table
->ClipPlane
= save_ClipPlane
;
6985 table
->ColorMask
= save_ColorMask
;
6986 table
->ColorMaterial
= save_ColorMaterial
;
6987 table
->CopyPixels
= save_CopyPixels
;
6988 table
->CullFace
= save_CullFace
;
6989 table
->DeleteLists
= _mesa_DeleteLists
;
6990 table
->DepthFunc
= save_DepthFunc
;
6991 table
->DepthMask
= save_DepthMask
;
6992 table
->DepthRange
= save_DepthRange
;
6993 table
->Disable
= save_Disable
;
6994 table
->DrawBuffer
= save_DrawBuffer
;
6995 table
->DrawPixels
= save_DrawPixels
;
6996 table
->Enable
= save_Enable
;
6997 table
->EndList
= _mesa_EndList
;
6998 table
->EvalMesh1
= _mesa_save_EvalMesh1
;
6999 table
->EvalMesh2
= _mesa_save_EvalMesh2
;
7000 table
->Finish
= exec_Finish
;
7001 table
->Flush
= exec_Flush
;
7002 table
->Fogf
= save_Fogf
;
7003 table
->Fogfv
= save_Fogfv
;
7004 table
->Fogi
= save_Fogi
;
7005 table
->Fogiv
= save_Fogiv
;
7006 table
->FrontFace
= save_FrontFace
;
7007 table
->Frustum
= save_Frustum
;
7008 table
->GenLists
= _mesa_GenLists
;
7009 table
->GetBooleanv
= exec_GetBooleanv
;
7010 table
->GetClipPlane
= exec_GetClipPlane
;
7011 table
->GetDoublev
= exec_GetDoublev
;
7012 table
->GetError
= exec_GetError
;
7013 table
->GetFloatv
= exec_GetFloatv
;
7014 table
->GetIntegerv
= exec_GetIntegerv
;
7015 table
->GetLightfv
= exec_GetLightfv
;
7016 table
->GetLightiv
= exec_GetLightiv
;
7017 table
->GetMapdv
= exec_GetMapdv
;
7018 table
->GetMapfv
= exec_GetMapfv
;
7019 table
->GetMapiv
= exec_GetMapiv
;
7020 table
->GetMaterialfv
= exec_GetMaterialfv
;
7021 table
->GetMaterialiv
= exec_GetMaterialiv
;
7022 table
->GetPixelMapfv
= exec_GetPixelMapfv
;
7023 table
->GetPixelMapuiv
= exec_GetPixelMapuiv
;
7024 table
->GetPixelMapusv
= exec_GetPixelMapusv
;
7025 table
->GetPolygonStipple
= exec_GetPolygonStipple
;
7026 table
->GetString
= exec_GetString
;
7027 table
->GetTexEnvfv
= exec_GetTexEnvfv
;
7028 table
->GetTexEnviv
= exec_GetTexEnviv
;
7029 table
->GetTexGendv
= exec_GetTexGendv
;
7030 table
->GetTexGenfv
= exec_GetTexGenfv
;
7031 table
->GetTexGeniv
= exec_GetTexGeniv
;
7032 table
->GetTexImage
= exec_GetTexImage
;
7033 table
->GetTexLevelParameterfv
= exec_GetTexLevelParameterfv
;
7034 table
->GetTexLevelParameteriv
= exec_GetTexLevelParameteriv
;
7035 table
->GetTexParameterfv
= exec_GetTexParameterfv
;
7036 table
->GetTexParameteriv
= exec_GetTexParameteriv
;
7037 table
->Hint
= save_Hint
;
7038 table
->IndexMask
= save_IndexMask
;
7039 table
->InitNames
= save_InitNames
;
7040 table
->IsEnabled
= exec_IsEnabled
;
7041 table
->IsList
= _mesa_IsList
;
7042 table
->LightModelf
= save_LightModelf
;
7043 table
->LightModelfv
= save_LightModelfv
;
7044 table
->LightModeli
= save_LightModeli
;
7045 table
->LightModeliv
= save_LightModeliv
;
7046 table
->Lightf
= save_Lightf
;
7047 table
->Lightfv
= save_Lightfv
;
7048 table
->Lighti
= save_Lighti
;
7049 table
->Lightiv
= save_Lightiv
;
7050 table
->LineStipple
= save_LineStipple
;
7051 table
->LineWidth
= save_LineWidth
;
7052 table
->ListBase
= save_ListBase
;
7053 table
->LoadIdentity
= save_LoadIdentity
;
7054 table
->LoadMatrixd
= save_LoadMatrixd
;
7055 table
->LoadMatrixf
= save_LoadMatrixf
;
7056 table
->LoadName
= save_LoadName
;
7057 table
->LogicOp
= save_LogicOp
;
7058 table
->Map1d
= save_Map1d
;
7059 table
->Map1f
= save_Map1f
;
7060 table
->Map2d
= save_Map2d
;
7061 table
->Map2f
= save_Map2f
;
7062 table
->MapGrid1d
= save_MapGrid1d
;
7063 table
->MapGrid1f
= save_MapGrid1f
;
7064 table
->MapGrid2d
= save_MapGrid2d
;
7065 table
->MapGrid2f
= save_MapGrid2f
;
7066 table
->MatrixMode
= save_MatrixMode
;
7067 table
->MultMatrixd
= save_MultMatrixd
;
7068 table
->MultMatrixf
= save_MultMatrixf
;
7069 table
->NewList
= save_NewList
;
7070 table
->Ortho
= save_Ortho
;
7071 table
->PassThrough
= save_PassThrough
;
7072 table
->PixelMapfv
= save_PixelMapfv
;
7073 table
->PixelMapuiv
= save_PixelMapuiv
;
7074 table
->PixelMapusv
= save_PixelMapusv
;
7075 table
->PixelStoref
= exec_PixelStoref
;
7076 table
->PixelStorei
= exec_PixelStorei
;
7077 table
->PixelTransferf
= save_PixelTransferf
;
7078 table
->PixelTransferi
= save_PixelTransferi
;
7079 table
->PixelZoom
= save_PixelZoom
;
7080 table
->PointSize
= save_PointSize
;
7081 table
->PolygonMode
= save_PolygonMode
;
7082 table
->PolygonOffset
= save_PolygonOffset
;
7083 table
->PolygonStipple
= save_PolygonStipple
;
7084 table
->PopAttrib
= save_PopAttrib
;
7085 table
->PopMatrix
= save_PopMatrix
;
7086 table
->PopName
= save_PopName
;
7087 table
->PushAttrib
= save_PushAttrib
;
7088 table
->PushMatrix
= save_PushMatrix
;
7089 table
->PushName
= save_PushName
;
7090 table
->RasterPos2d
= save_RasterPos2d
;
7091 table
->RasterPos2dv
= save_RasterPos2dv
;
7092 table
->RasterPos2f
= save_RasterPos2f
;
7093 table
->RasterPos2fv
= save_RasterPos2fv
;
7094 table
->RasterPos2i
= save_RasterPos2i
;
7095 table
->RasterPos2iv
= save_RasterPos2iv
;
7096 table
->RasterPos2s
= save_RasterPos2s
;
7097 table
->RasterPos2sv
= save_RasterPos2sv
;
7098 table
->RasterPos3d
= save_RasterPos3d
;
7099 table
->RasterPos3dv
= save_RasterPos3dv
;
7100 table
->RasterPos3f
= save_RasterPos3f
;
7101 table
->RasterPos3fv
= save_RasterPos3fv
;
7102 table
->RasterPos3i
= save_RasterPos3i
;
7103 table
->RasterPos3iv
= save_RasterPos3iv
;
7104 table
->RasterPos3s
= save_RasterPos3s
;
7105 table
->RasterPos3sv
= save_RasterPos3sv
;
7106 table
->RasterPos4d
= save_RasterPos4d
;
7107 table
->RasterPos4dv
= save_RasterPos4dv
;
7108 table
->RasterPos4f
= save_RasterPos4f
;
7109 table
->RasterPos4fv
= save_RasterPos4fv
;
7110 table
->RasterPos4i
= save_RasterPos4i
;
7111 table
->RasterPos4iv
= save_RasterPos4iv
;
7112 table
->RasterPos4s
= save_RasterPos4s
;
7113 table
->RasterPos4sv
= save_RasterPos4sv
;
7114 table
->ReadBuffer
= save_ReadBuffer
;
7115 table
->ReadPixels
= exec_ReadPixels
;
7116 table
->RenderMode
= exec_RenderMode
;
7117 table
->Rotated
= save_Rotated
;
7118 table
->Rotatef
= save_Rotatef
;
7119 table
->Scaled
= save_Scaled
;
7120 table
->Scalef
= save_Scalef
;
7121 table
->Scissor
= save_Scissor
;
7122 table
->FeedbackBuffer
= exec_FeedbackBuffer
;
7123 table
->SelectBuffer
= exec_SelectBuffer
;
7124 table
->ShadeModel
= save_ShadeModel
;
7125 table
->StencilFunc
= save_StencilFunc
;
7126 table
->StencilMask
= save_StencilMask
;
7127 table
->StencilOp
= save_StencilOp
;
7128 table
->TexEnvf
= save_TexEnvf
;
7129 table
->TexEnvfv
= save_TexEnvfv
;
7130 table
->TexEnvi
= save_TexEnvi
;
7131 table
->TexEnviv
= save_TexEnviv
;
7132 table
->TexGend
= save_TexGend
;
7133 table
->TexGendv
= save_TexGendv
;
7134 table
->TexGenf
= save_TexGenf
;
7135 table
->TexGenfv
= save_TexGenfv
;
7136 table
->TexGeni
= save_TexGeni
;
7137 table
->TexGeniv
= save_TexGeniv
;
7138 table
->TexImage1D
= save_TexImage1D
;
7139 table
->TexImage2D
= save_TexImage2D
;
7140 table
->TexParameterf
= save_TexParameterf
;
7141 table
->TexParameterfv
= save_TexParameterfv
;
7142 table
->TexParameteri
= save_TexParameteri
;
7143 table
->TexParameteriv
= save_TexParameteriv
;
7144 table
->Translated
= save_Translated
;
7145 table
->Translatef
= save_Translatef
;
7146 table
->Viewport
= save_Viewport
;
7149 table
->AreTexturesResident
= exec_AreTexturesResident
;
7150 table
->AreTexturesResidentEXT
= exec_AreTexturesResident
;
7151 table
->BindTexture
= save_BindTexture
;
7152 table
->ColorPointer
= exec_ColorPointer
;
7153 table
->CopyTexImage1D
= save_CopyTexImage1D
;
7154 table
->CopyTexImage2D
= save_CopyTexImage2D
;
7155 table
->CopyTexSubImage1D
= save_CopyTexSubImage1D
;
7156 table
->CopyTexSubImage2D
= save_CopyTexSubImage2D
;
7157 table
->DeleteTextures
= exec_DeleteTextures
;
7158 table
->DisableClientState
= exec_DisableClientState
;
7159 table
->EdgeFlagPointer
= exec_EdgeFlagPointer
;
7160 table
->EnableClientState
= exec_EnableClientState
;
7161 table
->GenTextures
= exec_GenTextures
;
7162 table
->GenTexturesEXT
= exec_GenTextures
;
7163 table
->GetPointerv
= exec_GetPointerv
;
7164 table
->IndexPointer
= exec_IndexPointer
;
7165 table
->InterleavedArrays
= exec_InterleavedArrays
;
7166 table
->IsTexture
= exec_IsTexture
;
7167 table
->IsTextureEXT
= exec_IsTexture
;
7168 table
->NormalPointer
= exec_NormalPointer
;
7169 table
->PopClientAttrib
= exec_PopClientAttrib
;
7170 table
->PrioritizeTextures
= save_PrioritizeTextures
;
7171 table
->PushClientAttrib
= exec_PushClientAttrib
;
7172 table
->TexCoordPointer
= exec_TexCoordPointer
;
7173 table
->TexSubImage1D
= save_TexSubImage1D
;
7174 table
->TexSubImage2D
= save_TexSubImage2D
;
7175 table
->VertexPointer
= exec_VertexPointer
;
7178 table
->CopyTexSubImage3D
= save_CopyTexSubImage3D
;
7179 table
->TexImage3D
= save_TexImage3D
;
7180 table
->TexSubImage3D
= save_TexSubImage3D
;
7182 /* GL_ARB_imaging */
7183 /* Not all are supported */
7184 table
->BlendColor
= save_BlendColor
;
7185 table
->BlendEquation
= save_BlendEquation
;
7186 table
->ColorSubTable
= save_ColorSubTable
;
7187 table
->ColorTable
= save_ColorTable
;
7188 table
->ColorTableParameterfv
= save_ColorTableParameterfv
;
7189 table
->ColorTableParameteriv
= save_ColorTableParameteriv
;
7190 table
->ConvolutionFilter1D
= save_ConvolutionFilter1D
;
7191 table
->ConvolutionFilter2D
= save_ConvolutionFilter2D
;
7192 table
->ConvolutionParameterf
= save_ConvolutionParameterf
;
7193 table
->ConvolutionParameterfv
= save_ConvolutionParameterfv
;
7194 table
->ConvolutionParameteri
= save_ConvolutionParameteri
;
7195 table
->ConvolutionParameteriv
= save_ConvolutionParameteriv
;
7196 table
->CopyColorSubTable
= save_CopyColorSubTable
;
7197 table
->CopyColorTable
= save_CopyColorTable
;
7198 table
->CopyConvolutionFilter1D
= exec_CopyConvolutionFilter1D
;
7199 table
->CopyConvolutionFilter2D
= exec_CopyConvolutionFilter2D
;
7200 table
->GetColorTable
= exec_GetColorTable
;
7201 table
->GetColorTableEXT
= exec_GetColorTable
;
7202 table
->GetColorTableParameterfv
= exec_GetColorTableParameterfv
;
7203 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7204 table
->GetColorTableParameteriv
= exec_GetColorTableParameteriv
;
7205 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7206 table
->GetConvolutionFilter
= exec_GetConvolutionFilter
;
7207 table
->GetConvolutionFilterEXT
= exec_GetConvolutionFilter
;
7208 table
->GetConvolutionParameterfv
= exec_GetConvolutionParameterfv
;
7209 table
->GetConvolutionParameterfvEXT
= exec_GetConvolutionParameterfv
;
7210 table
->GetConvolutionParameteriv
= exec_GetConvolutionParameteriv
;
7211 table
->GetConvolutionParameterivEXT
= exec_GetConvolutionParameteriv
;
7212 table
->GetHistogram
= exec_GetHistogram
;
7213 table
->GetHistogramEXT
= exec_GetHistogram
;
7214 table
->GetHistogramParameterfv
= exec_GetHistogramParameterfv
;
7215 table
->GetHistogramParameterfvEXT
= exec_GetHistogramParameterfv
;
7216 table
->GetHistogramParameteriv
= exec_GetHistogramParameteriv
;
7217 table
->GetHistogramParameterivEXT
= exec_GetHistogramParameteriv
;
7218 table
->GetMinmax
= exec_GetMinmax
;
7219 table
->GetMinmaxEXT
= exec_GetMinmax
;
7220 table
->GetMinmaxParameterfv
= exec_GetMinmaxParameterfv
;
7221 table
->GetMinmaxParameterfvEXT
= exec_GetMinmaxParameterfv
;
7222 table
->GetMinmaxParameteriv
= exec_GetMinmaxParameteriv
;
7223 table
->GetMinmaxParameterivEXT
= exec_GetMinmaxParameteriv
;
7224 table
->GetSeparableFilter
= exec_GetSeparableFilter
;
7225 table
->GetSeparableFilterEXT
= exec_GetSeparableFilter
;
7226 table
->Histogram
= save_Histogram
;
7227 table
->Minmax
= save_Minmax
;
7228 table
->ResetHistogram
= save_ResetHistogram
;
7229 table
->ResetMinmax
= save_ResetMinmax
;
7230 table
->SeparableFilter2D
= exec_SeparableFilter2D
;
7232 /* 2. GL_EXT_blend_color */
7234 table
->BlendColorEXT
= save_BlendColorEXT
;
7237 /* 3. GL_EXT_polygon_offset */
7238 table
->PolygonOffsetEXT
= save_PolygonOffsetEXT
;
7240 /* 6. GL_EXT_texture3d */
7242 table
->CopyTexSubImage3DEXT
= save_CopyTexSubImage3D
;
7243 table
->TexImage3DEXT
= save_TexImage3DEXT
;
7244 table
->TexSubImage3DEXT
= save_TexSubImage3D
;
7247 /* 15. GL_SGIX_pixel_texture */
7248 table
->PixelTexGenSGIX
= save_PixelTexGenSGIX
;
7250 /* 15. GL_SGIS_pixel_texture */
7251 table
->PixelTexGenParameteriSGIS
= save_PixelTexGenParameteriSGIS
;
7252 table
->PixelTexGenParameterfSGIS
= save_PixelTexGenParameterfSGIS
;
7253 table
->PixelTexGenParameterivSGIS
= save_PixelTexGenParameterivSGIS
;
7254 table
->PixelTexGenParameterfvSGIS
= save_PixelTexGenParameterfvSGIS
;
7255 table
->GetPixelTexGenParameterivSGIS
= exec_GetPixelTexGenParameterivSGIS
;
7256 table
->GetPixelTexGenParameterfvSGIS
= exec_GetPixelTexGenParameterfvSGIS
;
7258 /* 30. GL_EXT_vertex_array */
7259 table
->ColorPointerEXT
= exec_ColorPointerEXT
;
7260 table
->EdgeFlagPointerEXT
= exec_EdgeFlagPointerEXT
;
7261 table
->IndexPointerEXT
= exec_IndexPointerEXT
;
7262 table
->NormalPointerEXT
= exec_NormalPointerEXT
;
7263 table
->TexCoordPointerEXT
= exec_TexCoordPointerEXT
;
7264 table
->VertexPointerEXT
= exec_VertexPointerEXT
;
7266 /* 37. GL_EXT_blend_minmax */
7268 table
->BlendEquationEXT
= save_BlendEquationEXT
;
7271 /* 54. GL_EXT_point_parameters */
7272 table
->PointParameterfEXT
= save_PointParameterfEXT
;
7273 table
->PointParameterfvEXT
= save_PointParameterfvEXT
;
7275 /* 78. GL_EXT_paletted_texture */
7277 table
->ColorTableEXT
= save_ColorTable
;
7278 table
->ColorSubTableEXT
= save_ColorSubTable
;
7280 table
->GetColorTableEXT
= exec_GetColorTable
;
7281 table
->GetColorTableParameterfvEXT
= exec_GetColorTableParameterfv
;
7282 table
->GetColorTableParameterivEXT
= exec_GetColorTableParameteriv
;
7284 /* 97. GL_EXT_compiled_vertex_array */
7285 table
->LockArraysEXT
= exec_LockArraysEXT
;
7286 table
->UnlockArraysEXT
= exec_UnlockArraysEXT
;
7288 /* 145. GL_EXT_secondary_color */
7289 table
->SecondaryColorPointerEXT
= exec_SecondaryColorPointerEXT
;
7291 /* 148. GL_EXT_multi_draw_arrays */
7292 table
->MultiDrawArraysEXT
= exec_MultiDrawArraysEXT
;
7293 table
->MultiDrawElementsEXT
= exec_MultiDrawElementsEXT
;
7295 /* 149. GL_EXT_fog_coord */
7296 table
->FogCoordPointerEXT
= exec_FogCoordPointerEXT
;
7298 /* 173. GL_EXT_blend_func_separate */
7299 table
->BlendFuncSeparateEXT
= save_BlendFuncSeparateEXT
;
7301 /* 196. GL_MESA_resize_buffers */
7302 table
->ResizeBuffersMESA
= exec_ResizeBuffersMESA
;
7304 /* 197. GL_MESA_window_pos */
7305 table
->WindowPos2dMESA
= save_WindowPos2dMESA
;
7306 table
->WindowPos2dvMESA
= save_WindowPos2dvMESA
;
7307 table
->WindowPos2fMESA
= save_WindowPos2fMESA
;
7308 table
->WindowPos2fvMESA
= save_WindowPos2fvMESA
;
7309 table
->WindowPos2iMESA
= save_WindowPos2iMESA
;
7310 table
->WindowPos2ivMESA
= save_WindowPos2ivMESA
;
7311 table
->WindowPos2sMESA
= save_WindowPos2sMESA
;
7312 table
->WindowPos2svMESA
= save_WindowPos2svMESA
;
7313 table
->WindowPos3dMESA
= save_WindowPos3dMESA
;
7314 table
->WindowPos3dvMESA
= save_WindowPos3dvMESA
;
7315 table
->WindowPos3fMESA
= save_WindowPos3fMESA
;
7316 table
->WindowPos3fvMESA
= save_WindowPos3fvMESA
;
7317 table
->WindowPos3iMESA
= save_WindowPos3iMESA
;
7318 table
->WindowPos3ivMESA
= save_WindowPos3ivMESA
;
7319 table
->WindowPos3sMESA
= save_WindowPos3sMESA
;
7320 table
->WindowPos3svMESA
= save_WindowPos3svMESA
;
7321 table
->WindowPos4dMESA
= save_WindowPos4dMESA
;
7322 table
->WindowPos4dvMESA
= save_WindowPos4dvMESA
;
7323 table
->WindowPos4fMESA
= save_WindowPos4fMESA
;
7324 table
->WindowPos4fvMESA
= save_WindowPos4fvMESA
;
7325 table
->WindowPos4iMESA
= save_WindowPos4iMESA
;
7326 table
->WindowPos4ivMESA
= save_WindowPos4ivMESA
;
7327 table
->WindowPos4sMESA
= save_WindowPos4sMESA
;
7328 table
->WindowPos4svMESA
= save_WindowPos4svMESA
;
7330 /* 200. GL_IBM_multimode_draw_arrays */
7331 table
->MultiModeDrawArraysIBM
= exec_MultiModeDrawArraysIBM
;
7332 table
->MultiModeDrawElementsIBM
= exec_MultiModeDrawElementsIBM
;
7334 #if FEATURE_NV_vertex_program
7335 /* 233. GL_NV_vertex_program */
7336 /* The following commands DO NOT go into display lists:
7337 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
7338 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
7340 table
->BindProgramNV
= save_BindProgramNV
;
7341 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7342 table
->ExecuteProgramNV
= save_ExecuteProgramNV
;
7343 table
->GenProgramsNV
= _mesa_GenPrograms
;
7344 table
->AreProgramsResidentNV
= _mesa_AreProgramsResidentNV
;
7345 table
->RequestResidentProgramsNV
= save_RequestResidentProgramsNV
;
7346 table
->GetProgramParameterfvNV
= _mesa_GetProgramParameterfvNV
;
7347 table
->GetProgramParameterdvNV
= _mesa_GetProgramParameterdvNV
;
7348 table
->GetProgramivNV
= _mesa_GetProgramivNV
;
7349 table
->GetProgramStringNV
= _mesa_GetProgramStringNV
;
7350 table
->GetTrackMatrixivNV
= _mesa_GetTrackMatrixivNV
;
7351 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7352 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7353 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7354 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7355 table
->IsProgramNV
= _mesa_IsProgram
;
7356 table
->LoadProgramNV
= save_LoadProgramNV
;
7357 table
->ProgramParameter4dNV
= save_ProgramParameter4dNV
;
7358 table
->ProgramParameter4dvNV
= save_ProgramParameter4dvNV
;
7359 table
->ProgramParameter4fNV
= save_ProgramParameter4fNV
;
7360 table
->ProgramParameter4fvNV
= save_ProgramParameter4fvNV
;
7361 table
->ProgramParameters4dvNV
= save_ProgramParameters4dvNV
;
7362 table
->ProgramParameters4fvNV
= save_ProgramParameters4fvNV
;
7363 table
->TrackMatrixNV
= save_TrackMatrixNV
;
7364 table
->VertexAttribPointerNV
= _mesa_VertexAttribPointerNV
;
7367 /* 282. GL_NV_fragment_program */
7368 #if FEATURE_NV_fragment_program
7369 table
->ProgramNamedParameter4fNV
= save_ProgramNamedParameter4fNV
;
7370 table
->ProgramNamedParameter4dNV
= save_ProgramNamedParameter4dNV
;
7371 table
->ProgramNamedParameter4fvNV
= save_ProgramNamedParameter4fvNV
;
7372 table
->ProgramNamedParameter4dvNV
= save_ProgramNamedParameter4dvNV
;
7373 table
->GetProgramNamedParameterfvNV
= _mesa_GetProgramNamedParameterfvNV
;
7374 table
->GetProgramNamedParameterdvNV
= _mesa_GetProgramNamedParameterdvNV
;
7375 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7376 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7377 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7378 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7379 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7380 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7383 /* 262. GL_NV_point_sprite */
7384 table
->PointParameteriNV
= save_PointParameteriNV
;
7385 table
->PointParameterivNV
= save_PointParameterivNV
;
7387 /* 268. GL_EXT_stencil_two_side */
7388 table
->ActiveStencilFaceEXT
= save_ActiveStencilFaceEXT
;
7390 /* ???. GL_EXT_depth_bounds_test */
7391 table
->DepthBoundsEXT
= save_DepthBoundsEXT
;
7393 /* ARB 1. GL_ARB_multitexture */
7394 table
->ActiveTextureARB
= save_ActiveTextureARB
;
7395 table
->ClientActiveTextureARB
= exec_ClientActiveTextureARB
;
7397 /* ARB 3. GL_ARB_transpose_matrix */
7398 table
->LoadTransposeMatrixdARB
= save_LoadTransposeMatrixdARB
;
7399 table
->LoadTransposeMatrixfARB
= save_LoadTransposeMatrixfARB
;
7400 table
->MultTransposeMatrixdARB
= save_MultTransposeMatrixdARB
;
7401 table
->MultTransposeMatrixfARB
= save_MultTransposeMatrixfARB
;
7403 /* ARB 5. GL_ARB_multisample */
7404 table
->SampleCoverageARB
= save_SampleCoverageARB
;
7406 /* ARB 12. GL_ARB_texture_compression */
7407 table
->CompressedTexImage3DARB
= save_CompressedTexImage3DARB
;
7408 table
->CompressedTexImage2DARB
= save_CompressedTexImage2DARB
;
7409 table
->CompressedTexImage1DARB
= save_CompressedTexImage1DARB
;
7410 table
->CompressedTexSubImage3DARB
= save_CompressedTexSubImage3DARB
;
7411 table
->CompressedTexSubImage2DARB
= save_CompressedTexSubImage2DARB
;
7412 table
->CompressedTexSubImage1DARB
= save_CompressedTexSubImage1DARB
;
7413 table
->GetCompressedTexImageARB
= exec_GetCompressedTexImageARB
;
7415 /* ARB 14. GL_ARB_point_parameters */
7416 /* aliased with EXT_point_parameters functions */
7418 /* ARB 25. GL_ARB_window_pos */
7419 /* aliased with MESA_window_pos functions */
7421 /* ARB 26. GL_ARB_vertex_program */
7422 /* ARB 27. GL_ARB_fragment_program */
7423 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7424 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
7425 table
->VertexAttribPointerARB
= _mesa_VertexAttribPointerARB
;
7426 table
->EnableVertexAttribArrayARB
= _mesa_EnableVertexAttribArrayARB
;
7427 table
->DisableVertexAttribArrayARB
= _mesa_DisableVertexAttribArrayARB
;
7428 table
->ProgramStringARB
= save_ProgramStringARB
;
7429 table
->BindProgramNV
= _mesa_BindProgram
;
7430 table
->DeleteProgramsNV
= _mesa_DeletePrograms
;
7431 table
->GenProgramsNV
= _mesa_GenPrograms
;
7432 table
->IsProgramNV
= _mesa_IsProgram
;
7433 table
->GetVertexAttribdvNV
= _mesa_GetVertexAttribdvNV
;
7434 table
->GetVertexAttribfvNV
= _mesa_GetVertexAttribfvNV
;
7435 table
->GetVertexAttribivNV
= _mesa_GetVertexAttribivNV
;
7436 table
->GetVertexAttribPointervNV
= _mesa_GetVertexAttribPointervNV
;
7437 table
->ProgramEnvParameter4dARB
= save_ProgramEnvParameter4dARB
;
7438 table
->ProgramEnvParameter4dvARB
= save_ProgramEnvParameter4dvARB
;
7439 table
->ProgramEnvParameter4fARB
= save_ProgramEnvParameter4fARB
;
7440 table
->ProgramEnvParameter4fvARB
= save_ProgramEnvParameter4fvARB
;
7441 table
->ProgramLocalParameter4dARB
= save_ProgramLocalParameter4dARB
;
7442 table
->ProgramLocalParameter4dvARB
= save_ProgramLocalParameter4dvARB
;
7443 table
->ProgramLocalParameter4fARB
= save_ProgramLocalParameter4fARB
;
7444 table
->ProgramLocalParameter4fvARB
= save_ProgramLocalParameter4fvARB
;
7445 table
->GetProgramEnvParameterdvARB
= _mesa_GetProgramEnvParameterdvARB
;
7446 table
->GetProgramEnvParameterfvARB
= _mesa_GetProgramEnvParameterfvARB
;
7447 table
->GetProgramLocalParameterdvARB
= _mesa_GetProgramLocalParameterdvARB
;
7448 table
->GetProgramLocalParameterfvARB
= _mesa_GetProgramLocalParameterfvARB
;
7449 table
->GetProgramivARB
= _mesa_GetProgramivARB
;
7450 table
->GetProgramStringARB
= _mesa_GetProgramStringARB
;
7453 /* ARB 28. GL_ARB_vertex_buffer_object */
7454 #if FEATURE_ARB_vertex_buffer_object
7455 /* None of the extension's functions get compiled */
7456 table
->BindBufferARB
= _mesa_BindBufferARB
;
7457 table
->BufferDataARB
= _mesa_BufferDataARB
;
7458 table
->BufferSubDataARB
= _mesa_BufferSubDataARB
;
7459 table
->DeleteBuffersARB
= _mesa_DeleteBuffersARB
;
7460 table
->GenBuffersARB
= _mesa_GenBuffersARB
;
7461 table
->GetBufferParameterivARB
= _mesa_GetBufferParameterivARB
;
7462 table
->GetBufferPointervARB
= _mesa_GetBufferPointervARB
;
7463 table
->GetBufferSubDataARB
= _mesa_GetBufferSubDataARB
;
7464 table
->IsBufferARB
= _mesa_IsBufferARB
;
7465 table
->MapBufferARB
= _mesa_MapBufferARB
;
7466 table
->UnmapBufferARB
= _mesa_UnmapBufferARB
;
7475 static const char *enum_string( GLenum k
)
7477 return _mesa_lookup_enum_by_nr( k
);
7482 * Print the commands in a display list. For debugging only.
7483 * TODO: many commands aren't handled yet.
7485 static void GLAPIENTRY
print_list( GLcontext
*ctx
, GLuint list
)
7490 if (!glIsList(list
)) {
7491 _mesa_printf("%u is not a display list ID\n", list
);
7495 n
= (Node
*) _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
7497 _mesa_printf("START-LIST %u, address %p\n", list
, (void*)n
);
7499 done
= n
? GL_FALSE
: GL_TRUE
;
7501 OpCode opcode
= n
[0].opcode
;
7502 GLint i
= (GLint
) n
[0].opcode
- (GLint
) OPCODE_DRV_0
;
7504 if (i
>= 0 && i
< (GLint
) ctx
->listext
.nr_opcodes
) {
7505 ctx
->listext
.opcode
[i
].print(ctx
, &n
[1]);
7506 n
+= ctx
->listext
.opcode
[i
].size
;
7511 _mesa_printf("accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
7514 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
7515 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
7517 case OPCODE_CALL_LIST
:
7518 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
7520 case OPCODE_CALL_LIST_OFFSET
:
7521 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
7522 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
7524 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7525 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
7526 enum_string(n
[1].e
), enum_string(n
[2].e
),
7527 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7529 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7530 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
7531 enum_string(n
[1].e
), enum_string(n
[2].e
),
7532 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
7534 case OPCODE_DISABLE
:
7535 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
7538 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
7540 case OPCODE_FRUSTUM
:
7541 _mesa_printf("Frustum %g %g %g %g %g %g\n",
7542 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7544 case OPCODE_LINE_STIPPLE
:
7545 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
7547 case OPCODE_LOAD_IDENTITY
:
7548 _mesa_printf("LoadIdentity\n");
7550 case OPCODE_LOAD_MATRIX
:
7551 _mesa_printf("LoadMatrix\n");
7552 _mesa_printf(" %8f %8f %8f %8f\n",
7553 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7554 _mesa_printf(" %8f %8f %8f %8f\n",
7555 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7556 _mesa_printf(" %8f %8f %8f %8f\n",
7557 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7558 _mesa_printf(" %8f %8f %8f %8f\n",
7559 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7561 case OPCODE_MULT_MATRIX
:
7562 _mesa_printf("MultMatrix (or Rotate)\n");
7563 _mesa_printf(" %8f %8f %8f %8f\n",
7564 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
7565 _mesa_printf(" %8f %8f %8f %8f\n",
7566 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
7567 _mesa_printf(" %8f %8f %8f %8f\n",
7568 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
7569 _mesa_printf(" %8f %8f %8f %8f\n",
7570 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
7573 _mesa_printf("Ortho %g %g %g %g %g %g\n",
7574 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
7576 case OPCODE_POP_ATTRIB
:
7577 _mesa_printf("PopAttrib\n");
7579 case OPCODE_POP_MATRIX
:
7580 _mesa_printf("PopMatrix\n");
7582 case OPCODE_POP_NAME
:
7583 _mesa_printf("PopName\n");
7585 case OPCODE_PUSH_ATTRIB
:
7586 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
7588 case OPCODE_PUSH_MATRIX
:
7589 _mesa_printf("PushMatrix\n");
7591 case OPCODE_PUSH_NAME
:
7592 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
7594 case OPCODE_RASTER_POS
:
7595 _mesa_printf("RasterPos %g %g %g %g\n",
7596 n
[1].f
, n
[2].f
,n
[3].f
,n
[4].f
);
7599 _mesa_printf("Rotate %g %g %g %g\n",
7600 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
7603 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7605 case OPCODE_TRANSLATE
:
7606 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
7608 case OPCODE_BIND_TEXTURE
:
7609 _mesa_printf("BindTexture %s %d\n",
7610 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
7612 case OPCODE_SHADE_MODEL
:
7613 _mesa_printf("ShadeModel %s\n",
7614 _mesa_lookup_enum_by_nr(n
[1].ui
));
7617 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
7618 _mesa_lookup_enum_by_nr(n
[1].ui
),
7619 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
7622 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
7623 _mesa_lookup_enum_by_nr(n
[1].ui
),
7624 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
7625 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
7627 case OPCODE_MAPGRID1
:
7628 _mesa_printf("MapGrid1 %d %.3f %.3f\n",
7629 n
[1].i
, n
[2].f
, n
[3].f
);
7631 case OPCODE_MAPGRID2
:
7632 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
7633 n
[1].i
, n
[2].f
, n
[3].f
,
7634 n
[4].i
, n
[5].f
, n
[6].f
);
7636 case OPCODE_EVALMESH1
:
7637 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
7639 case OPCODE_EVALMESH2
:
7640 _mesa_printf("EvalMesh2 %d %d %d %d\n",
7641 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
7645 * meta opcodes/commands
7648 _mesa_printf("Error: %s %s\n",
7649 enum_string(n
[1].e
), (const char *)n
[2].data
);
7651 case OPCODE_CONTINUE
:
7652 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
7653 n
= (Node
*) n
[1].next
;
7655 case OPCODE_END_OF_LIST
:
7656 _mesa_printf("END-LIST %u\n", list
);
7660 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
7661 _mesa_printf("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
7666 _mesa_printf("command %d, %u operands\n", opcode
, InstSize
[opcode
]);
7669 /* increment n to point to next compiled command */
7670 if (opcode
!=OPCODE_CONTINUE
) {
7671 n
+= InstSize
[opcode
];
7680 * Clients may call this function to help debug display list problems.
7681 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
7682 * changed, or break in the future without notice.
7684 void mesa_print_display_list( GLuint list
)
7686 GET_CURRENT_CONTEXT(ctx
);
7687 print_list( ctx
, list
);
7691 /**********************************************************************/
7692 /***** Initialization *****/
7693 /**********************************************************************/
7696 void _mesa_save_vtxfmt_init( GLvertexformat
*vfmt
)
7698 vfmt
->ArrayElement
= _ae_loopback_array_elt
; /* generic helper */
7699 vfmt
->Begin
= save_Begin
;
7700 vfmt
->CallList
= _mesa_save_CallList
;
7701 vfmt
->CallLists
= _mesa_save_CallLists
;
7702 vfmt
->Color3f
= save_Color3f
;
7703 vfmt
->Color3fv
= save_Color3fv
;
7704 vfmt
->Color4f
= save_Color4f
;
7705 vfmt
->Color4fv
= save_Color4fv
;
7706 vfmt
->EdgeFlag
= save_EdgeFlag
;
7707 vfmt
->EdgeFlagv
= save_EdgeFlagv
;
7708 vfmt
->End
= save_End
;
7709 vfmt
->EvalCoord1f
= save_EvalCoord1f
;
7710 vfmt
->EvalCoord1fv
= save_EvalCoord1fv
;
7711 vfmt
->EvalCoord2f
= save_EvalCoord2f
;
7712 vfmt
->EvalCoord2fv
= save_EvalCoord2fv
;
7713 vfmt
->EvalPoint1
= save_EvalPoint1
;
7714 vfmt
->EvalPoint2
= save_EvalPoint2
;
7715 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
7716 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
7717 vfmt
->Indexf
= save_Indexf
;
7718 vfmt
->Indexfv
= save_Indexfv
;
7719 vfmt
->Materialfv
= save_Materialfv
;
7720 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
7721 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
7722 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
7723 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
7724 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
7725 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
7726 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
7727 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
7728 vfmt
->Normal3f
= save_Normal3f
;
7729 vfmt
->Normal3fv
= save_Normal3fv
;
7730 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
7731 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
7732 vfmt
->TexCoord1f
= save_TexCoord1f
;
7733 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
7734 vfmt
->TexCoord2f
= save_TexCoord2f
;
7735 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
7736 vfmt
->TexCoord3f
= save_TexCoord3f
;
7737 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
7738 vfmt
->TexCoord4f
= save_TexCoord4f
;
7739 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
7740 vfmt
->Vertex2f
= save_Vertex2f
;
7741 vfmt
->Vertex2fv
= save_Vertex2fv
;
7742 vfmt
->Vertex3f
= save_Vertex3f
;
7743 vfmt
->Vertex3fv
= save_Vertex3fv
;
7744 vfmt
->Vertex4f
= save_Vertex4f
;
7745 vfmt
->Vertex4fv
= save_Vertex4fv
;
7746 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
7747 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
7748 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
7749 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
7750 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
7751 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
7752 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
7753 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
7755 vfmt
->EvalMesh1
= _mesa_save_EvalMesh1
;
7756 vfmt
->EvalMesh2
= _mesa_save_EvalMesh2
;
7757 vfmt
->Rectf
= save_Rectf
;
7759 /* The driver is required to implement these as
7760 * 1) They can probably do a better job.
7761 * 2) A lot of new mechanisms would have to be added to this module
7762 * to support it. That code would probably never get used,
7766 vfmt
->DrawArrays
= 0;
7767 vfmt
->DrawElements
= 0;
7768 vfmt
->DrawRangeElements
= 0;
7774 void _mesa_init_display_list( GLcontext
* ctx
)
7777 ctx
->ListState
.CallDepth
= 0;
7778 ctx
->ExecuteFlag
= GL_TRUE
;
7779 ctx
->CompileFlag
= GL_FALSE
;
7780 ctx
->ListState
.CurrentListPtr
= NULL
;
7781 ctx
->ListState
.CurrentBlock
= NULL
;
7782 ctx
->ListState
.CurrentListNum
= 0;
7783 ctx
->ListState
.CurrentPos
= 0;
7785 /* Display List group */
7786 ctx
->List
.ListBase
= 0;
7788 _mesa_save_vtxfmt_init( &ctx
->ListState
.ListVtxfmt
);