2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
34 #include "api_arrayelt.h"
36 #include "api_loopback.h"
38 #include "mfeatures.h"
39 #if FEATURE_ARB_vertex_buffer_object
40 #include "bufferobj.h"
47 #include "framebuffer.h"
48 #include "glapi/glapi.h"
58 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
59 #include "shader/arbprogram.h"
61 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
62 #include "shader/nvprogram.h"
64 #if FEATURE_ATI_fragment_shader
65 #include "shader/atifragshader.h"
68 #include "math/m_matrix.h"
70 #include "main/dispatch.h"
75 * Other parts of Mesa (such as the VBO module) can plug into the display
76 * list system. This structure describes new display list instructions.
78 struct gl_list_instruction
81 void (*Execute
)( GLcontext
*ctx
, void *data
);
82 void (*Destroy
)( GLcontext
*ctx
, void *data
);
83 void (*Print
)( GLcontext
*ctx
, void *data
);
87 #define MAX_DLIST_EXT_OPCODES 16
90 * Used by device drivers to hook new commands into display lists.
92 struct gl_list_extensions
94 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
103 * \param ctx GL context.
105 * Checks if dd_function_table::SaveNeedFlush is marked to flush
106 * stored (save) vertices, and calls
107 * dd_function_table::SaveFlushVertices if so.
109 #define SAVE_FLUSH_VERTICES(ctx) \
111 if (ctx->Driver.SaveNeedFlush) \
112 ctx->Driver.SaveFlushVertices(ctx); \
117 * Macro to assert that the API call was made outside the
118 * glBegin()/glEnd() pair, with return value.
120 * \param ctx GL context.
121 * \param retval value to return value in case the assertion fails.
123 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
125 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
126 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
127 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
133 * Macro to assert that the API call was made outside the
134 * glBegin()/glEnd() pair.
136 * \param ctx GL context.
138 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
140 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
141 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
142 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
148 * Macro to assert that the API call was made outside the
149 * glBegin()/glEnd() pair and flush the vertices.
151 * \param ctx GL context.
153 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
155 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
156 SAVE_FLUSH_VERTICES(ctx); \
160 * Macro to assert that the API call was made outside the
161 * glBegin()/glEnd() pair and flush the vertices, with return value.
163 * \param ctx GL context.
164 * \param retval value to return value in case the assertion fails.
166 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
168 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
169 SAVE_FLUSH_VERTICES(ctx); \
175 * Display list opcodes.
177 * The fact that these identifiers are assigned consecutive
178 * integer values starting at 0 is very important, see InstSize array usage)
182 OPCODE_INVALID
= -1, /* Force signed enum */
188 OPCODE_BLEND_EQUATION
,
189 OPCODE_BLEND_EQUATION_SEPARATE
,
190 OPCODE_BLEND_FUNC_SEPARATE
,
192 OPCODE_CALL_LIST_OFFSET
,
198 OPCODE_CLEAR_STENCIL
,
199 OPCODE_CLEAR_BUFFER_IV
,
200 OPCODE_CLEAR_BUFFER_UIV
,
201 OPCODE_CLEAR_BUFFER_FV
,
202 OPCODE_CLEAR_BUFFER_FI
,
205 OPCODE_COLOR_MASK_INDEXED
,
206 OPCODE_COLOR_MATERIAL
,
208 OPCODE_COLOR_TABLE_PARAMETER_FV
,
209 OPCODE_COLOR_TABLE_PARAMETER_IV
,
210 OPCODE_COLOR_SUB_TABLE
,
211 OPCODE_CONVOLUTION_FILTER_1D
,
212 OPCODE_CONVOLUTION_FILTER_2D
,
213 OPCODE_CONVOLUTION_PARAMETER_I
,
214 OPCODE_CONVOLUTION_PARAMETER_IV
,
215 OPCODE_CONVOLUTION_PARAMETER_F
,
216 OPCODE_CONVOLUTION_PARAMETER_FV
,
217 OPCODE_COPY_COLOR_SUB_TABLE
,
218 OPCODE_COPY_COLOR_TABLE
,
220 OPCODE_COPY_TEX_IMAGE1D
,
221 OPCODE_COPY_TEX_IMAGE2D
,
222 OPCODE_COPY_TEX_SUB_IMAGE1D
,
223 OPCODE_COPY_TEX_SUB_IMAGE2D
,
224 OPCODE_COPY_TEX_SUB_IMAGE3D
,
230 OPCODE_DISABLE_INDEXED
,
234 OPCODE_ENABLE_INDEXED
,
249 OPCODE_LOAD_IDENTITY
,
263 OPCODE_PIXEL_TRANSFER
,
266 OPCODE_POINT_PARAMETERS
,
268 OPCODE_POLYGON_STIPPLE
,
269 OPCODE_POLYGON_OFFSET
,
273 OPCODE_PRIORITIZE_TEXTURE
,
279 OPCODE_RESET_HISTOGRAM
,
280 OPCODE_RESET_MIN_MAX
,
284 OPCODE_SELECT_TEXTURE_SGIS
,
285 OPCODE_SELECT_TEXTURE_COORD_SET
,
296 OPCODE_TEX_SUB_IMAGE1D
,
297 OPCODE_TEX_SUB_IMAGE2D
,
298 OPCODE_TEX_SUB_IMAGE3D
,
302 /* GL_ARB_multitexture */
303 OPCODE_ACTIVE_TEXTURE
,
304 /* GL_ARB_texture_compression */
305 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
311 /* GL_ARB_multisample */
312 OPCODE_SAMPLE_COVERAGE
,
313 /* GL_ARB_window_pos */
314 OPCODE_WINDOW_POS_ARB
,
315 /* GL_NV_vertex_program */
316 OPCODE_BIND_PROGRAM_NV
,
317 OPCODE_EXECUTE_PROGRAM_NV
,
318 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
319 OPCODE_LOAD_PROGRAM_NV
,
320 OPCODE_TRACK_MATRIX_NV
,
321 /* GL_NV_fragment_program */
322 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
323 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
324 /* GL_EXT_stencil_two_side */
325 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
326 /* GL_EXT_depth_bounds_test */
327 OPCODE_DEPTH_BOUNDS_EXT
,
328 /* GL_ARB_vertex/fragment_program */
329 OPCODE_PROGRAM_STRING_ARB
,
330 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
331 /* GL_ARB_occlusion_query */
332 OPCODE_BEGIN_QUERY_ARB
,
333 OPCODE_END_QUERY_ARB
,
334 /* GL_ARB_draw_buffers */
335 OPCODE_DRAW_BUFFERS_ARB
,
336 /* GL_ATI_fragment_shader */
337 OPCODE_TEX_BUMP_PARAMETER_ATI
,
338 /* GL_ATI_fragment_shader */
339 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
340 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
342 OPCODE_STENCIL_FUNC_SEPARATE
,
343 OPCODE_STENCIL_OP_SEPARATE
,
344 OPCODE_STENCIL_MASK_SEPARATE
,
346 /* GL_ARB_shader_objects */
364 OPCODE_UNIFORM_MATRIX22
,
365 OPCODE_UNIFORM_MATRIX33
,
366 OPCODE_UNIFORM_MATRIX44
,
367 OPCODE_UNIFORM_MATRIX23
,
368 OPCODE_UNIFORM_MATRIX32
,
369 OPCODE_UNIFORM_MATRIX24
,
370 OPCODE_UNIFORM_MATRIX42
,
371 OPCODE_UNIFORM_MATRIX34
,
372 OPCODE_UNIFORM_MATRIX43
,
374 /* GL_EXT_framebuffer_blit */
375 OPCODE_BLIT_FRAMEBUFFER
,
377 /* Vertex attributes -- fallback for when optimized display
378 * list build isn't active.
397 /* GL_EXT_provoking_vertex */
398 OPCODE_PROVOKING_VERTEX
,
400 /* GL_EXT_transform_feedback */
401 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
402 OPCODE_END_TRANSFORM_FEEDBACK
,
404 /* The following three are meta instructions */
405 OPCODE_ERROR
, /* raise compiled-in error */
416 * Display list instructions are stored as sequences of "nodes". Nodes
417 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
418 * are linked together with a pointer.
420 * Each instruction in the display list is stored as a sequence of
421 * contiguous nodes in memory.
422 * Each node is the union of a variety of data types.
437 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
441 typedef union gl_dlist_node Node
;
445 * How many nodes to allocate at a time.
447 * \note Reduced now that we hold vertices etc. elsewhere.
449 #define BLOCK_SIZE 256
454 * Number of nodes of storage needed for each instruction.
455 * Sizes for dynamically allocated opcodes are stored in the context struct.
457 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
463 void mesa_print_display_list(GLuint list
);
466 /**********************************************************************/
467 /***** Private *****/
468 /**********************************************************************/
472 * Make an empty display list. This is used by glGenLists() to
473 * reserve display list IDs.
475 static struct gl_display_list
*
476 make_list(GLuint name
, GLuint count
)
478 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
480 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
481 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
487 * Lookup function to just encapsulate casting.
489 static INLINE
struct gl_display_list
*
490 lookup_list(GLcontext
*ctx
, GLuint list
)
492 return (struct gl_display_list
*)
493 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
497 /** Is the given opcode an extension code? */
498 static INLINE GLboolean
499 is_ext_opcode(OpCode opcode
)
501 return (opcode
>= OPCODE_EXT_0
);
505 /** Destroy an extended opcode instruction */
507 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
509 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
511 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
512 step
= ctx
->ListExt
->Opcode
[i
].Size
;
517 /** Execute an extended opcode instruction */
519 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
521 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
523 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
524 step
= ctx
->ListExt
->Opcode
[i
].Size
;
529 /** Print an extended opcode instruction */
531 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
533 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
535 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
536 step
= ctx
->ListExt
->Opcode
[i
].Size
;
542 * Delete the named display list, but don't remove from hash table.
543 * \param dlist - display list pointer
546 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
551 n
= block
= dlist
->Head
;
553 done
= block
? GL_FALSE
: GL_TRUE
;
555 const OpCode opcode
= n
[0].opcode
;
557 /* check for extension opcodes first */
558 if (is_ext_opcode(opcode
)) {
559 n
+= ext_opcode_destroy(ctx
, n
);
563 /* for some commands, we need to free malloc'd memory */
566 n
+= InstSize
[n
[0].opcode
];
570 n
+= InstSize
[n
[0].opcode
];
572 case OPCODE_DRAW_PIXELS
:
574 n
+= InstSize
[n
[0].opcode
];
578 n
+= InstSize
[n
[0].opcode
];
580 case OPCODE_COLOR_TABLE
:
582 n
+= InstSize
[n
[0].opcode
];
584 case OPCODE_COLOR_SUB_TABLE
:
586 n
+= InstSize
[n
[0].opcode
];
588 case OPCODE_CONVOLUTION_FILTER_1D
:
590 n
+= InstSize
[n
[0].opcode
];
592 case OPCODE_CONVOLUTION_FILTER_2D
:
594 n
+= InstSize
[n
[0].opcode
];
596 case OPCODE_POLYGON_STIPPLE
:
598 n
+= InstSize
[n
[0].opcode
];
600 case OPCODE_TEX_IMAGE1D
:
602 n
+= InstSize
[n
[0].opcode
];
604 case OPCODE_TEX_IMAGE2D
:
606 n
+= InstSize
[n
[0].opcode
];
608 case OPCODE_TEX_IMAGE3D
:
610 n
+= InstSize
[n
[0].opcode
];
612 case OPCODE_TEX_SUB_IMAGE1D
:
614 n
+= InstSize
[n
[0].opcode
];
616 case OPCODE_TEX_SUB_IMAGE2D
:
618 n
+= InstSize
[n
[0].opcode
];
620 case OPCODE_TEX_SUB_IMAGE3D
:
622 n
+= InstSize
[n
[0].opcode
];
624 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
626 n
+= InstSize
[n
[0].opcode
];
628 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
630 n
+= InstSize
[n
[0].opcode
];
632 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
634 n
+= InstSize
[n
[0].opcode
];
636 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
638 n
+= InstSize
[n
[0].opcode
];
640 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
642 n
+= InstSize
[n
[0].opcode
];
644 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
646 n
+= InstSize
[n
[0].opcode
];
648 #if FEATURE_NV_vertex_program
649 case OPCODE_LOAD_PROGRAM_NV
:
650 free(n
[4].data
); /* program string */
651 n
+= InstSize
[n
[0].opcode
];
653 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
654 free(n
[2].data
); /* array of program ids */
655 n
+= InstSize
[n
[0].opcode
];
658 #if FEATURE_NV_fragment_program
659 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
660 free(n
[3].data
); /* parameter name */
661 n
+= InstSize
[n
[0].opcode
];
664 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
665 case OPCODE_PROGRAM_STRING_ARB
:
666 free(n
[4].data
); /* program string */
667 n
+= InstSize
[n
[0].opcode
];
670 case OPCODE_UNIFORM_1FV
:
671 case OPCODE_UNIFORM_2FV
:
672 case OPCODE_UNIFORM_3FV
:
673 case OPCODE_UNIFORM_4FV
:
674 case OPCODE_UNIFORM_1IV
:
675 case OPCODE_UNIFORM_2IV
:
676 case OPCODE_UNIFORM_3IV
:
677 case OPCODE_UNIFORM_4IV
:
679 n
+= InstSize
[n
[0].opcode
];
681 case OPCODE_UNIFORM_MATRIX22
:
682 case OPCODE_UNIFORM_MATRIX33
:
683 case OPCODE_UNIFORM_MATRIX44
:
684 case OPCODE_UNIFORM_MATRIX24
:
685 case OPCODE_UNIFORM_MATRIX42
:
686 case OPCODE_UNIFORM_MATRIX23
:
687 case OPCODE_UNIFORM_MATRIX32
:
688 case OPCODE_UNIFORM_MATRIX34
:
689 case OPCODE_UNIFORM_MATRIX43
:
691 n
+= InstSize
[n
[0].opcode
];
694 case OPCODE_CONTINUE
:
695 n
= (Node
*) n
[1].next
;
699 case OPCODE_END_OF_LIST
:
704 /* Most frequent case */
705 n
+= InstSize
[n
[0].opcode
];
716 * Destroy a display list and remove from hash table.
717 * \param list - display list number
720 destroy_list(GLcontext
*ctx
, GLuint list
)
722 struct gl_display_list
*dlist
;
727 dlist
= lookup_list(ctx
, list
);
731 _mesa_delete_list(ctx
, dlist
);
732 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
737 * Translate the nth element of list from <type> to GLint.
740 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
752 bptr
= (GLbyte
*) list
;
753 return (GLint
) bptr
[n
];
754 case GL_UNSIGNED_BYTE
:
755 ubptr
= (GLubyte
*) list
;
756 return (GLint
) ubptr
[n
];
758 sptr
= (GLshort
*) list
;
759 return (GLint
) sptr
[n
];
760 case GL_UNSIGNED_SHORT
:
761 usptr
= (GLushort
*) list
;
762 return (GLint
) usptr
[n
];
764 iptr
= (GLint
*) list
;
766 case GL_UNSIGNED_INT
:
767 uiptr
= (GLuint
*) list
;
768 return (GLint
) uiptr
[n
];
770 fptr
= (GLfloat
*) list
;
771 return (GLint
) FLOORF(fptr
[n
]);
773 ubptr
= ((GLubyte
*) list
) + 2 * n
;
774 return (GLint
) ubptr
[0] * 256
777 ubptr
= ((GLubyte
*) list
) + 3 * n
;
778 return (GLint
) ubptr
[0] * 65536
779 + (GLint
) ubptr
[1] * 256
782 ubptr
= ((GLubyte
*) list
) + 4 * n
;
783 return (GLint
) ubptr
[0] * 16777216
784 + (GLint
) ubptr
[1] * 65536
785 + (GLint
) ubptr
[2] * 256
795 /**********************************************************************/
797 /**********************************************************************/
800 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
801 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
804 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
805 GLsizei width
, GLsizei height
, GLsizei depth
,
806 GLenum format
, GLenum type
, const GLvoid
* pixels
,
807 const struct gl_pixelstore_attrib
*unpack
)
809 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
811 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
812 format
, type
, pixels
, unpack
);
813 if (pixels
&& !image
) {
814 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
818 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
819 format
, type
, pixels
)) {
820 const GLubyte
*map
, *src
;
824 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
825 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
827 /* unable to map src buffer! */
828 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
832 src
= ADD_POINTERS(map
, pixels
);
833 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
834 format
, type
, src
, unpack
);
836 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
840 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
850 * Allocate space for a display list instruction (opcode + payload space).
851 * \param opcode the instruction opcode (OPCODE_* value)
852 * \param bytes instruction payload size (not counting opcode)
853 * \return pointer to allocated memory (the opcode space)
856 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
858 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
861 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
862 if (InstSize
[opcode
] == 0) {
863 /* save instruction size now */
864 InstSize
[opcode
] = numNodes
;
867 /* make sure instruction size agrees */
868 ASSERT(numNodes
== InstSize
[opcode
]);
872 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
873 /* This block is full. Allocate a new block and chain to it */
875 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
876 n
[0].opcode
= OPCODE_CONTINUE
;
877 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
879 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
882 n
[1].next
= (Node
*) newblock
;
883 ctx
->ListState
.CurrentBlock
= newblock
;
884 ctx
->ListState
.CurrentPos
= 0;
887 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
888 ctx
->ListState
.CurrentPos
+= numNodes
;
890 n
[0].opcode
= opcode
;
898 * Allocate space for a display list instruction. Used by callers outside
899 * this file for things like VBO vertex data.
901 * \param opcode the instruction opcode (OPCODE_* value)
902 * \param bytes instruction size in bytes, not counting opcode.
903 * \return pointer to the usable data area (not including the internal
907 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
909 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
911 return n
+ 1; /* return pointer to payload area, after opcode */
918 * This function allows modules and drivers to get their own opcodes
919 * for extending display list functionality.
920 * \param ctx the rendering context
921 * \param size number of bytes for storing the new display list command
922 * \param execute function to execute the new display list command
923 * \param destroy function to destroy the new display list command
924 * \param print function to print the new display list command
925 * \return the new opcode number or -1 if error
928 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
930 void (*execute
) (GLcontext
*, void *),
931 void (*destroy
) (GLcontext
*, void *),
932 void (*print
) (GLcontext
*, void *))
934 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
935 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
936 ctx
->ListExt
->Opcode
[i
].Size
=
937 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
938 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
939 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
940 ctx
->ListExt
->Opcode
[i
].Print
= print
;
941 return i
+ OPCODE_EXT_0
;
948 * Allocate space for a display list instruction. The space is basically
949 * an array of Nodes where node[0] holds the opcode, node[1] is the first
950 * function parameter, node[2] is the second parameter, etc.
952 * \param opcode one of OPCODE_x
953 * \param nparams number of function parameters
954 * \return pointer to start of instruction space
957 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
959 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
965 * Display List compilation functions
967 static void GLAPIENTRY
968 save_Accum(GLenum op
, GLfloat value
)
970 GET_CURRENT_CONTEXT(ctx
);
972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
973 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
978 if (ctx
->ExecuteFlag
) {
979 CALL_Accum(ctx
->Exec
, (op
, value
));
984 static void GLAPIENTRY
985 save_AlphaFunc(GLenum func
, GLclampf ref
)
987 GET_CURRENT_CONTEXT(ctx
);
989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
990 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
993 n
[2].f
= (GLfloat
) ref
;
995 if (ctx
->ExecuteFlag
) {
996 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1001 static void GLAPIENTRY
1002 save_BindTexture(GLenum target
, GLuint texture
)
1004 GET_CURRENT_CONTEXT(ctx
);
1006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1007 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1012 if (ctx
->ExecuteFlag
) {
1013 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1018 static void GLAPIENTRY
1019 save_Bitmap(GLsizei width
, GLsizei height
,
1020 GLfloat xorig
, GLfloat yorig
,
1021 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1023 GET_CURRENT_CONTEXT(ctx
);
1025 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1026 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1028 n
[1].i
= (GLint
) width
;
1029 n
[2].i
= (GLint
) height
;
1034 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1036 if (ctx
->ExecuteFlag
) {
1037 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1038 xorig
, yorig
, xmove
, ymove
, pixels
));
1043 static void GLAPIENTRY
1044 save_BlendEquation(GLenum mode
)
1046 GET_CURRENT_CONTEXT(ctx
);
1048 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1049 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1053 if (ctx
->ExecuteFlag
) {
1054 CALL_BlendEquation(ctx
->Exec
, (mode
));
1059 static void GLAPIENTRY
1060 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1062 GET_CURRENT_CONTEXT(ctx
);
1064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1065 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1070 if (ctx
->ExecuteFlag
) {
1071 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1076 static void GLAPIENTRY
1077 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1078 GLenum sfactorA
, GLenum dfactorA
)
1080 GET_CURRENT_CONTEXT(ctx
);
1082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1083 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1085 n
[1].e
= sfactorRGB
;
1086 n
[2].e
= dfactorRGB
;
1090 if (ctx
->ExecuteFlag
) {
1091 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1092 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1097 static void GLAPIENTRY
1098 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1100 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1104 static void GLAPIENTRY
1105 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1107 GET_CURRENT_CONTEXT(ctx
);
1109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1110 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1117 if (ctx
->ExecuteFlag
) {
1118 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1122 static void invalidate_saved_current_state( GLcontext
*ctx
)
1126 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1127 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1129 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1130 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1132 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1134 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1137 static void GLAPIENTRY
1138 save_CallList(GLuint list
)
1140 GET_CURRENT_CONTEXT(ctx
);
1142 SAVE_FLUSH_VERTICES(ctx
);
1144 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1149 /* After this, we don't know what state we're in. Invalidate all
1150 * cached information previously gathered:
1152 invalidate_saved_current_state( ctx
);
1154 if (ctx
->ExecuteFlag
) {
1155 _mesa_CallList(list
);
1160 static void GLAPIENTRY
1161 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1163 GET_CURRENT_CONTEXT(ctx
);
1165 GLboolean typeErrorFlag
;
1167 SAVE_FLUSH_VERTICES(ctx
);
1171 case GL_UNSIGNED_BYTE
:
1173 case GL_UNSIGNED_SHORT
:
1175 case GL_UNSIGNED_INT
:
1180 typeErrorFlag
= GL_FALSE
;
1183 typeErrorFlag
= GL_TRUE
;
1186 for (i
= 0; i
< num
; i
++) {
1187 GLint list
= translate_id(i
, type
, lists
);
1188 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1191 n
[2].b
= typeErrorFlag
;
1195 /* After this, we don't know what state we're in. Invalidate all
1196 * cached information previously gathered:
1198 invalidate_saved_current_state( ctx
);
1200 if (ctx
->ExecuteFlag
) {
1201 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1206 static void GLAPIENTRY
1207 save_Clear(GLbitfield mask
)
1209 GET_CURRENT_CONTEXT(ctx
);
1211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1212 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1216 if (ctx
->ExecuteFlag
) {
1217 CALL_Clear(ctx
->Exec
, (mask
));
1222 static void GLAPIENTRY
1223 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1225 GET_CURRENT_CONTEXT(ctx
);
1227 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1228 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1231 n
[2].i
= drawbuffer
;
1233 if (buffer
== GL_COLOR
) {
1244 if (ctx
->ExecuteFlag
) {
1245 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1250 static void GLAPIENTRY
1251 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1253 GET_CURRENT_CONTEXT(ctx
);
1255 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1256 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1259 n
[2].i
= drawbuffer
;
1261 if (buffer
== GL_COLOR
) {
1272 if (ctx
->ExecuteFlag
) {
1273 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1278 static void GLAPIENTRY
1279 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1281 GET_CURRENT_CONTEXT(ctx
);
1283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1284 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1287 n
[2].i
= drawbuffer
;
1289 if (buffer
== GL_COLOR
) {
1300 if (ctx
->ExecuteFlag
) {
1301 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1306 static void GLAPIENTRY
1307 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1308 GLfloat depth
, GLint stencil
)
1310 GET_CURRENT_CONTEXT(ctx
);
1312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1313 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1316 n
[2].i
= drawbuffer
;
1320 if (ctx
->ExecuteFlag
) {
1321 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1326 static void GLAPIENTRY
1327 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1329 GET_CURRENT_CONTEXT(ctx
);
1331 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1332 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1339 if (ctx
->ExecuteFlag
) {
1340 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1345 static void GLAPIENTRY
1346 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1348 GET_CURRENT_CONTEXT(ctx
);
1350 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1351 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1358 if (ctx
->ExecuteFlag
) {
1359 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1364 static void GLAPIENTRY
1365 save_ClearDepth(GLclampd depth
)
1367 GET_CURRENT_CONTEXT(ctx
);
1369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1370 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1372 n
[1].f
= (GLfloat
) depth
;
1374 if (ctx
->ExecuteFlag
) {
1375 CALL_ClearDepth(ctx
->Exec
, (depth
));
1380 static void GLAPIENTRY
1381 save_ClearIndex(GLfloat c
)
1383 GET_CURRENT_CONTEXT(ctx
);
1385 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1386 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1390 if (ctx
->ExecuteFlag
) {
1391 CALL_ClearIndex(ctx
->Exec
, (c
));
1396 static void GLAPIENTRY
1397 save_ClearStencil(GLint s
)
1399 GET_CURRENT_CONTEXT(ctx
);
1401 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1402 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1406 if (ctx
->ExecuteFlag
) {
1407 CALL_ClearStencil(ctx
->Exec
, (s
));
1412 static void GLAPIENTRY
1413 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1415 GET_CURRENT_CONTEXT(ctx
);
1417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1418 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1421 n
[2].f
= (GLfloat
) equ
[0];
1422 n
[3].f
= (GLfloat
) equ
[1];
1423 n
[4].f
= (GLfloat
) equ
[2];
1424 n
[5].f
= (GLfloat
) equ
[3];
1426 if (ctx
->ExecuteFlag
) {
1427 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1433 static void GLAPIENTRY
1434 save_ColorMask(GLboolean red
, GLboolean green
,
1435 GLboolean blue
, GLboolean alpha
)
1437 GET_CURRENT_CONTEXT(ctx
);
1439 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1440 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1447 if (ctx
->ExecuteFlag
) {
1448 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1453 static void GLAPIENTRY
1454 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1455 GLboolean blue
, GLboolean alpha
)
1457 GET_CURRENT_CONTEXT(ctx
);
1459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1460 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1468 if (ctx
->ExecuteFlag
) {
1469 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1474 static void GLAPIENTRY
1475 save_ColorMaterial(GLenum face
, GLenum mode
)
1477 GET_CURRENT_CONTEXT(ctx
);
1479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1481 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1486 if (ctx
->ExecuteFlag
) {
1487 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1492 static void GLAPIENTRY
1493 save_ColorTable(GLenum target
, GLenum internalFormat
,
1494 GLsizei width
, GLenum format
, GLenum type
,
1495 const GLvoid
* table
)
1497 GET_CURRENT_CONTEXT(ctx
);
1498 if (_mesa_is_proxy_texture(target
)) {
1499 /* execute immediately */
1500 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1501 format
, type
, table
));
1505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1506 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1509 n
[2].e
= internalFormat
;
1513 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1516 if (ctx
->ExecuteFlag
) {
1517 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1518 format
, type
, table
));
1525 static void GLAPIENTRY
1526 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1527 const GLfloat
*params
)
1529 GET_CURRENT_CONTEXT(ctx
);
1532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1534 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1539 if (pname
== GL_COLOR_TABLE_SGI
||
1540 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1541 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1542 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1549 if (ctx
->ExecuteFlag
) {
1550 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1555 static void GLAPIENTRY
1556 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1558 GET_CURRENT_CONTEXT(ctx
);
1561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1563 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1568 if (pname
== GL_COLOR_TABLE_SGI
||
1569 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1570 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1571 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1578 if (ctx
->ExecuteFlag
) {
1579 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1585 static void GLAPIENTRY
1586 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1587 GLenum format
, GLenum type
, const GLvoid
* table
)
1589 GET_CURRENT_CONTEXT(ctx
);
1591 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1592 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1599 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1602 if (ctx
->ExecuteFlag
) {
1603 CALL_ColorSubTable(ctx
->Exec
,
1604 (target
, start
, count
, format
, type
, table
));
1609 static void GLAPIENTRY
1610 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1611 GLint x
, GLint y
, GLsizei width
)
1613 GET_CURRENT_CONTEXT(ctx
);
1616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1617 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1625 if (ctx
->ExecuteFlag
) {
1626 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1631 static void GLAPIENTRY
1632 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1633 GLint x
, GLint y
, GLsizei width
)
1635 GET_CURRENT_CONTEXT(ctx
);
1638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1639 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1642 n
[2].e
= internalformat
;
1647 if (ctx
->ExecuteFlag
) {
1648 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1653 static void GLAPIENTRY
1654 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1655 GLenum format
, GLenum type
, const GLvoid
* filter
)
1657 GET_CURRENT_CONTEXT(ctx
);
1660 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1662 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1665 n
[2].e
= internalFormat
;
1669 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1672 if (ctx
->ExecuteFlag
) {
1673 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1674 format
, type
, filter
));
1679 static void GLAPIENTRY
1680 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1681 GLsizei width
, GLsizei height
, GLenum format
,
1682 GLenum type
, const GLvoid
* filter
)
1684 GET_CURRENT_CONTEXT(ctx
);
1687 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1689 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1692 n
[2].e
= internalFormat
;
1697 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1700 if (ctx
->ExecuteFlag
) {
1701 CALL_ConvolutionFilter2D(ctx
->Exec
,
1702 (target
, internalFormat
, width
, height
, format
,
1708 static void GLAPIENTRY
1709 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1711 GET_CURRENT_CONTEXT(ctx
);
1713 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1714 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1720 if (ctx
->ExecuteFlag
) {
1721 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1726 static void GLAPIENTRY
1727 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1729 GET_CURRENT_CONTEXT(ctx
);
1731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1732 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1737 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1738 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1739 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1745 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1748 if (ctx
->ExecuteFlag
) {
1749 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1754 static void GLAPIENTRY
1755 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1757 GET_CURRENT_CONTEXT(ctx
);
1759 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1760 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1766 if (ctx
->ExecuteFlag
) {
1767 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1772 static void GLAPIENTRY
1773 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1774 const GLfloat
*params
)
1776 GET_CURRENT_CONTEXT(ctx
);
1778 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1779 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1784 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1785 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1786 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1792 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1795 if (ctx
->ExecuteFlag
) {
1796 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1801 static void GLAPIENTRY
1802 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1804 GET_CURRENT_CONTEXT(ctx
);
1806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1807 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1811 n
[3].i
= (GLint
) width
;
1812 n
[4].i
= (GLint
) height
;
1815 if (ctx
->ExecuteFlag
) {
1816 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1822 static void GLAPIENTRY
1823 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1824 GLint x
, GLint y
, GLsizei width
, GLint border
)
1826 GET_CURRENT_CONTEXT(ctx
);
1828 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1829 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1833 n
[3].e
= internalformat
;
1839 if (ctx
->ExecuteFlag
) {
1840 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1841 x
, y
, width
, border
));
1846 static void GLAPIENTRY
1847 save_CopyTexImage2D(GLenum target
, GLint level
,
1848 GLenum internalformat
,
1849 GLint x
, GLint y
, GLsizei width
,
1850 GLsizei height
, GLint border
)
1852 GET_CURRENT_CONTEXT(ctx
);
1854 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1855 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1859 n
[3].e
= internalformat
;
1866 if (ctx
->ExecuteFlag
) {
1867 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1868 x
, y
, width
, height
, border
));
1874 static void GLAPIENTRY
1875 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1876 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1878 GET_CURRENT_CONTEXT(ctx
);
1880 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1881 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1890 if (ctx
->ExecuteFlag
) {
1891 CALL_CopyTexSubImage1D(ctx
->Exec
,
1892 (target
, level
, xoffset
, x
, y
, width
));
1897 static void GLAPIENTRY
1898 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1899 GLint xoffset
, GLint yoffset
,
1900 GLint x
, GLint y
, GLsizei width
, GLint height
)
1902 GET_CURRENT_CONTEXT(ctx
);
1904 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1905 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1916 if (ctx
->ExecuteFlag
) {
1917 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1918 x
, y
, width
, height
));
1923 static void GLAPIENTRY
1924 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1925 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1926 GLint x
, GLint y
, GLsizei width
, GLint height
)
1928 GET_CURRENT_CONTEXT(ctx
);
1930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1931 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1943 if (ctx
->ExecuteFlag
) {
1944 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1945 xoffset
, yoffset
, zoffset
,
1946 x
, y
, width
, height
));
1951 static void GLAPIENTRY
1952 save_CullFace(GLenum mode
)
1954 GET_CURRENT_CONTEXT(ctx
);
1956 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1957 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1961 if (ctx
->ExecuteFlag
) {
1962 CALL_CullFace(ctx
->Exec
, (mode
));
1967 static void GLAPIENTRY
1968 save_DepthFunc(GLenum func
)
1970 GET_CURRENT_CONTEXT(ctx
);
1972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1973 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1977 if (ctx
->ExecuteFlag
) {
1978 CALL_DepthFunc(ctx
->Exec
, (func
));
1983 static void GLAPIENTRY
1984 save_DepthMask(GLboolean mask
)
1986 GET_CURRENT_CONTEXT(ctx
);
1988 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1989 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
1993 if (ctx
->ExecuteFlag
) {
1994 CALL_DepthMask(ctx
->Exec
, (mask
));
1999 static void GLAPIENTRY
2000 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2002 GET_CURRENT_CONTEXT(ctx
);
2004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2005 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2007 n
[1].f
= (GLfloat
) nearval
;
2008 n
[2].f
= (GLfloat
) farval
;
2010 if (ctx
->ExecuteFlag
) {
2011 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2016 static void GLAPIENTRY
2017 save_Disable(GLenum cap
)
2019 GET_CURRENT_CONTEXT(ctx
);
2021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2022 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2026 if (ctx
->ExecuteFlag
) {
2027 CALL_Disable(ctx
->Exec
, (cap
));
2032 static void GLAPIENTRY
2033 save_DisableIndexed(GLuint index
, GLenum cap
)
2035 GET_CURRENT_CONTEXT(ctx
);
2037 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2038 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2043 if (ctx
->ExecuteFlag
) {
2044 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2049 static void GLAPIENTRY
2050 save_DrawBuffer(GLenum mode
)
2052 GET_CURRENT_CONTEXT(ctx
);
2054 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2055 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2059 if (ctx
->ExecuteFlag
) {
2060 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2065 static void GLAPIENTRY
2066 save_DrawPixels(GLsizei width
, GLsizei height
,
2067 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2069 GET_CURRENT_CONTEXT(ctx
);
2072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2074 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2080 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2081 pixels
, &ctx
->Unpack
);
2083 if (ctx
->ExecuteFlag
) {
2084 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2090 static void GLAPIENTRY
2091 save_Enable(GLenum cap
)
2093 GET_CURRENT_CONTEXT(ctx
);
2095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2096 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2100 if (ctx
->ExecuteFlag
) {
2101 CALL_Enable(ctx
->Exec
, (cap
));
2107 static void GLAPIENTRY
2108 save_EnableIndexed(GLuint index
, GLenum cap
)
2110 GET_CURRENT_CONTEXT(ctx
);
2112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2113 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2118 if (ctx
->ExecuteFlag
) {
2119 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2125 static void GLAPIENTRY
2126 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2128 GET_CURRENT_CONTEXT(ctx
);
2130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2131 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2137 if (ctx
->ExecuteFlag
) {
2138 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2143 static void GLAPIENTRY
2144 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2146 GET_CURRENT_CONTEXT(ctx
);
2148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2149 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2157 if (ctx
->ExecuteFlag
) {
2158 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2165 static void GLAPIENTRY
2166 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2168 GET_CURRENT_CONTEXT(ctx
);
2170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2171 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2179 if (ctx
->ExecuteFlag
) {
2180 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2185 static void GLAPIENTRY
2186 save_Fogf(GLenum pname
, GLfloat param
)
2190 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2191 save_Fogfv(pname
, parray
);
2195 static void GLAPIENTRY
2196 save_Fogiv(GLenum pname
, const GLint
*params
)
2201 case GL_FOG_DENSITY
:
2205 p
[0] = (GLfloat
) *params
;
2211 p
[0] = INT_TO_FLOAT(params
[0]);
2212 p
[1] = INT_TO_FLOAT(params
[1]);
2213 p
[2] = INT_TO_FLOAT(params
[2]);
2214 p
[3] = INT_TO_FLOAT(params
[3]);
2217 /* Error will be caught later in gl_Fogfv */
2218 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2220 save_Fogfv(pname
, p
);
2224 static void GLAPIENTRY
2225 save_Fogi(GLenum pname
, GLint param
)
2229 parray
[1] = parray
[2] = parray
[3] = 0;
2230 save_Fogiv(pname
, parray
);
2234 static void GLAPIENTRY
2235 save_FrontFace(GLenum mode
)
2237 GET_CURRENT_CONTEXT(ctx
);
2239 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2240 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2244 if (ctx
->ExecuteFlag
) {
2245 CALL_FrontFace(ctx
->Exec
, (mode
));
2250 static void GLAPIENTRY
2251 save_Frustum(GLdouble left
, GLdouble right
,
2252 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2254 GET_CURRENT_CONTEXT(ctx
);
2256 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2257 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2259 n
[1].f
= (GLfloat
) left
;
2260 n
[2].f
= (GLfloat
) right
;
2261 n
[3].f
= (GLfloat
) bottom
;
2262 n
[4].f
= (GLfloat
) top
;
2263 n
[5].f
= (GLfloat
) nearval
;
2264 n
[6].f
= (GLfloat
) farval
;
2266 if (ctx
->ExecuteFlag
) {
2267 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2272 static void GLAPIENTRY
2273 save_Hint(GLenum target
, GLenum mode
)
2275 GET_CURRENT_CONTEXT(ctx
);
2277 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2278 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2283 if (ctx
->ExecuteFlag
) {
2284 CALL_Hint(ctx
->Exec
, (target
, mode
));
2289 static void GLAPIENTRY
2290 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2293 GET_CURRENT_CONTEXT(ctx
);
2296 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2297 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2301 n
[3].e
= internalFormat
;
2304 if (ctx
->ExecuteFlag
) {
2305 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2310 static void GLAPIENTRY
2311 save_IndexMask(GLuint mask
)
2313 GET_CURRENT_CONTEXT(ctx
);
2315 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2316 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2320 if (ctx
->ExecuteFlag
) {
2321 CALL_IndexMask(ctx
->Exec
, (mask
));
2326 static void GLAPIENTRY
2327 save_InitNames(void)
2329 GET_CURRENT_CONTEXT(ctx
);
2330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2331 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2332 if (ctx
->ExecuteFlag
) {
2333 CALL_InitNames(ctx
->Exec
, ());
2338 static void GLAPIENTRY
2339 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2341 GET_CURRENT_CONTEXT(ctx
);
2343 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2344 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2362 case GL_SPOT_DIRECTION
:
2365 case GL_SPOT_EXPONENT
:
2368 case GL_SPOT_CUTOFF
:
2371 case GL_CONSTANT_ATTENUATION
:
2374 case GL_LINEAR_ATTENUATION
:
2377 case GL_QUADRATIC_ATTENUATION
:
2383 for (i
= 0; i
< nParams
; i
++) {
2384 n
[3 + i
].f
= params
[i
];
2387 if (ctx
->ExecuteFlag
) {
2388 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2393 static void GLAPIENTRY
2394 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2398 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2399 save_Lightfv(light
, pname
, parray
);
2403 static void GLAPIENTRY
2404 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2411 fparam
[0] = INT_TO_FLOAT(params
[0]);
2412 fparam
[1] = INT_TO_FLOAT(params
[1]);
2413 fparam
[2] = INT_TO_FLOAT(params
[2]);
2414 fparam
[3] = INT_TO_FLOAT(params
[3]);
2417 fparam
[0] = (GLfloat
) params
[0];
2418 fparam
[1] = (GLfloat
) params
[1];
2419 fparam
[2] = (GLfloat
) params
[2];
2420 fparam
[3] = (GLfloat
) params
[3];
2422 case GL_SPOT_DIRECTION
:
2423 fparam
[0] = (GLfloat
) params
[0];
2424 fparam
[1] = (GLfloat
) params
[1];
2425 fparam
[2] = (GLfloat
) params
[2];
2427 case GL_SPOT_EXPONENT
:
2428 case GL_SPOT_CUTOFF
:
2429 case GL_CONSTANT_ATTENUATION
:
2430 case GL_LINEAR_ATTENUATION
:
2431 case GL_QUADRATIC_ATTENUATION
:
2432 fparam
[0] = (GLfloat
) params
[0];
2435 /* error will be caught later in gl_Lightfv */
2438 save_Lightfv(light
, pname
, fparam
);
2442 static void GLAPIENTRY
2443 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2447 parray
[1] = parray
[2] = parray
[3] = 0;
2448 save_Lightiv(light
, pname
, parray
);
2452 static void GLAPIENTRY
2453 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2455 GET_CURRENT_CONTEXT(ctx
);
2457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2458 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2466 if (ctx
->ExecuteFlag
) {
2467 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2472 static void GLAPIENTRY
2473 save_LightModelf(GLenum pname
, GLfloat param
)
2477 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2478 save_LightModelfv(pname
, parray
);
2482 static void GLAPIENTRY
2483 save_LightModeliv(GLenum pname
, const GLint
*params
)
2487 case GL_LIGHT_MODEL_AMBIENT
:
2488 fparam
[0] = INT_TO_FLOAT(params
[0]);
2489 fparam
[1] = INT_TO_FLOAT(params
[1]);
2490 fparam
[2] = INT_TO_FLOAT(params
[2]);
2491 fparam
[3] = INT_TO_FLOAT(params
[3]);
2493 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2494 case GL_LIGHT_MODEL_TWO_SIDE
:
2495 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2496 fparam
[0] = (GLfloat
) params
[0];
2502 /* Error will be caught later in gl_LightModelfv */
2503 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2505 save_LightModelfv(pname
, fparam
);
2509 static void GLAPIENTRY
2510 save_LightModeli(GLenum pname
, GLint param
)
2514 parray
[1] = parray
[2] = parray
[3] = 0;
2515 save_LightModeliv(pname
, parray
);
2519 static void GLAPIENTRY
2520 save_LineStipple(GLint factor
, GLushort pattern
)
2522 GET_CURRENT_CONTEXT(ctx
);
2524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2525 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2530 if (ctx
->ExecuteFlag
) {
2531 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2536 static void GLAPIENTRY
2537 save_LineWidth(GLfloat width
)
2539 GET_CURRENT_CONTEXT(ctx
);
2541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2542 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2546 if (ctx
->ExecuteFlag
) {
2547 CALL_LineWidth(ctx
->Exec
, (width
));
2552 static void GLAPIENTRY
2553 save_ListBase(GLuint base
)
2555 GET_CURRENT_CONTEXT(ctx
);
2557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2558 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2562 if (ctx
->ExecuteFlag
) {
2563 CALL_ListBase(ctx
->Exec
, (base
));
2568 static void GLAPIENTRY
2569 save_LoadIdentity(void)
2571 GET_CURRENT_CONTEXT(ctx
);
2572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2573 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2574 if (ctx
->ExecuteFlag
) {
2575 CALL_LoadIdentity(ctx
->Exec
, ());
2580 static void GLAPIENTRY
2581 save_LoadMatrixf(const GLfloat
* m
)
2583 GET_CURRENT_CONTEXT(ctx
);
2585 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2586 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2589 for (i
= 0; i
< 16; i
++) {
2593 if (ctx
->ExecuteFlag
) {
2594 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2599 static void GLAPIENTRY
2600 save_LoadMatrixd(const GLdouble
* m
)
2604 for (i
= 0; i
< 16; i
++) {
2605 f
[i
] = (GLfloat
) m
[i
];
2607 save_LoadMatrixf(f
);
2611 static void GLAPIENTRY
2612 save_LoadName(GLuint name
)
2614 GET_CURRENT_CONTEXT(ctx
);
2616 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2617 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2621 if (ctx
->ExecuteFlag
) {
2622 CALL_LoadName(ctx
->Exec
, (name
));
2627 static void GLAPIENTRY
2628 save_LogicOp(GLenum opcode
)
2630 GET_CURRENT_CONTEXT(ctx
);
2632 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2633 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2637 if (ctx
->ExecuteFlag
) {
2638 CALL_LogicOp(ctx
->Exec
, (opcode
));
2643 static void GLAPIENTRY
2644 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2645 GLint order
, const GLdouble
* points
)
2647 GET_CURRENT_CONTEXT(ctx
);
2649 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2650 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2652 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2654 n
[2].f
= (GLfloat
) u1
;
2655 n
[3].f
= (GLfloat
) u2
;
2656 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2658 n
[6].data
= (void *) pnts
;
2660 if (ctx
->ExecuteFlag
) {
2661 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2665 static void GLAPIENTRY
2666 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2667 GLint order
, const GLfloat
* points
)
2669 GET_CURRENT_CONTEXT(ctx
);
2671 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2672 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2674 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2678 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2680 n
[6].data
= (void *) pnts
;
2682 if (ctx
->ExecuteFlag
) {
2683 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2688 static void GLAPIENTRY
2689 save_Map2d(GLenum target
,
2690 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2691 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2692 const GLdouble
* points
)
2694 GET_CURRENT_CONTEXT(ctx
);
2696 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2697 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2699 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2700 vstride
, vorder
, points
);
2702 n
[2].f
= (GLfloat
) u1
;
2703 n
[3].f
= (GLfloat
) u2
;
2704 n
[4].f
= (GLfloat
) v1
;
2705 n
[5].f
= (GLfloat
) v2
;
2706 /* XXX verify these strides are correct */
2707 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2708 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2711 n
[10].data
= (void *) pnts
;
2713 if (ctx
->ExecuteFlag
) {
2714 CALL_Map2d(ctx
->Exec
, (target
,
2715 u1
, u2
, ustride
, uorder
,
2716 v1
, v2
, vstride
, vorder
, points
));
2721 static void GLAPIENTRY
2722 save_Map2f(GLenum target
,
2723 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2724 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2725 const GLfloat
* points
)
2727 GET_CURRENT_CONTEXT(ctx
);
2729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2730 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2732 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2733 vstride
, vorder
, points
);
2739 /* XXX verify these strides are correct */
2740 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2741 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2744 n
[10].data
= (void *) pnts
;
2746 if (ctx
->ExecuteFlag
) {
2747 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2748 v1
, v2
, vstride
, vorder
, points
));
2753 static void GLAPIENTRY
2754 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2756 GET_CURRENT_CONTEXT(ctx
);
2758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2759 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2765 if (ctx
->ExecuteFlag
) {
2766 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2771 static void GLAPIENTRY
2772 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2774 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2778 static void GLAPIENTRY
2779 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2780 GLint vn
, GLfloat v1
, GLfloat v2
)
2782 GET_CURRENT_CONTEXT(ctx
);
2784 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2785 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2794 if (ctx
->ExecuteFlag
) {
2795 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2801 static void GLAPIENTRY
2802 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2803 GLint vn
, GLdouble v1
, GLdouble v2
)
2805 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2806 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2810 static void GLAPIENTRY
2811 save_MatrixMode(GLenum mode
)
2813 GET_CURRENT_CONTEXT(ctx
);
2815 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2816 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2820 if (ctx
->ExecuteFlag
) {
2821 CALL_MatrixMode(ctx
->Exec
, (mode
));
2826 static void GLAPIENTRY
2827 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2829 GET_CURRENT_CONTEXT(ctx
);
2832 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2833 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2836 n
[2].e
= internalFormat
;
2839 if (ctx
->ExecuteFlag
) {
2840 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2845 static void GLAPIENTRY
2846 save_MultMatrixf(const GLfloat
* m
)
2848 GET_CURRENT_CONTEXT(ctx
);
2850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2851 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2854 for (i
= 0; i
< 16; i
++) {
2858 if (ctx
->ExecuteFlag
) {
2859 CALL_MultMatrixf(ctx
->Exec
, (m
));
2864 static void GLAPIENTRY
2865 save_MultMatrixd(const GLdouble
* m
)
2869 for (i
= 0; i
< 16; i
++) {
2870 f
[i
] = (GLfloat
) m
[i
];
2872 save_MultMatrixf(f
);
2876 static void GLAPIENTRY
2877 save_NewList(GLuint name
, GLenum mode
)
2879 GET_CURRENT_CONTEXT(ctx
);
2880 /* It's an error to call this function while building a display list */
2881 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2888 static void GLAPIENTRY
2889 save_Ortho(GLdouble left
, GLdouble right
,
2890 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2892 GET_CURRENT_CONTEXT(ctx
);
2894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2895 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2897 n
[1].f
= (GLfloat
) left
;
2898 n
[2].f
= (GLfloat
) right
;
2899 n
[3].f
= (GLfloat
) bottom
;
2900 n
[4].f
= (GLfloat
) top
;
2901 n
[5].f
= (GLfloat
) nearval
;
2902 n
[6].f
= (GLfloat
) farval
;
2904 if (ctx
->ExecuteFlag
) {
2905 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2910 static void GLAPIENTRY
2911 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2913 GET_CURRENT_CONTEXT(ctx
);
2915 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2916 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2920 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
2921 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2923 if (ctx
->ExecuteFlag
) {
2924 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2929 static void GLAPIENTRY
2930 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2932 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2934 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2935 for (i
= 0; i
< mapsize
; i
++) {
2936 fvalues
[i
] = (GLfloat
) values
[i
];
2940 for (i
= 0; i
< mapsize
; i
++) {
2941 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2944 save_PixelMapfv(map
, mapsize
, fvalues
);
2948 static void GLAPIENTRY
2949 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2951 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2953 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2954 for (i
= 0; i
< mapsize
; i
++) {
2955 fvalues
[i
] = (GLfloat
) values
[i
];
2959 for (i
= 0; i
< mapsize
; i
++) {
2960 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2963 save_PixelMapfv(map
, mapsize
, fvalues
);
2967 static void GLAPIENTRY
2968 save_PixelTransferf(GLenum pname
, GLfloat param
)
2970 GET_CURRENT_CONTEXT(ctx
);
2972 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2973 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2978 if (ctx
->ExecuteFlag
) {
2979 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2984 static void GLAPIENTRY
2985 save_PixelTransferi(GLenum pname
, GLint param
)
2987 save_PixelTransferf(pname
, (GLfloat
) param
);
2991 static void GLAPIENTRY
2992 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2994 GET_CURRENT_CONTEXT(ctx
);
2996 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2997 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3002 if (ctx
->ExecuteFlag
) {
3003 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3008 static void GLAPIENTRY
3009 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3011 GET_CURRENT_CONTEXT(ctx
);
3013 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3014 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3021 if (ctx
->ExecuteFlag
) {
3022 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3027 static void GLAPIENTRY
3028 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3032 parray
[1] = parray
[2] = 0.0F
;
3033 save_PointParameterfvEXT(pname
, parray
);
3036 static void GLAPIENTRY
3037 save_PointParameteriNV(GLenum pname
, GLint param
)
3040 parray
[0] = (GLfloat
) param
;
3041 parray
[1] = parray
[2] = 0.0F
;
3042 save_PointParameterfvEXT(pname
, parray
);
3045 static void GLAPIENTRY
3046 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3049 parray
[0] = (GLfloat
) param
[0];
3050 parray
[1] = parray
[2] = 0.0F
;
3051 save_PointParameterfvEXT(pname
, parray
);
3055 static void GLAPIENTRY
3056 save_PointSize(GLfloat size
)
3058 GET_CURRENT_CONTEXT(ctx
);
3060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3061 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3065 if (ctx
->ExecuteFlag
) {
3066 CALL_PointSize(ctx
->Exec
, (size
));
3071 static void GLAPIENTRY
3072 save_PolygonMode(GLenum face
, GLenum mode
)
3074 GET_CURRENT_CONTEXT(ctx
);
3076 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3077 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3082 if (ctx
->ExecuteFlag
) {
3083 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3088 static void GLAPIENTRY
3089 save_PolygonStipple(const GLubyte
* pattern
)
3091 GET_CURRENT_CONTEXT(ctx
);
3094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3096 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3098 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3099 pattern
, &ctx
->Unpack
);
3101 if (ctx
->ExecuteFlag
) {
3102 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3107 static void GLAPIENTRY
3108 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3110 GET_CURRENT_CONTEXT(ctx
);
3112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3113 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3118 if (ctx
->ExecuteFlag
) {
3119 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3124 static void GLAPIENTRY
3125 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3127 GET_CURRENT_CONTEXT(ctx
);
3128 /* XXX mult by DepthMaxF here??? */
3129 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3133 static void GLAPIENTRY
3134 save_PopAttrib(void)
3136 GET_CURRENT_CONTEXT(ctx
);
3137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3138 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3139 if (ctx
->ExecuteFlag
) {
3140 CALL_PopAttrib(ctx
->Exec
, ());
3145 static void GLAPIENTRY
3146 save_PopMatrix(void)
3148 GET_CURRENT_CONTEXT(ctx
);
3149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3150 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3151 if (ctx
->ExecuteFlag
) {
3152 CALL_PopMatrix(ctx
->Exec
, ());
3157 static void GLAPIENTRY
3160 GET_CURRENT_CONTEXT(ctx
);
3161 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3162 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3163 if (ctx
->ExecuteFlag
) {
3164 CALL_PopName(ctx
->Exec
, ());
3169 static void GLAPIENTRY
3170 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3171 const GLclampf
* priorities
)
3173 GET_CURRENT_CONTEXT(ctx
);
3175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3177 for (i
= 0; i
< num
; i
++) {
3179 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3181 n
[1].ui
= textures
[i
];
3182 n
[2].f
= priorities
[i
];
3185 if (ctx
->ExecuteFlag
) {
3186 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3191 static void GLAPIENTRY
3192 save_PushAttrib(GLbitfield mask
)
3194 GET_CURRENT_CONTEXT(ctx
);
3196 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3197 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3201 if (ctx
->ExecuteFlag
) {
3202 CALL_PushAttrib(ctx
->Exec
, (mask
));
3207 static void GLAPIENTRY
3208 save_PushMatrix(void)
3210 GET_CURRENT_CONTEXT(ctx
);
3211 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3212 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3213 if (ctx
->ExecuteFlag
) {
3214 CALL_PushMatrix(ctx
->Exec
, ());
3219 static void GLAPIENTRY
3220 save_PushName(GLuint name
)
3222 GET_CURRENT_CONTEXT(ctx
);
3224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3225 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3229 if (ctx
->ExecuteFlag
) {
3230 CALL_PushName(ctx
->Exec
, (name
));
3235 static void GLAPIENTRY
3236 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3238 GET_CURRENT_CONTEXT(ctx
);
3240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3241 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3248 if (ctx
->ExecuteFlag
) {
3249 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3253 static void GLAPIENTRY
3254 save_RasterPos2d(GLdouble x
, GLdouble y
)
3256 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3259 static void GLAPIENTRY
3260 save_RasterPos2f(GLfloat x
, GLfloat y
)
3262 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3265 static void GLAPIENTRY
3266 save_RasterPos2i(GLint x
, GLint y
)
3268 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3271 static void GLAPIENTRY
3272 save_RasterPos2s(GLshort x
, GLshort y
)
3274 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3277 static void GLAPIENTRY
3278 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3280 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3283 static void GLAPIENTRY
3284 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3286 save_RasterPos4f(x
, y
, z
, 1.0F
);
3289 static void GLAPIENTRY
3290 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3292 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3295 static void GLAPIENTRY
3296 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3298 save_RasterPos4f(x
, y
, z
, 1.0F
);
3301 static void GLAPIENTRY
3302 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3304 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3307 static void GLAPIENTRY
3308 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3310 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3313 static void GLAPIENTRY
3314 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3316 save_RasterPos4f(x
, y
, z
, w
);
3319 static void GLAPIENTRY
3320 save_RasterPos2dv(const GLdouble
* v
)
3322 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3325 static void GLAPIENTRY
3326 save_RasterPos2fv(const GLfloat
* v
)
3328 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3331 static void GLAPIENTRY
3332 save_RasterPos2iv(const GLint
* v
)
3334 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3337 static void GLAPIENTRY
3338 save_RasterPos2sv(const GLshort
* v
)
3340 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3343 static void GLAPIENTRY
3344 save_RasterPos3dv(const GLdouble
* v
)
3346 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3349 static void GLAPIENTRY
3350 save_RasterPos3fv(const GLfloat
* v
)
3352 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3355 static void GLAPIENTRY
3356 save_RasterPos3iv(const GLint
* v
)
3358 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3361 static void GLAPIENTRY
3362 save_RasterPos3sv(const GLshort
* v
)
3364 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3367 static void GLAPIENTRY
3368 save_RasterPos4dv(const GLdouble
* v
)
3370 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3371 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3374 static void GLAPIENTRY
3375 save_RasterPos4fv(const GLfloat
* v
)
3377 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3380 static void GLAPIENTRY
3381 save_RasterPos4iv(const GLint
* v
)
3383 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3384 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3387 static void GLAPIENTRY
3388 save_RasterPos4sv(const GLshort
* v
)
3390 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3394 static void GLAPIENTRY
3395 save_PassThrough(GLfloat token
)
3397 GET_CURRENT_CONTEXT(ctx
);
3399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3400 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3404 if (ctx
->ExecuteFlag
) {
3405 CALL_PassThrough(ctx
->Exec
, (token
));
3410 static void GLAPIENTRY
3411 save_ReadBuffer(GLenum mode
)
3413 GET_CURRENT_CONTEXT(ctx
);
3415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3416 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3420 if (ctx
->ExecuteFlag
) {
3421 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3426 static void GLAPIENTRY
3427 save_ResetHistogram(GLenum target
)
3429 GET_CURRENT_CONTEXT(ctx
);
3431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3432 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3436 if (ctx
->ExecuteFlag
) {
3437 CALL_ResetHistogram(ctx
->Exec
, (target
));
3442 static void GLAPIENTRY
3443 save_ResetMinmax(GLenum target
)
3445 GET_CURRENT_CONTEXT(ctx
);
3447 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3448 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3452 if (ctx
->ExecuteFlag
) {
3453 CALL_ResetMinmax(ctx
->Exec
, (target
));
3458 static void GLAPIENTRY
3459 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3461 GET_CURRENT_CONTEXT(ctx
);
3463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3464 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3471 if (ctx
->ExecuteFlag
) {
3472 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3477 static void GLAPIENTRY
3478 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3480 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3484 static void GLAPIENTRY
3485 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3487 GET_CURRENT_CONTEXT(ctx
);
3489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3490 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3496 if (ctx
->ExecuteFlag
) {
3497 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3502 static void GLAPIENTRY
3503 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3505 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3509 static void GLAPIENTRY
3510 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3512 GET_CURRENT_CONTEXT(ctx
);
3514 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3515 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3522 if (ctx
->ExecuteFlag
) {
3523 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3528 static void GLAPIENTRY
3529 save_ShadeModel(GLenum mode
)
3531 GET_CURRENT_CONTEXT(ctx
);
3533 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3535 if (ctx
->ExecuteFlag
) {
3536 CALL_ShadeModel(ctx
->Exec
, (mode
));
3539 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3542 SAVE_FLUSH_VERTICES(ctx
);
3544 /* Only save the value if we know the statechange will take effect:
3546 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3547 ctx
->ListState
.Current
.ShadeModel
= mode
;
3549 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3556 static void GLAPIENTRY
3557 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3559 GET_CURRENT_CONTEXT(ctx
);
3561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3562 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3568 if (ctx
->ExecuteFlag
) {
3569 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3574 static void GLAPIENTRY
3575 save_StencilMask(GLuint mask
)
3577 GET_CURRENT_CONTEXT(ctx
);
3579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3580 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3584 if (ctx
->ExecuteFlag
) {
3585 CALL_StencilMask(ctx
->Exec
, (mask
));
3590 static void GLAPIENTRY
3591 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3593 GET_CURRENT_CONTEXT(ctx
);
3595 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3596 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3602 if (ctx
->ExecuteFlag
) {
3603 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3608 static void GLAPIENTRY
3609 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3611 GET_CURRENT_CONTEXT(ctx
);
3613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3614 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3621 if (ctx
->ExecuteFlag
) {
3622 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3627 static void GLAPIENTRY
3628 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3631 GET_CURRENT_CONTEXT(ctx
);
3633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3635 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3643 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3650 if (ctx
->ExecuteFlag
) {
3651 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3652 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3657 static void GLAPIENTRY
3658 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3660 GET_CURRENT_CONTEXT(ctx
);
3662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3663 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3668 if (ctx
->ExecuteFlag
) {
3669 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3674 static void GLAPIENTRY
3675 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3677 GET_CURRENT_CONTEXT(ctx
);
3679 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3680 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3687 if (ctx
->ExecuteFlag
) {
3688 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3693 static void GLAPIENTRY
3694 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3696 GET_CURRENT_CONTEXT(ctx
);
3698 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3699 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3703 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3711 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3714 if (ctx
->ExecuteFlag
) {
3715 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3720 static void GLAPIENTRY
3721 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3724 parray
[0] = (GLfloat
) param
;
3725 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3726 save_TexEnvfv(target
, pname
, parray
);
3730 static void GLAPIENTRY
3731 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3734 p
[0] = (GLfloat
) param
;
3735 p
[1] = p
[2] = p
[3] = 0.0F
;
3736 save_TexEnvfv(target
, pname
, p
);
3740 static void GLAPIENTRY
3741 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3744 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3745 p
[0] = INT_TO_FLOAT(param
[0]);
3746 p
[1] = INT_TO_FLOAT(param
[1]);
3747 p
[2] = INT_TO_FLOAT(param
[2]);
3748 p
[3] = INT_TO_FLOAT(param
[3]);
3751 p
[0] = (GLfloat
) param
[0];
3752 p
[1] = p
[2] = p
[3] = 0.0F
;
3754 save_TexEnvfv(target
, pname
, p
);
3758 static void GLAPIENTRY
3759 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3761 GET_CURRENT_CONTEXT(ctx
);
3763 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3764 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3773 if (ctx
->ExecuteFlag
) {
3774 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3779 static void GLAPIENTRY
3780 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3783 p
[0] = (GLfloat
) params
[0];
3784 p
[1] = (GLfloat
) params
[1];
3785 p
[2] = (GLfloat
) params
[2];
3786 p
[3] = (GLfloat
) params
[3];
3787 save_TexGenfv(coord
, pname
, p
);
3791 static void GLAPIENTRY
3792 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3795 parray
[0] = (GLfloat
) param
;
3796 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3797 save_TexGenfv(coord
, pname
, parray
);
3801 static void GLAPIENTRY
3802 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3805 p
[0] = (GLfloat
) params
[0];
3806 p
[1] = (GLfloat
) params
[1];
3807 p
[2] = (GLfloat
) params
[2];
3808 p
[3] = (GLfloat
) params
[3];
3809 save_TexGenfv(coord
, pname
, p
);
3813 static void GLAPIENTRY
3814 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3818 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3819 save_TexGenfv(coord
, pname
, parray
);
3823 static void GLAPIENTRY
3824 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3828 parray
[1] = parray
[2] = parray
[3] = 0;
3829 save_TexGeniv(coord
, pname
, parray
);
3833 static void GLAPIENTRY
3834 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3836 GET_CURRENT_CONTEXT(ctx
);
3838 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3839 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3848 if (ctx
->ExecuteFlag
) {
3849 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3854 static void GLAPIENTRY
3855 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3859 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3860 save_TexParameterfv(target
, pname
, parray
);
3864 static void GLAPIENTRY
3865 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3868 fparam
[0] = (GLfloat
) param
;
3869 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3870 save_TexParameterfv(target
, pname
, fparam
);
3874 static void GLAPIENTRY
3875 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3878 fparam
[0] = (GLfloat
) params
[0];
3879 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3880 save_TexParameterfv(target
, pname
, fparam
);
3884 static void GLAPIENTRY
3885 save_TexImage1D(GLenum target
,
3886 GLint level
, GLint components
,
3887 GLsizei width
, GLint border
,
3888 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3890 GET_CURRENT_CONTEXT(ctx
);
3891 if (target
== GL_PROXY_TEXTURE_1D
) {
3892 /* don't compile, execute immediately */
3893 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3894 border
, format
, type
, pixels
));
3898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3899 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3903 n
[3].i
= components
;
3904 n
[4].i
= (GLint
) width
;
3908 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3909 pixels
, &ctx
->Unpack
);
3911 if (ctx
->ExecuteFlag
) {
3912 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3913 border
, format
, type
, pixels
));
3919 static void GLAPIENTRY
3920 save_TexImage2D(GLenum target
,
3921 GLint level
, GLint components
,
3922 GLsizei width
, GLsizei height
, GLint border
,
3923 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3925 GET_CURRENT_CONTEXT(ctx
);
3926 if (target
== GL_PROXY_TEXTURE_2D
) {
3927 /* don't compile, execute immediately */
3928 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3929 height
, border
, format
, type
, pixels
));
3933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3934 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3938 n
[3].i
= components
;
3939 n
[4].i
= (GLint
) width
;
3940 n
[5].i
= (GLint
) height
;
3944 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3945 pixels
, &ctx
->Unpack
);
3947 if (ctx
->ExecuteFlag
) {
3948 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3949 height
, border
, format
, type
, pixels
));
3955 static void GLAPIENTRY
3956 save_TexImage3D(GLenum target
,
3957 GLint level
, GLint internalFormat
,
3958 GLsizei width
, GLsizei height
, GLsizei depth
,
3960 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3962 GET_CURRENT_CONTEXT(ctx
);
3963 if (target
== GL_PROXY_TEXTURE_3D
) {
3964 /* don't compile, execute immediately */
3965 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3966 height
, depth
, border
, format
, type
,
3971 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3972 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3976 n
[3].i
= (GLint
) internalFormat
;
3977 n
[4].i
= (GLint
) width
;
3978 n
[5].i
= (GLint
) height
;
3979 n
[6].i
= (GLint
) depth
;
3983 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3984 pixels
, &ctx
->Unpack
);
3986 if (ctx
->ExecuteFlag
) {
3987 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3988 height
, depth
, border
, format
, type
,
3995 static void GLAPIENTRY
3996 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3997 GLsizei width
, GLenum format
, GLenum type
,
3998 const GLvoid
* pixels
)
4000 GET_CURRENT_CONTEXT(ctx
);
4003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4005 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4010 n
[4].i
= (GLint
) width
;
4013 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4014 pixels
, &ctx
->Unpack
);
4016 if (ctx
->ExecuteFlag
) {
4017 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4018 format
, type
, pixels
));
4023 static void GLAPIENTRY
4024 save_TexSubImage2D(GLenum target
, GLint level
,
4025 GLint xoffset
, GLint yoffset
,
4026 GLsizei width
, GLsizei height
,
4027 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4029 GET_CURRENT_CONTEXT(ctx
);
4032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4034 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4040 n
[5].i
= (GLint
) width
;
4041 n
[6].i
= (GLint
) height
;
4044 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4045 pixels
, &ctx
->Unpack
);
4047 if (ctx
->ExecuteFlag
) {
4048 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4049 width
, height
, format
, type
, pixels
));
4054 static void GLAPIENTRY
4055 save_TexSubImage3D(GLenum target
, GLint level
,
4056 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4057 GLsizei width
, GLsizei height
, GLsizei depth
,
4058 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4060 GET_CURRENT_CONTEXT(ctx
);
4063 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4065 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4072 n
[6].i
= (GLint
) width
;
4073 n
[7].i
= (GLint
) height
;
4074 n
[8].i
= (GLint
) depth
;
4077 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4078 pixels
, &ctx
->Unpack
);
4080 if (ctx
->ExecuteFlag
) {
4081 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4082 xoffset
, yoffset
, zoffset
,
4083 width
, height
, depth
, format
, type
,
4089 static void GLAPIENTRY
4090 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4092 GET_CURRENT_CONTEXT(ctx
);
4094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4095 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4101 if (ctx
->ExecuteFlag
) {
4102 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4107 static void GLAPIENTRY
4108 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4110 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4115 static void GLAPIENTRY
4116 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4118 GET_CURRENT_CONTEXT(ctx
);
4120 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4121 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4125 n
[3].i
= (GLint
) width
;
4126 n
[4].i
= (GLint
) height
;
4128 if (ctx
->ExecuteFlag
) {
4129 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4134 static void GLAPIENTRY
4135 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4137 GET_CURRENT_CONTEXT(ctx
);
4139 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4140 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4147 if (ctx
->ExecuteFlag
) {
4148 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4152 static void GLAPIENTRY
4153 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4155 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4158 static void GLAPIENTRY
4159 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4161 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4164 static void GLAPIENTRY
4165 save_WindowPos2iMESA(GLint x
, GLint y
)
4167 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4170 static void GLAPIENTRY
4171 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4173 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4176 static void GLAPIENTRY
4177 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4179 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4182 static void GLAPIENTRY
4183 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4185 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4188 static void GLAPIENTRY
4189 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4191 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4194 static void GLAPIENTRY
4195 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4197 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4200 static void GLAPIENTRY
4201 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4203 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4206 static void GLAPIENTRY
4207 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4209 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4212 static void GLAPIENTRY
4213 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4215 save_WindowPos4fMESA(x
, y
, z
, w
);
4218 static void GLAPIENTRY
4219 save_WindowPos2dvMESA(const GLdouble
* v
)
4221 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4224 static void GLAPIENTRY
4225 save_WindowPos2fvMESA(const GLfloat
* v
)
4227 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4230 static void GLAPIENTRY
4231 save_WindowPos2ivMESA(const GLint
* v
)
4233 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4236 static void GLAPIENTRY
4237 save_WindowPos2svMESA(const GLshort
* v
)
4239 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4242 static void GLAPIENTRY
4243 save_WindowPos3dvMESA(const GLdouble
* v
)
4245 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4248 static void GLAPIENTRY
4249 save_WindowPos3fvMESA(const GLfloat
* v
)
4251 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4254 static void GLAPIENTRY
4255 save_WindowPos3ivMESA(const GLint
* v
)
4257 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4260 static void GLAPIENTRY
4261 save_WindowPos3svMESA(const GLshort
* v
)
4263 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4266 static void GLAPIENTRY
4267 save_WindowPos4dvMESA(const GLdouble
* v
)
4269 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4270 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4273 static void GLAPIENTRY
4274 save_WindowPos4fvMESA(const GLfloat
* v
)
4276 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4279 static void GLAPIENTRY
4280 save_WindowPos4ivMESA(const GLint
* v
)
4282 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4283 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4286 static void GLAPIENTRY
4287 save_WindowPos4svMESA(const GLshort
* v
)
4289 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4294 /* GL_ARB_multitexture */
4295 static void GLAPIENTRY
4296 save_ActiveTextureARB(GLenum target
)
4298 GET_CURRENT_CONTEXT(ctx
);
4300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4301 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4305 if (ctx
->ExecuteFlag
) {
4306 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4311 /* GL_ARB_transpose_matrix */
4313 static void GLAPIENTRY
4314 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4317 _math_transposefd(tm
, m
);
4318 save_LoadMatrixf(tm
);
4322 static void GLAPIENTRY
4323 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4326 _math_transposef(tm
, m
);
4327 save_LoadMatrixf(tm
);
4331 static void GLAPIENTRY
4332 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4335 _math_transposefd(tm
, m
);
4336 save_MultMatrixf(tm
);
4340 static void GLAPIENTRY
4341 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4344 _math_transposef(tm
, m
);
4345 save_MultMatrixf(tm
);
4349 /* GL_ARB_texture_compression */
4350 static void GLAPIENTRY
4351 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4352 GLenum internalFormat
, GLsizei width
,
4353 GLint border
, GLsizei imageSize
,
4354 const GLvoid
* data
)
4356 GET_CURRENT_CONTEXT(ctx
);
4357 if (target
== GL_PROXY_TEXTURE_1D
) {
4358 /* don't compile, execute immediately */
4359 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4360 width
, border
, imageSize
,
4366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4367 /* make copy of image */
4368 image
= malloc(imageSize
);
4370 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4373 memcpy(image
, data
, imageSize
);
4374 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4378 n
[3].e
= internalFormat
;
4379 n
[4].i
= (GLint
) width
;
4387 if (ctx
->ExecuteFlag
) {
4388 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4389 (target
, level
, internalFormat
, width
,
4390 border
, imageSize
, data
));
4396 static void GLAPIENTRY
4397 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4398 GLenum internalFormat
, GLsizei width
,
4399 GLsizei height
, GLint border
, GLsizei imageSize
,
4400 const GLvoid
* data
)
4402 GET_CURRENT_CONTEXT(ctx
);
4403 if (target
== GL_PROXY_TEXTURE_2D
) {
4404 /* don't compile, execute immediately */
4405 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4406 width
, height
, border
,
4412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4413 /* make copy of image */
4414 image
= malloc(imageSize
);
4416 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4419 memcpy(image
, data
, imageSize
);
4420 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4424 n
[3].e
= internalFormat
;
4425 n
[4].i
= (GLint
) width
;
4426 n
[5].i
= (GLint
) height
;
4434 if (ctx
->ExecuteFlag
) {
4435 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4436 (target
, level
, internalFormat
, width
,
4437 height
, border
, imageSize
, data
));
4443 static void GLAPIENTRY
4444 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4445 GLenum internalFormat
, GLsizei width
,
4446 GLsizei height
, GLsizei depth
, GLint border
,
4447 GLsizei imageSize
, const GLvoid
* data
)
4449 GET_CURRENT_CONTEXT(ctx
);
4450 if (target
== GL_PROXY_TEXTURE_3D
) {
4451 /* don't compile, execute immediately */
4452 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4453 width
, height
, depth
, border
,
4459 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4460 /* make copy of image */
4461 image
= malloc(imageSize
);
4463 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4466 memcpy(image
, data
, imageSize
);
4467 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4471 n
[3].e
= internalFormat
;
4472 n
[4].i
= (GLint
) width
;
4473 n
[5].i
= (GLint
) height
;
4474 n
[6].i
= (GLint
) depth
;
4482 if (ctx
->ExecuteFlag
) {
4483 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4484 (target
, level
, internalFormat
, width
,
4485 height
, depth
, border
, imageSize
,
4492 static void GLAPIENTRY
4493 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4494 GLsizei width
, GLenum format
,
4495 GLsizei imageSize
, const GLvoid
* data
)
4500 GET_CURRENT_CONTEXT(ctx
);
4501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4503 /* make copy of image */
4504 image
= malloc(imageSize
);
4506 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4509 memcpy(image
, data
, imageSize
);
4510 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4515 n
[4].i
= (GLint
) width
;
4523 if (ctx
->ExecuteFlag
) {
4524 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4525 width
, format
, imageSize
,
4531 static void GLAPIENTRY
4532 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4533 GLint yoffset
, GLsizei width
, GLsizei height
,
4534 GLenum format
, GLsizei imageSize
,
4535 const GLvoid
* data
)
4540 GET_CURRENT_CONTEXT(ctx
);
4541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4543 /* make copy of image */
4544 image
= malloc(imageSize
);
4546 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4549 memcpy(image
, data
, imageSize
);
4550 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4556 n
[5].i
= (GLint
) width
;
4557 n
[6].i
= (GLint
) height
;
4565 if (ctx
->ExecuteFlag
) {
4566 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4567 (target
, level
, xoffset
, yoffset
, width
,
4568 height
, format
, imageSize
, data
));
4573 static void GLAPIENTRY
4574 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4575 GLint yoffset
, GLint zoffset
, GLsizei width
,
4576 GLsizei height
, GLsizei depth
, GLenum format
,
4577 GLsizei imageSize
, const GLvoid
* data
)
4582 GET_CURRENT_CONTEXT(ctx
);
4583 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4585 /* make copy of image */
4586 image
= malloc(imageSize
);
4588 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4591 memcpy(image
, data
, imageSize
);
4592 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4599 n
[6].i
= (GLint
) width
;
4600 n
[7].i
= (GLint
) height
;
4601 n
[8].i
= (GLint
) depth
;
4603 n
[10].i
= imageSize
;
4609 if (ctx
->ExecuteFlag
) {
4610 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4611 (target
, level
, xoffset
, yoffset
,
4612 zoffset
, width
, height
, depth
, format
,
4618 /* GL_ARB_multisample */
4619 static void GLAPIENTRY
4620 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4622 GET_CURRENT_CONTEXT(ctx
);
4624 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4625 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4630 if (ctx
->ExecuteFlag
) {
4631 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4637 * GL_NV_vertex_program
4639 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4640 static void GLAPIENTRY
4641 save_BindProgramNV(GLenum target
, GLuint id
)
4643 GET_CURRENT_CONTEXT(ctx
);
4645 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4646 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4651 if (ctx
->ExecuteFlag
) {
4652 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4656 static void GLAPIENTRY
4657 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4658 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4660 GET_CURRENT_CONTEXT(ctx
);
4662 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4663 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4672 if (ctx
->ExecuteFlag
) {
4673 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4678 static void GLAPIENTRY
4679 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4680 const GLfloat
*params
)
4682 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4683 params
[2], params
[3]);
4687 static void GLAPIENTRY
4688 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4689 const GLfloat
* params
)
4691 GET_CURRENT_CONTEXT(ctx
);
4693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4697 const GLfloat
* p
= params
;
4699 for (i
= 0 ; i
< count
; i
++) {
4700 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4713 if (ctx
->ExecuteFlag
) {
4714 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4719 static void GLAPIENTRY
4720 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4721 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4723 save_ProgramEnvParameter4fARB(target
, index
,
4725 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4729 static void GLAPIENTRY
4730 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4731 const GLdouble
*params
)
4733 save_ProgramEnvParameter4fARB(target
, index
,
4734 (GLfloat
) params
[0],
4735 (GLfloat
) params
[1],
4736 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4739 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4741 #if FEATURE_NV_vertex_program
4742 static void GLAPIENTRY
4743 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4745 GET_CURRENT_CONTEXT(ctx
);
4747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4748 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4757 if (ctx
->ExecuteFlag
) {
4758 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4763 static void GLAPIENTRY
4764 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4765 GLuint num
, const GLdouble
*params
)
4768 for (i
= 0; i
< num
; i
++) {
4769 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4774 static void GLAPIENTRY
4775 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4776 GLuint num
, const GLfloat
*params
)
4779 for (i
= 0; i
< num
; i
++) {
4780 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4785 static void GLAPIENTRY
4786 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4787 const GLubyte
* program
)
4789 GET_CURRENT_CONTEXT(ctx
);
4792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4794 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4796 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
4798 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4801 memcpy(programCopy
, program
, len
);
4805 n
[4].data
= programCopy
;
4807 if (ctx
->ExecuteFlag
) {
4808 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4813 static void GLAPIENTRY
4814 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4816 GET_CURRENT_CONTEXT(ctx
);
4819 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4821 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4823 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
4825 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4828 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4832 if (ctx
->ExecuteFlag
) {
4833 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4838 static void GLAPIENTRY
4839 save_TrackMatrixNV(GLenum target
, GLuint address
,
4840 GLenum matrix
, GLenum transform
)
4842 GET_CURRENT_CONTEXT(ctx
);
4844 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4845 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4852 if (ctx
->ExecuteFlag
) {
4853 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4856 #endif /* FEATURE_NV_vertex_program */
4860 * GL_NV_fragment_program
4862 #if FEATURE_NV_fragment_program
4863 static void GLAPIENTRY
4864 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4865 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4867 GET_CURRENT_CONTEXT(ctx
);
4869 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4870 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4879 if (ctx
->ExecuteFlag
) {
4880 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4885 static void GLAPIENTRY
4886 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4887 const GLfloat
*params
)
4889 GET_CURRENT_CONTEXT(ctx
);
4891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4892 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4901 if (ctx
->ExecuteFlag
) {
4902 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4907 static void GLAPIENTRY
4908 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4909 const GLfloat
*params
)
4911 GET_CURRENT_CONTEXT(ctx
);
4913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4917 const GLfloat
* p
= params
;
4919 for (i
= 0 ; i
< count
; i
++) {
4920 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4933 if (ctx
->ExecuteFlag
) {
4934 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4939 static void GLAPIENTRY
4940 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4941 GLdouble x
, GLdouble y
,
4942 GLdouble z
, GLdouble w
)
4944 GET_CURRENT_CONTEXT(ctx
);
4946 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4947 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4951 n
[3].f
= (GLfloat
) x
;
4952 n
[4].f
= (GLfloat
) y
;
4953 n
[5].f
= (GLfloat
) z
;
4954 n
[6].f
= (GLfloat
) w
;
4956 if (ctx
->ExecuteFlag
) {
4957 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4962 static void GLAPIENTRY
4963 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4964 const GLdouble
*params
)
4966 GET_CURRENT_CONTEXT(ctx
);
4968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4969 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4973 n
[3].f
= (GLfloat
) params
[0];
4974 n
[4].f
= (GLfloat
) params
[1];
4975 n
[5].f
= (GLfloat
) params
[2];
4976 n
[6].f
= (GLfloat
) params
[3];
4978 if (ctx
->ExecuteFlag
) {
4979 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4983 static void GLAPIENTRY
4984 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4985 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4987 GET_CURRENT_CONTEXT(ctx
);
4990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4992 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4994 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
4996 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4999 memcpy(nameCopy
, name
, len
);
5002 n
[3].data
= nameCopy
;
5008 if (ctx
->ExecuteFlag
) {
5009 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5014 static void GLAPIENTRY
5015 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5018 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5022 static void GLAPIENTRY
5023 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5024 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5026 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5027 (GLfloat
) z
, (GLfloat
) w
);
5031 static void GLAPIENTRY
5032 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5035 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5036 (GLfloat
) v
[1], (GLfloat
) v
[2],
5040 #endif /* FEATURE_NV_fragment_program */
5044 /* GL_EXT_stencil_two_side */
5045 static void GLAPIENTRY
5046 save_ActiveStencilFaceEXT(GLenum face
)
5048 GET_CURRENT_CONTEXT(ctx
);
5050 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5051 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5055 if (ctx
->ExecuteFlag
) {
5056 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5061 /* GL_EXT_depth_bounds_test */
5062 static void GLAPIENTRY
5063 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5065 GET_CURRENT_CONTEXT(ctx
);
5067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5068 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5070 n
[1].f
= (GLfloat
) zmin
;
5071 n
[2].f
= (GLfloat
) zmax
;
5073 if (ctx
->ExecuteFlag
) {
5074 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5080 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5082 static void GLAPIENTRY
5083 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5084 const GLvoid
* string
)
5086 GET_CURRENT_CONTEXT(ctx
);
5089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5091 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5093 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5095 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5098 memcpy(programCopy
, string
, len
);
5102 n
[4].data
= programCopy
;
5104 if (ctx
->ExecuteFlag
) {
5105 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5109 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5112 #if FEATURE_queryobj
5114 static void GLAPIENTRY
5115 save_BeginQueryARB(GLenum target
, GLuint id
)
5117 GET_CURRENT_CONTEXT(ctx
);
5119 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5120 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5125 if (ctx
->ExecuteFlag
) {
5126 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5131 static void GLAPIENTRY
5132 save_EndQueryARB(GLenum target
)
5134 GET_CURRENT_CONTEXT(ctx
);
5136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5137 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5141 if (ctx
->ExecuteFlag
) {
5142 CALL_EndQueryARB(ctx
->Exec
, (target
));
5146 #endif /* FEATURE_queryobj */
5149 static void GLAPIENTRY
5150 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5152 GET_CURRENT_CONTEXT(ctx
);
5154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5155 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5159 if (count
> MAX_DRAW_BUFFERS
)
5160 count
= MAX_DRAW_BUFFERS
;
5161 for (i
= 0; i
< count
; i
++) {
5162 n
[2 + i
].e
= buffers
[i
];
5165 if (ctx
->ExecuteFlag
) {
5166 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5170 static void GLAPIENTRY
5171 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5173 GET_CURRENT_CONTEXT(ctx
);
5176 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5184 if (ctx
->ExecuteFlag
) {
5185 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5189 static void GLAPIENTRY
5190 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5193 p
[0] = INT_TO_FLOAT(param
[0]);
5194 p
[1] = INT_TO_FLOAT(param
[1]);
5195 p
[2] = INT_TO_FLOAT(param
[2]);
5196 p
[3] = INT_TO_FLOAT(param
[3]);
5197 save_TexBumpParameterfvATI(pname
, p
);
5200 #if FEATURE_ATI_fragment_shader
5201 static void GLAPIENTRY
5202 save_BindFragmentShaderATI(GLuint id
)
5204 GET_CURRENT_CONTEXT(ctx
);
5207 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5211 if (ctx
->ExecuteFlag
) {
5212 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5216 static void GLAPIENTRY
5217 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5219 GET_CURRENT_CONTEXT(ctx
);
5222 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5230 if (ctx
->ExecuteFlag
) {
5231 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5237 save_Attr1fNV(GLenum attr
, GLfloat x
)
5239 GET_CURRENT_CONTEXT(ctx
);
5241 SAVE_FLUSH_VERTICES(ctx
);
5242 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5248 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5249 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5250 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5252 if (ctx
->ExecuteFlag
) {
5253 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5258 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5260 GET_CURRENT_CONTEXT(ctx
);
5262 SAVE_FLUSH_VERTICES(ctx
);
5263 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5270 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5271 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5272 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5274 if (ctx
->ExecuteFlag
) {
5275 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5280 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5282 GET_CURRENT_CONTEXT(ctx
);
5284 SAVE_FLUSH_VERTICES(ctx
);
5285 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5293 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5294 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5295 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5297 if (ctx
->ExecuteFlag
) {
5298 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5303 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5305 GET_CURRENT_CONTEXT(ctx
);
5307 SAVE_FLUSH_VERTICES(ctx
);
5308 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5317 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5318 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5319 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5321 if (ctx
->ExecuteFlag
) {
5322 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5328 save_Attr1fARB(GLenum attr
, GLfloat x
)
5330 GET_CURRENT_CONTEXT(ctx
);
5332 SAVE_FLUSH_VERTICES(ctx
);
5333 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5339 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5340 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5341 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5343 if (ctx
->ExecuteFlag
) {
5344 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5349 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5351 GET_CURRENT_CONTEXT(ctx
);
5353 SAVE_FLUSH_VERTICES(ctx
);
5354 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5361 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5362 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5363 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5365 if (ctx
->ExecuteFlag
) {
5366 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5371 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5373 GET_CURRENT_CONTEXT(ctx
);
5375 SAVE_FLUSH_VERTICES(ctx
);
5376 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5384 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5385 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5386 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5388 if (ctx
->ExecuteFlag
) {
5389 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5394 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5396 GET_CURRENT_CONTEXT(ctx
);
5398 SAVE_FLUSH_VERTICES(ctx
);
5399 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5408 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5409 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5410 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5412 if (ctx
->ExecuteFlag
) {
5413 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5418 static void GLAPIENTRY
5419 save_EvalCoord1f(GLfloat x
)
5421 GET_CURRENT_CONTEXT(ctx
);
5423 SAVE_FLUSH_VERTICES(ctx
);
5424 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5428 if (ctx
->ExecuteFlag
) {
5429 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5433 static void GLAPIENTRY
5434 save_EvalCoord1fv(const GLfloat
* v
)
5436 save_EvalCoord1f(v
[0]);
5439 static void GLAPIENTRY
5440 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5442 GET_CURRENT_CONTEXT(ctx
);
5444 SAVE_FLUSH_VERTICES(ctx
);
5445 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5450 if (ctx
->ExecuteFlag
) {
5451 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5455 static void GLAPIENTRY
5456 save_EvalCoord2fv(const GLfloat
* v
)
5458 save_EvalCoord2f(v
[0], v
[1]);
5462 static void GLAPIENTRY
5463 save_EvalPoint1(GLint x
)
5465 GET_CURRENT_CONTEXT(ctx
);
5467 SAVE_FLUSH_VERTICES(ctx
);
5468 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5472 if (ctx
->ExecuteFlag
) {
5473 CALL_EvalPoint1(ctx
->Exec
, (x
));
5477 static void GLAPIENTRY
5478 save_EvalPoint2(GLint x
, GLint y
)
5480 GET_CURRENT_CONTEXT(ctx
);
5482 SAVE_FLUSH_VERTICES(ctx
);
5483 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5488 if (ctx
->ExecuteFlag
) {
5489 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5493 static void GLAPIENTRY
5494 save_Indexf(GLfloat x
)
5496 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5499 static void GLAPIENTRY
5500 save_Indexfv(const GLfloat
* v
)
5502 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5505 static void GLAPIENTRY
5506 save_EdgeFlag(GLboolean x
)
5508 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5511 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5515 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5519 static void GLAPIENTRY
5520 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5522 GET_CURRENT_CONTEXT(ctx
);
5530 case GL_FRONT_AND_BACK
:
5533 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5542 case GL_AMBIENT_AND_DIFFUSE
:
5548 case GL_COLOR_INDEXES
:
5552 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5556 if (ctx
->ExecuteFlag
) {
5557 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5560 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5562 /* Try to eliminate redundant statechanges. Because it is legal to
5563 * call glMaterial even inside begin/end calls, don't need to worry
5564 * about ctx->Driver.CurrentSavePrimitive here.
5566 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5567 if (bitmask
& (1 << i
)) {
5568 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5569 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5570 bitmask
&= ~(1 << i
);
5573 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5574 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5579 /* If this call has effect, return early:
5584 SAVE_FLUSH_VERTICES(ctx
);
5586 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5590 for (i
= 0; i
< args
; i
++)
5591 n
[3 + i
].f
= param
[i
];
5595 static void GLAPIENTRY
5596 save_Begin(GLenum mode
)
5598 GET_CURRENT_CONTEXT(ctx
);
5600 GLboolean error
= GL_FALSE
;
5602 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5603 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5606 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5607 /* Typically the first begin. This may raise an error on
5608 * playback, depending on whether CallList is issued from inside
5609 * a begin/end or not.
5611 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5613 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5614 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5617 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5622 /* Give the driver an opportunity to hook in an optimized
5623 * display list compiler.
5625 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5628 SAVE_FLUSH_VERTICES(ctx
);
5629 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5635 if (ctx
->ExecuteFlag
) {
5636 CALL_Begin(ctx
->Exec
, (mode
));
5640 static void GLAPIENTRY
5643 GET_CURRENT_CONTEXT(ctx
);
5644 SAVE_FLUSH_VERTICES(ctx
);
5645 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5646 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5647 if (ctx
->ExecuteFlag
) {
5648 CALL_End(ctx
->Exec
, ());
5652 static void GLAPIENTRY
5653 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5655 GET_CURRENT_CONTEXT(ctx
);
5657 SAVE_FLUSH_VERTICES(ctx
);
5658 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5665 if (ctx
->ExecuteFlag
) {
5666 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5671 static void GLAPIENTRY
5672 save_Vertex2f(GLfloat x
, GLfloat y
)
5674 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5677 static void GLAPIENTRY
5678 save_Vertex2fv(const GLfloat
* v
)
5680 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5683 static void GLAPIENTRY
5684 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5686 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5689 static void GLAPIENTRY
5690 save_Vertex3fv(const GLfloat
* v
)
5692 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5695 static void GLAPIENTRY
5696 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5698 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5701 static void GLAPIENTRY
5702 save_Vertex4fv(const GLfloat
* v
)
5704 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5707 static void GLAPIENTRY
5708 save_TexCoord1f(GLfloat x
)
5710 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5713 static void GLAPIENTRY
5714 save_TexCoord1fv(const GLfloat
* v
)
5716 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5719 static void GLAPIENTRY
5720 save_TexCoord2f(GLfloat x
, GLfloat y
)
5722 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5725 static void GLAPIENTRY
5726 save_TexCoord2fv(const GLfloat
* v
)
5728 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5731 static void GLAPIENTRY
5732 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5734 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5737 static void GLAPIENTRY
5738 save_TexCoord3fv(const GLfloat
* v
)
5740 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5743 static void GLAPIENTRY
5744 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5746 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5749 static void GLAPIENTRY
5750 save_TexCoord4fv(const GLfloat
* v
)
5752 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5755 static void GLAPIENTRY
5756 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5758 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5761 static void GLAPIENTRY
5762 save_Normal3fv(const GLfloat
* v
)
5764 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5767 static void GLAPIENTRY
5768 save_FogCoordfEXT(GLfloat x
)
5770 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5773 static void GLAPIENTRY
5774 save_FogCoordfvEXT(const GLfloat
* v
)
5776 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5779 static void GLAPIENTRY
5780 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5782 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5785 static void GLAPIENTRY
5786 save_Color3fv(const GLfloat
* v
)
5788 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5791 static void GLAPIENTRY
5792 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5794 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5797 static void GLAPIENTRY
5798 save_Color4fv(const GLfloat
* v
)
5800 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5803 static void GLAPIENTRY
5804 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5806 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5809 static void GLAPIENTRY
5810 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5812 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5816 /* Just call the respective ATTR for texcoord
5818 static void GLAPIENTRY
5819 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5821 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5822 save_Attr1fNV(attr
, x
);
5825 static void GLAPIENTRY
5826 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5828 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5829 save_Attr1fNV(attr
, v
[0]);
5832 static void GLAPIENTRY
5833 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5835 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5836 save_Attr2fNV(attr
, x
, y
);
5839 static void GLAPIENTRY
5840 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5842 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5843 save_Attr2fNV(attr
, v
[0], v
[1]);
5846 static void GLAPIENTRY
5847 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5849 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5850 save_Attr3fNV(attr
, x
, y
, z
);
5853 static void GLAPIENTRY
5854 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5856 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5857 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5860 static void GLAPIENTRY
5861 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5862 GLfloat z
, GLfloat w
)
5864 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5865 save_Attr4fNV(attr
, x
, y
, z
, w
);
5868 static void GLAPIENTRY
5869 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5871 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5872 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5877 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5883 GET_CURRENT_CONTEXT(ctx
);
5884 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5888 /* First level for NV_vertex_program:
5890 * Check for errors at compile time?.
5892 static void GLAPIENTRY
5893 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5895 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5896 save_Attr1fNV(index
, x
);
5901 static void GLAPIENTRY
5902 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5904 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5905 save_Attr1fNV(index
, v
[0]);
5910 static void GLAPIENTRY
5911 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5913 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5914 save_Attr2fNV(index
, x
, y
);
5919 static void GLAPIENTRY
5920 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5922 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5923 save_Attr2fNV(index
, v
[0], v
[1]);
5928 static void GLAPIENTRY
5929 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5931 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5932 save_Attr3fNV(index
, x
, y
, z
);
5937 static void GLAPIENTRY
5938 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5940 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5941 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5946 static void GLAPIENTRY
5947 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5948 GLfloat z
, GLfloat w
)
5950 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5951 save_Attr4fNV(index
, x
, y
, z
, w
);
5956 static void GLAPIENTRY
5957 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5959 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5960 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5968 static void GLAPIENTRY
5969 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5971 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5972 save_Attr1fARB(index
, x
);
5977 static void GLAPIENTRY
5978 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5980 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5981 save_Attr1fARB(index
, v
[0]);
5986 static void GLAPIENTRY
5987 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5989 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5990 save_Attr2fARB(index
, x
, y
);
5995 static void GLAPIENTRY
5996 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5998 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5999 save_Attr2fARB(index
, v
[0], v
[1]);
6004 static void GLAPIENTRY
6005 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6007 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6008 save_Attr3fARB(index
, x
, y
, z
);
6013 static void GLAPIENTRY
6014 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6016 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6017 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6022 static void GLAPIENTRY
6023 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6026 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6027 save_Attr4fARB(index
, x
, y
, z
, w
);
6032 static void GLAPIENTRY
6033 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6035 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6036 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6042 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6044 static void GLAPIENTRY
6045 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6047 GET_CURRENT_CONTEXT(ctx
);
6048 FLUSH_VERTICES(ctx
, 0);
6049 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6052 static GLint GLAPIENTRY
6053 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6055 GET_CURRENT_CONTEXT(ctx
);
6056 FLUSH_VERTICES(ctx
, 0);
6057 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6059 /* XXX more shader functions needed here */
6063 #if FEATURE_EXT_framebuffer_blit
6064 static void GLAPIENTRY
6065 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6066 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6067 GLbitfield mask
, GLenum filter
)
6069 GET_CURRENT_CONTEXT(ctx
);
6071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6072 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6085 if (ctx
->ExecuteFlag
) {
6086 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6087 dstX0
, dstY0
, dstX1
, dstY1
,
6094 /** GL_EXT_provoking_vertex */
6095 static void GLAPIENTRY
6096 save_ProvokingVertexEXT(GLenum mode
)
6098 GET_CURRENT_CONTEXT(ctx
);
6100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6101 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6105 if (ctx
->ExecuteFlag
) {
6106 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6107 _mesa_ProvokingVertexEXT(mode
);
6112 /** GL_EXT_transform_feedback */
6113 static void GLAPIENTRY
6114 save_BeginTransformFeedback(GLenum mode
)
6116 GET_CURRENT_CONTEXT(ctx
);
6118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6119 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6123 if (ctx
->ExecuteFlag
) {
6124 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6129 /** GL_EXT_transform_feedback */
6130 static void GLAPIENTRY
6131 save_EndTransformFeedback(void)
6133 GET_CURRENT_CONTEXT(ctx
);
6134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6135 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6136 if (ctx
->ExecuteFlag
) {
6137 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6142 /* aka UseProgram() */
6143 static void GLAPIENTRY
6144 save_UseProgramObjectARB(GLhandleARB program
)
6146 GET_CURRENT_CONTEXT(ctx
);
6148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6149 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6153 if (ctx
->ExecuteFlag
) {
6154 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6159 static void GLAPIENTRY
6160 save_Uniform1fARB(GLint location
, GLfloat x
)
6162 GET_CURRENT_CONTEXT(ctx
);
6164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6165 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6170 if (ctx
->ExecuteFlag
) {
6171 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6176 static void GLAPIENTRY
6177 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6179 GET_CURRENT_CONTEXT(ctx
);
6181 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6182 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6188 if (ctx
->ExecuteFlag
) {
6189 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6194 static void GLAPIENTRY
6195 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6197 GET_CURRENT_CONTEXT(ctx
);
6199 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6200 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6207 if (ctx
->ExecuteFlag
) {
6208 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6213 static void GLAPIENTRY
6214 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6216 GET_CURRENT_CONTEXT(ctx
);
6218 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6219 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6227 if (ctx
->ExecuteFlag
) {
6228 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6233 /** Return copy of memory */
6235 memdup(const void *src
, GLsizei bytes
)
6237 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6239 memcpy(b
, src
, bytes
);
6244 static void GLAPIENTRY
6245 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6247 GET_CURRENT_CONTEXT(ctx
);
6249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6250 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6254 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6256 if (ctx
->ExecuteFlag
) {
6257 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6261 static void GLAPIENTRY
6262 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6264 GET_CURRENT_CONTEXT(ctx
);
6266 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6267 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6271 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6273 if (ctx
->ExecuteFlag
) {
6274 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6278 static void GLAPIENTRY
6279 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6281 GET_CURRENT_CONTEXT(ctx
);
6283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6284 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6288 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6290 if (ctx
->ExecuteFlag
) {
6291 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6295 static void GLAPIENTRY
6296 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6298 GET_CURRENT_CONTEXT(ctx
);
6300 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6301 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6305 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6307 if (ctx
->ExecuteFlag
) {
6308 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6313 static void GLAPIENTRY
6314 save_Uniform1iARB(GLint location
, GLint x
)
6316 GET_CURRENT_CONTEXT(ctx
);
6318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6319 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6324 if (ctx
->ExecuteFlag
) {
6325 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6329 static void GLAPIENTRY
6330 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6332 GET_CURRENT_CONTEXT(ctx
);
6334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6335 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6341 if (ctx
->ExecuteFlag
) {
6342 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6346 static void GLAPIENTRY
6347 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6349 GET_CURRENT_CONTEXT(ctx
);
6351 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6352 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6359 if (ctx
->ExecuteFlag
) {
6360 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6364 static void GLAPIENTRY
6365 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6367 GET_CURRENT_CONTEXT(ctx
);
6369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6370 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6378 if (ctx
->ExecuteFlag
) {
6379 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6385 static void GLAPIENTRY
6386 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6388 GET_CURRENT_CONTEXT(ctx
);
6390 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6391 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6395 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6397 if (ctx
->ExecuteFlag
) {
6398 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6402 static void GLAPIENTRY
6403 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6405 GET_CURRENT_CONTEXT(ctx
);
6407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6408 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6412 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6414 if (ctx
->ExecuteFlag
) {
6415 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6419 static void GLAPIENTRY
6420 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6422 GET_CURRENT_CONTEXT(ctx
);
6424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6425 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6429 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6431 if (ctx
->ExecuteFlag
) {
6432 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6436 static void GLAPIENTRY
6437 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6439 GET_CURRENT_CONTEXT(ctx
);
6441 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6442 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6446 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6448 if (ctx
->ExecuteFlag
) {
6449 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6454 static void GLAPIENTRY
6455 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6458 GET_CURRENT_CONTEXT(ctx
);
6460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6461 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6466 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6468 if (ctx
->ExecuteFlag
) {
6469 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6473 static void GLAPIENTRY
6474 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6477 GET_CURRENT_CONTEXT(ctx
);
6479 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6480 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6485 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6487 if (ctx
->ExecuteFlag
) {
6488 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6492 static void GLAPIENTRY
6493 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6496 GET_CURRENT_CONTEXT(ctx
);
6498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6499 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6504 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6506 if (ctx
->ExecuteFlag
) {
6507 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6512 static void GLAPIENTRY
6513 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6516 GET_CURRENT_CONTEXT(ctx
);
6518 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6519 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6524 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6526 if (ctx
->ExecuteFlag
) {
6527 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6531 static void GLAPIENTRY
6532 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6535 GET_CURRENT_CONTEXT(ctx
);
6537 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6538 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6543 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6545 if (ctx
->ExecuteFlag
) {
6546 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6551 static void GLAPIENTRY
6552 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6555 GET_CURRENT_CONTEXT(ctx
);
6557 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6558 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6563 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6565 if (ctx
->ExecuteFlag
) {
6566 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6570 static void GLAPIENTRY
6571 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6574 GET_CURRENT_CONTEXT(ctx
);
6576 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6577 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6582 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6584 if (ctx
->ExecuteFlag
) {
6585 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6590 static void GLAPIENTRY
6591 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6594 GET_CURRENT_CONTEXT(ctx
);
6596 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6597 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6602 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6604 if (ctx
->ExecuteFlag
) {
6605 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6609 static void GLAPIENTRY
6610 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6613 GET_CURRENT_CONTEXT(ctx
);
6615 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6616 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6621 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6623 if (ctx
->ExecuteFlag
) {
6624 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6631 * Save an error-generating command into display list.
6633 * KW: Will appear in the list before the vertex buffer containing the
6634 * command that provoked the error. I don't see this as a problem.
6637 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6640 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6643 n
[2].data
= (void *) s
;
6649 * Compile an error into current display list.
6652 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6654 if (ctx
->CompileFlag
)
6655 save_error(ctx
, error
, s
);
6656 if (ctx
->ExecuteFlag
)
6657 _mesa_error(ctx
, error
, s
);
6662 * Test if ID names a display list.
6665 islist(GLcontext
*ctx
, GLuint list
)
6667 if (list
> 0 && lookup_list(ctx
, list
)) {
6677 /**********************************************************************/
6678 /* Display list execution */
6679 /**********************************************************************/
6683 * Execute a display list. Note that the ListBase offset must have already
6684 * been added before calling this function. I.e. the list argument is
6685 * the absolute list number, not relative to ListBase.
6686 * \param list - display list number
6689 execute_list(GLcontext
*ctx
, GLuint list
)
6691 struct gl_display_list
*dlist
;
6695 if (list
== 0 || !islist(ctx
, list
))
6698 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6699 /* raise an error? */
6703 dlist
= lookup_list(ctx
, list
);
6707 ctx
->ListState
.CallDepth
++;
6709 if (ctx
->Driver
.BeginCallList
)
6710 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6716 const OpCode opcode
= n
[0].opcode
;
6718 if (is_ext_opcode(opcode
)) {
6719 n
+= ext_opcode_execute(ctx
, n
);
6724 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6727 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6729 case OPCODE_ALPHA_FUNC
:
6730 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6732 case OPCODE_BIND_TEXTURE
:
6733 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6737 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6738 ctx
->Unpack
= ctx
->DefaultPacking
;
6739 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6740 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6741 (const GLubyte
*) n
[7].data
));
6742 ctx
->Unpack
= save
; /* restore */
6745 case OPCODE_BLEND_COLOR
:
6746 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6748 case OPCODE_BLEND_EQUATION
:
6749 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6751 case OPCODE_BLEND_EQUATION_SEPARATE
:
6752 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6754 case OPCODE_BLEND_FUNC_SEPARATE
:
6755 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6756 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6758 case OPCODE_CALL_LIST
:
6759 /* Generated by glCallList(), don't add ListBase */
6760 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6761 execute_list(ctx
, n
[1].ui
);
6764 case OPCODE_CALL_LIST_OFFSET
:
6765 /* Generated by glCallLists() so we must add ListBase */
6767 /* user specified a bad data type at compile time */
6768 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6770 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6771 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6772 execute_list(ctx
, list
);
6776 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6778 case OPCODE_CLEAR_BUFFER_IV
:
6785 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6788 case OPCODE_CLEAR_BUFFER_UIV
:
6795 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6798 case OPCODE_CLEAR_BUFFER_FV
:
6805 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
6808 case OPCODE_CLEAR_BUFFER_FI
:
6809 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
6811 case OPCODE_CLEAR_COLOR
:
6812 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6814 case OPCODE_CLEAR_ACCUM
:
6815 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6817 case OPCODE_CLEAR_DEPTH
:
6818 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6820 case OPCODE_CLEAR_INDEX
:
6821 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6823 case OPCODE_CLEAR_STENCIL
:
6824 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6826 case OPCODE_CLIP_PLANE
:
6833 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6836 case OPCODE_COLOR_MASK
:
6837 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6839 case OPCODE_COLOR_MASK_INDEXED
:
6840 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
6843 case OPCODE_COLOR_MATERIAL
:
6844 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6846 case OPCODE_COLOR_TABLE
:
6848 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6849 ctx
->Unpack
= ctx
->DefaultPacking
;
6850 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6851 n
[5].e
, n
[6].data
));
6852 ctx
->Unpack
= save
; /* restore */
6855 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6862 CALL_ColorTableParameterfv(ctx
->Exec
,
6863 (n
[1].e
, n
[2].e
, params
));
6866 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6873 CALL_ColorTableParameteriv(ctx
->Exec
,
6874 (n
[1].e
, n
[2].e
, params
));
6877 case OPCODE_COLOR_SUB_TABLE
:
6879 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6880 ctx
->Unpack
= ctx
->DefaultPacking
;
6881 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6882 n
[4].e
, n
[5].e
, n
[6].data
));
6883 ctx
->Unpack
= save
; /* restore */
6886 case OPCODE_CONVOLUTION_FILTER_1D
:
6888 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6889 ctx
->Unpack
= ctx
->DefaultPacking
;
6890 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6893 ctx
->Unpack
= save
; /* restore */
6896 case OPCODE_CONVOLUTION_FILTER_2D
:
6898 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6899 ctx
->Unpack
= ctx
->DefaultPacking
;
6900 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6901 n
[4].i
, n
[5].e
, n
[6].e
,
6903 ctx
->Unpack
= save
; /* restore */
6906 case OPCODE_CONVOLUTION_PARAMETER_I
:
6907 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6909 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6916 CALL_ConvolutionParameteriv(ctx
->Exec
,
6917 (n
[1].e
, n
[2].e
, params
));
6920 case OPCODE_CONVOLUTION_PARAMETER_F
:
6921 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6923 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6930 CALL_ConvolutionParameterfv(ctx
->Exec
,
6931 (n
[1].e
, n
[2].e
, params
));
6934 case OPCODE_COPY_COLOR_SUB_TABLE
:
6935 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6936 n
[3].i
, n
[4].i
, n
[5].i
));
6938 case OPCODE_COPY_COLOR_TABLE
:
6939 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6940 n
[3].i
, n
[4].i
, n
[5].i
));
6942 case OPCODE_COPY_PIXELS
:
6943 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6944 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6947 case OPCODE_COPY_TEX_IMAGE1D
:
6948 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6949 n
[5].i
, n
[6].i
, n
[7].i
));
6951 case OPCODE_COPY_TEX_IMAGE2D
:
6952 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6953 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6955 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6956 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6957 n
[4].i
, n
[5].i
, n
[6].i
));
6959 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6960 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6961 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6964 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6965 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6966 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6969 case OPCODE_CULL_FACE
:
6970 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6972 case OPCODE_DEPTH_FUNC
:
6973 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6975 case OPCODE_DEPTH_MASK
:
6976 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6978 case OPCODE_DEPTH_RANGE
:
6979 CALL_DepthRange(ctx
->Exec
,
6980 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6982 case OPCODE_DISABLE
:
6983 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6985 case OPCODE_DISABLE_INDEXED
:
6986 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6988 case OPCODE_DRAW_BUFFER
:
6989 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6991 case OPCODE_DRAW_PIXELS
:
6993 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6994 ctx
->Unpack
= ctx
->DefaultPacking
;
6995 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6997 ctx
->Unpack
= save
; /* restore */
7001 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7003 case OPCODE_ENABLE_INDEXED
:
7004 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7006 case OPCODE_EVALMESH1
:
7007 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7009 case OPCODE_EVALMESH2
:
7010 CALL_EvalMesh2(ctx
->Exec
,
7011 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7020 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7023 case OPCODE_FRONT_FACE
:
7024 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7026 case OPCODE_FRUSTUM
:
7027 CALL_Frustum(ctx
->Exec
,
7028 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7031 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7033 case OPCODE_HISTOGRAM
:
7034 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7036 case OPCODE_INDEX_MASK
:
7037 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7039 case OPCODE_INIT_NAMES
:
7040 CALL_InitNames(ctx
->Exec
, ());
7049 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7052 case OPCODE_LIGHT_MODEL
:
7059 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7062 case OPCODE_LINE_STIPPLE
:
7063 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7065 case OPCODE_LINE_WIDTH
:
7066 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7068 case OPCODE_LIST_BASE
:
7069 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7071 case OPCODE_LOAD_IDENTITY
:
7072 CALL_LoadIdentity(ctx
->Exec
, ());
7074 case OPCODE_LOAD_MATRIX
:
7075 if (sizeof(Node
) == sizeof(GLfloat
)) {
7076 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7081 for (i
= 0; i
< 16; i
++) {
7084 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7087 case OPCODE_LOAD_NAME
:
7088 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7090 case OPCODE_LOGIC_OP
:
7091 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7095 GLenum target
= n
[1].e
;
7096 GLint ustride
= _mesa_evaluator_components(target
);
7097 GLint uorder
= n
[5].i
;
7098 GLfloat u1
= n
[2].f
;
7099 GLfloat u2
= n
[3].f
;
7100 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7101 (GLfloat
*) n
[6].data
));
7106 GLenum target
= n
[1].e
;
7107 GLfloat u1
= n
[2].f
;
7108 GLfloat u2
= n
[3].f
;
7109 GLfloat v1
= n
[4].f
;
7110 GLfloat v2
= n
[5].f
;
7111 GLint ustride
= n
[6].i
;
7112 GLint vstride
= n
[7].i
;
7113 GLint uorder
= n
[8].i
;
7114 GLint vorder
= n
[9].i
;
7115 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7116 v1
, v2
, vstride
, vorder
,
7117 (GLfloat
*) n
[10].data
));
7120 case OPCODE_MAPGRID1
:
7121 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7123 case OPCODE_MAPGRID2
:
7124 CALL_MapGrid2f(ctx
->Exec
,
7125 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7127 case OPCODE_MATRIX_MODE
:
7128 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7130 case OPCODE_MIN_MAX
:
7131 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7133 case OPCODE_MULT_MATRIX
:
7134 if (sizeof(Node
) == sizeof(GLfloat
)) {
7135 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7140 for (i
= 0; i
< 16; i
++) {
7143 CALL_MultMatrixf(ctx
->Exec
, (m
));
7147 CALL_Ortho(ctx
->Exec
,
7148 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7150 case OPCODE_PASSTHROUGH
:
7151 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7153 case OPCODE_PIXEL_MAP
:
7154 CALL_PixelMapfv(ctx
->Exec
,
7155 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7157 case OPCODE_PIXEL_TRANSFER
:
7158 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7160 case OPCODE_PIXEL_ZOOM
:
7161 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7163 case OPCODE_POINT_SIZE
:
7164 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7166 case OPCODE_POINT_PARAMETERS
:
7172 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7175 case OPCODE_POLYGON_MODE
:
7176 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7178 case OPCODE_POLYGON_STIPPLE
:
7180 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7181 ctx
->Unpack
= ctx
->DefaultPacking
;
7182 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7183 ctx
->Unpack
= save
; /* restore */
7186 case OPCODE_POLYGON_OFFSET
:
7187 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7189 case OPCODE_POP_ATTRIB
:
7190 CALL_PopAttrib(ctx
->Exec
, ());
7192 case OPCODE_POP_MATRIX
:
7193 CALL_PopMatrix(ctx
->Exec
, ());
7195 case OPCODE_POP_NAME
:
7196 CALL_PopName(ctx
->Exec
, ());
7198 case OPCODE_PRIORITIZE_TEXTURE
:
7199 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7201 case OPCODE_PUSH_ATTRIB
:
7202 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7204 case OPCODE_PUSH_MATRIX
:
7205 CALL_PushMatrix(ctx
->Exec
, ());
7207 case OPCODE_PUSH_NAME
:
7208 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7210 case OPCODE_RASTER_POS
:
7211 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7213 case OPCODE_READ_BUFFER
:
7214 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7216 case OPCODE_RESET_HISTOGRAM
:
7217 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7219 case OPCODE_RESET_MIN_MAX
:
7220 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7223 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7226 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7228 case OPCODE_SCISSOR
:
7229 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7231 case OPCODE_SHADE_MODEL
:
7232 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7234 case OPCODE_PROVOKING_VERTEX
:
7235 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7237 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
7238 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
7240 case OPCODE_END_TRANSFORM_FEEDBACK
:
7241 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
7243 case OPCODE_STENCIL_FUNC
:
7244 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7246 case OPCODE_STENCIL_MASK
:
7247 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7249 case OPCODE_STENCIL_OP
:
7250 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7252 case OPCODE_STENCIL_FUNC_SEPARATE
:
7253 CALL_StencilFuncSeparate(ctx
->Exec
,
7254 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7256 case OPCODE_STENCIL_MASK_SEPARATE
:
7257 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7259 case OPCODE_STENCIL_OP_SEPARATE
:
7260 CALL_StencilOpSeparate(ctx
->Exec
,
7261 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7270 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7280 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7283 case OPCODE_TEXPARAMETER
:
7290 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7293 case OPCODE_TEX_IMAGE1D
:
7295 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7296 ctx
->Unpack
= ctx
->DefaultPacking
;
7297 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7299 n
[3].i
, /* components */
7301 n
[5].e
, /* border */
7302 n
[6].e
, /* format */
7305 ctx
->Unpack
= save
; /* restore */
7308 case OPCODE_TEX_IMAGE2D
:
7310 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7311 ctx
->Unpack
= ctx
->DefaultPacking
;
7312 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7314 n
[3].i
, /* components */
7316 n
[5].i
, /* height */
7317 n
[6].e
, /* border */
7318 n
[7].e
, /* format */
7321 ctx
->Unpack
= save
; /* restore */
7324 case OPCODE_TEX_IMAGE3D
:
7326 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7327 ctx
->Unpack
= ctx
->DefaultPacking
;
7328 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7330 n
[3].i
, /* components */
7332 n
[5].i
, /* height */
7334 n
[7].e
, /* border */
7335 n
[8].e
, /* format */
7338 ctx
->Unpack
= save
; /* restore */
7341 case OPCODE_TEX_SUB_IMAGE1D
:
7343 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7344 ctx
->Unpack
= ctx
->DefaultPacking
;
7345 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7347 n
[6].e
, n
[7].data
));
7348 ctx
->Unpack
= save
; /* restore */
7351 case OPCODE_TEX_SUB_IMAGE2D
:
7353 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7354 ctx
->Unpack
= ctx
->DefaultPacking
;
7355 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7357 n
[6].i
, n
[7].e
, n
[8].e
,
7359 ctx
->Unpack
= save
; /* restore */
7362 case OPCODE_TEX_SUB_IMAGE3D
:
7364 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7365 ctx
->Unpack
= ctx
->DefaultPacking
;
7366 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7367 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7368 n
[8].i
, n
[9].e
, n
[10].e
,
7370 ctx
->Unpack
= save
; /* restore */
7373 case OPCODE_TRANSLATE
:
7374 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7376 case OPCODE_VIEWPORT
:
7377 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7378 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7380 case OPCODE_WINDOW_POS
:
7381 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7383 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7384 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7386 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7387 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7388 n
[4].i
, n
[5].i
, n
[6].i
,
7391 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7392 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7393 n
[4].i
, n
[5].i
, n
[6].i
,
7394 n
[7].i
, n
[8].data
));
7396 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7397 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7398 n
[4].i
, n
[5].i
, n
[6].i
,
7402 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7403 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7404 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7405 n
[5].e
, n
[6].i
, n
[7].data
));
7407 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7408 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7409 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7410 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7413 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7414 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7415 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7416 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7417 n
[9].e
, n
[10].i
, n
[11].data
));
7419 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7420 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7422 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7423 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7425 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7426 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7427 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7430 #if FEATURE_NV_vertex_program
7431 case OPCODE_EXECUTE_PROGRAM_NV
:
7438 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7441 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7442 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7443 (GLuint
*) n
[2].data
));
7445 case OPCODE_LOAD_PROGRAM_NV
:
7446 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7447 (const GLubyte
*) n
[4].data
));
7449 case OPCODE_TRACK_MATRIX_NV
:
7450 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7454 #if FEATURE_NV_fragment_program
7455 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7456 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7457 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7460 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7461 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7462 (const GLubyte
*) n
[3].
7463 data
, n
[4].f
, n
[5].f
,
7468 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7469 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7471 case OPCODE_DEPTH_BOUNDS_EXT
:
7472 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7474 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7475 case OPCODE_PROGRAM_STRING_ARB
:
7476 CALL_ProgramStringARB(ctx
->Exec
,
7477 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7480 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7481 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7482 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7487 #if FEATURE_queryobj
7488 case OPCODE_BEGIN_QUERY_ARB
:
7489 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7491 case OPCODE_END_QUERY_ARB
:
7492 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7495 case OPCODE_DRAW_BUFFERS_ARB
:
7497 GLenum buffers
[MAX_DRAW_BUFFERS
];
7498 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7499 for (i
= 0; i
< count
; i
++)
7500 buffers
[i
] = n
[2 + i
].e
;
7501 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7504 #if FEATURE_EXT_framebuffer_blit
7505 case OPCODE_BLIT_FRAMEBUFFER
:
7506 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7507 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7512 case OPCODE_USE_PROGRAM
:
7513 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7515 case OPCODE_UNIFORM_1F
:
7516 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7518 case OPCODE_UNIFORM_2F
:
7519 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7521 case OPCODE_UNIFORM_3F
:
7522 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7524 case OPCODE_UNIFORM_4F
:
7525 CALL_Uniform4fARB(ctx
->Exec
,
7526 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7528 case OPCODE_UNIFORM_1FV
:
7529 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7531 case OPCODE_UNIFORM_2FV
:
7532 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7534 case OPCODE_UNIFORM_3FV
:
7535 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7537 case OPCODE_UNIFORM_4FV
:
7538 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7540 case OPCODE_UNIFORM_1I
:
7541 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7543 case OPCODE_UNIFORM_2I
:
7544 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7546 case OPCODE_UNIFORM_3I
:
7547 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7549 case OPCODE_UNIFORM_4I
:
7550 CALL_Uniform4iARB(ctx
->Exec
,
7551 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7553 case OPCODE_UNIFORM_1IV
:
7554 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7556 case OPCODE_UNIFORM_2IV
:
7557 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7559 case OPCODE_UNIFORM_3IV
:
7560 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7562 case OPCODE_UNIFORM_4IV
:
7563 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7566 case OPCODE_UNIFORM_MATRIX22
:
7567 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7568 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7570 case OPCODE_UNIFORM_MATRIX33
:
7571 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7572 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7574 case OPCODE_UNIFORM_MATRIX44
:
7575 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7576 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7578 case OPCODE_UNIFORM_MATRIX23
:
7579 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7580 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7582 case OPCODE_UNIFORM_MATRIX32
:
7583 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7584 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7586 case OPCODE_UNIFORM_MATRIX24
:
7587 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7588 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7590 case OPCODE_UNIFORM_MATRIX42
:
7591 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7592 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7594 case OPCODE_UNIFORM_MATRIX34
:
7595 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7596 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7598 case OPCODE_UNIFORM_MATRIX43
:
7599 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7600 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7603 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7606 GLuint i
, pname
= n
[1].ui
;
7608 for (i
= 0; i
< 4; i
++)
7609 values
[i
] = n
[1 + i
].f
;
7610 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7613 #if FEATURE_ATI_fragment_shader
7614 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7615 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7617 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7620 GLuint i
, dst
= n
[1].ui
;
7622 for (i
= 0; i
< 4; i
++)
7623 values
[i
] = n
[1 + i
].f
;
7624 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7628 case OPCODE_ATTR_1F_NV
:
7629 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7631 case OPCODE_ATTR_2F_NV
:
7632 /* Really shouldn't have to do this - the Node structure
7633 * is convenient, but it would be better to store the data
7634 * packed appropriately so that it can be sent directly
7635 * on. With x86_64 becoming common, this will start to
7638 if (sizeof(Node
) == sizeof(GLfloat
))
7639 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7641 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7643 case OPCODE_ATTR_3F_NV
:
7644 if (sizeof(Node
) == sizeof(GLfloat
))
7645 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7647 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7650 case OPCODE_ATTR_4F_NV
:
7651 if (sizeof(Node
) == sizeof(GLfloat
))
7652 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7654 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7657 case OPCODE_ATTR_1F_ARB
:
7658 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7660 case OPCODE_ATTR_2F_ARB
:
7661 /* Really shouldn't have to do this - the Node structure
7662 * is convenient, but it would be better to store the data
7663 * packed appropriately so that it can be sent directly
7664 * on. With x86_64 becoming common, this will start to
7667 if (sizeof(Node
) == sizeof(GLfloat
))
7668 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7670 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7672 case OPCODE_ATTR_3F_ARB
:
7673 if (sizeof(Node
) == sizeof(GLfloat
))
7674 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7676 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7679 case OPCODE_ATTR_4F_ARB
:
7680 if (sizeof(Node
) == sizeof(GLfloat
))
7681 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7683 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7686 case OPCODE_MATERIAL
:
7687 if (sizeof(Node
) == sizeof(GLfloat
))
7688 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7695 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7699 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7702 CALL_End(ctx
->Exec
, ());
7705 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7707 case OPCODE_EVAL_C1
:
7708 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7710 case OPCODE_EVAL_C2
:
7711 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7713 case OPCODE_EVAL_P1
:
7714 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7716 case OPCODE_EVAL_P2
:
7717 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7720 case OPCODE_CONTINUE
:
7721 n
= (Node
*) n
[1].next
;
7723 case OPCODE_END_OF_LIST
:
7729 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
7731 _mesa_problem(ctx
, msg
);
7736 /* increment n to point to next compiled command */
7737 if (opcode
!= OPCODE_CONTINUE
) {
7738 n
+= InstSize
[opcode
];
7743 if (ctx
->Driver
.EndCallList
)
7744 ctx
->Driver
.EndCallList(ctx
);
7746 ctx
->ListState
.CallDepth
--;
7751 /**********************************************************************/
7753 /**********************************************************************/
7756 * Test if a display list number is valid.
7758 static GLboolean GLAPIENTRY
7759 _mesa_IsList(GLuint list
)
7761 GET_CURRENT_CONTEXT(ctx
);
7762 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7763 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7764 return islist(ctx
, list
);
7769 * Delete a sequence of consecutive display lists.
7771 static void GLAPIENTRY
7772 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7774 GET_CURRENT_CONTEXT(ctx
);
7776 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7777 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7780 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7783 for (i
= list
; i
< list
+ range
; i
++) {
7784 destroy_list(ctx
, i
);
7790 * Return a display list number, n, such that lists n through n+range-1
7793 static GLuint GLAPIENTRY
7794 _mesa_GenLists(GLsizei range
)
7796 GET_CURRENT_CONTEXT(ctx
);
7798 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7799 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7802 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7810 * Make this an atomic operation
7812 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7814 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7816 /* reserve the list IDs by with empty/dummy lists */
7818 for (i
= 0; i
< range
; i
++) {
7819 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7820 make_list(base
+ i
, 1));
7824 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7831 * Begin a new display list.
7833 static void GLAPIENTRY
7834 _mesa_NewList(GLuint name
, GLenum mode
)
7836 GET_CURRENT_CONTEXT(ctx
);
7838 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7839 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7841 if (MESA_VERBOSE
& VERBOSE_API
)
7842 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7843 _mesa_lookup_enum_by_nr(mode
));
7846 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7850 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7851 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7855 if (ctx
->ListState
.CurrentList
) {
7856 /* already compiling a display list */
7857 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7861 ctx
->CompileFlag
= GL_TRUE
;
7862 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7864 /* Reset acumulated list state:
7866 invalidate_saved_current_state( ctx
);
7868 /* Allocate new display list */
7869 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7870 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7871 ctx
->ListState
.CurrentPos
= 0;
7873 ctx
->Driver
.NewList(ctx
, name
, mode
);
7875 ctx
->CurrentDispatch
= ctx
->Save
;
7876 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7881 * End definition of current display list.
7883 static void GLAPIENTRY
7886 GET_CURRENT_CONTEXT(ctx
);
7887 SAVE_FLUSH_VERTICES(ctx
);
7888 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7890 if (MESA_VERBOSE
& VERBOSE_API
)
7891 _mesa_debug(ctx
, "glEndList\n");
7893 /* Check that a list is under construction */
7894 if (!ctx
->ListState
.CurrentList
) {
7895 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7899 /* Call before emitting END_OF_LIST, in case the driver wants to
7900 * emit opcodes itself.
7902 ctx
->Driver
.EndList(ctx
);
7904 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
7906 /* Destroy old list, if any */
7907 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7909 /* Install the new list */
7910 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7911 ctx
->ListState
.CurrentList
->Name
,
7912 ctx
->ListState
.CurrentList
);
7915 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7916 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7918 ctx
->ListState
.CurrentList
= NULL
;
7919 ctx
->ExecuteFlag
= GL_TRUE
;
7920 ctx
->CompileFlag
= GL_FALSE
;
7922 ctx
->CurrentDispatch
= ctx
->Exec
;
7923 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7928 _mesa_CallList(GLuint list
)
7930 GLboolean save_compile_flag
;
7931 GET_CURRENT_CONTEXT(ctx
);
7932 FLUSH_CURRENT(ctx
, 0);
7933 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7934 /* execute the display list, and restore the CompileFlag. */
7936 if (MESA_VERBOSE
& VERBOSE_API
)
7937 _mesa_debug(ctx
, "glCallList %d\n", list
);
7940 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7944 /* mesa_print_display_list( list ); */
7946 save_compile_flag
= ctx
->CompileFlag
;
7947 if (save_compile_flag
) {
7948 ctx
->CompileFlag
= GL_FALSE
;
7951 execute_list(ctx
, list
);
7952 ctx
->CompileFlag
= save_compile_flag
;
7954 /* also restore API function pointers to point to "save" versions */
7955 if (save_compile_flag
) {
7956 ctx
->CurrentDispatch
= ctx
->Save
;
7957 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7963 * Execute glCallLists: call multiple display lists.
7966 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7968 GET_CURRENT_CONTEXT(ctx
);
7970 GLboolean save_compile_flag
;
7972 if (MESA_VERBOSE
& VERBOSE_API
)
7973 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7977 case GL_UNSIGNED_BYTE
:
7979 case GL_UNSIGNED_SHORT
:
7981 case GL_UNSIGNED_INT
:
7989 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7993 /* Save the CompileFlag status, turn it off, execute display list,
7994 * and restore the CompileFlag.
7996 save_compile_flag
= ctx
->CompileFlag
;
7997 ctx
->CompileFlag
= GL_FALSE
;
7999 for (i
= 0; i
< n
; i
++) {
8000 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
8001 execute_list(ctx
, list
);
8004 ctx
->CompileFlag
= save_compile_flag
;
8006 /* also restore API function pointers to point to "save" versions */
8007 if (save_compile_flag
) {
8008 ctx
->CurrentDispatch
= ctx
->Save
;
8009 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8015 * Set the offset added to list numbers in glCallLists.
8017 static void GLAPIENTRY
8018 _mesa_ListBase(GLuint base
)
8020 GET_CURRENT_CONTEXT(ctx
);
8021 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8022 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8023 ctx
->List
.ListBase
= base
;
8027 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8029 static void GLAPIENTRY
8032 GET_CURRENT_CONTEXT(ctx
);
8033 FLUSH_VERTICES(ctx
, 0);
8034 CALL_Finish(ctx
->Exec
, ());
8037 static void GLAPIENTRY
8040 GET_CURRENT_CONTEXT(ctx
);
8041 FLUSH_VERTICES(ctx
, 0);
8042 CALL_Flush(ctx
->Exec
, ());
8045 static void GLAPIENTRY
8046 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8048 GET_CURRENT_CONTEXT(ctx
);
8049 FLUSH_VERTICES(ctx
, 0);
8050 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8053 static void GLAPIENTRY
8054 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8056 GET_CURRENT_CONTEXT(ctx
);
8057 FLUSH_VERTICES(ctx
, 0);
8058 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8061 static void GLAPIENTRY
8062 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8064 GET_CURRENT_CONTEXT(ctx
);
8065 FLUSH_VERTICES(ctx
, 0);
8066 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8069 static GLenum GLAPIENTRY
8072 GET_CURRENT_CONTEXT(ctx
);
8073 FLUSH_VERTICES(ctx
, 0);
8074 return CALL_GetError(ctx
->Exec
, ());
8077 static void GLAPIENTRY
8078 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8080 GET_CURRENT_CONTEXT(ctx
);
8081 FLUSH_VERTICES(ctx
, 0);
8082 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8085 static void GLAPIENTRY
8086 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8088 GET_CURRENT_CONTEXT(ctx
);
8089 FLUSH_VERTICES(ctx
, 0);
8090 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8093 static void GLAPIENTRY
8094 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8096 GET_CURRENT_CONTEXT(ctx
);
8097 FLUSH_VERTICES(ctx
, 0);
8098 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8101 static void GLAPIENTRY
8102 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8104 GET_CURRENT_CONTEXT(ctx
);
8105 FLUSH_VERTICES(ctx
, 0);
8106 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8109 static void GLAPIENTRY
8110 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8112 GET_CURRENT_CONTEXT(ctx
);
8113 FLUSH_VERTICES(ctx
, 0);
8114 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8117 static void GLAPIENTRY
8118 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8120 GET_CURRENT_CONTEXT(ctx
);
8121 FLUSH_VERTICES(ctx
, 0);
8122 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8125 static void GLAPIENTRY
8126 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8128 GET_CURRENT_CONTEXT(ctx
);
8129 FLUSH_VERTICES(ctx
, 0);
8130 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8133 static void GLAPIENTRY
8134 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8136 GET_CURRENT_CONTEXT(ctx
);
8137 FLUSH_VERTICES(ctx
, 0);
8138 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8141 static void GLAPIENTRY
8142 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8144 GET_CURRENT_CONTEXT(ctx
);
8145 FLUSH_VERTICES(ctx
, 0);
8146 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8149 static void GLAPIENTRY
8150 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8152 GET_CURRENT_CONTEXT(ctx
);
8153 FLUSH_VERTICES(ctx
, 0);
8154 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8157 static void GLAPIENTRY
8158 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8160 GET_CURRENT_CONTEXT(ctx
);
8161 FLUSH_VERTICES(ctx
, 0);
8162 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8165 static void GLAPIENTRY
8166 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8168 GET_CURRENT_CONTEXT(ctx
);
8169 FLUSH_VERTICES(ctx
, 0);
8170 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8173 static void GLAPIENTRY
8174 exec_GetPolygonStipple(GLubyte
* dest
)
8176 GET_CURRENT_CONTEXT(ctx
);
8177 FLUSH_VERTICES(ctx
, 0);
8178 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8181 static const GLubyte
*GLAPIENTRY
8182 exec_GetString(GLenum name
)
8184 GET_CURRENT_CONTEXT(ctx
);
8185 FLUSH_VERTICES(ctx
, 0);
8186 return CALL_GetString(ctx
->Exec
, (name
));
8189 static void GLAPIENTRY
8190 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8192 GET_CURRENT_CONTEXT(ctx
);
8193 FLUSH_VERTICES(ctx
, 0);
8194 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8197 static void GLAPIENTRY
8198 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8200 GET_CURRENT_CONTEXT(ctx
);
8201 FLUSH_VERTICES(ctx
, 0);
8202 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8205 static void GLAPIENTRY
8206 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8208 GET_CURRENT_CONTEXT(ctx
);
8209 FLUSH_VERTICES(ctx
, 0);
8210 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8213 static void GLAPIENTRY
8214 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8216 GET_CURRENT_CONTEXT(ctx
);
8217 FLUSH_VERTICES(ctx
, 0);
8218 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8221 static void GLAPIENTRY
8222 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8224 GET_CURRENT_CONTEXT(ctx
);
8225 FLUSH_VERTICES(ctx
, 0);
8226 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8229 static void GLAPIENTRY
8230 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8231 GLenum type
, GLvoid
* pixels
)
8233 GET_CURRENT_CONTEXT(ctx
);
8234 FLUSH_VERTICES(ctx
, 0);
8235 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8238 static void GLAPIENTRY
8239 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8240 GLenum pname
, GLfloat
*params
)
8242 GET_CURRENT_CONTEXT(ctx
);
8243 FLUSH_VERTICES(ctx
, 0);
8244 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8247 static void GLAPIENTRY
8248 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8249 GLenum pname
, GLint
*params
)
8251 GET_CURRENT_CONTEXT(ctx
);
8252 FLUSH_VERTICES(ctx
, 0);
8253 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8256 static void GLAPIENTRY
8257 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8259 GET_CURRENT_CONTEXT(ctx
);
8260 FLUSH_VERTICES(ctx
, 0);
8261 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8264 static void GLAPIENTRY
8265 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8267 GET_CURRENT_CONTEXT(ctx
);
8268 FLUSH_VERTICES(ctx
, 0);
8269 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8272 static GLboolean GLAPIENTRY
8273 exec_IsEnabled(GLenum cap
)
8275 GET_CURRENT_CONTEXT(ctx
);
8276 FLUSH_VERTICES(ctx
, 0);
8277 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8280 static void GLAPIENTRY
8281 exec_PixelStoref(GLenum pname
, GLfloat param
)
8283 GET_CURRENT_CONTEXT(ctx
);
8284 FLUSH_VERTICES(ctx
, 0);
8285 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8288 static void GLAPIENTRY
8289 exec_PixelStorei(GLenum pname
, GLint param
)
8291 GET_CURRENT_CONTEXT(ctx
);
8292 FLUSH_VERTICES(ctx
, 0);
8293 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8296 static void GLAPIENTRY
8297 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8298 GLenum format
, GLenum type
, GLvoid
* pixels
)
8300 GET_CURRENT_CONTEXT(ctx
);
8301 FLUSH_VERTICES(ctx
, 0);
8302 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8305 static GLint GLAPIENTRY
8306 exec_RenderMode(GLenum mode
)
8308 GET_CURRENT_CONTEXT(ctx
);
8309 FLUSH_VERTICES(ctx
, 0);
8310 return CALL_RenderMode(ctx
->Exec
, (mode
));
8313 static void GLAPIENTRY
8314 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8316 GET_CURRENT_CONTEXT(ctx
);
8317 FLUSH_VERTICES(ctx
, 0);
8318 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8321 static void GLAPIENTRY
8322 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8324 GET_CURRENT_CONTEXT(ctx
);
8325 FLUSH_VERTICES(ctx
, 0);
8326 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8329 static GLboolean GLAPIENTRY
8330 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8331 GLboolean
* residences
)
8333 GET_CURRENT_CONTEXT(ctx
);
8334 FLUSH_VERTICES(ctx
, 0);
8335 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8338 static void GLAPIENTRY
8339 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8341 GET_CURRENT_CONTEXT(ctx
);
8342 FLUSH_VERTICES(ctx
, 0);
8343 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8346 static void GLAPIENTRY
8347 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8349 GET_CURRENT_CONTEXT(ctx
);
8350 FLUSH_VERTICES(ctx
, 0);
8351 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8354 static void GLAPIENTRY
8355 exec_DisableClientState(GLenum cap
)
8357 GET_CURRENT_CONTEXT(ctx
);
8358 FLUSH_VERTICES(ctx
, 0);
8359 CALL_DisableClientState(ctx
->Exec
, (cap
));
8362 static void GLAPIENTRY
8363 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8365 GET_CURRENT_CONTEXT(ctx
);
8366 FLUSH_VERTICES(ctx
, 0);
8367 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8370 static void GLAPIENTRY
8371 exec_EnableClientState(GLenum cap
)
8373 GET_CURRENT_CONTEXT(ctx
);
8374 FLUSH_VERTICES(ctx
, 0);
8375 CALL_EnableClientState(ctx
->Exec
, (cap
));
8378 static void GLAPIENTRY
8379 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8381 GET_CURRENT_CONTEXT(ctx
);
8382 FLUSH_VERTICES(ctx
, 0);
8383 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8386 static void GLAPIENTRY
8387 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8389 GET_CURRENT_CONTEXT(ctx
);
8390 FLUSH_VERTICES(ctx
, 0);
8391 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8394 static void GLAPIENTRY
8395 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8397 GET_CURRENT_CONTEXT(ctx
);
8398 FLUSH_VERTICES(ctx
, 0);
8399 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8402 static void GLAPIENTRY
8403 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8405 GET_CURRENT_CONTEXT(ctx
);
8406 FLUSH_VERTICES(ctx
, 0);
8407 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8410 static GLboolean GLAPIENTRY
8411 exec_IsTexture(GLuint texture
)
8413 GET_CURRENT_CONTEXT(ctx
);
8414 FLUSH_VERTICES(ctx
, 0);
8415 return CALL_IsTexture(ctx
->Exec
, (texture
));
8418 static void GLAPIENTRY
8419 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8421 GET_CURRENT_CONTEXT(ctx
);
8422 FLUSH_VERTICES(ctx
, 0);
8423 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8426 static void GLAPIENTRY
8427 exec_PopClientAttrib(void)
8429 GET_CURRENT_CONTEXT(ctx
);
8430 FLUSH_VERTICES(ctx
, 0);
8431 CALL_PopClientAttrib(ctx
->Exec
, ());
8434 static void GLAPIENTRY
8435 exec_PushClientAttrib(GLbitfield mask
)
8437 GET_CURRENT_CONTEXT(ctx
);
8438 FLUSH_VERTICES(ctx
, 0);
8439 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8442 static void GLAPIENTRY
8443 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8446 GET_CURRENT_CONTEXT(ctx
);
8447 FLUSH_VERTICES(ctx
, 0);
8448 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8451 static void GLAPIENTRY
8452 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8454 GET_CURRENT_CONTEXT(ctx
);
8455 FLUSH_VERTICES(ctx
, 0);
8456 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8459 static void GLAPIENTRY
8460 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8463 GET_CURRENT_CONTEXT(ctx
);
8464 FLUSH_VERTICES(ctx
, 0);
8465 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8468 static void GLAPIENTRY
8469 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8470 GLint x
, GLint y
, GLsizei width
)
8472 GET_CURRENT_CONTEXT(ctx
);
8473 FLUSH_VERTICES(ctx
, 0);
8474 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8475 (target
, internalFormat
, x
, y
, width
));
8478 static void GLAPIENTRY
8479 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8480 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8482 GET_CURRENT_CONTEXT(ctx
);
8483 FLUSH_VERTICES(ctx
, 0);
8484 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8485 (target
, internalFormat
, x
, y
, width
,
8489 static void GLAPIENTRY
8490 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8492 GET_CURRENT_CONTEXT(ctx
);
8493 FLUSH_VERTICES(ctx
, 0);
8494 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8497 static void GLAPIENTRY
8498 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8500 GET_CURRENT_CONTEXT(ctx
);
8501 FLUSH_VERTICES(ctx
, 0);
8502 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8505 static void GLAPIENTRY
8506 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8508 GET_CURRENT_CONTEXT(ctx
);
8509 FLUSH_VERTICES(ctx
, 0);
8510 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8513 static void GLAPIENTRY
8514 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8517 GET_CURRENT_CONTEXT(ctx
);
8518 FLUSH_VERTICES(ctx
, 0);
8519 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8522 static void GLAPIENTRY
8523 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8525 GET_CURRENT_CONTEXT(ctx
);
8526 FLUSH_VERTICES(ctx
, 0);
8527 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8530 static void GLAPIENTRY
8531 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8533 GET_CURRENT_CONTEXT(ctx
);
8534 FLUSH_VERTICES(ctx
, 0);
8535 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8538 static void GLAPIENTRY
8539 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8540 GLenum type
, GLvoid
*values
)
8542 GET_CURRENT_CONTEXT(ctx
);
8543 FLUSH_VERTICES(ctx
, 0);
8544 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8547 static void GLAPIENTRY
8548 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8550 GET_CURRENT_CONTEXT(ctx
);
8551 FLUSH_VERTICES(ctx
, 0);
8552 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8555 static void GLAPIENTRY
8556 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8558 GET_CURRENT_CONTEXT(ctx
);
8559 FLUSH_VERTICES(ctx
, 0);
8560 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8563 static void GLAPIENTRY
8564 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8565 GLenum type
, GLvoid
*values
)
8567 GET_CURRENT_CONTEXT(ctx
);
8568 FLUSH_VERTICES(ctx
, 0);
8569 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8572 static void GLAPIENTRY
8573 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8575 GET_CURRENT_CONTEXT(ctx
);
8576 FLUSH_VERTICES(ctx
, 0);
8577 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8580 static void GLAPIENTRY
8581 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8583 GET_CURRENT_CONTEXT(ctx
);
8584 FLUSH_VERTICES(ctx
, 0);
8585 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8588 static void GLAPIENTRY
8589 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8590 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8592 GET_CURRENT_CONTEXT(ctx
);
8593 FLUSH_VERTICES(ctx
, 0);
8594 CALL_GetSeparableFilter(ctx
->Exec
,
8595 (target
, format
, type
, row
, column
, span
));
8598 static void GLAPIENTRY
8599 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8600 GLsizei width
, GLsizei height
, GLenum format
,
8601 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8603 GET_CURRENT_CONTEXT(ctx
);
8604 FLUSH_VERTICES(ctx
, 0);
8605 CALL_SeparableFilter2D(ctx
->Exec
,
8606 (target
, internalFormat
, width
, height
, format
,
8607 type
, row
, column
));
8610 static void GLAPIENTRY
8611 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8612 GLsizei count
, const GLvoid
*ptr
)
8614 GET_CURRENT_CONTEXT(ctx
);
8615 FLUSH_VERTICES(ctx
, 0);
8616 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8619 static void GLAPIENTRY
8620 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8622 GET_CURRENT_CONTEXT(ctx
);
8623 FLUSH_VERTICES(ctx
, 0);
8624 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8627 static void GLAPIENTRY
8628 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8631 GET_CURRENT_CONTEXT(ctx
);
8632 FLUSH_VERTICES(ctx
, 0);
8633 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8636 static void GLAPIENTRY
8637 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8640 GET_CURRENT_CONTEXT(ctx
);
8641 FLUSH_VERTICES(ctx
, 0);
8642 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8645 static void GLAPIENTRY
8646 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8647 GLsizei count
, const GLvoid
*ptr
)
8649 GET_CURRENT_CONTEXT(ctx
);
8650 FLUSH_VERTICES(ctx
, 0);
8651 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8654 static void GLAPIENTRY
8655 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8656 GLsizei count
, const GLvoid
*ptr
)
8658 GET_CURRENT_CONTEXT(ctx
);
8659 FLUSH_VERTICES(ctx
, 0);
8660 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8663 static void GLAPIENTRY
8664 exec_LockArraysEXT(GLint first
, GLsizei count
)
8666 GET_CURRENT_CONTEXT(ctx
);
8667 FLUSH_VERTICES(ctx
, 0);
8668 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8671 static void GLAPIENTRY
8672 exec_UnlockArraysEXT(void)
8674 GET_CURRENT_CONTEXT(ctx
);
8675 FLUSH_VERTICES(ctx
, 0);
8676 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8679 static void GLAPIENTRY
8680 exec_ClientActiveTextureARB(GLenum target
)
8682 GET_CURRENT_CONTEXT(ctx
);
8683 FLUSH_VERTICES(ctx
, 0);
8684 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8687 static void GLAPIENTRY
8688 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8689 GLsizei stride
, const GLvoid
*ptr
)
8691 GET_CURRENT_CONTEXT(ctx
);
8692 FLUSH_VERTICES(ctx
, 0);
8693 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8696 static void GLAPIENTRY
8697 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8699 GET_CURRENT_CONTEXT(ctx
);
8700 FLUSH_VERTICES(ctx
, 0);
8701 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8704 /* GL_EXT_multi_draw_arrays */
8705 static void GLAPIENTRY
8706 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8707 GLsizei
* count
, GLsizei primcount
)
8709 GET_CURRENT_CONTEXT(ctx
);
8710 FLUSH_VERTICES(ctx
, 0);
8711 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8714 /* GL_IBM_multimode_draw_arrays */
8715 static void GLAPIENTRY
8716 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8717 const GLsizei
* count
, GLsizei primcount
,
8720 GET_CURRENT_CONTEXT(ctx
);
8721 FLUSH_VERTICES(ctx
, 0);
8722 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8723 (mode
, first
, count
, primcount
, modestride
));
8726 /* GL_IBM_multimode_draw_arrays */
8727 static void GLAPIENTRY
8728 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8729 const GLsizei
* count
,
8731 const GLvoid
* const *indices
,
8732 GLsizei primcount
, GLint modestride
)
8734 GET_CURRENT_CONTEXT(ctx
);
8735 FLUSH_VERTICES(ctx
, 0);
8736 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8737 (mode
, count
, type
, indices
, primcount
,
8744 * Setup the given dispatch table to point to Mesa's display list
8745 * building functions.
8747 * This does not include any of the tnl functions - they are
8748 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8751 struct _glapi_table
*
8752 _mesa_create_save_table(void)
8754 struct _glapi_table
*table
;
8756 table
= _mesa_alloc_dispatch_table(sizeof *table
);
8760 _mesa_loopback_init_api_table(table
);
8763 SET_Accum(table
, save_Accum
);
8764 SET_AlphaFunc(table
, save_AlphaFunc
);
8765 SET_Bitmap(table
, save_Bitmap
);
8766 SET_BlendFunc(table
, save_BlendFunc
);
8767 SET_CallList(table
, save_CallList
);
8768 SET_CallLists(table
, save_CallLists
);
8769 SET_Clear(table
, save_Clear
);
8770 SET_ClearAccum(table
, save_ClearAccum
);
8771 SET_ClearColor(table
, save_ClearColor
);
8772 SET_ClearDepth(table
, save_ClearDepth
);
8773 SET_ClearIndex(table
, save_ClearIndex
);
8774 SET_ClearStencil(table
, save_ClearStencil
);
8775 SET_ClipPlane(table
, save_ClipPlane
);
8776 SET_ColorMask(table
, save_ColorMask
);
8777 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
8778 SET_ColorMaterial(table
, save_ColorMaterial
);
8779 SET_CopyPixels(table
, save_CopyPixels
);
8780 SET_CullFace(table
, save_CullFace
);
8781 SET_DeleteLists(table
, _mesa_DeleteLists
);
8782 SET_DepthFunc(table
, save_DepthFunc
);
8783 SET_DepthMask(table
, save_DepthMask
);
8784 SET_DepthRange(table
, save_DepthRange
);
8785 SET_Disable(table
, save_Disable
);
8786 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
8787 SET_DrawBuffer(table
, save_DrawBuffer
);
8788 SET_DrawPixels(table
, save_DrawPixels
);
8789 SET_Enable(table
, save_Enable
);
8790 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
8791 SET_EndList(table
, _mesa_EndList
);
8792 SET_EvalMesh1(table
, save_EvalMesh1
);
8793 SET_EvalMesh2(table
, save_EvalMesh2
);
8794 SET_Finish(table
, exec_Finish
);
8795 SET_Flush(table
, exec_Flush
);
8796 SET_Fogf(table
, save_Fogf
);
8797 SET_Fogfv(table
, save_Fogfv
);
8798 SET_Fogi(table
, save_Fogi
);
8799 SET_Fogiv(table
, save_Fogiv
);
8800 SET_FrontFace(table
, save_FrontFace
);
8801 SET_Frustum(table
, save_Frustum
);
8802 SET_GenLists(table
, _mesa_GenLists
);
8803 SET_GetBooleanv(table
, exec_GetBooleanv
);
8804 SET_GetClipPlane(table
, exec_GetClipPlane
);
8805 SET_GetDoublev(table
, exec_GetDoublev
);
8806 SET_GetError(table
, exec_GetError
);
8807 SET_GetFloatv(table
, exec_GetFloatv
);
8808 SET_GetIntegerv(table
, exec_GetIntegerv
);
8809 SET_GetLightfv(table
, exec_GetLightfv
);
8810 SET_GetLightiv(table
, exec_GetLightiv
);
8811 SET_GetMapdv(table
, exec_GetMapdv
);
8812 SET_GetMapfv(table
, exec_GetMapfv
);
8813 SET_GetMapiv(table
, exec_GetMapiv
);
8814 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8815 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8816 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8817 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8818 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8819 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8820 SET_GetString(table
, exec_GetString
);
8821 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8822 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8823 SET_GetTexGendv(table
, exec_GetTexGendv
);
8824 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8825 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8826 SET_GetTexImage(table
, exec_GetTexImage
);
8827 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8828 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8829 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8830 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8831 SET_Hint(table
, save_Hint
);
8832 SET_IndexMask(table
, save_IndexMask
);
8833 SET_InitNames(table
, save_InitNames
);
8834 SET_IsEnabled(table
, exec_IsEnabled
);
8835 SET_IsList(table
, _mesa_IsList
);
8836 SET_LightModelf(table
, save_LightModelf
);
8837 SET_LightModelfv(table
, save_LightModelfv
);
8838 SET_LightModeli(table
, save_LightModeli
);
8839 SET_LightModeliv(table
, save_LightModeliv
);
8840 SET_Lightf(table
, save_Lightf
);
8841 SET_Lightfv(table
, save_Lightfv
);
8842 SET_Lighti(table
, save_Lighti
);
8843 SET_Lightiv(table
, save_Lightiv
);
8844 SET_LineStipple(table
, save_LineStipple
);
8845 SET_LineWidth(table
, save_LineWidth
);
8846 SET_ListBase(table
, save_ListBase
);
8847 SET_LoadIdentity(table
, save_LoadIdentity
);
8848 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8849 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8850 SET_LoadName(table
, save_LoadName
);
8851 SET_LogicOp(table
, save_LogicOp
);
8852 SET_Map1d(table
, save_Map1d
);
8853 SET_Map1f(table
, save_Map1f
);
8854 SET_Map2d(table
, save_Map2d
);
8855 SET_Map2f(table
, save_Map2f
);
8856 SET_MapGrid1d(table
, save_MapGrid1d
);
8857 SET_MapGrid1f(table
, save_MapGrid1f
);
8858 SET_MapGrid2d(table
, save_MapGrid2d
);
8859 SET_MapGrid2f(table
, save_MapGrid2f
);
8860 SET_MatrixMode(table
, save_MatrixMode
);
8861 SET_MultMatrixd(table
, save_MultMatrixd
);
8862 SET_MultMatrixf(table
, save_MultMatrixf
);
8863 SET_NewList(table
, save_NewList
);
8864 SET_Ortho(table
, save_Ortho
);
8865 SET_PassThrough(table
, save_PassThrough
);
8866 SET_PixelMapfv(table
, save_PixelMapfv
);
8867 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8868 SET_PixelMapusv(table
, save_PixelMapusv
);
8869 SET_PixelStoref(table
, exec_PixelStoref
);
8870 SET_PixelStorei(table
, exec_PixelStorei
);
8871 SET_PixelTransferf(table
, save_PixelTransferf
);
8872 SET_PixelTransferi(table
, save_PixelTransferi
);
8873 SET_PixelZoom(table
, save_PixelZoom
);
8874 SET_PointSize(table
, save_PointSize
);
8875 SET_PolygonMode(table
, save_PolygonMode
);
8876 SET_PolygonOffset(table
, save_PolygonOffset
);
8877 SET_PolygonStipple(table
, save_PolygonStipple
);
8878 SET_PopAttrib(table
, save_PopAttrib
);
8879 SET_PopMatrix(table
, save_PopMatrix
);
8880 SET_PopName(table
, save_PopName
);
8881 SET_PushAttrib(table
, save_PushAttrib
);
8882 SET_PushMatrix(table
, save_PushMatrix
);
8883 SET_PushName(table
, save_PushName
);
8884 SET_RasterPos2d(table
, save_RasterPos2d
);
8885 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8886 SET_RasterPos2f(table
, save_RasterPos2f
);
8887 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8888 SET_RasterPos2i(table
, save_RasterPos2i
);
8889 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8890 SET_RasterPos2s(table
, save_RasterPos2s
);
8891 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8892 SET_RasterPos3d(table
, save_RasterPos3d
);
8893 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8894 SET_RasterPos3f(table
, save_RasterPos3f
);
8895 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8896 SET_RasterPos3i(table
, save_RasterPos3i
);
8897 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8898 SET_RasterPos3s(table
, save_RasterPos3s
);
8899 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8900 SET_RasterPos4d(table
, save_RasterPos4d
);
8901 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8902 SET_RasterPos4f(table
, save_RasterPos4f
);
8903 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8904 SET_RasterPos4i(table
, save_RasterPos4i
);
8905 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8906 SET_RasterPos4s(table
, save_RasterPos4s
);
8907 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8908 SET_ReadBuffer(table
, save_ReadBuffer
);
8909 SET_ReadPixels(table
, exec_ReadPixels
);
8910 SET_RenderMode(table
, exec_RenderMode
);
8911 SET_Rotated(table
, save_Rotated
);
8912 SET_Rotatef(table
, save_Rotatef
);
8913 SET_Scaled(table
, save_Scaled
);
8914 SET_Scalef(table
, save_Scalef
);
8915 SET_Scissor(table
, save_Scissor
);
8916 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8917 SET_SelectBuffer(table
, exec_SelectBuffer
);
8918 SET_ShadeModel(table
, save_ShadeModel
);
8919 SET_StencilFunc(table
, save_StencilFunc
);
8920 SET_StencilMask(table
, save_StencilMask
);
8921 SET_StencilOp(table
, save_StencilOp
);
8922 SET_TexEnvf(table
, save_TexEnvf
);
8923 SET_TexEnvfv(table
, save_TexEnvfv
);
8924 SET_TexEnvi(table
, save_TexEnvi
);
8925 SET_TexEnviv(table
, save_TexEnviv
);
8926 SET_TexGend(table
, save_TexGend
);
8927 SET_TexGendv(table
, save_TexGendv
);
8928 SET_TexGenf(table
, save_TexGenf
);
8929 SET_TexGenfv(table
, save_TexGenfv
);
8930 SET_TexGeni(table
, save_TexGeni
);
8931 SET_TexGeniv(table
, save_TexGeniv
);
8932 SET_TexImage1D(table
, save_TexImage1D
);
8933 SET_TexImage2D(table
, save_TexImage2D
);
8934 SET_TexParameterf(table
, save_TexParameterf
);
8935 SET_TexParameterfv(table
, save_TexParameterfv
);
8936 SET_TexParameteri(table
, save_TexParameteri
);
8937 SET_TexParameteriv(table
, save_TexParameteriv
);
8938 SET_Translated(table
, save_Translated
);
8939 SET_Translatef(table
, save_Translatef
);
8940 SET_Viewport(table
, save_Viewport
);
8943 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8944 SET_BindTexture(table
, save_BindTexture
);
8945 SET_ColorPointer(table
, exec_ColorPointer
);
8946 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8947 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8948 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8949 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8950 SET_DeleteTextures(table
, exec_DeleteTextures
);
8951 SET_DisableClientState(table
, exec_DisableClientState
);
8952 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8953 SET_EnableClientState(table
, exec_EnableClientState
);
8954 SET_GenTextures(table
, exec_GenTextures
);
8955 SET_GetPointerv(table
, exec_GetPointerv
);
8956 SET_IndexPointer(table
, exec_IndexPointer
);
8957 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8958 SET_IsTexture(table
, exec_IsTexture
);
8959 SET_NormalPointer(table
, exec_NormalPointer
);
8960 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8961 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8962 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8963 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8964 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8965 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8966 SET_VertexPointer(table
, exec_VertexPointer
);
8969 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8970 SET_TexImage3D(table
, save_TexImage3D
);
8971 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8974 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8975 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8976 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8978 /* ATI_separate_stencil */
8979 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8981 /* GL_ARB_imaging */
8982 /* Not all are supported */
8983 SET_BlendColor(table
, save_BlendColor
);
8984 SET_BlendEquation(table
, save_BlendEquation
);
8985 SET_ColorSubTable(table
, save_ColorSubTable
);
8986 SET_ColorTable(table
, save_ColorTable
);
8987 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8988 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8989 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8990 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8991 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8992 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8993 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8994 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8995 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8996 SET_CopyColorTable(table
, save_CopyColorTable
);
8997 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8998 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8999 SET_GetColorTable(table
, exec_GetColorTable
);
9000 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
9001 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
9002 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
9003 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
9004 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
9005 SET_GetHistogram(table
, exec_GetHistogram
);
9006 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
9007 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
9008 SET_GetMinmax(table
, exec_GetMinmax
);
9009 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
9010 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
9011 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
9012 SET_Histogram(table
, save_Histogram
);
9013 SET_Minmax(table
, save_Minmax
);
9014 SET_ResetHistogram(table
, save_ResetHistogram
);
9015 SET_ResetMinmax(table
, save_ResetMinmax
);
9016 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
9018 /* 2. GL_EXT_blend_color */
9020 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9023 /* 3. GL_EXT_polygon_offset */
9024 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9026 /* 6. GL_EXT_texture3d */
9028 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9029 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9030 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9033 /* 14. GL_SGI_color_table */
9035 SET_ColorTableSGI(table
, save_ColorTable
);
9036 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9037 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9038 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9039 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9042 /* 30. GL_EXT_vertex_array */
9043 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9044 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9045 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9046 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9047 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9048 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9050 /* 37. GL_EXT_blend_minmax */
9052 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9055 /* 54. GL_EXT_point_parameters */
9056 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9057 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9059 /* 97. GL_EXT_compiled_vertex_array */
9060 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9061 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9063 /* 145. GL_EXT_secondary_color */
9064 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9066 /* 148. GL_EXT_multi_draw_arrays */
9067 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9069 /* 149. GL_EXT_fog_coord */
9070 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9072 /* 173. GL_EXT_blend_func_separate */
9073 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9075 /* 196. GL_MESA_resize_buffers */
9076 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9078 /* 197. GL_MESA_window_pos */
9079 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9080 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9081 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9082 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9083 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9084 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9085 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9086 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9087 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9088 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9089 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9090 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9091 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9092 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9093 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9094 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9095 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9096 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9097 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9098 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9099 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9100 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9101 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9102 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9104 /* 200. GL_IBM_multimode_draw_arrays */
9105 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9106 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9108 #if FEATURE_NV_vertex_program
9109 /* 233. GL_NV_vertex_program */
9110 /* The following commands DO NOT go into display lists:
9111 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9112 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9114 SET_BindProgramNV(table
, save_BindProgramNV
);
9115 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9116 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
9117 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9118 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
9119 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
9120 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
9121 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
9122 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
9123 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
9124 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
9125 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9126 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9127 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9128 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9129 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9130 SET_LoadProgramNV(table
, save_LoadProgramNV
);
9131 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9132 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9133 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9134 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9135 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
9136 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
9137 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
9138 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
9141 /* 244. GL_ATI_envmap_bumpmap */
9142 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9143 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9145 /* 245. GL_ATI_fragment_shader */
9146 #if FEATURE_ATI_fragment_shader
9147 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9148 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9151 /* 282. GL_NV_fragment_program */
9152 #if FEATURE_NV_fragment_program
9153 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
9154 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
9155 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
9156 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
9157 SET_GetProgramNamedParameterfvNV(table
,
9158 _mesa_GetProgramNamedParameterfvNV
);
9159 SET_GetProgramNamedParameterdvNV(table
,
9160 _mesa_GetProgramNamedParameterdvNV
);
9161 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9162 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9163 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9164 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9165 SET_GetProgramLocalParameterdvARB(table
,
9166 _mesa_GetProgramLocalParameterdvARB
);
9167 SET_GetProgramLocalParameterfvARB(table
,
9168 _mesa_GetProgramLocalParameterfvARB
);
9171 /* 262. GL_NV_point_sprite */
9172 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9173 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9175 /* 268. GL_EXT_stencil_two_side */
9176 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9178 /* 273. GL_APPLE_vertex_array_object */
9179 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9180 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9181 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9182 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9184 /* ???. GL_EXT_depth_bounds_test */
9185 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9187 /* ARB 1. GL_ARB_multitexture */
9188 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9189 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9191 /* ARB 3. GL_ARB_transpose_matrix */
9192 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9193 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9194 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9195 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9197 /* ARB 5. GL_ARB_multisample */
9198 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9200 /* ARB 12. GL_ARB_texture_compression */
9201 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9202 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9203 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9204 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9205 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9206 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9207 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9209 /* ARB 14. GL_ARB_point_parameters */
9210 /* aliased with EXT_point_parameters functions */
9212 /* ARB 25. GL_ARB_window_pos */
9213 /* aliased with MESA_window_pos functions */
9215 /* ARB 26. GL_ARB_vertex_program */
9216 /* ARB 27. GL_ARB_fragment_program */
9217 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9218 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9219 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9220 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9221 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9222 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9223 SET_BindProgramNV(table
, save_BindProgramNV
);
9224 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9225 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9226 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9227 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9228 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9229 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9230 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9231 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9232 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9233 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9234 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9235 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9236 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9237 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9238 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9239 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9240 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9241 SET_GetProgramLocalParameterdvARB(table
,
9242 _mesa_GetProgramLocalParameterdvARB
);
9243 SET_GetProgramLocalParameterfvARB(table
,
9244 _mesa_GetProgramLocalParameterfvARB
);
9245 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9246 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9249 /* ARB 28. GL_ARB_vertex_buffer_object */
9250 #if FEATURE_ARB_vertex_buffer_object
9251 /* None of the extension's functions get compiled */
9252 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9253 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9254 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9255 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9256 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9257 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9258 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9259 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9260 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9261 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9262 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9265 #if FEATURE_queryobj
9266 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9267 SET_EndQueryARB(table
, save_EndQueryARB
);
9268 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9269 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9270 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9271 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9272 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9273 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9275 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9277 #if FEATURE_EXT_framebuffer_blit
9278 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9281 /* GL_ARB_shader_objects */
9282 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9283 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9284 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9285 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9286 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9287 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9288 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9289 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9290 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9291 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9292 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9293 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9294 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9295 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9296 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9297 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9298 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9299 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9300 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9301 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9302 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9303 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9304 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9305 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9306 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9307 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9309 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9310 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9311 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9312 /* XXX additional functions need to be implemented here! */
9314 /* 299. GL_EXT_blend_equation_separate */
9315 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9317 /* GL_EXT_gpu_program_parameters */
9318 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9319 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9320 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9323 /* ARB 50. GL_ARB_map_buffer_range */
9324 #if FEATURE_ARB_map_buffer_range
9325 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9326 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9329 /* ARB 59. GL_ARB_copy_buffer */
9330 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9332 /* 352. GL_EXT_transform_feedback */
9333 #if FEATURE_EXT_transform_feedback
9334 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
9335 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
9338 /* 364. GL_EXT_provoking_vertex */
9339 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9341 /* 371. GL_APPLE_object_purgeable */
9342 #if FEATURE_APPLE_object_purgeable
9343 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
9344 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
9349 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9350 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9351 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9352 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9354 (void) save_ClearBufferiv
;
9355 (void) save_ClearBufferuiv
;
9356 (void) save_ClearBufferfv
;
9357 (void) save_ClearBufferfi
;
9366 enum_string(GLenum k
)
9368 return _mesa_lookup_enum_by_nr(k
);
9373 * Print the commands in a display list. For debugging only.
9374 * TODO: many commands aren't handled yet.
9376 static void GLAPIENTRY
9377 print_list(GLcontext
*ctx
, GLuint list
)
9379 struct gl_display_list
*dlist
;
9383 if (!islist(ctx
, list
)) {
9384 printf("%u is not a display list ID\n", list
);
9388 dlist
= lookup_list(ctx
, list
);
9394 printf("START-LIST %u, address %p\n", list
, (void *) n
);
9396 done
= n
? GL_FALSE
: GL_TRUE
;
9398 const OpCode opcode
= n
[0].opcode
;
9400 if (is_ext_opcode(opcode
)) {
9401 n
+= ext_opcode_print(ctx
, n
);
9406 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9409 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9410 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9412 case OPCODE_CALL_LIST
:
9413 printf("CallList %d\n", (int) n
[1].ui
);
9415 case OPCODE_CALL_LIST_OFFSET
:
9416 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9417 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9419 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9420 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9421 enum_string(n
[1].e
), enum_string(n
[2].e
),
9422 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9424 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9425 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9426 enum_string(n
[1].e
), enum_string(n
[2].e
),
9427 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9429 case OPCODE_DISABLE
:
9430 printf("Disable %s\n", enum_string(n
[1].e
));
9433 printf("Enable %s\n", enum_string(n
[1].e
));
9435 case OPCODE_FRUSTUM
:
9436 printf("Frustum %g %g %g %g %g %g\n",
9437 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9439 case OPCODE_LINE_STIPPLE
:
9440 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9442 case OPCODE_LOAD_IDENTITY
:
9443 printf("LoadIdentity\n");
9445 case OPCODE_LOAD_MATRIX
:
9446 printf("LoadMatrix\n");
9447 printf(" %8f %8f %8f %8f\n",
9448 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9449 printf(" %8f %8f %8f %8f\n",
9450 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9451 printf(" %8f %8f %8f %8f\n",
9452 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9453 printf(" %8f %8f %8f %8f\n",
9454 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9456 case OPCODE_MULT_MATRIX
:
9457 printf("MultMatrix (or Rotate)\n");
9458 printf(" %8f %8f %8f %8f\n",
9459 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9460 printf(" %8f %8f %8f %8f\n",
9461 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9462 printf(" %8f %8f %8f %8f\n",
9463 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9464 printf(" %8f %8f %8f %8f\n",
9465 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9468 printf("Ortho %g %g %g %g %g %g\n",
9469 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9471 case OPCODE_POP_ATTRIB
:
9472 printf("PopAttrib\n");
9474 case OPCODE_POP_MATRIX
:
9475 printf("PopMatrix\n");
9477 case OPCODE_POP_NAME
:
9478 printf("PopName\n");
9480 case OPCODE_PUSH_ATTRIB
:
9481 printf("PushAttrib %x\n", n
[1].bf
);
9483 case OPCODE_PUSH_MATRIX
:
9484 printf("PushMatrix\n");
9486 case OPCODE_PUSH_NAME
:
9487 printf("PushName %d\n", (int) n
[1].ui
);
9489 case OPCODE_RASTER_POS
:
9490 printf("RasterPos %g %g %g %g\n",
9491 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9494 printf("Rotate %g %g %g %g\n",
9495 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9498 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9500 case OPCODE_TRANSLATE
:
9501 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9503 case OPCODE_BIND_TEXTURE
:
9504 printf("BindTexture %s %d\n",
9505 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9507 case OPCODE_SHADE_MODEL
:
9508 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9511 printf("Map1 %s %.3f %.3f %d %d\n",
9512 _mesa_lookup_enum_by_nr(n
[1].ui
),
9513 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9516 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9517 _mesa_lookup_enum_by_nr(n
[1].ui
),
9518 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9519 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9521 case OPCODE_MAPGRID1
:
9522 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9524 case OPCODE_MAPGRID2
:
9525 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9526 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9528 case OPCODE_EVALMESH1
:
9529 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9531 case OPCODE_EVALMESH2
:
9532 printf("EvalMesh2 %d %d %d %d\n",
9533 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9536 case OPCODE_ATTR_1F_NV
:
9537 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9539 case OPCODE_ATTR_2F_NV
:
9540 printf("ATTR_2F_NV attr %d: %f %f\n",
9541 n
[1].i
, n
[2].f
, n
[3].f
);
9543 case OPCODE_ATTR_3F_NV
:
9544 printf("ATTR_3F_NV attr %d: %f %f %f\n",
9545 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9547 case OPCODE_ATTR_4F_NV
:
9548 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9549 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9551 case OPCODE_ATTR_1F_ARB
:
9552 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9554 case OPCODE_ATTR_2F_ARB
:
9555 printf("ATTR_2F_ARB attr %d: %f %f\n",
9556 n
[1].i
, n
[2].f
, n
[3].f
);
9558 case OPCODE_ATTR_3F_ARB
:
9559 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9560 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9562 case OPCODE_ATTR_4F_ARB
:
9563 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9564 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9567 case OPCODE_MATERIAL
:
9568 printf("MATERIAL %x %x: %f %f %f %f\n",
9569 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9572 printf("BEGIN %x\n", n
[1].i
);
9578 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9581 case OPCODE_EVAL_C1
:
9582 printf("EVAL_C1 %f\n", n
[1].f
);
9584 case OPCODE_EVAL_C2
:
9585 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9587 case OPCODE_EVAL_P1
:
9588 printf("EVAL_P1 %d\n", n
[1].i
);
9590 case OPCODE_EVAL_P2
:
9591 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9594 case OPCODE_PROVOKING_VERTEX
:
9595 printf("ProvokingVertex %s\n",
9596 _mesa_lookup_enum_by_nr(n
[1].ui
));
9600 * meta opcodes/commands
9603 printf("Error: %s %s\n",
9604 enum_string(n
[1].e
), (const char *) n
[2].data
);
9606 case OPCODE_CONTINUE
:
9607 printf("DISPLAY-LIST-CONTINUE\n");
9608 n
= (Node
*) n
[1].next
;
9610 case OPCODE_END_OF_LIST
:
9611 printf("END-LIST %u\n", list
);
9615 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9617 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9618 opcode
, (void *) n
);
9622 printf("command %d, %u operands\n", opcode
,
9626 /* increment n to point to next compiled command */
9627 if (opcode
!= OPCODE_CONTINUE
) {
9628 n
+= InstSize
[opcode
];
9637 * Clients may call this function to help debug display list problems.
9638 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9639 * changed, or break in the future without notice.
9642 mesa_print_display_list(GLuint list
)
9644 GET_CURRENT_CONTEXT(ctx
);
9645 print_list(ctx
, list
);
9649 /**********************************************************************/
9650 /***** Initialization *****/
9651 /**********************************************************************/
9654 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9656 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9658 vfmt
->Begin
= save_Begin
;
9660 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9662 vfmt
->Color3f
= save_Color3f
;
9663 vfmt
->Color3fv
= save_Color3fv
;
9664 vfmt
->Color4f
= save_Color4f
;
9665 vfmt
->Color4fv
= save_Color4fv
;
9666 vfmt
->EdgeFlag
= save_EdgeFlag
;
9667 vfmt
->End
= save_End
;
9669 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9671 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9672 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9673 vfmt
->Indexf
= save_Indexf
;
9674 vfmt
->Indexfv
= save_Indexfv
;
9675 vfmt
->Materialfv
= save_Materialfv
;
9676 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9677 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9678 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9679 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9680 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9681 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9682 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9683 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9684 vfmt
->Normal3f
= save_Normal3f
;
9685 vfmt
->Normal3fv
= save_Normal3fv
;
9686 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9687 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9688 vfmt
->TexCoord1f
= save_TexCoord1f
;
9689 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9690 vfmt
->TexCoord2f
= save_TexCoord2f
;
9691 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9692 vfmt
->TexCoord3f
= save_TexCoord3f
;
9693 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9694 vfmt
->TexCoord4f
= save_TexCoord4f
;
9695 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9696 vfmt
->Vertex2f
= save_Vertex2f
;
9697 vfmt
->Vertex2fv
= save_Vertex2fv
;
9698 vfmt
->Vertex3f
= save_Vertex3f
;
9699 vfmt
->Vertex3fv
= save_Vertex3fv
;
9700 vfmt
->Vertex4f
= save_Vertex4f
;
9701 vfmt
->Vertex4fv
= save_Vertex4fv
;
9702 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9703 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9704 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9705 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9706 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9707 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9708 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9709 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9710 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9711 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9712 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9713 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9714 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9715 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9716 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9717 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9719 vfmt
->Rectf
= save_Rectf
;
9721 /* The driver is required to implement these as
9722 * 1) They can probably do a better job.
9723 * 2) A lot of new mechanisms would have to be added to this module
9724 * to support it. That code would probably never get used,
9728 vfmt
->DrawArrays
= 0;
9729 vfmt
->DrawElements
= 0;
9730 vfmt
->DrawRangeElements
= 0;
9731 vfmt
->MultiDrawElemementsEXT
= 0;
9732 vfmt
->DrawElementsBaseVertex
= 0;
9733 vfmt
->DrawRangeElementsBaseVertex
= 0;
9734 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9740 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9741 const GLvertexformat
*vfmt
)
9743 SET_CallList(disp
, vfmt
->CallList
);
9744 SET_CallLists(disp
, vfmt
->CallLists
);
9748 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9750 SET_CallList(disp
, _mesa_CallList
);
9751 SET_CallLists(disp
, _mesa_CallLists
);
9753 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9754 SET_EndList(disp
, _mesa_EndList
);
9755 SET_GenLists(disp
, _mesa_GenLists
);
9756 SET_IsList(disp
, _mesa_IsList
);
9757 SET_ListBase(disp
, _mesa_ListBase
);
9758 SET_NewList(disp
, _mesa_NewList
);
9762 #endif /* FEATURE_dlist */
9766 * Initialize display list state for given context.
9769 _mesa_init_display_list(GLcontext
*ctx
)
9771 static GLboolean tableInitialized
= GL_FALSE
;
9773 /* zero-out the instruction size table, just once */
9774 if (!tableInitialized
) {
9775 memset(InstSize
, 0, sizeof(InstSize
));
9776 tableInitialized
= GL_TRUE
;
9779 /* extension info */
9780 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9783 ctx
->ListState
.CallDepth
= 0;
9784 ctx
->ExecuteFlag
= GL_TRUE
;
9785 ctx
->CompileFlag
= GL_FALSE
;
9786 ctx
->ListState
.CurrentBlock
= NULL
;
9787 ctx
->ListState
.CurrentPos
= 0;
9789 /* Display List group */
9790 ctx
->List
.ListBase
= 0;
9793 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9799 _mesa_free_display_list_data(GLcontext
*ctx
)
9802 ctx
->ListExt
= NULL
;