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"
37 #if FEATURE_ATI_fragment_shader
38 #include "atifragshader.h"
41 #include "mfeatures.h"
42 #if FEATURE_ARB_vertex_buffer_object
43 #include "bufferobj.h"
50 #include "framebuffer.h"
51 #include "glapi/glapi.h"
61 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
62 #include "arbprogram.h"
64 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
65 #include "nvprogram.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
,
384 /* GL_EXT_framebuffer_blit */
385 OPCODE_BLIT_FRAMEBUFFER
,
387 /* Vertex attributes -- fallback for when optimized display
388 * list build isn't active.
407 /* GL_EXT_provoking_vertex */
408 OPCODE_PROVOKING_VERTEX
,
410 /* GL_EXT_transform_feedback */
411 OPCODE_BEGIN_TRANSFORM_FEEDBACK
,
412 OPCODE_END_TRANSFORM_FEEDBACK
,
414 /* The following three are meta instructions */
415 OPCODE_ERROR
, /* raise compiled-in error */
426 * Display list instructions are stored as sequences of "nodes". Nodes
427 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
428 * are linked together with a pointer.
430 * Each instruction in the display list is stored as a sequence of
431 * contiguous nodes in memory.
432 * Each node is the union of a variety of data types.
447 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
451 typedef union gl_dlist_node Node
;
455 * How many nodes to allocate at a time.
457 * \note Reduced now that we hold vertices etc. elsewhere.
459 #define BLOCK_SIZE 256
464 * Number of nodes of storage needed for each instruction.
465 * Sizes for dynamically allocated opcodes are stored in the context struct.
467 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
473 void mesa_print_display_list(GLuint list
);
476 /**********************************************************************/
477 /***** Private *****/
478 /**********************************************************************/
482 * Make an empty display list. This is used by glGenLists() to
483 * reserve display list IDs.
485 static struct gl_display_list
*
486 make_list(GLuint name
, GLuint count
)
488 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
490 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
491 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
497 * Lookup function to just encapsulate casting.
499 static INLINE
struct gl_display_list
*
500 lookup_list(GLcontext
*ctx
, GLuint list
)
502 return (struct gl_display_list
*)
503 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
507 /** Is the given opcode an extension code? */
508 static INLINE GLboolean
509 is_ext_opcode(OpCode opcode
)
511 return (opcode
>= OPCODE_EXT_0
);
515 /** Destroy an extended opcode instruction */
517 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
519 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
521 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
522 step
= ctx
->ListExt
->Opcode
[i
].Size
;
527 /** Execute an extended opcode instruction */
529 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
531 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
533 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
534 step
= ctx
->ListExt
->Opcode
[i
].Size
;
539 /** Print an extended opcode instruction */
541 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
543 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
545 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
546 step
= ctx
->ListExt
->Opcode
[i
].Size
;
552 * Delete the named display list, but don't remove from hash table.
553 * \param dlist - display list pointer
556 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
561 n
= block
= dlist
->Head
;
563 done
= block
? GL_FALSE
: GL_TRUE
;
565 const OpCode opcode
= n
[0].opcode
;
567 /* check for extension opcodes first */
568 if (is_ext_opcode(opcode
)) {
569 n
+= ext_opcode_destroy(ctx
, n
);
573 /* for some commands, we need to free malloc'd memory */
576 n
+= InstSize
[n
[0].opcode
];
580 n
+= InstSize
[n
[0].opcode
];
582 case OPCODE_DRAW_PIXELS
:
584 n
+= InstSize
[n
[0].opcode
];
588 n
+= InstSize
[n
[0].opcode
];
590 case OPCODE_COLOR_TABLE
:
592 n
+= InstSize
[n
[0].opcode
];
594 case OPCODE_COLOR_SUB_TABLE
:
596 n
+= InstSize
[n
[0].opcode
];
598 case OPCODE_CONVOLUTION_FILTER_1D
:
600 n
+= InstSize
[n
[0].opcode
];
602 case OPCODE_CONVOLUTION_FILTER_2D
:
604 n
+= InstSize
[n
[0].opcode
];
606 case OPCODE_POLYGON_STIPPLE
:
608 n
+= InstSize
[n
[0].opcode
];
610 case OPCODE_TEX_IMAGE1D
:
612 n
+= InstSize
[n
[0].opcode
];
614 case OPCODE_TEX_IMAGE2D
:
616 n
+= InstSize
[n
[0].opcode
];
618 case OPCODE_TEX_IMAGE3D
:
620 n
+= InstSize
[n
[0].opcode
];
622 case OPCODE_TEX_SUB_IMAGE1D
:
624 n
+= InstSize
[n
[0].opcode
];
626 case OPCODE_TEX_SUB_IMAGE2D
:
628 n
+= InstSize
[n
[0].opcode
];
630 case OPCODE_TEX_SUB_IMAGE3D
:
632 n
+= InstSize
[n
[0].opcode
];
634 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
636 n
+= InstSize
[n
[0].opcode
];
638 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
640 n
+= InstSize
[n
[0].opcode
];
642 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
644 n
+= InstSize
[n
[0].opcode
];
646 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
648 n
+= InstSize
[n
[0].opcode
];
650 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
652 n
+= InstSize
[n
[0].opcode
];
654 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
656 n
+= InstSize
[n
[0].opcode
];
658 #if FEATURE_NV_vertex_program
659 case OPCODE_LOAD_PROGRAM_NV
:
660 free(n
[4].data
); /* program string */
661 n
+= InstSize
[n
[0].opcode
];
663 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
664 free(n
[2].data
); /* array of program ids */
665 n
+= InstSize
[n
[0].opcode
];
668 #if FEATURE_NV_fragment_program
669 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
670 free(n
[3].data
); /* parameter name */
671 n
+= InstSize
[n
[0].opcode
];
674 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
675 case OPCODE_PROGRAM_STRING_ARB
:
676 free(n
[4].data
); /* program string */
677 n
+= InstSize
[n
[0].opcode
];
680 case OPCODE_UNIFORM_1FV
:
681 case OPCODE_UNIFORM_2FV
:
682 case OPCODE_UNIFORM_3FV
:
683 case OPCODE_UNIFORM_4FV
:
684 case OPCODE_UNIFORM_1IV
:
685 case OPCODE_UNIFORM_2IV
:
686 case OPCODE_UNIFORM_3IV
:
687 case OPCODE_UNIFORM_4IV
:
688 case OPCODE_UNIFORM_1UIV
:
689 case OPCODE_UNIFORM_2UIV
:
690 case OPCODE_UNIFORM_3UIV
:
691 case OPCODE_UNIFORM_4UIV
:
693 n
+= InstSize
[n
[0].opcode
];
695 case OPCODE_UNIFORM_MATRIX22
:
696 case OPCODE_UNIFORM_MATRIX33
:
697 case OPCODE_UNIFORM_MATRIX44
:
698 case OPCODE_UNIFORM_MATRIX24
:
699 case OPCODE_UNIFORM_MATRIX42
:
700 case OPCODE_UNIFORM_MATRIX23
:
701 case OPCODE_UNIFORM_MATRIX32
:
702 case OPCODE_UNIFORM_MATRIX34
:
703 case OPCODE_UNIFORM_MATRIX43
:
705 n
+= InstSize
[n
[0].opcode
];
708 case OPCODE_CONTINUE
:
709 n
= (Node
*) n
[1].next
;
713 case OPCODE_END_OF_LIST
:
718 /* Most frequent case */
719 n
+= InstSize
[n
[0].opcode
];
730 * Destroy a display list and remove from hash table.
731 * \param list - display list number
734 destroy_list(GLcontext
*ctx
, GLuint list
)
736 struct gl_display_list
*dlist
;
741 dlist
= lookup_list(ctx
, list
);
745 _mesa_delete_list(ctx
, dlist
);
746 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
751 * Translate the nth element of list from <type> to GLint.
754 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
766 bptr
= (GLbyte
*) list
;
767 return (GLint
) bptr
[n
];
768 case GL_UNSIGNED_BYTE
:
769 ubptr
= (GLubyte
*) list
;
770 return (GLint
) ubptr
[n
];
772 sptr
= (GLshort
*) list
;
773 return (GLint
) sptr
[n
];
774 case GL_UNSIGNED_SHORT
:
775 usptr
= (GLushort
*) list
;
776 return (GLint
) usptr
[n
];
778 iptr
= (GLint
*) list
;
780 case GL_UNSIGNED_INT
:
781 uiptr
= (GLuint
*) list
;
782 return (GLint
) uiptr
[n
];
784 fptr
= (GLfloat
*) list
;
785 return (GLint
) FLOORF(fptr
[n
]);
787 ubptr
= ((GLubyte
*) list
) + 2 * n
;
788 return (GLint
) ubptr
[0] * 256
791 ubptr
= ((GLubyte
*) list
) + 3 * n
;
792 return (GLint
) ubptr
[0] * 65536
793 + (GLint
) ubptr
[1] * 256
796 ubptr
= ((GLubyte
*) list
) + 4 * n
;
797 return (GLint
) ubptr
[0] * 16777216
798 + (GLint
) ubptr
[1] * 65536
799 + (GLint
) ubptr
[2] * 256
809 /**********************************************************************/
811 /**********************************************************************/
814 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
815 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
818 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
819 GLsizei width
, GLsizei height
, GLsizei depth
,
820 GLenum format
, GLenum type
, const GLvoid
* pixels
,
821 const struct gl_pixelstore_attrib
*unpack
)
823 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
825 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
826 format
, type
, pixels
, unpack
);
827 if (pixels
&& !image
) {
828 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
832 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
833 format
, type
, pixels
)) {
834 const GLubyte
*map
, *src
;
838 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
839 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
841 /* unable to map src buffer! */
842 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
846 src
= ADD_POINTERS(map
, pixels
);
847 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
848 format
, type
, src
, unpack
);
850 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
854 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
864 * Allocate space for a display list instruction (opcode + payload space).
865 * \param opcode the instruction opcode (OPCODE_* value)
866 * \param bytes instruction payload size (not counting opcode)
867 * \return pointer to allocated memory (the opcode space)
870 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
872 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
875 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
876 if (InstSize
[opcode
] == 0) {
877 /* save instruction size now */
878 InstSize
[opcode
] = numNodes
;
881 /* make sure instruction size agrees */
882 ASSERT(numNodes
== InstSize
[opcode
]);
886 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
887 /* This block is full. Allocate a new block and chain to it */
889 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
890 n
[0].opcode
= OPCODE_CONTINUE
;
891 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
893 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
896 n
[1].next
= (Node
*) newblock
;
897 ctx
->ListState
.CurrentBlock
= newblock
;
898 ctx
->ListState
.CurrentPos
= 0;
901 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
902 ctx
->ListState
.CurrentPos
+= numNodes
;
904 n
[0].opcode
= opcode
;
912 * Allocate space for a display list instruction. Used by callers outside
913 * this file for things like VBO vertex data.
915 * \param opcode the instruction opcode (OPCODE_* value)
916 * \param bytes instruction size in bytes, not counting opcode.
917 * \return pointer to the usable data area (not including the internal
921 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
923 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
925 return n
+ 1; /* return pointer to payload area, after opcode */
932 * This function allows modules and drivers to get their own opcodes
933 * for extending display list functionality.
934 * \param ctx the rendering context
935 * \param size number of bytes for storing the new display list command
936 * \param execute function to execute the new display list command
937 * \param destroy function to destroy the new display list command
938 * \param print function to print the new display list command
939 * \return the new opcode number or -1 if error
942 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
944 void (*execute
) (GLcontext
*, void *),
945 void (*destroy
) (GLcontext
*, void *),
946 void (*print
) (GLcontext
*, void *))
948 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
949 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
950 ctx
->ListExt
->Opcode
[i
].Size
=
951 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
952 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
953 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
954 ctx
->ListExt
->Opcode
[i
].Print
= print
;
955 return i
+ OPCODE_EXT_0
;
962 * Allocate space for a display list instruction. The space is basically
963 * an array of Nodes where node[0] holds the opcode, node[1] is the first
964 * function parameter, node[2] is the second parameter, etc.
966 * \param opcode one of OPCODE_x
967 * \param nparams number of function parameters
968 * \return pointer to start of instruction space
971 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
973 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
979 * Display List compilation functions
981 static void GLAPIENTRY
982 save_Accum(GLenum op
, GLfloat value
)
984 GET_CURRENT_CONTEXT(ctx
);
986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
987 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
992 if (ctx
->ExecuteFlag
) {
993 CALL_Accum(ctx
->Exec
, (op
, value
));
998 static void GLAPIENTRY
999 save_AlphaFunc(GLenum func
, GLclampf ref
)
1001 GET_CURRENT_CONTEXT(ctx
);
1003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1004 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1007 n
[2].f
= (GLfloat
) ref
;
1009 if (ctx
->ExecuteFlag
) {
1010 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1015 static void GLAPIENTRY
1016 save_BindTexture(GLenum target
, GLuint texture
)
1018 GET_CURRENT_CONTEXT(ctx
);
1020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1021 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1026 if (ctx
->ExecuteFlag
) {
1027 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1032 static void GLAPIENTRY
1033 save_Bitmap(GLsizei width
, GLsizei height
,
1034 GLfloat xorig
, GLfloat yorig
,
1035 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1037 GET_CURRENT_CONTEXT(ctx
);
1039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1040 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1042 n
[1].i
= (GLint
) width
;
1043 n
[2].i
= (GLint
) height
;
1048 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1050 if (ctx
->ExecuteFlag
) {
1051 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1052 xorig
, yorig
, xmove
, ymove
, pixels
));
1057 static void GLAPIENTRY
1058 save_BlendEquation(GLenum mode
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1067 if (ctx
->ExecuteFlag
) {
1068 CALL_BlendEquation(ctx
->Exec
, (mode
));
1073 static void GLAPIENTRY
1074 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1076 GET_CURRENT_CONTEXT(ctx
);
1078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1079 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1084 if (ctx
->ExecuteFlag
) {
1085 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1090 static void GLAPIENTRY
1091 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1092 GLenum sfactorA
, GLenum dfactorA
)
1094 GET_CURRENT_CONTEXT(ctx
);
1096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1097 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1099 n
[1].e
= sfactorRGB
;
1100 n
[2].e
= dfactorRGB
;
1104 if (ctx
->ExecuteFlag
) {
1105 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1106 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1111 static void GLAPIENTRY
1112 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1114 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1118 static void GLAPIENTRY
1119 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1121 GET_CURRENT_CONTEXT(ctx
);
1123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1124 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1131 if (ctx
->ExecuteFlag
) {
1132 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1136 static void invalidate_saved_current_state( GLcontext
*ctx
)
1140 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1141 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1143 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1144 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1146 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1148 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1151 static void GLAPIENTRY
1152 save_CallList(GLuint list
)
1154 GET_CURRENT_CONTEXT(ctx
);
1156 SAVE_FLUSH_VERTICES(ctx
);
1158 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1163 /* After this, we don't know what state we're in. Invalidate all
1164 * cached information previously gathered:
1166 invalidate_saved_current_state( ctx
);
1168 if (ctx
->ExecuteFlag
) {
1169 _mesa_CallList(list
);
1174 static void GLAPIENTRY
1175 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1177 GET_CURRENT_CONTEXT(ctx
);
1179 GLboolean typeErrorFlag
;
1181 SAVE_FLUSH_VERTICES(ctx
);
1185 case GL_UNSIGNED_BYTE
:
1187 case GL_UNSIGNED_SHORT
:
1189 case GL_UNSIGNED_INT
:
1194 typeErrorFlag
= GL_FALSE
;
1197 typeErrorFlag
= GL_TRUE
;
1200 for (i
= 0; i
< num
; i
++) {
1201 GLint list
= translate_id(i
, type
, lists
);
1202 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1205 n
[2].b
= typeErrorFlag
;
1209 /* After this, we don't know what state we're in. Invalidate all
1210 * cached information previously gathered:
1212 invalidate_saved_current_state( ctx
);
1214 if (ctx
->ExecuteFlag
) {
1215 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1220 static void GLAPIENTRY
1221 save_Clear(GLbitfield mask
)
1223 GET_CURRENT_CONTEXT(ctx
);
1225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1226 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1230 if (ctx
->ExecuteFlag
) {
1231 CALL_Clear(ctx
->Exec
, (mask
));
1236 static void GLAPIENTRY
1237 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1239 GET_CURRENT_CONTEXT(ctx
);
1241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1242 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1245 n
[2].i
= drawbuffer
;
1247 if (buffer
== GL_COLOR
) {
1258 if (ctx
->ExecuteFlag
) {
1259 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1264 static void GLAPIENTRY
1265 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1267 GET_CURRENT_CONTEXT(ctx
);
1269 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1270 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1273 n
[2].i
= drawbuffer
;
1275 if (buffer
== GL_COLOR
) {
1286 if (ctx
->ExecuteFlag
) {
1287 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1292 static void GLAPIENTRY
1293 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1295 GET_CURRENT_CONTEXT(ctx
);
1297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1298 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1301 n
[2].i
= drawbuffer
;
1303 if (buffer
== GL_COLOR
) {
1314 if (ctx
->ExecuteFlag
) {
1315 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1320 static void GLAPIENTRY
1321 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1322 GLfloat depth
, GLint stencil
)
1324 GET_CURRENT_CONTEXT(ctx
);
1326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1327 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1330 n
[2].i
= drawbuffer
;
1334 if (ctx
->ExecuteFlag
) {
1335 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1340 static void GLAPIENTRY
1341 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1343 GET_CURRENT_CONTEXT(ctx
);
1345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1346 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1353 if (ctx
->ExecuteFlag
) {
1354 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1359 static void GLAPIENTRY
1360 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1362 GET_CURRENT_CONTEXT(ctx
);
1364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1365 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1372 if (ctx
->ExecuteFlag
) {
1373 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1378 static void GLAPIENTRY
1379 save_ClearDepth(GLclampd depth
)
1381 GET_CURRENT_CONTEXT(ctx
);
1383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1384 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1386 n
[1].f
= (GLfloat
) depth
;
1388 if (ctx
->ExecuteFlag
) {
1389 CALL_ClearDepth(ctx
->Exec
, (depth
));
1394 static void GLAPIENTRY
1395 save_ClearIndex(GLfloat c
)
1397 GET_CURRENT_CONTEXT(ctx
);
1399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1400 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1404 if (ctx
->ExecuteFlag
) {
1405 CALL_ClearIndex(ctx
->Exec
, (c
));
1410 static void GLAPIENTRY
1411 save_ClearStencil(GLint s
)
1413 GET_CURRENT_CONTEXT(ctx
);
1415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1416 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1420 if (ctx
->ExecuteFlag
) {
1421 CALL_ClearStencil(ctx
->Exec
, (s
));
1426 static void GLAPIENTRY
1427 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1429 GET_CURRENT_CONTEXT(ctx
);
1431 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1432 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1435 n
[2].f
= (GLfloat
) equ
[0];
1436 n
[3].f
= (GLfloat
) equ
[1];
1437 n
[4].f
= (GLfloat
) equ
[2];
1438 n
[5].f
= (GLfloat
) equ
[3];
1440 if (ctx
->ExecuteFlag
) {
1441 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1447 static void GLAPIENTRY
1448 save_ColorMask(GLboolean red
, GLboolean green
,
1449 GLboolean blue
, GLboolean alpha
)
1451 GET_CURRENT_CONTEXT(ctx
);
1453 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1454 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1461 if (ctx
->ExecuteFlag
) {
1462 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1467 static void GLAPIENTRY
1468 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1469 GLboolean blue
, GLboolean alpha
)
1471 GET_CURRENT_CONTEXT(ctx
);
1473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1474 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1482 if (ctx
->ExecuteFlag
) {
1483 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1488 static void GLAPIENTRY
1489 save_ColorMaterial(GLenum face
, GLenum mode
)
1491 GET_CURRENT_CONTEXT(ctx
);
1493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1495 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1500 if (ctx
->ExecuteFlag
) {
1501 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1506 static void GLAPIENTRY
1507 save_ColorTable(GLenum target
, GLenum internalFormat
,
1508 GLsizei width
, GLenum format
, GLenum type
,
1509 const GLvoid
* table
)
1511 GET_CURRENT_CONTEXT(ctx
);
1512 if (_mesa_is_proxy_texture(target
)) {
1513 /* execute immediately */
1514 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1515 format
, type
, table
));
1519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1520 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1523 n
[2].e
= internalFormat
;
1527 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1530 if (ctx
->ExecuteFlag
) {
1531 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1532 format
, type
, table
));
1539 static void GLAPIENTRY
1540 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1541 const GLfloat
*params
)
1543 GET_CURRENT_CONTEXT(ctx
);
1546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1548 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1553 if (pname
== GL_COLOR_TABLE_SGI
||
1554 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1555 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1556 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1563 if (ctx
->ExecuteFlag
) {
1564 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1569 static void GLAPIENTRY
1570 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1572 GET_CURRENT_CONTEXT(ctx
);
1575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1577 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1582 if (pname
== GL_COLOR_TABLE_SGI
||
1583 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1584 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1585 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1592 if (ctx
->ExecuteFlag
) {
1593 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1599 static void GLAPIENTRY
1600 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1601 GLenum format
, GLenum type
, const GLvoid
* table
)
1603 GET_CURRENT_CONTEXT(ctx
);
1605 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1606 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1613 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1616 if (ctx
->ExecuteFlag
) {
1617 CALL_ColorSubTable(ctx
->Exec
,
1618 (target
, start
, count
, format
, type
, table
));
1623 static void GLAPIENTRY
1624 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1625 GLint x
, GLint y
, GLsizei width
)
1627 GET_CURRENT_CONTEXT(ctx
);
1630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1631 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1639 if (ctx
->ExecuteFlag
) {
1640 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1645 static void GLAPIENTRY
1646 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1647 GLint x
, GLint y
, GLsizei width
)
1649 GET_CURRENT_CONTEXT(ctx
);
1652 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1653 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1656 n
[2].e
= internalformat
;
1661 if (ctx
->ExecuteFlag
) {
1662 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1667 static void GLAPIENTRY
1668 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1669 GLenum format
, GLenum type
, const GLvoid
* filter
)
1671 GET_CURRENT_CONTEXT(ctx
);
1674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1676 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1679 n
[2].e
= internalFormat
;
1683 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1686 if (ctx
->ExecuteFlag
) {
1687 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1688 format
, type
, filter
));
1693 static void GLAPIENTRY
1694 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1695 GLsizei width
, GLsizei height
, GLenum format
,
1696 GLenum type
, const GLvoid
* filter
)
1698 GET_CURRENT_CONTEXT(ctx
);
1701 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1703 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1706 n
[2].e
= internalFormat
;
1711 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1714 if (ctx
->ExecuteFlag
) {
1715 CALL_ConvolutionFilter2D(ctx
->Exec
,
1716 (target
, internalFormat
, width
, height
, format
,
1722 static void GLAPIENTRY
1723 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1725 GET_CURRENT_CONTEXT(ctx
);
1727 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1728 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1734 if (ctx
->ExecuteFlag
) {
1735 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1740 static void GLAPIENTRY
1741 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1743 GET_CURRENT_CONTEXT(ctx
);
1745 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1746 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1751 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1752 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1753 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1759 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1762 if (ctx
->ExecuteFlag
) {
1763 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1768 static void GLAPIENTRY
1769 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1780 if (ctx
->ExecuteFlag
) {
1781 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1786 static void GLAPIENTRY
1787 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1788 const GLfloat
*params
)
1790 GET_CURRENT_CONTEXT(ctx
);
1792 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1793 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1798 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1799 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1800 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1806 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1809 if (ctx
->ExecuteFlag
) {
1810 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1815 static void GLAPIENTRY
1816 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1818 GET_CURRENT_CONTEXT(ctx
);
1820 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1821 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1825 n
[3].i
= (GLint
) width
;
1826 n
[4].i
= (GLint
) height
;
1829 if (ctx
->ExecuteFlag
) {
1830 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1836 static void GLAPIENTRY
1837 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1838 GLint x
, GLint y
, GLsizei width
, GLint border
)
1840 GET_CURRENT_CONTEXT(ctx
);
1842 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1843 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1847 n
[3].e
= internalformat
;
1853 if (ctx
->ExecuteFlag
) {
1854 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1855 x
, y
, width
, border
));
1860 static void GLAPIENTRY
1861 save_CopyTexImage2D(GLenum target
, GLint level
,
1862 GLenum internalformat
,
1863 GLint x
, GLint y
, GLsizei width
,
1864 GLsizei height
, GLint border
)
1866 GET_CURRENT_CONTEXT(ctx
);
1868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1869 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1873 n
[3].e
= internalformat
;
1880 if (ctx
->ExecuteFlag
) {
1881 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1882 x
, y
, width
, height
, border
));
1888 static void GLAPIENTRY
1889 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1890 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1892 GET_CURRENT_CONTEXT(ctx
);
1894 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1895 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1904 if (ctx
->ExecuteFlag
) {
1905 CALL_CopyTexSubImage1D(ctx
->Exec
,
1906 (target
, level
, xoffset
, x
, y
, width
));
1911 static void GLAPIENTRY
1912 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1913 GLint xoffset
, GLint yoffset
,
1914 GLint x
, GLint y
, GLsizei width
, GLint height
)
1916 GET_CURRENT_CONTEXT(ctx
);
1918 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1919 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1930 if (ctx
->ExecuteFlag
) {
1931 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1932 x
, y
, width
, height
));
1937 static void GLAPIENTRY
1938 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1939 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1940 GLint x
, GLint y
, GLsizei width
, GLint height
)
1942 GET_CURRENT_CONTEXT(ctx
);
1944 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1945 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1957 if (ctx
->ExecuteFlag
) {
1958 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1959 xoffset
, yoffset
, zoffset
,
1960 x
, y
, width
, height
));
1965 static void GLAPIENTRY
1966 save_CullFace(GLenum mode
)
1968 GET_CURRENT_CONTEXT(ctx
);
1970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1971 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1975 if (ctx
->ExecuteFlag
) {
1976 CALL_CullFace(ctx
->Exec
, (mode
));
1981 static void GLAPIENTRY
1982 save_DepthFunc(GLenum func
)
1984 GET_CURRENT_CONTEXT(ctx
);
1986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1987 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1991 if (ctx
->ExecuteFlag
) {
1992 CALL_DepthFunc(ctx
->Exec
, (func
));
1997 static void GLAPIENTRY
1998 save_DepthMask(GLboolean mask
)
2000 GET_CURRENT_CONTEXT(ctx
);
2002 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2003 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2007 if (ctx
->ExecuteFlag
) {
2008 CALL_DepthMask(ctx
->Exec
, (mask
));
2013 static void GLAPIENTRY
2014 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2016 GET_CURRENT_CONTEXT(ctx
);
2018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2019 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2021 n
[1].f
= (GLfloat
) nearval
;
2022 n
[2].f
= (GLfloat
) farval
;
2024 if (ctx
->ExecuteFlag
) {
2025 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2030 static void GLAPIENTRY
2031 save_Disable(GLenum cap
)
2033 GET_CURRENT_CONTEXT(ctx
);
2035 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2036 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2040 if (ctx
->ExecuteFlag
) {
2041 CALL_Disable(ctx
->Exec
, (cap
));
2046 static void GLAPIENTRY
2047 save_DisableIndexed(GLuint index
, GLenum cap
)
2049 GET_CURRENT_CONTEXT(ctx
);
2051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2052 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2057 if (ctx
->ExecuteFlag
) {
2058 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2063 static void GLAPIENTRY
2064 save_DrawBuffer(GLenum mode
)
2066 GET_CURRENT_CONTEXT(ctx
);
2068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2069 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2073 if (ctx
->ExecuteFlag
) {
2074 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2079 static void GLAPIENTRY
2080 save_DrawPixels(GLsizei width
, GLsizei height
,
2081 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2083 GET_CURRENT_CONTEXT(ctx
);
2086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2088 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2094 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2095 pixels
, &ctx
->Unpack
);
2097 if (ctx
->ExecuteFlag
) {
2098 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2104 static void GLAPIENTRY
2105 save_Enable(GLenum cap
)
2107 GET_CURRENT_CONTEXT(ctx
);
2109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2110 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2114 if (ctx
->ExecuteFlag
) {
2115 CALL_Enable(ctx
->Exec
, (cap
));
2121 static void GLAPIENTRY
2122 save_EnableIndexed(GLuint index
, GLenum cap
)
2124 GET_CURRENT_CONTEXT(ctx
);
2126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2127 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2132 if (ctx
->ExecuteFlag
) {
2133 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2139 static void GLAPIENTRY
2140 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2142 GET_CURRENT_CONTEXT(ctx
);
2144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2145 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2151 if (ctx
->ExecuteFlag
) {
2152 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2157 static void GLAPIENTRY
2158 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2160 GET_CURRENT_CONTEXT(ctx
);
2162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2163 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2171 if (ctx
->ExecuteFlag
) {
2172 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2179 static void GLAPIENTRY
2180 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2182 GET_CURRENT_CONTEXT(ctx
);
2184 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2185 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2193 if (ctx
->ExecuteFlag
) {
2194 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2199 static void GLAPIENTRY
2200 save_Fogf(GLenum pname
, GLfloat param
)
2204 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2205 save_Fogfv(pname
, parray
);
2209 static void GLAPIENTRY
2210 save_Fogiv(GLenum pname
, const GLint
*params
)
2215 case GL_FOG_DENSITY
:
2219 p
[0] = (GLfloat
) *params
;
2225 p
[0] = INT_TO_FLOAT(params
[0]);
2226 p
[1] = INT_TO_FLOAT(params
[1]);
2227 p
[2] = INT_TO_FLOAT(params
[2]);
2228 p
[3] = INT_TO_FLOAT(params
[3]);
2231 /* Error will be caught later in gl_Fogfv */
2232 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2234 save_Fogfv(pname
, p
);
2238 static void GLAPIENTRY
2239 save_Fogi(GLenum pname
, GLint param
)
2243 parray
[1] = parray
[2] = parray
[3] = 0;
2244 save_Fogiv(pname
, parray
);
2248 static void GLAPIENTRY
2249 save_FrontFace(GLenum mode
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2258 if (ctx
->ExecuteFlag
) {
2259 CALL_FrontFace(ctx
->Exec
, (mode
));
2264 static void GLAPIENTRY
2265 save_Frustum(GLdouble left
, GLdouble right
,
2266 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2268 GET_CURRENT_CONTEXT(ctx
);
2270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2271 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2273 n
[1].f
= (GLfloat
) left
;
2274 n
[2].f
= (GLfloat
) right
;
2275 n
[3].f
= (GLfloat
) bottom
;
2276 n
[4].f
= (GLfloat
) top
;
2277 n
[5].f
= (GLfloat
) nearval
;
2278 n
[6].f
= (GLfloat
) farval
;
2280 if (ctx
->ExecuteFlag
) {
2281 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2286 static void GLAPIENTRY
2287 save_Hint(GLenum target
, GLenum mode
)
2289 GET_CURRENT_CONTEXT(ctx
);
2291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2292 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_Hint(ctx
->Exec
, (target
, mode
));
2303 static void GLAPIENTRY
2304 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2307 GET_CURRENT_CONTEXT(ctx
);
2310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2311 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2315 n
[3].e
= internalFormat
;
2318 if (ctx
->ExecuteFlag
) {
2319 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2324 static void GLAPIENTRY
2325 save_IndexMask(GLuint mask
)
2327 GET_CURRENT_CONTEXT(ctx
);
2329 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2330 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2334 if (ctx
->ExecuteFlag
) {
2335 CALL_IndexMask(ctx
->Exec
, (mask
));
2340 static void GLAPIENTRY
2341 save_InitNames(void)
2343 GET_CURRENT_CONTEXT(ctx
);
2344 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2345 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2346 if (ctx
->ExecuteFlag
) {
2347 CALL_InitNames(ctx
->Exec
, ());
2352 static void GLAPIENTRY
2353 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2355 GET_CURRENT_CONTEXT(ctx
);
2357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2358 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2376 case GL_SPOT_DIRECTION
:
2379 case GL_SPOT_EXPONENT
:
2382 case GL_SPOT_CUTOFF
:
2385 case GL_CONSTANT_ATTENUATION
:
2388 case GL_LINEAR_ATTENUATION
:
2391 case GL_QUADRATIC_ATTENUATION
:
2397 for (i
= 0; i
< nParams
; i
++) {
2398 n
[3 + i
].f
= params
[i
];
2401 if (ctx
->ExecuteFlag
) {
2402 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2407 static void GLAPIENTRY
2408 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2412 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2413 save_Lightfv(light
, pname
, parray
);
2417 static void GLAPIENTRY
2418 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2425 fparam
[0] = INT_TO_FLOAT(params
[0]);
2426 fparam
[1] = INT_TO_FLOAT(params
[1]);
2427 fparam
[2] = INT_TO_FLOAT(params
[2]);
2428 fparam
[3] = INT_TO_FLOAT(params
[3]);
2431 fparam
[0] = (GLfloat
) params
[0];
2432 fparam
[1] = (GLfloat
) params
[1];
2433 fparam
[2] = (GLfloat
) params
[2];
2434 fparam
[3] = (GLfloat
) params
[3];
2436 case GL_SPOT_DIRECTION
:
2437 fparam
[0] = (GLfloat
) params
[0];
2438 fparam
[1] = (GLfloat
) params
[1];
2439 fparam
[2] = (GLfloat
) params
[2];
2441 case GL_SPOT_EXPONENT
:
2442 case GL_SPOT_CUTOFF
:
2443 case GL_CONSTANT_ATTENUATION
:
2444 case GL_LINEAR_ATTENUATION
:
2445 case GL_QUADRATIC_ATTENUATION
:
2446 fparam
[0] = (GLfloat
) params
[0];
2449 /* error will be caught later in gl_Lightfv */
2452 save_Lightfv(light
, pname
, fparam
);
2456 static void GLAPIENTRY
2457 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2461 parray
[1] = parray
[2] = parray
[3] = 0;
2462 save_Lightiv(light
, pname
, parray
);
2466 static void GLAPIENTRY
2467 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2469 GET_CURRENT_CONTEXT(ctx
);
2471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2472 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2480 if (ctx
->ExecuteFlag
) {
2481 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2486 static void GLAPIENTRY
2487 save_LightModelf(GLenum pname
, GLfloat param
)
2491 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2492 save_LightModelfv(pname
, parray
);
2496 static void GLAPIENTRY
2497 save_LightModeliv(GLenum pname
, const GLint
*params
)
2501 case GL_LIGHT_MODEL_AMBIENT
:
2502 fparam
[0] = INT_TO_FLOAT(params
[0]);
2503 fparam
[1] = INT_TO_FLOAT(params
[1]);
2504 fparam
[2] = INT_TO_FLOAT(params
[2]);
2505 fparam
[3] = INT_TO_FLOAT(params
[3]);
2507 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2508 case GL_LIGHT_MODEL_TWO_SIDE
:
2509 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2510 fparam
[0] = (GLfloat
) params
[0];
2516 /* Error will be caught later in gl_LightModelfv */
2517 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2519 save_LightModelfv(pname
, fparam
);
2523 static void GLAPIENTRY
2524 save_LightModeli(GLenum pname
, GLint param
)
2528 parray
[1] = parray
[2] = parray
[3] = 0;
2529 save_LightModeliv(pname
, parray
);
2533 static void GLAPIENTRY
2534 save_LineStipple(GLint factor
, GLushort pattern
)
2536 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2544 if (ctx
->ExecuteFlag
) {
2545 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2550 static void GLAPIENTRY
2551 save_LineWidth(GLfloat width
)
2553 GET_CURRENT_CONTEXT(ctx
);
2555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2556 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2560 if (ctx
->ExecuteFlag
) {
2561 CALL_LineWidth(ctx
->Exec
, (width
));
2566 static void GLAPIENTRY
2567 save_ListBase(GLuint base
)
2569 GET_CURRENT_CONTEXT(ctx
);
2571 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2572 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2576 if (ctx
->ExecuteFlag
) {
2577 CALL_ListBase(ctx
->Exec
, (base
));
2582 static void GLAPIENTRY
2583 save_LoadIdentity(void)
2585 GET_CURRENT_CONTEXT(ctx
);
2586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2587 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2588 if (ctx
->ExecuteFlag
) {
2589 CALL_LoadIdentity(ctx
->Exec
, ());
2594 static void GLAPIENTRY
2595 save_LoadMatrixf(const GLfloat
* m
)
2597 GET_CURRENT_CONTEXT(ctx
);
2599 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2600 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2603 for (i
= 0; i
< 16; i
++) {
2607 if (ctx
->ExecuteFlag
) {
2608 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2613 static void GLAPIENTRY
2614 save_LoadMatrixd(const GLdouble
* m
)
2618 for (i
= 0; i
< 16; i
++) {
2619 f
[i
] = (GLfloat
) m
[i
];
2621 save_LoadMatrixf(f
);
2625 static void GLAPIENTRY
2626 save_LoadName(GLuint name
)
2628 GET_CURRENT_CONTEXT(ctx
);
2630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2631 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2635 if (ctx
->ExecuteFlag
) {
2636 CALL_LoadName(ctx
->Exec
, (name
));
2641 static void GLAPIENTRY
2642 save_LogicOp(GLenum opcode
)
2644 GET_CURRENT_CONTEXT(ctx
);
2646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2647 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2651 if (ctx
->ExecuteFlag
) {
2652 CALL_LogicOp(ctx
->Exec
, (opcode
));
2657 static void GLAPIENTRY
2658 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2659 GLint order
, const GLdouble
* points
)
2661 GET_CURRENT_CONTEXT(ctx
);
2663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2664 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2666 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2668 n
[2].f
= (GLfloat
) u1
;
2669 n
[3].f
= (GLfloat
) u2
;
2670 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2672 n
[6].data
= (void *) pnts
;
2674 if (ctx
->ExecuteFlag
) {
2675 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2679 static void GLAPIENTRY
2680 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2681 GLint order
, const GLfloat
* points
)
2683 GET_CURRENT_CONTEXT(ctx
);
2685 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2686 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2688 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2692 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2694 n
[6].data
= (void *) pnts
;
2696 if (ctx
->ExecuteFlag
) {
2697 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2702 static void GLAPIENTRY
2703 save_Map2d(GLenum target
,
2704 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2705 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2706 const GLdouble
* points
)
2708 GET_CURRENT_CONTEXT(ctx
);
2710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2711 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2713 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2714 vstride
, vorder
, points
);
2716 n
[2].f
= (GLfloat
) u1
;
2717 n
[3].f
= (GLfloat
) u2
;
2718 n
[4].f
= (GLfloat
) v1
;
2719 n
[5].f
= (GLfloat
) v2
;
2720 /* XXX verify these strides are correct */
2721 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2722 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2725 n
[10].data
= (void *) pnts
;
2727 if (ctx
->ExecuteFlag
) {
2728 CALL_Map2d(ctx
->Exec
, (target
,
2729 u1
, u2
, ustride
, uorder
,
2730 v1
, v2
, vstride
, vorder
, points
));
2735 static void GLAPIENTRY
2736 save_Map2f(GLenum target
,
2737 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2738 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2739 const GLfloat
* points
)
2741 GET_CURRENT_CONTEXT(ctx
);
2743 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2744 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2746 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2747 vstride
, vorder
, points
);
2753 /* XXX verify these strides are correct */
2754 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2755 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2758 n
[10].data
= (void *) pnts
;
2760 if (ctx
->ExecuteFlag
) {
2761 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2762 v1
, v2
, vstride
, vorder
, points
));
2767 static void GLAPIENTRY
2768 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2770 GET_CURRENT_CONTEXT(ctx
);
2772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2773 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2779 if (ctx
->ExecuteFlag
) {
2780 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2785 static void GLAPIENTRY
2786 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2788 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2792 static void GLAPIENTRY
2793 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2794 GLint vn
, GLfloat v1
, GLfloat v2
)
2796 GET_CURRENT_CONTEXT(ctx
);
2798 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2799 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2808 if (ctx
->ExecuteFlag
) {
2809 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2815 static void GLAPIENTRY
2816 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2817 GLint vn
, GLdouble v1
, GLdouble v2
)
2819 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2820 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2824 static void GLAPIENTRY
2825 save_MatrixMode(GLenum mode
)
2827 GET_CURRENT_CONTEXT(ctx
);
2829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2830 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2834 if (ctx
->ExecuteFlag
) {
2835 CALL_MatrixMode(ctx
->Exec
, (mode
));
2840 static void GLAPIENTRY
2841 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2843 GET_CURRENT_CONTEXT(ctx
);
2846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2847 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2850 n
[2].e
= internalFormat
;
2853 if (ctx
->ExecuteFlag
) {
2854 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2859 static void GLAPIENTRY
2860 save_MultMatrixf(const GLfloat
* m
)
2862 GET_CURRENT_CONTEXT(ctx
);
2864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2865 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2868 for (i
= 0; i
< 16; i
++) {
2872 if (ctx
->ExecuteFlag
) {
2873 CALL_MultMatrixf(ctx
->Exec
, (m
));
2878 static void GLAPIENTRY
2879 save_MultMatrixd(const GLdouble
* m
)
2883 for (i
= 0; i
< 16; i
++) {
2884 f
[i
] = (GLfloat
) m
[i
];
2886 save_MultMatrixf(f
);
2890 static void GLAPIENTRY
2891 save_NewList(GLuint name
, GLenum mode
)
2893 GET_CURRENT_CONTEXT(ctx
);
2894 /* It's an error to call this function while building a display list */
2895 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2902 static void GLAPIENTRY
2903 save_Ortho(GLdouble left
, GLdouble right
,
2904 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2906 GET_CURRENT_CONTEXT(ctx
);
2908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2909 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2911 n
[1].f
= (GLfloat
) left
;
2912 n
[2].f
= (GLfloat
) right
;
2913 n
[3].f
= (GLfloat
) bottom
;
2914 n
[4].f
= (GLfloat
) top
;
2915 n
[5].f
= (GLfloat
) nearval
;
2916 n
[6].f
= (GLfloat
) farval
;
2918 if (ctx
->ExecuteFlag
) {
2919 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2924 static void GLAPIENTRY
2925 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2927 GET_CURRENT_CONTEXT(ctx
);
2929 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2930 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2934 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
2935 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2937 if (ctx
->ExecuteFlag
) {
2938 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2943 static void GLAPIENTRY
2944 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2946 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2948 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2949 for (i
= 0; i
< mapsize
; i
++) {
2950 fvalues
[i
] = (GLfloat
) values
[i
];
2954 for (i
= 0; i
< mapsize
; i
++) {
2955 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2958 save_PixelMapfv(map
, mapsize
, fvalues
);
2962 static void GLAPIENTRY
2963 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2965 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2967 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2968 for (i
= 0; i
< mapsize
; i
++) {
2969 fvalues
[i
] = (GLfloat
) values
[i
];
2973 for (i
= 0; i
< mapsize
; i
++) {
2974 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2977 save_PixelMapfv(map
, mapsize
, fvalues
);
2981 static void GLAPIENTRY
2982 save_PixelTransferf(GLenum pname
, GLfloat param
)
2984 GET_CURRENT_CONTEXT(ctx
);
2986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2987 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2992 if (ctx
->ExecuteFlag
) {
2993 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2998 static void GLAPIENTRY
2999 save_PixelTransferi(GLenum pname
, GLint param
)
3001 save_PixelTransferf(pname
, (GLfloat
) param
);
3005 static void GLAPIENTRY
3006 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3008 GET_CURRENT_CONTEXT(ctx
);
3010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3011 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3016 if (ctx
->ExecuteFlag
) {
3017 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3022 static void GLAPIENTRY
3023 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3025 GET_CURRENT_CONTEXT(ctx
);
3027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3028 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3035 if (ctx
->ExecuteFlag
) {
3036 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3041 static void GLAPIENTRY
3042 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3046 parray
[1] = parray
[2] = 0.0F
;
3047 save_PointParameterfvEXT(pname
, parray
);
3050 static void GLAPIENTRY
3051 save_PointParameteriNV(GLenum pname
, GLint param
)
3054 parray
[0] = (GLfloat
) param
;
3055 parray
[1] = parray
[2] = 0.0F
;
3056 save_PointParameterfvEXT(pname
, parray
);
3059 static void GLAPIENTRY
3060 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3063 parray
[0] = (GLfloat
) param
[0];
3064 parray
[1] = parray
[2] = 0.0F
;
3065 save_PointParameterfvEXT(pname
, parray
);
3069 static void GLAPIENTRY
3070 save_PointSize(GLfloat size
)
3072 GET_CURRENT_CONTEXT(ctx
);
3074 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3075 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3079 if (ctx
->ExecuteFlag
) {
3080 CALL_PointSize(ctx
->Exec
, (size
));
3085 static void GLAPIENTRY
3086 save_PolygonMode(GLenum face
, GLenum mode
)
3088 GET_CURRENT_CONTEXT(ctx
);
3090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3091 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3096 if (ctx
->ExecuteFlag
) {
3097 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3102 static void GLAPIENTRY
3103 save_PolygonStipple(const GLubyte
* pattern
)
3105 GET_CURRENT_CONTEXT(ctx
);
3108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3110 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3112 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3113 pattern
, &ctx
->Unpack
);
3115 if (ctx
->ExecuteFlag
) {
3116 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3121 static void GLAPIENTRY
3122 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3124 GET_CURRENT_CONTEXT(ctx
);
3126 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3127 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3132 if (ctx
->ExecuteFlag
) {
3133 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3138 static void GLAPIENTRY
3139 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3141 GET_CURRENT_CONTEXT(ctx
);
3142 /* XXX mult by DepthMaxF here??? */
3143 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3147 static void GLAPIENTRY
3148 save_PopAttrib(void)
3150 GET_CURRENT_CONTEXT(ctx
);
3151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3152 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3153 if (ctx
->ExecuteFlag
) {
3154 CALL_PopAttrib(ctx
->Exec
, ());
3159 static void GLAPIENTRY
3160 save_PopMatrix(void)
3162 GET_CURRENT_CONTEXT(ctx
);
3163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3164 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3165 if (ctx
->ExecuteFlag
) {
3166 CALL_PopMatrix(ctx
->Exec
, ());
3171 static void GLAPIENTRY
3174 GET_CURRENT_CONTEXT(ctx
);
3175 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3176 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3177 if (ctx
->ExecuteFlag
) {
3178 CALL_PopName(ctx
->Exec
, ());
3183 static void GLAPIENTRY
3184 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3185 const GLclampf
* priorities
)
3187 GET_CURRENT_CONTEXT(ctx
);
3189 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3191 for (i
= 0; i
< num
; i
++) {
3193 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3195 n
[1].ui
= textures
[i
];
3196 n
[2].f
= priorities
[i
];
3199 if (ctx
->ExecuteFlag
) {
3200 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3205 static void GLAPIENTRY
3206 save_PushAttrib(GLbitfield mask
)
3208 GET_CURRENT_CONTEXT(ctx
);
3210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3211 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3215 if (ctx
->ExecuteFlag
) {
3216 CALL_PushAttrib(ctx
->Exec
, (mask
));
3221 static void GLAPIENTRY
3222 save_PushMatrix(void)
3224 GET_CURRENT_CONTEXT(ctx
);
3225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3226 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3227 if (ctx
->ExecuteFlag
) {
3228 CALL_PushMatrix(ctx
->Exec
, ());
3233 static void GLAPIENTRY
3234 save_PushName(GLuint name
)
3236 GET_CURRENT_CONTEXT(ctx
);
3238 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3239 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_PushName(ctx
->Exec
, (name
));
3249 static void GLAPIENTRY
3250 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3252 GET_CURRENT_CONTEXT(ctx
);
3254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3255 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3262 if (ctx
->ExecuteFlag
) {
3263 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3267 static void GLAPIENTRY
3268 save_RasterPos2d(GLdouble x
, GLdouble y
)
3270 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3273 static void GLAPIENTRY
3274 save_RasterPos2f(GLfloat x
, GLfloat y
)
3276 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3279 static void GLAPIENTRY
3280 save_RasterPos2i(GLint x
, GLint y
)
3282 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3285 static void GLAPIENTRY
3286 save_RasterPos2s(GLshort x
, GLshort y
)
3288 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3291 static void GLAPIENTRY
3292 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3294 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3297 static void GLAPIENTRY
3298 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3300 save_RasterPos4f(x
, y
, z
, 1.0F
);
3303 static void GLAPIENTRY
3304 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3306 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3309 static void GLAPIENTRY
3310 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3312 save_RasterPos4f(x
, y
, z
, 1.0F
);
3315 static void GLAPIENTRY
3316 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3318 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3321 static void GLAPIENTRY
3322 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3324 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3327 static void GLAPIENTRY
3328 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3330 save_RasterPos4f(x
, y
, z
, w
);
3333 static void GLAPIENTRY
3334 save_RasterPos2dv(const GLdouble
* v
)
3336 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3339 static void GLAPIENTRY
3340 save_RasterPos2fv(const GLfloat
* v
)
3342 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3345 static void GLAPIENTRY
3346 save_RasterPos2iv(const GLint
* v
)
3348 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3351 static void GLAPIENTRY
3352 save_RasterPos2sv(const GLshort
* v
)
3354 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3357 static void GLAPIENTRY
3358 save_RasterPos3dv(const GLdouble
* v
)
3360 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3363 static void GLAPIENTRY
3364 save_RasterPos3fv(const GLfloat
* v
)
3366 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3369 static void GLAPIENTRY
3370 save_RasterPos3iv(const GLint
* v
)
3372 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3375 static void GLAPIENTRY
3376 save_RasterPos3sv(const GLshort
* v
)
3378 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3381 static void GLAPIENTRY
3382 save_RasterPos4dv(const GLdouble
* v
)
3384 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3385 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3388 static void GLAPIENTRY
3389 save_RasterPos4fv(const GLfloat
* v
)
3391 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3394 static void GLAPIENTRY
3395 save_RasterPos4iv(const GLint
* v
)
3397 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3398 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3401 static void GLAPIENTRY
3402 save_RasterPos4sv(const GLshort
* v
)
3404 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3408 static void GLAPIENTRY
3409 save_PassThrough(GLfloat token
)
3411 GET_CURRENT_CONTEXT(ctx
);
3413 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3414 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3418 if (ctx
->ExecuteFlag
) {
3419 CALL_PassThrough(ctx
->Exec
, (token
));
3424 static void GLAPIENTRY
3425 save_ReadBuffer(GLenum mode
)
3427 GET_CURRENT_CONTEXT(ctx
);
3429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3430 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3434 if (ctx
->ExecuteFlag
) {
3435 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3440 static void GLAPIENTRY
3441 save_ResetHistogram(GLenum target
)
3443 GET_CURRENT_CONTEXT(ctx
);
3445 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3446 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3450 if (ctx
->ExecuteFlag
) {
3451 CALL_ResetHistogram(ctx
->Exec
, (target
));
3456 static void GLAPIENTRY
3457 save_ResetMinmax(GLenum target
)
3459 GET_CURRENT_CONTEXT(ctx
);
3461 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3462 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3466 if (ctx
->ExecuteFlag
) {
3467 CALL_ResetMinmax(ctx
->Exec
, (target
));
3472 static void GLAPIENTRY
3473 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3475 GET_CURRENT_CONTEXT(ctx
);
3477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3478 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3485 if (ctx
->ExecuteFlag
) {
3486 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3491 static void GLAPIENTRY
3492 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3494 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3498 static void GLAPIENTRY
3499 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3501 GET_CURRENT_CONTEXT(ctx
);
3503 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3504 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3510 if (ctx
->ExecuteFlag
) {
3511 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3516 static void GLAPIENTRY
3517 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3519 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3523 static void GLAPIENTRY
3524 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3526 GET_CURRENT_CONTEXT(ctx
);
3528 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3529 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3536 if (ctx
->ExecuteFlag
) {
3537 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3542 static void GLAPIENTRY
3543 save_ShadeModel(GLenum mode
)
3545 GET_CURRENT_CONTEXT(ctx
);
3547 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3549 if (ctx
->ExecuteFlag
) {
3550 CALL_ShadeModel(ctx
->Exec
, (mode
));
3553 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3556 SAVE_FLUSH_VERTICES(ctx
);
3558 /* Only save the value if we know the statechange will take effect:
3560 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3561 ctx
->ListState
.Current
.ShadeModel
= mode
;
3563 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3570 static void GLAPIENTRY
3571 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3573 GET_CURRENT_CONTEXT(ctx
);
3575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3576 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3582 if (ctx
->ExecuteFlag
) {
3583 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3588 static void GLAPIENTRY
3589 save_StencilMask(GLuint mask
)
3591 GET_CURRENT_CONTEXT(ctx
);
3593 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3594 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3598 if (ctx
->ExecuteFlag
) {
3599 CALL_StencilMask(ctx
->Exec
, (mask
));
3604 static void GLAPIENTRY
3605 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3607 GET_CURRENT_CONTEXT(ctx
);
3609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3610 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3616 if (ctx
->ExecuteFlag
) {
3617 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3622 static void GLAPIENTRY
3623 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3625 GET_CURRENT_CONTEXT(ctx
);
3627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3628 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3635 if (ctx
->ExecuteFlag
) {
3636 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3641 static void GLAPIENTRY
3642 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3645 GET_CURRENT_CONTEXT(ctx
);
3647 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3649 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3657 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3664 if (ctx
->ExecuteFlag
) {
3665 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3666 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3671 static void GLAPIENTRY
3672 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3674 GET_CURRENT_CONTEXT(ctx
);
3676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3677 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3682 if (ctx
->ExecuteFlag
) {
3683 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3688 static void GLAPIENTRY
3689 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3691 GET_CURRENT_CONTEXT(ctx
);
3693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3694 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3701 if (ctx
->ExecuteFlag
) {
3702 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3707 static void GLAPIENTRY
3708 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3710 GET_CURRENT_CONTEXT(ctx
);
3712 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3713 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3717 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3725 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3728 if (ctx
->ExecuteFlag
) {
3729 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3734 static void GLAPIENTRY
3735 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3738 parray
[0] = (GLfloat
) param
;
3739 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3740 save_TexEnvfv(target
, pname
, parray
);
3744 static void GLAPIENTRY
3745 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3748 p
[0] = (GLfloat
) param
;
3749 p
[1] = p
[2] = p
[3] = 0.0F
;
3750 save_TexEnvfv(target
, pname
, p
);
3754 static void GLAPIENTRY
3755 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3758 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3759 p
[0] = INT_TO_FLOAT(param
[0]);
3760 p
[1] = INT_TO_FLOAT(param
[1]);
3761 p
[2] = INT_TO_FLOAT(param
[2]);
3762 p
[3] = INT_TO_FLOAT(param
[3]);
3765 p
[0] = (GLfloat
) param
[0];
3766 p
[1] = p
[2] = p
[3] = 0.0F
;
3768 save_TexEnvfv(target
, pname
, p
);
3772 static void GLAPIENTRY
3773 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3775 GET_CURRENT_CONTEXT(ctx
);
3777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3778 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3787 if (ctx
->ExecuteFlag
) {
3788 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3793 static void GLAPIENTRY
3794 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3797 p
[0] = (GLfloat
) params
[0];
3798 p
[1] = (GLfloat
) params
[1];
3799 p
[2] = (GLfloat
) params
[2];
3800 p
[3] = (GLfloat
) params
[3];
3801 save_TexGenfv(coord
, pname
, p
);
3805 static void GLAPIENTRY
3806 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3809 parray
[0] = (GLfloat
) param
;
3810 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3811 save_TexGenfv(coord
, pname
, parray
);
3815 static void GLAPIENTRY
3816 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3819 p
[0] = (GLfloat
) params
[0];
3820 p
[1] = (GLfloat
) params
[1];
3821 p
[2] = (GLfloat
) params
[2];
3822 p
[3] = (GLfloat
) params
[3];
3823 save_TexGenfv(coord
, pname
, p
);
3827 static void GLAPIENTRY
3828 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3832 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3833 save_TexGenfv(coord
, pname
, parray
);
3837 static void GLAPIENTRY
3838 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3842 parray
[1] = parray
[2] = parray
[3] = 0;
3843 save_TexGeniv(coord
, pname
, parray
);
3847 static void GLAPIENTRY
3848 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3850 GET_CURRENT_CONTEXT(ctx
);
3852 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3853 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3862 if (ctx
->ExecuteFlag
) {
3863 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3868 static void GLAPIENTRY
3869 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3873 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3874 save_TexParameterfv(target
, pname
, parray
);
3878 static void GLAPIENTRY
3879 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3882 fparam
[0] = (GLfloat
) param
;
3883 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3884 save_TexParameterfv(target
, pname
, fparam
);
3888 static void GLAPIENTRY
3889 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3892 fparam
[0] = (GLfloat
) params
[0];
3893 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3894 save_TexParameterfv(target
, pname
, fparam
);
3898 static void GLAPIENTRY
3899 save_TexImage1D(GLenum target
,
3900 GLint level
, GLint components
,
3901 GLsizei width
, GLint border
,
3902 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3904 GET_CURRENT_CONTEXT(ctx
);
3905 if (target
== GL_PROXY_TEXTURE_1D
) {
3906 /* don't compile, execute immediately */
3907 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3908 border
, format
, type
, pixels
));
3912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3913 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3917 n
[3].i
= components
;
3918 n
[4].i
= (GLint
) width
;
3922 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3923 pixels
, &ctx
->Unpack
);
3925 if (ctx
->ExecuteFlag
) {
3926 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3927 border
, format
, type
, pixels
));
3933 static void GLAPIENTRY
3934 save_TexImage2D(GLenum target
,
3935 GLint level
, GLint components
,
3936 GLsizei width
, GLsizei height
, GLint border
,
3937 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3939 GET_CURRENT_CONTEXT(ctx
);
3940 if (target
== GL_PROXY_TEXTURE_2D
) {
3941 /* don't compile, execute immediately */
3942 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3943 height
, border
, format
, type
, pixels
));
3947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3948 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3952 n
[3].i
= components
;
3953 n
[4].i
= (GLint
) width
;
3954 n
[5].i
= (GLint
) height
;
3958 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3959 pixels
, &ctx
->Unpack
);
3961 if (ctx
->ExecuteFlag
) {
3962 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3963 height
, border
, format
, type
, pixels
));
3969 static void GLAPIENTRY
3970 save_TexImage3D(GLenum target
,
3971 GLint level
, GLint internalFormat
,
3972 GLsizei width
, GLsizei height
, GLsizei depth
,
3974 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3976 GET_CURRENT_CONTEXT(ctx
);
3977 if (target
== GL_PROXY_TEXTURE_3D
) {
3978 /* don't compile, execute immediately */
3979 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3980 height
, depth
, border
, format
, type
,
3985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3986 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3990 n
[3].i
= (GLint
) internalFormat
;
3991 n
[4].i
= (GLint
) width
;
3992 n
[5].i
= (GLint
) height
;
3993 n
[6].i
= (GLint
) depth
;
3997 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3998 pixels
, &ctx
->Unpack
);
4000 if (ctx
->ExecuteFlag
) {
4001 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4002 height
, depth
, border
, format
, type
,
4009 static void GLAPIENTRY
4010 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4011 GLsizei width
, GLenum format
, GLenum type
,
4012 const GLvoid
* pixels
)
4014 GET_CURRENT_CONTEXT(ctx
);
4017 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4019 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4024 n
[4].i
= (GLint
) width
;
4027 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4028 pixels
, &ctx
->Unpack
);
4030 if (ctx
->ExecuteFlag
) {
4031 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4032 format
, type
, pixels
));
4037 static void GLAPIENTRY
4038 save_TexSubImage2D(GLenum target
, GLint level
,
4039 GLint xoffset
, GLint yoffset
,
4040 GLsizei width
, GLsizei height
,
4041 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4043 GET_CURRENT_CONTEXT(ctx
);
4046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4048 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4054 n
[5].i
= (GLint
) width
;
4055 n
[6].i
= (GLint
) height
;
4058 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4059 pixels
, &ctx
->Unpack
);
4061 if (ctx
->ExecuteFlag
) {
4062 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4063 width
, height
, format
, type
, pixels
));
4068 static void GLAPIENTRY
4069 save_TexSubImage3D(GLenum target
, GLint level
,
4070 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4071 GLsizei width
, GLsizei height
, GLsizei depth
,
4072 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4074 GET_CURRENT_CONTEXT(ctx
);
4077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4079 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4086 n
[6].i
= (GLint
) width
;
4087 n
[7].i
= (GLint
) height
;
4088 n
[8].i
= (GLint
) depth
;
4091 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4092 pixels
, &ctx
->Unpack
);
4094 if (ctx
->ExecuteFlag
) {
4095 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4096 xoffset
, yoffset
, zoffset
,
4097 width
, height
, depth
, format
, type
,
4103 static void GLAPIENTRY
4104 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4106 GET_CURRENT_CONTEXT(ctx
);
4108 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4109 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4115 if (ctx
->ExecuteFlag
) {
4116 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4121 static void GLAPIENTRY
4122 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4124 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4129 static void GLAPIENTRY
4130 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4132 GET_CURRENT_CONTEXT(ctx
);
4134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4135 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4139 n
[3].i
= (GLint
) width
;
4140 n
[4].i
= (GLint
) height
;
4142 if (ctx
->ExecuteFlag
) {
4143 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4148 static void GLAPIENTRY
4149 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4151 GET_CURRENT_CONTEXT(ctx
);
4153 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4154 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4161 if (ctx
->ExecuteFlag
) {
4162 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4166 static void GLAPIENTRY
4167 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4169 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4172 static void GLAPIENTRY
4173 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4175 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4178 static void GLAPIENTRY
4179 save_WindowPos2iMESA(GLint x
, GLint y
)
4181 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4184 static void GLAPIENTRY
4185 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4187 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4190 static void GLAPIENTRY
4191 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4193 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4196 static void GLAPIENTRY
4197 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4199 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4202 static void GLAPIENTRY
4203 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4205 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4208 static void GLAPIENTRY
4209 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4211 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4214 static void GLAPIENTRY
4215 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4217 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4220 static void GLAPIENTRY
4221 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4223 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4226 static void GLAPIENTRY
4227 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4229 save_WindowPos4fMESA(x
, y
, z
, w
);
4232 static void GLAPIENTRY
4233 save_WindowPos2dvMESA(const GLdouble
* v
)
4235 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4238 static void GLAPIENTRY
4239 save_WindowPos2fvMESA(const GLfloat
* v
)
4241 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4244 static void GLAPIENTRY
4245 save_WindowPos2ivMESA(const GLint
* v
)
4247 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4250 static void GLAPIENTRY
4251 save_WindowPos2svMESA(const GLshort
* v
)
4253 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4256 static void GLAPIENTRY
4257 save_WindowPos3dvMESA(const GLdouble
* v
)
4259 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4262 static void GLAPIENTRY
4263 save_WindowPos3fvMESA(const GLfloat
* v
)
4265 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4268 static void GLAPIENTRY
4269 save_WindowPos3ivMESA(const GLint
* v
)
4271 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4274 static void GLAPIENTRY
4275 save_WindowPos3svMESA(const GLshort
* v
)
4277 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4280 static void GLAPIENTRY
4281 save_WindowPos4dvMESA(const GLdouble
* v
)
4283 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4284 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4287 static void GLAPIENTRY
4288 save_WindowPos4fvMESA(const GLfloat
* v
)
4290 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4293 static void GLAPIENTRY
4294 save_WindowPos4ivMESA(const GLint
* v
)
4296 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4297 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4300 static void GLAPIENTRY
4301 save_WindowPos4svMESA(const GLshort
* v
)
4303 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4308 /* GL_ARB_multitexture */
4309 static void GLAPIENTRY
4310 save_ActiveTextureARB(GLenum target
)
4312 GET_CURRENT_CONTEXT(ctx
);
4314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4315 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4319 if (ctx
->ExecuteFlag
) {
4320 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4325 /* GL_ARB_transpose_matrix */
4327 static void GLAPIENTRY
4328 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4331 _math_transposefd(tm
, m
);
4332 save_LoadMatrixf(tm
);
4336 static void GLAPIENTRY
4337 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4340 _math_transposef(tm
, m
);
4341 save_LoadMatrixf(tm
);
4345 static void GLAPIENTRY
4346 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4349 _math_transposefd(tm
, m
);
4350 save_MultMatrixf(tm
);
4354 static void GLAPIENTRY
4355 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4358 _math_transposef(tm
, m
);
4359 save_MultMatrixf(tm
);
4363 /* GL_ARB_texture_compression */
4364 static void GLAPIENTRY
4365 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4366 GLenum internalFormat
, GLsizei width
,
4367 GLint border
, GLsizei imageSize
,
4368 const GLvoid
* data
)
4370 GET_CURRENT_CONTEXT(ctx
);
4371 if (target
== GL_PROXY_TEXTURE_1D
) {
4372 /* don't compile, execute immediately */
4373 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4374 width
, border
, imageSize
,
4380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4381 /* make copy of image */
4382 image
= malloc(imageSize
);
4384 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4387 memcpy(image
, data
, imageSize
);
4388 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4392 n
[3].e
= internalFormat
;
4393 n
[4].i
= (GLint
) width
;
4401 if (ctx
->ExecuteFlag
) {
4402 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4403 (target
, level
, internalFormat
, width
,
4404 border
, imageSize
, data
));
4410 static void GLAPIENTRY
4411 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4412 GLenum internalFormat
, GLsizei width
,
4413 GLsizei height
, GLint border
, GLsizei imageSize
,
4414 const GLvoid
* data
)
4416 GET_CURRENT_CONTEXT(ctx
);
4417 if (target
== GL_PROXY_TEXTURE_2D
) {
4418 /* don't compile, execute immediately */
4419 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4420 width
, height
, border
,
4426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4427 /* make copy of image */
4428 image
= malloc(imageSize
);
4430 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4433 memcpy(image
, data
, imageSize
);
4434 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4438 n
[3].e
= internalFormat
;
4439 n
[4].i
= (GLint
) width
;
4440 n
[5].i
= (GLint
) height
;
4448 if (ctx
->ExecuteFlag
) {
4449 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4450 (target
, level
, internalFormat
, width
,
4451 height
, border
, imageSize
, data
));
4457 static void GLAPIENTRY
4458 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4459 GLenum internalFormat
, GLsizei width
,
4460 GLsizei height
, GLsizei depth
, GLint border
,
4461 GLsizei imageSize
, const GLvoid
* data
)
4463 GET_CURRENT_CONTEXT(ctx
);
4464 if (target
== GL_PROXY_TEXTURE_3D
) {
4465 /* don't compile, execute immediately */
4466 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4467 width
, height
, depth
, border
,
4473 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4474 /* make copy of image */
4475 image
= malloc(imageSize
);
4477 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4480 memcpy(image
, data
, imageSize
);
4481 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4485 n
[3].e
= internalFormat
;
4486 n
[4].i
= (GLint
) width
;
4487 n
[5].i
= (GLint
) height
;
4488 n
[6].i
= (GLint
) depth
;
4496 if (ctx
->ExecuteFlag
) {
4497 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4498 (target
, level
, internalFormat
, width
,
4499 height
, depth
, border
, imageSize
,
4506 static void GLAPIENTRY
4507 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4508 GLsizei width
, GLenum format
,
4509 GLsizei imageSize
, const GLvoid
* data
)
4514 GET_CURRENT_CONTEXT(ctx
);
4515 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4517 /* make copy of image */
4518 image
= malloc(imageSize
);
4520 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4523 memcpy(image
, data
, imageSize
);
4524 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4529 n
[4].i
= (GLint
) width
;
4537 if (ctx
->ExecuteFlag
) {
4538 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4539 width
, format
, imageSize
,
4545 static void GLAPIENTRY
4546 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4547 GLint yoffset
, GLsizei width
, GLsizei height
,
4548 GLenum format
, GLsizei imageSize
,
4549 const GLvoid
* data
)
4554 GET_CURRENT_CONTEXT(ctx
);
4555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4557 /* make copy of image */
4558 image
= malloc(imageSize
);
4560 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4563 memcpy(image
, data
, imageSize
);
4564 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4570 n
[5].i
= (GLint
) width
;
4571 n
[6].i
= (GLint
) height
;
4579 if (ctx
->ExecuteFlag
) {
4580 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4581 (target
, level
, xoffset
, yoffset
, width
,
4582 height
, format
, imageSize
, data
));
4587 static void GLAPIENTRY
4588 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4589 GLint yoffset
, GLint zoffset
, GLsizei width
,
4590 GLsizei height
, GLsizei depth
, GLenum format
,
4591 GLsizei imageSize
, const GLvoid
* data
)
4596 GET_CURRENT_CONTEXT(ctx
);
4597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4599 /* make copy of image */
4600 image
= malloc(imageSize
);
4602 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4605 memcpy(image
, data
, imageSize
);
4606 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4613 n
[6].i
= (GLint
) width
;
4614 n
[7].i
= (GLint
) height
;
4615 n
[8].i
= (GLint
) depth
;
4617 n
[10].i
= imageSize
;
4623 if (ctx
->ExecuteFlag
) {
4624 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4625 (target
, level
, xoffset
, yoffset
,
4626 zoffset
, width
, height
, depth
, format
,
4632 /* GL_ARB_multisample */
4633 static void GLAPIENTRY
4634 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4636 GET_CURRENT_CONTEXT(ctx
);
4638 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4639 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4644 if (ctx
->ExecuteFlag
) {
4645 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4651 * GL_NV_vertex_program
4653 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4654 static void GLAPIENTRY
4655 save_BindProgramNV(GLenum target
, GLuint id
)
4657 GET_CURRENT_CONTEXT(ctx
);
4659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4665 if (ctx
->ExecuteFlag
) {
4666 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4670 static void GLAPIENTRY
4671 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4672 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4674 GET_CURRENT_CONTEXT(ctx
);
4676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4677 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4686 if (ctx
->ExecuteFlag
) {
4687 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4692 static void GLAPIENTRY
4693 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4694 const GLfloat
*params
)
4696 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4697 params
[2], params
[3]);
4701 static void GLAPIENTRY
4702 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4703 const GLfloat
* params
)
4705 GET_CURRENT_CONTEXT(ctx
);
4707 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4711 const GLfloat
* p
= params
;
4713 for (i
= 0 ; i
< count
; i
++) {
4714 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4727 if (ctx
->ExecuteFlag
) {
4728 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4733 static void GLAPIENTRY
4734 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4735 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4737 save_ProgramEnvParameter4fARB(target
, index
,
4739 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4743 static void GLAPIENTRY
4744 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4745 const GLdouble
*params
)
4747 save_ProgramEnvParameter4fARB(target
, index
,
4748 (GLfloat
) params
[0],
4749 (GLfloat
) params
[1],
4750 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4753 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4755 #if FEATURE_NV_vertex_program
4756 static void GLAPIENTRY
4757 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4759 GET_CURRENT_CONTEXT(ctx
);
4761 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4762 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4771 if (ctx
->ExecuteFlag
) {
4772 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4777 static void GLAPIENTRY
4778 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4779 GLuint num
, const GLdouble
*params
)
4782 for (i
= 0; i
< num
; i
++) {
4783 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4788 static void GLAPIENTRY
4789 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4790 GLuint num
, const GLfloat
*params
)
4793 for (i
= 0; i
< num
; i
++) {
4794 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4799 static void GLAPIENTRY
4800 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4801 const GLubyte
* program
)
4803 GET_CURRENT_CONTEXT(ctx
);
4806 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4808 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4810 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
4812 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4815 memcpy(programCopy
, program
, len
);
4819 n
[4].data
= programCopy
;
4821 if (ctx
->ExecuteFlag
) {
4822 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4827 static void GLAPIENTRY
4828 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4830 GET_CURRENT_CONTEXT(ctx
);
4833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4835 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4837 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
4839 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4842 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4846 if (ctx
->ExecuteFlag
) {
4847 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4852 static void GLAPIENTRY
4853 save_TrackMatrixNV(GLenum target
, GLuint address
,
4854 GLenum matrix
, GLenum transform
)
4856 GET_CURRENT_CONTEXT(ctx
);
4858 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4859 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4866 if (ctx
->ExecuteFlag
) {
4867 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4870 #endif /* FEATURE_NV_vertex_program */
4874 * GL_NV_fragment_program
4876 #if FEATURE_NV_fragment_program
4877 static void GLAPIENTRY
4878 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4879 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4881 GET_CURRENT_CONTEXT(ctx
);
4883 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4884 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4893 if (ctx
->ExecuteFlag
) {
4894 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4899 static void GLAPIENTRY
4900 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4901 const GLfloat
*params
)
4903 GET_CURRENT_CONTEXT(ctx
);
4905 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4906 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4915 if (ctx
->ExecuteFlag
) {
4916 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4921 static void GLAPIENTRY
4922 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4923 const GLfloat
*params
)
4925 GET_CURRENT_CONTEXT(ctx
);
4927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4931 const GLfloat
* p
= params
;
4933 for (i
= 0 ; i
< count
; i
++) {
4934 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4947 if (ctx
->ExecuteFlag
) {
4948 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4953 static void GLAPIENTRY
4954 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4955 GLdouble x
, GLdouble y
,
4956 GLdouble z
, GLdouble w
)
4958 GET_CURRENT_CONTEXT(ctx
);
4960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4961 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4965 n
[3].f
= (GLfloat
) x
;
4966 n
[4].f
= (GLfloat
) y
;
4967 n
[5].f
= (GLfloat
) z
;
4968 n
[6].f
= (GLfloat
) w
;
4970 if (ctx
->ExecuteFlag
) {
4971 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4976 static void GLAPIENTRY
4977 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4978 const GLdouble
*params
)
4980 GET_CURRENT_CONTEXT(ctx
);
4982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4983 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4987 n
[3].f
= (GLfloat
) params
[0];
4988 n
[4].f
= (GLfloat
) params
[1];
4989 n
[5].f
= (GLfloat
) params
[2];
4990 n
[6].f
= (GLfloat
) params
[3];
4992 if (ctx
->ExecuteFlag
) {
4993 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4997 static void GLAPIENTRY
4998 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4999 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5001 GET_CURRENT_CONTEXT(ctx
);
5004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5006 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5008 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
5010 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5013 memcpy(nameCopy
, name
, len
);
5016 n
[3].data
= nameCopy
;
5022 if (ctx
->ExecuteFlag
) {
5023 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5028 static void GLAPIENTRY
5029 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5032 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5036 static void GLAPIENTRY
5037 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5038 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5040 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5041 (GLfloat
) z
, (GLfloat
) w
);
5045 static void GLAPIENTRY
5046 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5049 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5050 (GLfloat
) v
[1], (GLfloat
) v
[2],
5054 #endif /* FEATURE_NV_fragment_program */
5058 /* GL_EXT_stencil_two_side */
5059 static void GLAPIENTRY
5060 save_ActiveStencilFaceEXT(GLenum face
)
5062 GET_CURRENT_CONTEXT(ctx
);
5064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5065 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5069 if (ctx
->ExecuteFlag
) {
5070 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5075 /* GL_EXT_depth_bounds_test */
5076 static void GLAPIENTRY
5077 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5079 GET_CURRENT_CONTEXT(ctx
);
5081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5082 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5084 n
[1].f
= (GLfloat
) zmin
;
5085 n
[2].f
= (GLfloat
) zmax
;
5087 if (ctx
->ExecuteFlag
) {
5088 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5094 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5096 static void GLAPIENTRY
5097 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5098 const GLvoid
* string
)
5100 GET_CURRENT_CONTEXT(ctx
);
5103 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5105 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5107 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5109 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5112 memcpy(programCopy
, string
, len
);
5116 n
[4].data
= programCopy
;
5118 if (ctx
->ExecuteFlag
) {
5119 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5123 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5126 #if FEATURE_queryobj
5128 static void GLAPIENTRY
5129 save_BeginQueryARB(GLenum target
, GLuint id
)
5131 GET_CURRENT_CONTEXT(ctx
);
5133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5134 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5139 if (ctx
->ExecuteFlag
) {
5140 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5145 static void GLAPIENTRY
5146 save_EndQueryARB(GLenum target
)
5148 GET_CURRENT_CONTEXT(ctx
);
5150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5151 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5155 if (ctx
->ExecuteFlag
) {
5156 CALL_EndQueryARB(ctx
->Exec
, (target
));
5160 #endif /* FEATURE_queryobj */
5163 static void GLAPIENTRY
5164 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5166 GET_CURRENT_CONTEXT(ctx
);
5168 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5169 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5173 if (count
> MAX_DRAW_BUFFERS
)
5174 count
= MAX_DRAW_BUFFERS
;
5175 for (i
= 0; i
< count
; i
++) {
5176 n
[2 + i
].e
= buffers
[i
];
5179 if (ctx
->ExecuteFlag
) {
5180 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5184 static void GLAPIENTRY
5185 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5187 GET_CURRENT_CONTEXT(ctx
);
5190 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5198 if (ctx
->ExecuteFlag
) {
5199 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5203 static void GLAPIENTRY
5204 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5207 p
[0] = INT_TO_FLOAT(param
[0]);
5208 p
[1] = INT_TO_FLOAT(param
[1]);
5209 p
[2] = INT_TO_FLOAT(param
[2]);
5210 p
[3] = INT_TO_FLOAT(param
[3]);
5211 save_TexBumpParameterfvATI(pname
, p
);
5214 #if FEATURE_ATI_fragment_shader
5215 static void GLAPIENTRY
5216 save_BindFragmentShaderATI(GLuint id
)
5218 GET_CURRENT_CONTEXT(ctx
);
5221 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5225 if (ctx
->ExecuteFlag
) {
5226 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5230 static void GLAPIENTRY
5231 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5233 GET_CURRENT_CONTEXT(ctx
);
5236 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5244 if (ctx
->ExecuteFlag
) {
5245 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5251 save_Attr1fNV(GLenum attr
, GLfloat x
)
5253 GET_CURRENT_CONTEXT(ctx
);
5255 SAVE_FLUSH_VERTICES(ctx
);
5256 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5262 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5263 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5264 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5266 if (ctx
->ExecuteFlag
) {
5267 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5272 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5274 GET_CURRENT_CONTEXT(ctx
);
5276 SAVE_FLUSH_VERTICES(ctx
);
5277 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5284 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5285 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5286 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5288 if (ctx
->ExecuteFlag
) {
5289 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5294 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5296 GET_CURRENT_CONTEXT(ctx
);
5298 SAVE_FLUSH_VERTICES(ctx
);
5299 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5307 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5308 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5309 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5311 if (ctx
->ExecuteFlag
) {
5312 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5317 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5319 GET_CURRENT_CONTEXT(ctx
);
5321 SAVE_FLUSH_VERTICES(ctx
);
5322 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5331 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5332 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5333 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5335 if (ctx
->ExecuteFlag
) {
5336 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5342 save_Attr1fARB(GLenum attr
, GLfloat x
)
5344 GET_CURRENT_CONTEXT(ctx
);
5346 SAVE_FLUSH_VERTICES(ctx
);
5347 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5353 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5354 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5355 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5357 if (ctx
->ExecuteFlag
) {
5358 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5363 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5365 GET_CURRENT_CONTEXT(ctx
);
5367 SAVE_FLUSH_VERTICES(ctx
);
5368 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5375 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5376 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5377 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5379 if (ctx
->ExecuteFlag
) {
5380 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5385 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5387 GET_CURRENT_CONTEXT(ctx
);
5389 SAVE_FLUSH_VERTICES(ctx
);
5390 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5398 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5399 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5400 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5402 if (ctx
->ExecuteFlag
) {
5403 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5408 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5410 GET_CURRENT_CONTEXT(ctx
);
5412 SAVE_FLUSH_VERTICES(ctx
);
5413 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5422 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5423 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5424 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5426 if (ctx
->ExecuteFlag
) {
5427 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5432 static void GLAPIENTRY
5433 save_EvalCoord1f(GLfloat x
)
5435 GET_CURRENT_CONTEXT(ctx
);
5437 SAVE_FLUSH_VERTICES(ctx
);
5438 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5442 if (ctx
->ExecuteFlag
) {
5443 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5447 static void GLAPIENTRY
5448 save_EvalCoord1fv(const GLfloat
* v
)
5450 save_EvalCoord1f(v
[0]);
5453 static void GLAPIENTRY
5454 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5456 GET_CURRENT_CONTEXT(ctx
);
5458 SAVE_FLUSH_VERTICES(ctx
);
5459 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5464 if (ctx
->ExecuteFlag
) {
5465 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5469 static void GLAPIENTRY
5470 save_EvalCoord2fv(const GLfloat
* v
)
5472 save_EvalCoord2f(v
[0], v
[1]);
5476 static void GLAPIENTRY
5477 save_EvalPoint1(GLint x
)
5479 GET_CURRENT_CONTEXT(ctx
);
5481 SAVE_FLUSH_VERTICES(ctx
);
5482 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5486 if (ctx
->ExecuteFlag
) {
5487 CALL_EvalPoint1(ctx
->Exec
, (x
));
5491 static void GLAPIENTRY
5492 save_EvalPoint2(GLint x
, GLint y
)
5494 GET_CURRENT_CONTEXT(ctx
);
5496 SAVE_FLUSH_VERTICES(ctx
);
5497 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5502 if (ctx
->ExecuteFlag
) {
5503 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5507 static void GLAPIENTRY
5508 save_Indexf(GLfloat x
)
5510 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5513 static void GLAPIENTRY
5514 save_Indexfv(const GLfloat
* v
)
5516 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5519 static void GLAPIENTRY
5520 save_EdgeFlag(GLboolean x
)
5522 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5525 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5529 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5533 static void GLAPIENTRY
5534 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5536 GET_CURRENT_CONTEXT(ctx
);
5544 case GL_FRONT_AND_BACK
:
5547 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5556 case GL_AMBIENT_AND_DIFFUSE
:
5562 case GL_COLOR_INDEXES
:
5566 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5570 if (ctx
->ExecuteFlag
) {
5571 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5574 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5576 /* Try to eliminate redundant statechanges. Because it is legal to
5577 * call glMaterial even inside begin/end calls, don't need to worry
5578 * about ctx->Driver.CurrentSavePrimitive here.
5580 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5581 if (bitmask
& (1 << i
)) {
5582 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5583 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5584 bitmask
&= ~(1 << i
);
5587 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5588 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5593 /* If this call has effect, return early:
5598 SAVE_FLUSH_VERTICES(ctx
);
5600 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5604 for (i
= 0; i
< args
; i
++)
5605 n
[3 + i
].f
= param
[i
];
5609 static void GLAPIENTRY
5610 save_Begin(GLenum mode
)
5612 GET_CURRENT_CONTEXT(ctx
);
5614 GLboolean error
= GL_FALSE
;
5616 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5617 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5620 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5621 /* Typically the first begin. This may raise an error on
5622 * playback, depending on whether CallList is issued from inside
5623 * a begin/end or not.
5625 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5627 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5628 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5631 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5636 /* Give the driver an opportunity to hook in an optimized
5637 * display list compiler.
5639 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5642 SAVE_FLUSH_VERTICES(ctx
);
5643 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5649 if (ctx
->ExecuteFlag
) {
5650 CALL_Begin(ctx
->Exec
, (mode
));
5654 static void GLAPIENTRY
5657 GET_CURRENT_CONTEXT(ctx
);
5658 SAVE_FLUSH_VERTICES(ctx
);
5659 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5660 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5661 if (ctx
->ExecuteFlag
) {
5662 CALL_End(ctx
->Exec
, ());
5666 static void GLAPIENTRY
5667 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5669 GET_CURRENT_CONTEXT(ctx
);
5671 SAVE_FLUSH_VERTICES(ctx
);
5672 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5679 if (ctx
->ExecuteFlag
) {
5680 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5685 static void GLAPIENTRY
5686 save_Vertex2f(GLfloat x
, GLfloat y
)
5688 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5691 static void GLAPIENTRY
5692 save_Vertex2fv(const GLfloat
* v
)
5694 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5697 static void GLAPIENTRY
5698 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5700 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5703 static void GLAPIENTRY
5704 save_Vertex3fv(const GLfloat
* v
)
5706 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5709 static void GLAPIENTRY
5710 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5712 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5715 static void GLAPIENTRY
5716 save_Vertex4fv(const GLfloat
* v
)
5718 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5721 static void GLAPIENTRY
5722 save_TexCoord1f(GLfloat x
)
5724 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5727 static void GLAPIENTRY
5728 save_TexCoord1fv(const GLfloat
* v
)
5730 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5733 static void GLAPIENTRY
5734 save_TexCoord2f(GLfloat x
, GLfloat y
)
5736 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5739 static void GLAPIENTRY
5740 save_TexCoord2fv(const GLfloat
* v
)
5742 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5745 static void GLAPIENTRY
5746 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5748 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5751 static void GLAPIENTRY
5752 save_TexCoord3fv(const GLfloat
* v
)
5754 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5757 static void GLAPIENTRY
5758 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5760 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5763 static void GLAPIENTRY
5764 save_TexCoord4fv(const GLfloat
* v
)
5766 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5769 static void GLAPIENTRY
5770 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5772 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5775 static void GLAPIENTRY
5776 save_Normal3fv(const GLfloat
* v
)
5778 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5781 static void GLAPIENTRY
5782 save_FogCoordfEXT(GLfloat x
)
5784 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5787 static void GLAPIENTRY
5788 save_FogCoordfvEXT(const GLfloat
* v
)
5790 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5793 static void GLAPIENTRY
5794 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5796 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5799 static void GLAPIENTRY
5800 save_Color3fv(const GLfloat
* v
)
5802 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5805 static void GLAPIENTRY
5806 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5808 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5811 static void GLAPIENTRY
5812 save_Color4fv(const GLfloat
* v
)
5814 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5817 static void GLAPIENTRY
5818 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5820 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5823 static void GLAPIENTRY
5824 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5826 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5830 /* Just call the respective ATTR for texcoord
5832 static void GLAPIENTRY
5833 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5835 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5836 save_Attr1fNV(attr
, x
);
5839 static void GLAPIENTRY
5840 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5842 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5843 save_Attr1fNV(attr
, v
[0]);
5846 static void GLAPIENTRY
5847 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5849 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5850 save_Attr2fNV(attr
, x
, y
);
5853 static void GLAPIENTRY
5854 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5856 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5857 save_Attr2fNV(attr
, v
[0], v
[1]);
5860 static void GLAPIENTRY
5861 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5863 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5864 save_Attr3fNV(attr
, x
, y
, z
);
5867 static void GLAPIENTRY
5868 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5870 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5871 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5874 static void GLAPIENTRY
5875 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5876 GLfloat z
, GLfloat w
)
5878 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5879 save_Attr4fNV(attr
, x
, y
, z
, w
);
5882 static void GLAPIENTRY
5883 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5885 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5886 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5891 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5897 GET_CURRENT_CONTEXT(ctx
);
5898 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5902 /* First level for NV_vertex_program:
5904 * Check for errors at compile time?.
5906 static void GLAPIENTRY
5907 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5909 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5910 save_Attr1fNV(index
, x
);
5915 static void GLAPIENTRY
5916 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5918 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5919 save_Attr1fNV(index
, v
[0]);
5924 static void GLAPIENTRY
5925 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5927 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5928 save_Attr2fNV(index
, x
, y
);
5933 static void GLAPIENTRY
5934 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5936 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5937 save_Attr2fNV(index
, v
[0], v
[1]);
5942 static void GLAPIENTRY
5943 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5945 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5946 save_Attr3fNV(index
, x
, y
, z
);
5951 static void GLAPIENTRY
5952 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5954 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5955 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5960 static void GLAPIENTRY
5961 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5962 GLfloat z
, GLfloat w
)
5964 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5965 save_Attr4fNV(index
, x
, y
, z
, w
);
5970 static void GLAPIENTRY
5971 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5973 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5974 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5982 static void GLAPIENTRY
5983 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5985 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5986 save_Attr1fARB(index
, x
);
5991 static void GLAPIENTRY
5992 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5994 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5995 save_Attr1fARB(index
, v
[0]);
6000 static void GLAPIENTRY
6001 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6003 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6004 save_Attr2fARB(index
, x
, y
);
6009 static void GLAPIENTRY
6010 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6012 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6013 save_Attr2fARB(index
, v
[0], v
[1]);
6018 static void GLAPIENTRY
6019 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6021 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6022 save_Attr3fARB(index
, x
, y
, z
);
6027 static void GLAPIENTRY
6028 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6030 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6031 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6036 static void GLAPIENTRY
6037 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6040 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6041 save_Attr4fARB(index
, x
, y
, z
, w
);
6046 static void GLAPIENTRY
6047 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6049 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6050 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6056 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6058 static void GLAPIENTRY
6059 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6061 GET_CURRENT_CONTEXT(ctx
);
6062 FLUSH_VERTICES(ctx
, 0);
6063 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6066 static GLint GLAPIENTRY
6067 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6069 GET_CURRENT_CONTEXT(ctx
);
6070 FLUSH_VERTICES(ctx
, 0);
6071 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6073 /* XXX more shader functions needed here */
6077 #if FEATURE_EXT_framebuffer_blit
6078 static void GLAPIENTRY
6079 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6080 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6081 GLbitfield mask
, GLenum filter
)
6083 GET_CURRENT_CONTEXT(ctx
);
6085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6086 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6099 if (ctx
->ExecuteFlag
) {
6100 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6101 dstX0
, dstY0
, dstX1
, dstY1
,
6108 /** GL_EXT_provoking_vertex */
6109 static void GLAPIENTRY
6110 save_ProvokingVertexEXT(GLenum mode
)
6112 GET_CURRENT_CONTEXT(ctx
);
6114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6115 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6119 if (ctx
->ExecuteFlag
) {
6120 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6121 _mesa_ProvokingVertexEXT(mode
);
6126 /** GL_EXT_transform_feedback */
6127 static void GLAPIENTRY
6128 save_BeginTransformFeedback(GLenum mode
)
6130 GET_CURRENT_CONTEXT(ctx
);
6132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6133 n
= alloc_instruction(ctx
, OPCODE_BEGIN_TRANSFORM_FEEDBACK
, 1);
6137 if (ctx
->ExecuteFlag
) {
6138 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (mode
));
6143 /** GL_EXT_transform_feedback */
6144 static void GLAPIENTRY
6145 save_EndTransformFeedback(void)
6147 GET_CURRENT_CONTEXT(ctx
);
6148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6149 (void) alloc_instruction(ctx
, OPCODE_END_TRANSFORM_FEEDBACK
, 0);
6150 if (ctx
->ExecuteFlag
) {
6151 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
6156 /* aka UseProgram() */
6157 static void GLAPIENTRY
6158 save_UseProgramObjectARB(GLhandleARB program
)
6160 GET_CURRENT_CONTEXT(ctx
);
6162 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6163 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6167 if (ctx
->ExecuteFlag
) {
6168 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6173 static void GLAPIENTRY
6174 save_Uniform1fARB(GLint location
, GLfloat x
)
6176 GET_CURRENT_CONTEXT(ctx
);
6178 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6179 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6184 if (ctx
->ExecuteFlag
) {
6185 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6190 static void GLAPIENTRY
6191 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6193 GET_CURRENT_CONTEXT(ctx
);
6195 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6196 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6202 if (ctx
->ExecuteFlag
) {
6203 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6208 static void GLAPIENTRY
6209 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6211 GET_CURRENT_CONTEXT(ctx
);
6213 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6214 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6221 if (ctx
->ExecuteFlag
) {
6222 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6227 static void GLAPIENTRY
6228 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6230 GET_CURRENT_CONTEXT(ctx
);
6232 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6233 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6241 if (ctx
->ExecuteFlag
) {
6242 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6247 /** Return copy of memory */
6249 memdup(const void *src
, GLsizei bytes
)
6251 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6253 memcpy(b
, src
, bytes
);
6258 static void GLAPIENTRY
6259 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6261 GET_CURRENT_CONTEXT(ctx
);
6263 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6264 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6268 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6270 if (ctx
->ExecuteFlag
) {
6271 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6275 static void GLAPIENTRY
6276 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6278 GET_CURRENT_CONTEXT(ctx
);
6280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6281 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6285 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6287 if (ctx
->ExecuteFlag
) {
6288 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6292 static void GLAPIENTRY
6293 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6295 GET_CURRENT_CONTEXT(ctx
);
6297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6298 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6302 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6304 if (ctx
->ExecuteFlag
) {
6305 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6309 static void GLAPIENTRY
6310 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6312 GET_CURRENT_CONTEXT(ctx
);
6314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6315 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6319 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6321 if (ctx
->ExecuteFlag
) {
6322 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6327 static void GLAPIENTRY
6328 save_Uniform1iARB(GLint location
, GLint x
)
6330 GET_CURRENT_CONTEXT(ctx
);
6332 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6333 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6338 if (ctx
->ExecuteFlag
) {
6339 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6343 static void GLAPIENTRY
6344 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6346 GET_CURRENT_CONTEXT(ctx
);
6348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6349 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6355 if (ctx
->ExecuteFlag
) {
6356 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6360 static void GLAPIENTRY
6361 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6363 GET_CURRENT_CONTEXT(ctx
);
6365 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6366 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6373 if (ctx
->ExecuteFlag
) {
6374 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6378 static void GLAPIENTRY
6379 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6381 GET_CURRENT_CONTEXT(ctx
);
6383 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6384 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6392 if (ctx
->ExecuteFlag
) {
6393 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6399 static void GLAPIENTRY
6400 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6402 GET_CURRENT_CONTEXT(ctx
);
6404 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6405 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6409 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6411 if (ctx
->ExecuteFlag
) {
6412 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6416 static void GLAPIENTRY
6417 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6419 GET_CURRENT_CONTEXT(ctx
);
6421 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6422 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6426 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6428 if (ctx
->ExecuteFlag
) {
6429 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6433 static void GLAPIENTRY
6434 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6436 GET_CURRENT_CONTEXT(ctx
);
6438 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6439 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6443 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6445 if (ctx
->ExecuteFlag
) {
6446 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6450 static void GLAPIENTRY
6451 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6453 GET_CURRENT_CONTEXT(ctx
);
6455 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6456 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6460 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6462 if (ctx
->ExecuteFlag
) {
6463 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6469 static void GLAPIENTRY
6470 save_Uniform1ui(GLint location
, GLuint x
)
6472 GET_CURRENT_CONTEXT(ctx
);
6474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6475 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UI
, 2);
6480 if (ctx
->ExecuteFlag
) {
6481 /*CALL_Uniform1ui(ctx->Exec, (location, x));*/
6485 static void GLAPIENTRY
6486 save_Uniform2ui(GLint location
, GLuint x
, GLuint y
)
6488 GET_CURRENT_CONTEXT(ctx
);
6490 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6491 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UI
, 3);
6497 if (ctx
->ExecuteFlag
) {
6498 /*CALL_Uniform2ui(ctx->Exec, (location, x, y));*/
6502 static void GLAPIENTRY
6503 save_Uniform3ui(GLint location
, GLuint x
, GLuint y
, GLuint z
)
6505 GET_CURRENT_CONTEXT(ctx
);
6507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6508 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UI
, 4);
6515 if (ctx
->ExecuteFlag
) {
6516 /*CALL_Uniform3ui(ctx->Exec, (location, x, y, z));*/
6520 static void GLAPIENTRY
6521 save_Uniform4ui(GLint location
, GLuint x
, GLuint y
, GLuint z
, GLuint w
)
6523 GET_CURRENT_CONTEXT(ctx
);
6525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UI
, 5);
6534 if (ctx
->ExecuteFlag
) {
6535 /*CALL_Uniform4ui(ctx->Exec, (location, x, y, z, w));*/
6541 static void GLAPIENTRY
6542 save_Uniform1uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6544 GET_CURRENT_CONTEXT(ctx
);
6546 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6547 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1UIV
, 3);
6551 n
[3].data
= memdup(v
, count
* 1 * sizeof(*v
));
6553 if (ctx
->ExecuteFlag
) {
6554 /*CALL_Uniform1uiv(ctx->Exec, (location, count, v));*/
6558 static void GLAPIENTRY
6559 save_Uniform2uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6561 GET_CURRENT_CONTEXT(ctx
);
6563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6564 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2UIV
, 3);
6568 n
[3].data
= memdup(v
, count
* 2 * sizeof(*v
));
6570 if (ctx
->ExecuteFlag
) {
6571 /*CALL_Uniform2uiv(ctx->Exec, (location, count, v));*/
6575 static void GLAPIENTRY
6576 save_Uniform3uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6578 GET_CURRENT_CONTEXT(ctx
);
6580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6581 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3UIV
, 3);
6585 n
[3].data
= memdup(v
, count
* 3 * sizeof(*v
));
6587 if (ctx
->ExecuteFlag
) {
6588 /*CALL_Uniform3uiv(ctx->Exec, (location, count, v));*/
6592 static void GLAPIENTRY
6593 save_Uniform4uiv(GLint location
, GLsizei count
, const GLuint
*v
)
6595 GET_CURRENT_CONTEXT(ctx
);
6597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6598 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4UIV
, 3);
6602 n
[3].data
= memdup(v
, count
* 4 * sizeof(*v
));
6604 if (ctx
->ExecuteFlag
) {
6605 /*CALL_Uniform4uiv(ctx->Exec, (location, count, v));*/
6611 static void GLAPIENTRY
6612 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6615 GET_CURRENT_CONTEXT(ctx
);
6617 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6618 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6623 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6625 if (ctx
->ExecuteFlag
) {
6626 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6630 static void GLAPIENTRY
6631 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6634 GET_CURRENT_CONTEXT(ctx
);
6636 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6637 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6642 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6644 if (ctx
->ExecuteFlag
) {
6645 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6649 static void GLAPIENTRY
6650 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6653 GET_CURRENT_CONTEXT(ctx
);
6655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6656 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6661 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6663 if (ctx
->ExecuteFlag
) {
6664 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6669 static void GLAPIENTRY
6670 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6673 GET_CURRENT_CONTEXT(ctx
);
6675 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6676 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6681 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6683 if (ctx
->ExecuteFlag
) {
6684 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6688 static void GLAPIENTRY
6689 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6692 GET_CURRENT_CONTEXT(ctx
);
6694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6695 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6700 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6702 if (ctx
->ExecuteFlag
) {
6703 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6708 static void GLAPIENTRY
6709 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6712 GET_CURRENT_CONTEXT(ctx
);
6714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6715 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6720 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6722 if (ctx
->ExecuteFlag
) {
6723 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6727 static void GLAPIENTRY
6728 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6731 GET_CURRENT_CONTEXT(ctx
);
6733 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6734 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6739 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6741 if (ctx
->ExecuteFlag
) {
6742 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6747 static void GLAPIENTRY
6748 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6751 GET_CURRENT_CONTEXT(ctx
);
6753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6754 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6759 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6761 if (ctx
->ExecuteFlag
) {
6762 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6766 static void GLAPIENTRY
6767 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6770 GET_CURRENT_CONTEXT(ctx
);
6772 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6773 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6778 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6780 if (ctx
->ExecuteFlag
) {
6781 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6788 * Save an error-generating command into display list.
6790 * KW: Will appear in the list before the vertex buffer containing the
6791 * command that provoked the error. I don't see this as a problem.
6794 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6797 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6800 n
[2].data
= (void *) s
;
6806 * Compile an error into current display list.
6809 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6811 if (ctx
->CompileFlag
)
6812 save_error(ctx
, error
, s
);
6813 if (ctx
->ExecuteFlag
)
6814 _mesa_error(ctx
, error
, s
);
6819 * Test if ID names a display list.
6822 islist(GLcontext
*ctx
, GLuint list
)
6824 if (list
> 0 && lookup_list(ctx
, list
)) {
6834 /**********************************************************************/
6835 /* Display list execution */
6836 /**********************************************************************/
6840 * Execute a display list. Note that the ListBase offset must have already
6841 * been added before calling this function. I.e. the list argument is
6842 * the absolute list number, not relative to ListBase.
6843 * \param list - display list number
6846 execute_list(GLcontext
*ctx
, GLuint list
)
6848 struct gl_display_list
*dlist
;
6852 if (list
== 0 || !islist(ctx
, list
))
6855 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6856 /* raise an error? */
6860 dlist
= lookup_list(ctx
, list
);
6864 ctx
->ListState
.CallDepth
++;
6866 if (ctx
->Driver
.BeginCallList
)
6867 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6873 const OpCode opcode
= n
[0].opcode
;
6875 if (is_ext_opcode(opcode
)) {
6876 n
+= ext_opcode_execute(ctx
, n
);
6881 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6884 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6886 case OPCODE_ALPHA_FUNC
:
6887 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6889 case OPCODE_BIND_TEXTURE
:
6890 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6894 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6895 ctx
->Unpack
= ctx
->DefaultPacking
;
6896 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6897 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6898 (const GLubyte
*) n
[7].data
));
6899 ctx
->Unpack
= save
; /* restore */
6902 case OPCODE_BLEND_COLOR
:
6903 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6905 case OPCODE_BLEND_EQUATION
:
6906 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6908 case OPCODE_BLEND_EQUATION_SEPARATE
:
6909 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6911 case OPCODE_BLEND_FUNC_SEPARATE
:
6912 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6913 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6915 case OPCODE_CALL_LIST
:
6916 /* Generated by glCallList(), don't add ListBase */
6917 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6918 execute_list(ctx
, n
[1].ui
);
6921 case OPCODE_CALL_LIST_OFFSET
:
6922 /* Generated by glCallLists() so we must add ListBase */
6924 /* user specified a bad data type at compile time */
6925 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6927 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6928 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6929 execute_list(ctx
, list
);
6933 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6935 case OPCODE_CLEAR_BUFFER_IV
:
6942 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6945 case OPCODE_CLEAR_BUFFER_UIV
:
6952 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6955 case OPCODE_CLEAR_BUFFER_FV
:
6962 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
6965 case OPCODE_CLEAR_BUFFER_FI
:
6966 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
6968 case OPCODE_CLEAR_COLOR
:
6969 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6971 case OPCODE_CLEAR_ACCUM
:
6972 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6974 case OPCODE_CLEAR_DEPTH
:
6975 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6977 case OPCODE_CLEAR_INDEX
:
6978 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6980 case OPCODE_CLEAR_STENCIL
:
6981 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6983 case OPCODE_CLIP_PLANE
:
6990 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6993 case OPCODE_COLOR_MASK
:
6994 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6996 case OPCODE_COLOR_MASK_INDEXED
:
6997 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
7000 case OPCODE_COLOR_MATERIAL
:
7001 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7003 case OPCODE_COLOR_TABLE
:
7005 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7006 ctx
->Unpack
= ctx
->DefaultPacking
;
7007 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
7008 n
[5].e
, n
[6].data
));
7009 ctx
->Unpack
= save
; /* restore */
7012 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
7019 CALL_ColorTableParameterfv(ctx
->Exec
,
7020 (n
[1].e
, n
[2].e
, params
));
7023 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
7030 CALL_ColorTableParameteriv(ctx
->Exec
,
7031 (n
[1].e
, n
[2].e
, params
));
7034 case OPCODE_COLOR_SUB_TABLE
:
7036 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7037 ctx
->Unpack
= ctx
->DefaultPacking
;
7038 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7039 n
[4].e
, n
[5].e
, n
[6].data
));
7040 ctx
->Unpack
= save
; /* restore */
7043 case OPCODE_CONVOLUTION_FILTER_1D
:
7045 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7046 ctx
->Unpack
= ctx
->DefaultPacking
;
7047 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7050 ctx
->Unpack
= save
; /* restore */
7053 case OPCODE_CONVOLUTION_FILTER_2D
:
7055 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7056 ctx
->Unpack
= ctx
->DefaultPacking
;
7057 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7058 n
[4].i
, n
[5].e
, n
[6].e
,
7060 ctx
->Unpack
= save
; /* restore */
7063 case OPCODE_CONVOLUTION_PARAMETER_I
:
7064 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
7066 case OPCODE_CONVOLUTION_PARAMETER_IV
:
7073 CALL_ConvolutionParameteriv(ctx
->Exec
,
7074 (n
[1].e
, n
[2].e
, params
));
7077 case OPCODE_CONVOLUTION_PARAMETER_F
:
7078 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
7080 case OPCODE_CONVOLUTION_PARAMETER_FV
:
7087 CALL_ConvolutionParameterfv(ctx
->Exec
,
7088 (n
[1].e
, n
[2].e
, params
));
7091 case OPCODE_COPY_COLOR_SUB_TABLE
:
7092 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7093 n
[3].i
, n
[4].i
, n
[5].i
));
7095 case OPCODE_COPY_COLOR_TABLE
:
7096 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
7097 n
[3].i
, n
[4].i
, n
[5].i
));
7099 case OPCODE_COPY_PIXELS
:
7100 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7101 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
7104 case OPCODE_COPY_TEX_IMAGE1D
:
7105 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7106 n
[5].i
, n
[6].i
, n
[7].i
));
7108 case OPCODE_COPY_TEX_IMAGE2D
:
7109 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
7110 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
7112 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
7113 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7114 n
[4].i
, n
[5].i
, n
[6].i
));
7116 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
7117 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7118 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7121 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
7122 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7123 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7126 case OPCODE_CULL_FACE
:
7127 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
7129 case OPCODE_DEPTH_FUNC
:
7130 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
7132 case OPCODE_DEPTH_MASK
:
7133 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
7135 case OPCODE_DEPTH_RANGE
:
7136 CALL_DepthRange(ctx
->Exec
,
7137 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
7139 case OPCODE_DISABLE
:
7140 CALL_Disable(ctx
->Exec
, (n
[1].e
));
7142 case OPCODE_DISABLE_INDEXED
:
7143 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7145 case OPCODE_DRAW_BUFFER
:
7146 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
7148 case OPCODE_DRAW_PIXELS
:
7150 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7151 ctx
->Unpack
= ctx
->DefaultPacking
;
7152 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
7154 ctx
->Unpack
= save
; /* restore */
7158 CALL_Enable(ctx
->Exec
, (n
[1].e
));
7160 case OPCODE_ENABLE_INDEXED
:
7161 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
7163 case OPCODE_EVALMESH1
:
7164 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
7166 case OPCODE_EVALMESH2
:
7167 CALL_EvalMesh2(ctx
->Exec
,
7168 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7177 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7180 case OPCODE_FRONT_FACE
:
7181 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7183 case OPCODE_FRUSTUM
:
7184 CALL_Frustum(ctx
->Exec
,
7185 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7188 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7190 case OPCODE_HISTOGRAM
:
7191 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7193 case OPCODE_INDEX_MASK
:
7194 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7196 case OPCODE_INIT_NAMES
:
7197 CALL_InitNames(ctx
->Exec
, ());
7206 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7209 case OPCODE_LIGHT_MODEL
:
7216 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7219 case OPCODE_LINE_STIPPLE
:
7220 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7222 case OPCODE_LINE_WIDTH
:
7223 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7225 case OPCODE_LIST_BASE
:
7226 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7228 case OPCODE_LOAD_IDENTITY
:
7229 CALL_LoadIdentity(ctx
->Exec
, ());
7231 case OPCODE_LOAD_MATRIX
:
7232 if (sizeof(Node
) == sizeof(GLfloat
)) {
7233 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7238 for (i
= 0; i
< 16; i
++) {
7241 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7244 case OPCODE_LOAD_NAME
:
7245 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7247 case OPCODE_LOGIC_OP
:
7248 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7252 GLenum target
= n
[1].e
;
7253 GLint ustride
= _mesa_evaluator_components(target
);
7254 GLint uorder
= n
[5].i
;
7255 GLfloat u1
= n
[2].f
;
7256 GLfloat u2
= n
[3].f
;
7257 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7258 (GLfloat
*) n
[6].data
));
7263 GLenum target
= n
[1].e
;
7264 GLfloat u1
= n
[2].f
;
7265 GLfloat u2
= n
[3].f
;
7266 GLfloat v1
= n
[4].f
;
7267 GLfloat v2
= n
[5].f
;
7268 GLint ustride
= n
[6].i
;
7269 GLint vstride
= n
[7].i
;
7270 GLint uorder
= n
[8].i
;
7271 GLint vorder
= n
[9].i
;
7272 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7273 v1
, v2
, vstride
, vorder
,
7274 (GLfloat
*) n
[10].data
));
7277 case OPCODE_MAPGRID1
:
7278 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7280 case OPCODE_MAPGRID2
:
7281 CALL_MapGrid2f(ctx
->Exec
,
7282 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7284 case OPCODE_MATRIX_MODE
:
7285 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7287 case OPCODE_MIN_MAX
:
7288 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7290 case OPCODE_MULT_MATRIX
:
7291 if (sizeof(Node
) == sizeof(GLfloat
)) {
7292 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7297 for (i
= 0; i
< 16; i
++) {
7300 CALL_MultMatrixf(ctx
->Exec
, (m
));
7304 CALL_Ortho(ctx
->Exec
,
7305 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7307 case OPCODE_PASSTHROUGH
:
7308 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7310 case OPCODE_PIXEL_MAP
:
7311 CALL_PixelMapfv(ctx
->Exec
,
7312 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7314 case OPCODE_PIXEL_TRANSFER
:
7315 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7317 case OPCODE_PIXEL_ZOOM
:
7318 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7320 case OPCODE_POINT_SIZE
:
7321 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7323 case OPCODE_POINT_PARAMETERS
:
7329 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7332 case OPCODE_POLYGON_MODE
:
7333 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7335 case OPCODE_POLYGON_STIPPLE
:
7337 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7338 ctx
->Unpack
= ctx
->DefaultPacking
;
7339 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7340 ctx
->Unpack
= save
; /* restore */
7343 case OPCODE_POLYGON_OFFSET
:
7344 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7346 case OPCODE_POP_ATTRIB
:
7347 CALL_PopAttrib(ctx
->Exec
, ());
7349 case OPCODE_POP_MATRIX
:
7350 CALL_PopMatrix(ctx
->Exec
, ());
7352 case OPCODE_POP_NAME
:
7353 CALL_PopName(ctx
->Exec
, ());
7355 case OPCODE_PRIORITIZE_TEXTURE
:
7356 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7358 case OPCODE_PUSH_ATTRIB
:
7359 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7361 case OPCODE_PUSH_MATRIX
:
7362 CALL_PushMatrix(ctx
->Exec
, ());
7364 case OPCODE_PUSH_NAME
:
7365 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7367 case OPCODE_RASTER_POS
:
7368 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7370 case OPCODE_READ_BUFFER
:
7371 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7373 case OPCODE_RESET_HISTOGRAM
:
7374 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7376 case OPCODE_RESET_MIN_MAX
:
7377 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7380 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7383 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7385 case OPCODE_SCISSOR
:
7386 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7388 case OPCODE_SHADE_MODEL
:
7389 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7391 case OPCODE_PROVOKING_VERTEX
:
7392 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7394 case OPCODE_BEGIN_TRANSFORM_FEEDBACK
:
7395 CALL_BeginTransformFeedbackEXT(ctx
->Exec
, (n
[1].e
));
7397 case OPCODE_END_TRANSFORM_FEEDBACK
:
7398 CALL_EndTransformFeedbackEXT(ctx
->Exec
, ());
7400 case OPCODE_STENCIL_FUNC
:
7401 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7403 case OPCODE_STENCIL_MASK
:
7404 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7406 case OPCODE_STENCIL_OP
:
7407 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7409 case OPCODE_STENCIL_FUNC_SEPARATE
:
7410 CALL_StencilFuncSeparate(ctx
->Exec
,
7411 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7413 case OPCODE_STENCIL_MASK_SEPARATE
:
7414 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7416 case OPCODE_STENCIL_OP_SEPARATE
:
7417 CALL_StencilOpSeparate(ctx
->Exec
,
7418 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7427 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7437 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7440 case OPCODE_TEXPARAMETER
:
7447 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7450 case OPCODE_TEX_IMAGE1D
:
7452 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7453 ctx
->Unpack
= ctx
->DefaultPacking
;
7454 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7456 n
[3].i
, /* components */
7458 n
[5].e
, /* border */
7459 n
[6].e
, /* format */
7462 ctx
->Unpack
= save
; /* restore */
7465 case OPCODE_TEX_IMAGE2D
:
7467 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7468 ctx
->Unpack
= ctx
->DefaultPacking
;
7469 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7471 n
[3].i
, /* components */
7473 n
[5].i
, /* height */
7474 n
[6].e
, /* border */
7475 n
[7].e
, /* format */
7478 ctx
->Unpack
= save
; /* restore */
7481 case OPCODE_TEX_IMAGE3D
:
7483 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7484 ctx
->Unpack
= ctx
->DefaultPacking
;
7485 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7487 n
[3].i
, /* components */
7489 n
[5].i
, /* height */
7491 n
[7].e
, /* border */
7492 n
[8].e
, /* format */
7495 ctx
->Unpack
= save
; /* restore */
7498 case OPCODE_TEX_SUB_IMAGE1D
:
7500 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7501 ctx
->Unpack
= ctx
->DefaultPacking
;
7502 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7504 n
[6].e
, n
[7].data
));
7505 ctx
->Unpack
= save
; /* restore */
7508 case OPCODE_TEX_SUB_IMAGE2D
:
7510 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7511 ctx
->Unpack
= ctx
->DefaultPacking
;
7512 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7514 n
[6].i
, n
[7].e
, n
[8].e
,
7516 ctx
->Unpack
= save
; /* restore */
7519 case OPCODE_TEX_SUB_IMAGE3D
:
7521 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7522 ctx
->Unpack
= ctx
->DefaultPacking
;
7523 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7524 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7525 n
[8].i
, n
[9].e
, n
[10].e
,
7527 ctx
->Unpack
= save
; /* restore */
7530 case OPCODE_TRANSLATE
:
7531 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7533 case OPCODE_VIEWPORT
:
7534 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7535 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7537 case OPCODE_WINDOW_POS
:
7538 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7540 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7541 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7543 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7544 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7545 n
[4].i
, n
[5].i
, n
[6].i
,
7548 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7549 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7550 n
[4].i
, n
[5].i
, n
[6].i
,
7551 n
[7].i
, n
[8].data
));
7553 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7554 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7555 n
[4].i
, n
[5].i
, n
[6].i
,
7559 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7560 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7561 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7562 n
[5].e
, n
[6].i
, n
[7].data
));
7564 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7565 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7566 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7567 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7570 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7571 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7572 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7573 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7574 n
[9].e
, n
[10].i
, n
[11].data
));
7576 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7577 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7579 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7580 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7582 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7583 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7584 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7587 #if FEATURE_NV_vertex_program
7588 case OPCODE_EXECUTE_PROGRAM_NV
:
7595 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7598 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7599 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7600 (GLuint
*) n
[2].data
));
7602 case OPCODE_LOAD_PROGRAM_NV
:
7603 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7604 (const GLubyte
*) n
[4].data
));
7606 case OPCODE_TRACK_MATRIX_NV
:
7607 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7611 #if FEATURE_NV_fragment_program
7612 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7613 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7614 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7617 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7618 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7619 (const GLubyte
*) n
[3].
7620 data
, n
[4].f
, n
[5].f
,
7625 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7626 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7628 case OPCODE_DEPTH_BOUNDS_EXT
:
7629 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7631 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7632 case OPCODE_PROGRAM_STRING_ARB
:
7633 CALL_ProgramStringARB(ctx
->Exec
,
7634 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7637 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7638 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7639 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7644 #if FEATURE_queryobj
7645 case OPCODE_BEGIN_QUERY_ARB
:
7646 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7648 case OPCODE_END_QUERY_ARB
:
7649 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7652 case OPCODE_DRAW_BUFFERS_ARB
:
7654 GLenum buffers
[MAX_DRAW_BUFFERS
];
7655 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7656 for (i
= 0; i
< count
; i
++)
7657 buffers
[i
] = n
[2 + i
].e
;
7658 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7661 #if FEATURE_EXT_framebuffer_blit
7662 case OPCODE_BLIT_FRAMEBUFFER
:
7663 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7664 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7669 case OPCODE_USE_PROGRAM
:
7670 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7672 case OPCODE_UNIFORM_1F
:
7673 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7675 case OPCODE_UNIFORM_2F
:
7676 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7678 case OPCODE_UNIFORM_3F
:
7679 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7681 case OPCODE_UNIFORM_4F
:
7682 CALL_Uniform4fARB(ctx
->Exec
,
7683 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7685 case OPCODE_UNIFORM_1FV
:
7686 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7688 case OPCODE_UNIFORM_2FV
:
7689 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7691 case OPCODE_UNIFORM_3FV
:
7692 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7694 case OPCODE_UNIFORM_4FV
:
7695 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7697 case OPCODE_UNIFORM_1I
:
7698 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7700 case OPCODE_UNIFORM_2I
:
7701 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7703 case OPCODE_UNIFORM_3I
:
7704 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7706 case OPCODE_UNIFORM_4I
:
7707 CALL_Uniform4iARB(ctx
->Exec
,
7708 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7710 case OPCODE_UNIFORM_1IV
:
7711 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7713 case OPCODE_UNIFORM_2IV
:
7714 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7716 case OPCODE_UNIFORM_3IV
:
7717 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7719 case OPCODE_UNIFORM_4IV
:
7720 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7722 case OPCODE_UNIFORM_1UI
:
7723 /*CALL_Uniform1uiARB(ctx->Exec, (n[1].i, n[2].i));*/
7725 case OPCODE_UNIFORM_2UI
:
7726 /*CALL_Uniform2uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i));*/
7728 case OPCODE_UNIFORM_3UI
:
7729 /*CALL_Uniform3uiARB(ctx->Exec, (n[1].i, n[2].i, n[3].i, n[4].i));*/
7731 case OPCODE_UNIFORM_4UI
:
7732 /*CALL_Uniform4uiARB(ctx->Exec,
7733 (n[1].i, n[2].i, n[3].i, n[4].i, n[5].i));
7736 case OPCODE_UNIFORM_1UIV
:
7737 /*CALL_Uniform1uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
7739 case OPCODE_UNIFORM_2UIV
:
7740 /*CALL_Uniform2uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
7742 case OPCODE_UNIFORM_3UIV
:
7743 /*CALL_Uniform3uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
7745 case OPCODE_UNIFORM_4UIV
:
7746 /*CALL_Uniform4uivARB(ctx->Exec, (n[1].i, n[2].i, n[3].data));*/
7748 case OPCODE_UNIFORM_MATRIX22
:
7749 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7750 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7752 case OPCODE_UNIFORM_MATRIX33
:
7753 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7754 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7756 case OPCODE_UNIFORM_MATRIX44
:
7757 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7758 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7760 case OPCODE_UNIFORM_MATRIX23
:
7761 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7762 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7764 case OPCODE_UNIFORM_MATRIX32
:
7765 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7766 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7768 case OPCODE_UNIFORM_MATRIX24
:
7769 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7770 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7772 case OPCODE_UNIFORM_MATRIX42
:
7773 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7774 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7776 case OPCODE_UNIFORM_MATRIX34
:
7777 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7778 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7780 case OPCODE_UNIFORM_MATRIX43
:
7781 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7782 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7785 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7788 GLuint i
, pname
= n
[1].ui
;
7790 for (i
= 0; i
< 4; i
++)
7791 values
[i
] = n
[1 + i
].f
;
7792 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7795 #if FEATURE_ATI_fragment_shader
7796 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7797 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7799 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7802 GLuint i
, dst
= n
[1].ui
;
7804 for (i
= 0; i
< 4; i
++)
7805 values
[i
] = n
[1 + i
].f
;
7806 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7810 case OPCODE_ATTR_1F_NV
:
7811 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7813 case OPCODE_ATTR_2F_NV
:
7814 /* Really shouldn't have to do this - the Node structure
7815 * is convenient, but it would be better to store the data
7816 * packed appropriately so that it can be sent directly
7817 * on. With x86_64 becoming common, this will start to
7820 if (sizeof(Node
) == sizeof(GLfloat
))
7821 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7823 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7825 case OPCODE_ATTR_3F_NV
:
7826 if (sizeof(Node
) == sizeof(GLfloat
))
7827 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7829 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7832 case OPCODE_ATTR_4F_NV
:
7833 if (sizeof(Node
) == sizeof(GLfloat
))
7834 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7836 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7839 case OPCODE_ATTR_1F_ARB
:
7840 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7842 case OPCODE_ATTR_2F_ARB
:
7843 /* Really shouldn't have to do this - the Node structure
7844 * is convenient, but it would be better to store the data
7845 * packed appropriately so that it can be sent directly
7846 * on. With x86_64 becoming common, this will start to
7849 if (sizeof(Node
) == sizeof(GLfloat
))
7850 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7852 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7854 case OPCODE_ATTR_3F_ARB
:
7855 if (sizeof(Node
) == sizeof(GLfloat
))
7856 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7858 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7861 case OPCODE_ATTR_4F_ARB
:
7862 if (sizeof(Node
) == sizeof(GLfloat
))
7863 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7865 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7868 case OPCODE_MATERIAL
:
7869 if (sizeof(Node
) == sizeof(GLfloat
))
7870 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7877 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7881 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7884 CALL_End(ctx
->Exec
, ());
7887 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7889 case OPCODE_EVAL_C1
:
7890 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7892 case OPCODE_EVAL_C2
:
7893 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7895 case OPCODE_EVAL_P1
:
7896 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7898 case OPCODE_EVAL_P2
:
7899 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7902 case OPCODE_CONTINUE
:
7903 n
= (Node
*) n
[1].next
;
7905 case OPCODE_END_OF_LIST
:
7911 _mesa_snprintf(msg
, sizeof(msg
), "Error in execute_list: opcode=%d",
7913 _mesa_problem(ctx
, msg
);
7918 /* increment n to point to next compiled command */
7919 if (opcode
!= OPCODE_CONTINUE
) {
7920 n
+= InstSize
[opcode
];
7925 if (ctx
->Driver
.EndCallList
)
7926 ctx
->Driver
.EndCallList(ctx
);
7928 ctx
->ListState
.CallDepth
--;
7933 /**********************************************************************/
7935 /**********************************************************************/
7938 * Test if a display list number is valid.
7940 static GLboolean GLAPIENTRY
7941 _mesa_IsList(GLuint list
)
7943 GET_CURRENT_CONTEXT(ctx
);
7944 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7945 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7946 return islist(ctx
, list
);
7951 * Delete a sequence of consecutive display lists.
7953 static void GLAPIENTRY
7954 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7956 GET_CURRENT_CONTEXT(ctx
);
7958 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7959 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7962 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7965 for (i
= list
; i
< list
+ range
; i
++) {
7966 destroy_list(ctx
, i
);
7972 * Return a display list number, n, such that lists n through n+range-1
7975 static GLuint GLAPIENTRY
7976 _mesa_GenLists(GLsizei range
)
7978 GET_CURRENT_CONTEXT(ctx
);
7980 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7981 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7984 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7992 * Make this an atomic operation
7994 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7996 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7998 /* reserve the list IDs by with empty/dummy lists */
8000 for (i
= 0; i
< range
; i
++) {
8001 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
8002 make_list(base
+ i
, 1));
8006 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
8013 * Begin a new display list.
8015 static void GLAPIENTRY
8016 _mesa_NewList(GLuint name
, GLenum mode
)
8018 GET_CURRENT_CONTEXT(ctx
);
8020 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
8021 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8023 if (MESA_VERBOSE
& VERBOSE_API
)
8024 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
8025 _mesa_lookup_enum_by_nr(mode
));
8028 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
8032 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
8033 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
8037 if (ctx
->ListState
.CurrentList
) {
8038 /* already compiling a display list */
8039 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
8043 ctx
->CompileFlag
= GL_TRUE
;
8044 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
8046 /* Reset acumulated list state:
8048 invalidate_saved_current_state( ctx
);
8050 /* Allocate new display list */
8051 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
8052 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
8053 ctx
->ListState
.CurrentPos
= 0;
8055 ctx
->Driver
.NewList(ctx
, name
, mode
);
8057 ctx
->CurrentDispatch
= ctx
->Save
;
8058 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8063 * End definition of current display list.
8065 static void GLAPIENTRY
8068 GET_CURRENT_CONTEXT(ctx
);
8069 SAVE_FLUSH_VERTICES(ctx
);
8070 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
8072 if (MESA_VERBOSE
& VERBOSE_API
)
8073 _mesa_debug(ctx
, "glEndList\n");
8075 /* Check that a list is under construction */
8076 if (!ctx
->ListState
.CurrentList
) {
8077 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
8081 /* Call before emitting END_OF_LIST, in case the driver wants to
8082 * emit opcodes itself.
8084 ctx
->Driver
.EndList(ctx
);
8086 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
8088 /* Destroy old list, if any */
8089 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
8091 /* Install the new list */
8092 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
8093 ctx
->ListState
.CurrentList
->Name
,
8094 ctx
->ListState
.CurrentList
);
8097 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
8098 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
8100 ctx
->ListState
.CurrentList
= NULL
;
8101 ctx
->ExecuteFlag
= GL_TRUE
;
8102 ctx
->CompileFlag
= GL_FALSE
;
8104 ctx
->CurrentDispatch
= ctx
->Exec
;
8105 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8110 _mesa_CallList(GLuint list
)
8112 GLboolean save_compile_flag
;
8113 GET_CURRENT_CONTEXT(ctx
);
8114 FLUSH_CURRENT(ctx
, 0);
8115 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
8116 /* execute the display list, and restore the CompileFlag. */
8118 if (MESA_VERBOSE
& VERBOSE_API
)
8119 _mesa_debug(ctx
, "glCallList %d\n", list
);
8122 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
8126 /* mesa_print_display_list( list ); */
8128 save_compile_flag
= ctx
->CompileFlag
;
8129 if (save_compile_flag
) {
8130 ctx
->CompileFlag
= GL_FALSE
;
8133 execute_list(ctx
, list
);
8134 ctx
->CompileFlag
= save_compile_flag
;
8136 /* also restore API function pointers to point to "save" versions */
8137 if (save_compile_flag
) {
8138 ctx
->CurrentDispatch
= ctx
->Save
;
8139 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8145 * Execute glCallLists: call multiple display lists.
8148 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
8150 GET_CURRENT_CONTEXT(ctx
);
8152 GLboolean save_compile_flag
;
8154 if (MESA_VERBOSE
& VERBOSE_API
)
8155 _mesa_debug(ctx
, "glCallLists %d\n", n
);
8159 case GL_UNSIGNED_BYTE
:
8161 case GL_UNSIGNED_SHORT
:
8163 case GL_UNSIGNED_INT
:
8171 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
8175 /* Save the CompileFlag status, turn it off, execute display list,
8176 * and restore the CompileFlag.
8178 save_compile_flag
= ctx
->CompileFlag
;
8179 ctx
->CompileFlag
= GL_FALSE
;
8181 for (i
= 0; i
< n
; i
++) {
8182 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
8183 execute_list(ctx
, list
);
8186 ctx
->CompileFlag
= save_compile_flag
;
8188 /* also restore API function pointers to point to "save" versions */
8189 if (save_compile_flag
) {
8190 ctx
->CurrentDispatch
= ctx
->Save
;
8191 _glapi_set_dispatch(ctx
->CurrentDispatch
);
8197 * Set the offset added to list numbers in glCallLists.
8199 static void GLAPIENTRY
8200 _mesa_ListBase(GLuint base
)
8202 GET_CURRENT_CONTEXT(ctx
);
8203 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8204 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8205 ctx
->List
.ListBase
= base
;
8209 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8211 static void GLAPIENTRY
8214 GET_CURRENT_CONTEXT(ctx
);
8215 FLUSH_VERTICES(ctx
, 0);
8216 CALL_Finish(ctx
->Exec
, ());
8219 static void GLAPIENTRY
8222 GET_CURRENT_CONTEXT(ctx
);
8223 FLUSH_VERTICES(ctx
, 0);
8224 CALL_Flush(ctx
->Exec
, ());
8227 static void GLAPIENTRY
8228 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8230 GET_CURRENT_CONTEXT(ctx
);
8231 FLUSH_VERTICES(ctx
, 0);
8232 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8235 static void GLAPIENTRY
8236 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8238 GET_CURRENT_CONTEXT(ctx
);
8239 FLUSH_VERTICES(ctx
, 0);
8240 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8243 static void GLAPIENTRY
8244 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8246 GET_CURRENT_CONTEXT(ctx
);
8247 FLUSH_VERTICES(ctx
, 0);
8248 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8251 static GLenum GLAPIENTRY
8254 GET_CURRENT_CONTEXT(ctx
);
8255 FLUSH_VERTICES(ctx
, 0);
8256 return CALL_GetError(ctx
->Exec
, ());
8259 static void GLAPIENTRY
8260 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8262 GET_CURRENT_CONTEXT(ctx
);
8263 FLUSH_VERTICES(ctx
, 0);
8264 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8267 static void GLAPIENTRY
8268 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8270 GET_CURRENT_CONTEXT(ctx
);
8271 FLUSH_VERTICES(ctx
, 0);
8272 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8275 static void GLAPIENTRY
8276 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8278 GET_CURRENT_CONTEXT(ctx
);
8279 FLUSH_VERTICES(ctx
, 0);
8280 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8283 static void GLAPIENTRY
8284 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8286 GET_CURRENT_CONTEXT(ctx
);
8287 FLUSH_VERTICES(ctx
, 0);
8288 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8291 static void GLAPIENTRY
8292 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8294 GET_CURRENT_CONTEXT(ctx
);
8295 FLUSH_VERTICES(ctx
, 0);
8296 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8299 static void GLAPIENTRY
8300 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8302 GET_CURRENT_CONTEXT(ctx
);
8303 FLUSH_VERTICES(ctx
, 0);
8304 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8307 static void GLAPIENTRY
8308 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8310 GET_CURRENT_CONTEXT(ctx
);
8311 FLUSH_VERTICES(ctx
, 0);
8312 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8315 static void GLAPIENTRY
8316 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8318 GET_CURRENT_CONTEXT(ctx
);
8319 FLUSH_VERTICES(ctx
, 0);
8320 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8323 static void GLAPIENTRY
8324 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8326 GET_CURRENT_CONTEXT(ctx
);
8327 FLUSH_VERTICES(ctx
, 0);
8328 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8331 static void GLAPIENTRY
8332 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8334 GET_CURRENT_CONTEXT(ctx
);
8335 FLUSH_VERTICES(ctx
, 0);
8336 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8339 static void GLAPIENTRY
8340 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8342 GET_CURRENT_CONTEXT(ctx
);
8343 FLUSH_VERTICES(ctx
, 0);
8344 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8347 static void GLAPIENTRY
8348 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8350 GET_CURRENT_CONTEXT(ctx
);
8351 FLUSH_VERTICES(ctx
, 0);
8352 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8355 static void GLAPIENTRY
8356 exec_GetPolygonStipple(GLubyte
* dest
)
8358 GET_CURRENT_CONTEXT(ctx
);
8359 FLUSH_VERTICES(ctx
, 0);
8360 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8363 static const GLubyte
*GLAPIENTRY
8364 exec_GetString(GLenum name
)
8366 GET_CURRENT_CONTEXT(ctx
);
8367 FLUSH_VERTICES(ctx
, 0);
8368 return CALL_GetString(ctx
->Exec
, (name
));
8371 static void GLAPIENTRY
8372 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8374 GET_CURRENT_CONTEXT(ctx
);
8375 FLUSH_VERTICES(ctx
, 0);
8376 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8379 static void GLAPIENTRY
8380 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8382 GET_CURRENT_CONTEXT(ctx
);
8383 FLUSH_VERTICES(ctx
, 0);
8384 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8387 static void GLAPIENTRY
8388 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8390 GET_CURRENT_CONTEXT(ctx
);
8391 FLUSH_VERTICES(ctx
, 0);
8392 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8395 static void GLAPIENTRY
8396 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8398 GET_CURRENT_CONTEXT(ctx
);
8399 FLUSH_VERTICES(ctx
, 0);
8400 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8403 static void GLAPIENTRY
8404 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8406 GET_CURRENT_CONTEXT(ctx
);
8407 FLUSH_VERTICES(ctx
, 0);
8408 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8411 static void GLAPIENTRY
8412 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8413 GLenum type
, GLvoid
* pixels
)
8415 GET_CURRENT_CONTEXT(ctx
);
8416 FLUSH_VERTICES(ctx
, 0);
8417 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8420 static void GLAPIENTRY
8421 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8422 GLenum pname
, GLfloat
*params
)
8424 GET_CURRENT_CONTEXT(ctx
);
8425 FLUSH_VERTICES(ctx
, 0);
8426 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8429 static void GLAPIENTRY
8430 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8431 GLenum pname
, GLint
*params
)
8433 GET_CURRENT_CONTEXT(ctx
);
8434 FLUSH_VERTICES(ctx
, 0);
8435 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8438 static void GLAPIENTRY
8439 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8441 GET_CURRENT_CONTEXT(ctx
);
8442 FLUSH_VERTICES(ctx
, 0);
8443 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8446 static void GLAPIENTRY
8447 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8449 GET_CURRENT_CONTEXT(ctx
);
8450 FLUSH_VERTICES(ctx
, 0);
8451 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8454 static GLboolean GLAPIENTRY
8455 exec_IsEnabled(GLenum cap
)
8457 GET_CURRENT_CONTEXT(ctx
);
8458 FLUSH_VERTICES(ctx
, 0);
8459 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8462 static void GLAPIENTRY
8463 exec_PixelStoref(GLenum pname
, GLfloat param
)
8465 GET_CURRENT_CONTEXT(ctx
);
8466 FLUSH_VERTICES(ctx
, 0);
8467 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8470 static void GLAPIENTRY
8471 exec_PixelStorei(GLenum pname
, GLint param
)
8473 GET_CURRENT_CONTEXT(ctx
);
8474 FLUSH_VERTICES(ctx
, 0);
8475 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8478 static void GLAPIENTRY
8479 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8480 GLenum format
, GLenum type
, GLvoid
* pixels
)
8482 GET_CURRENT_CONTEXT(ctx
);
8483 FLUSH_VERTICES(ctx
, 0);
8484 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8487 static GLint GLAPIENTRY
8488 exec_RenderMode(GLenum mode
)
8490 GET_CURRENT_CONTEXT(ctx
);
8491 FLUSH_VERTICES(ctx
, 0);
8492 return CALL_RenderMode(ctx
->Exec
, (mode
));
8495 static void GLAPIENTRY
8496 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8498 GET_CURRENT_CONTEXT(ctx
);
8499 FLUSH_VERTICES(ctx
, 0);
8500 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8503 static void GLAPIENTRY
8504 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8506 GET_CURRENT_CONTEXT(ctx
);
8507 FLUSH_VERTICES(ctx
, 0);
8508 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8511 static GLboolean GLAPIENTRY
8512 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8513 GLboolean
* residences
)
8515 GET_CURRENT_CONTEXT(ctx
);
8516 FLUSH_VERTICES(ctx
, 0);
8517 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8520 static void GLAPIENTRY
8521 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8523 GET_CURRENT_CONTEXT(ctx
);
8524 FLUSH_VERTICES(ctx
, 0);
8525 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8528 static void GLAPIENTRY
8529 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8531 GET_CURRENT_CONTEXT(ctx
);
8532 FLUSH_VERTICES(ctx
, 0);
8533 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8536 static void GLAPIENTRY
8537 exec_DisableClientState(GLenum cap
)
8539 GET_CURRENT_CONTEXT(ctx
);
8540 FLUSH_VERTICES(ctx
, 0);
8541 CALL_DisableClientState(ctx
->Exec
, (cap
));
8544 static void GLAPIENTRY
8545 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8547 GET_CURRENT_CONTEXT(ctx
);
8548 FLUSH_VERTICES(ctx
, 0);
8549 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8552 static void GLAPIENTRY
8553 exec_EnableClientState(GLenum cap
)
8555 GET_CURRENT_CONTEXT(ctx
);
8556 FLUSH_VERTICES(ctx
, 0);
8557 CALL_EnableClientState(ctx
->Exec
, (cap
));
8560 static void GLAPIENTRY
8561 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8563 GET_CURRENT_CONTEXT(ctx
);
8564 FLUSH_VERTICES(ctx
, 0);
8565 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8568 static void GLAPIENTRY
8569 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8571 GET_CURRENT_CONTEXT(ctx
);
8572 FLUSH_VERTICES(ctx
, 0);
8573 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8576 static void GLAPIENTRY
8577 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8579 GET_CURRENT_CONTEXT(ctx
);
8580 FLUSH_VERTICES(ctx
, 0);
8581 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8584 static void GLAPIENTRY
8585 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8587 GET_CURRENT_CONTEXT(ctx
);
8588 FLUSH_VERTICES(ctx
, 0);
8589 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8592 static GLboolean GLAPIENTRY
8593 exec_IsTexture(GLuint texture
)
8595 GET_CURRENT_CONTEXT(ctx
);
8596 FLUSH_VERTICES(ctx
, 0);
8597 return CALL_IsTexture(ctx
->Exec
, (texture
));
8600 static void GLAPIENTRY
8601 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8603 GET_CURRENT_CONTEXT(ctx
);
8604 FLUSH_VERTICES(ctx
, 0);
8605 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8608 static void GLAPIENTRY
8609 exec_PopClientAttrib(void)
8611 GET_CURRENT_CONTEXT(ctx
);
8612 FLUSH_VERTICES(ctx
, 0);
8613 CALL_PopClientAttrib(ctx
->Exec
, ());
8616 static void GLAPIENTRY
8617 exec_PushClientAttrib(GLbitfield mask
)
8619 GET_CURRENT_CONTEXT(ctx
);
8620 FLUSH_VERTICES(ctx
, 0);
8621 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8624 static void GLAPIENTRY
8625 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8628 GET_CURRENT_CONTEXT(ctx
);
8629 FLUSH_VERTICES(ctx
, 0);
8630 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8633 static void GLAPIENTRY
8634 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8636 GET_CURRENT_CONTEXT(ctx
);
8637 FLUSH_VERTICES(ctx
, 0);
8638 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8641 static void GLAPIENTRY
8642 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8645 GET_CURRENT_CONTEXT(ctx
);
8646 FLUSH_VERTICES(ctx
, 0);
8647 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8650 static void GLAPIENTRY
8651 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8652 GLint x
, GLint y
, GLsizei width
)
8654 GET_CURRENT_CONTEXT(ctx
);
8655 FLUSH_VERTICES(ctx
, 0);
8656 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8657 (target
, internalFormat
, x
, y
, width
));
8660 static void GLAPIENTRY
8661 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8662 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8664 GET_CURRENT_CONTEXT(ctx
);
8665 FLUSH_VERTICES(ctx
, 0);
8666 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8667 (target
, internalFormat
, x
, y
, width
,
8671 static void GLAPIENTRY
8672 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8674 GET_CURRENT_CONTEXT(ctx
);
8675 FLUSH_VERTICES(ctx
, 0);
8676 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8679 static void GLAPIENTRY
8680 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8682 GET_CURRENT_CONTEXT(ctx
);
8683 FLUSH_VERTICES(ctx
, 0);
8684 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8687 static void GLAPIENTRY
8688 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8690 GET_CURRENT_CONTEXT(ctx
);
8691 FLUSH_VERTICES(ctx
, 0);
8692 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8695 static void GLAPIENTRY
8696 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8699 GET_CURRENT_CONTEXT(ctx
);
8700 FLUSH_VERTICES(ctx
, 0);
8701 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8704 static void GLAPIENTRY
8705 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8707 GET_CURRENT_CONTEXT(ctx
);
8708 FLUSH_VERTICES(ctx
, 0);
8709 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8712 static void GLAPIENTRY
8713 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8715 GET_CURRENT_CONTEXT(ctx
);
8716 FLUSH_VERTICES(ctx
, 0);
8717 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8720 static void GLAPIENTRY
8721 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8722 GLenum type
, GLvoid
*values
)
8724 GET_CURRENT_CONTEXT(ctx
);
8725 FLUSH_VERTICES(ctx
, 0);
8726 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8729 static void GLAPIENTRY
8730 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8732 GET_CURRENT_CONTEXT(ctx
);
8733 FLUSH_VERTICES(ctx
, 0);
8734 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8737 static void GLAPIENTRY
8738 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8740 GET_CURRENT_CONTEXT(ctx
);
8741 FLUSH_VERTICES(ctx
, 0);
8742 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8745 static void GLAPIENTRY
8746 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8747 GLenum type
, GLvoid
*values
)
8749 GET_CURRENT_CONTEXT(ctx
);
8750 FLUSH_VERTICES(ctx
, 0);
8751 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8754 static void GLAPIENTRY
8755 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8757 GET_CURRENT_CONTEXT(ctx
);
8758 FLUSH_VERTICES(ctx
, 0);
8759 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8762 static void GLAPIENTRY
8763 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8765 GET_CURRENT_CONTEXT(ctx
);
8766 FLUSH_VERTICES(ctx
, 0);
8767 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8770 static void GLAPIENTRY
8771 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8772 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8774 GET_CURRENT_CONTEXT(ctx
);
8775 FLUSH_VERTICES(ctx
, 0);
8776 CALL_GetSeparableFilter(ctx
->Exec
,
8777 (target
, format
, type
, row
, column
, span
));
8780 static void GLAPIENTRY
8781 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8782 GLsizei width
, GLsizei height
, GLenum format
,
8783 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8785 GET_CURRENT_CONTEXT(ctx
);
8786 FLUSH_VERTICES(ctx
, 0);
8787 CALL_SeparableFilter2D(ctx
->Exec
,
8788 (target
, internalFormat
, width
, height
, format
,
8789 type
, row
, column
));
8792 static void GLAPIENTRY
8793 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8794 GLsizei count
, const GLvoid
*ptr
)
8796 GET_CURRENT_CONTEXT(ctx
);
8797 FLUSH_VERTICES(ctx
, 0);
8798 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8801 static void GLAPIENTRY
8802 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8804 GET_CURRENT_CONTEXT(ctx
);
8805 FLUSH_VERTICES(ctx
, 0);
8806 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8809 static void GLAPIENTRY
8810 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8813 GET_CURRENT_CONTEXT(ctx
);
8814 FLUSH_VERTICES(ctx
, 0);
8815 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8818 static void GLAPIENTRY
8819 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8822 GET_CURRENT_CONTEXT(ctx
);
8823 FLUSH_VERTICES(ctx
, 0);
8824 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8827 static void GLAPIENTRY
8828 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8829 GLsizei count
, const GLvoid
*ptr
)
8831 GET_CURRENT_CONTEXT(ctx
);
8832 FLUSH_VERTICES(ctx
, 0);
8833 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8836 static void GLAPIENTRY
8837 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8838 GLsizei count
, const GLvoid
*ptr
)
8840 GET_CURRENT_CONTEXT(ctx
);
8841 FLUSH_VERTICES(ctx
, 0);
8842 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8845 static void GLAPIENTRY
8846 exec_LockArraysEXT(GLint first
, GLsizei count
)
8848 GET_CURRENT_CONTEXT(ctx
);
8849 FLUSH_VERTICES(ctx
, 0);
8850 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8853 static void GLAPIENTRY
8854 exec_UnlockArraysEXT(void)
8856 GET_CURRENT_CONTEXT(ctx
);
8857 FLUSH_VERTICES(ctx
, 0);
8858 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8861 static void GLAPIENTRY
8862 exec_ClientActiveTextureARB(GLenum target
)
8864 GET_CURRENT_CONTEXT(ctx
);
8865 FLUSH_VERTICES(ctx
, 0);
8866 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8869 static void GLAPIENTRY
8870 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8871 GLsizei stride
, const GLvoid
*ptr
)
8873 GET_CURRENT_CONTEXT(ctx
);
8874 FLUSH_VERTICES(ctx
, 0);
8875 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8878 static void GLAPIENTRY
8879 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8881 GET_CURRENT_CONTEXT(ctx
);
8882 FLUSH_VERTICES(ctx
, 0);
8883 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8886 /* GL_EXT_multi_draw_arrays */
8887 static void GLAPIENTRY
8888 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8889 GLsizei
* count
, GLsizei primcount
)
8891 GET_CURRENT_CONTEXT(ctx
);
8892 FLUSH_VERTICES(ctx
, 0);
8893 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8896 /* GL_IBM_multimode_draw_arrays */
8897 static void GLAPIENTRY
8898 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8899 const GLsizei
* count
, GLsizei primcount
,
8902 GET_CURRENT_CONTEXT(ctx
);
8903 FLUSH_VERTICES(ctx
, 0);
8904 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8905 (mode
, first
, count
, primcount
, modestride
));
8908 /* GL_IBM_multimode_draw_arrays */
8909 static void GLAPIENTRY
8910 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8911 const GLsizei
* count
,
8913 const GLvoid
* const *indices
,
8914 GLsizei primcount
, GLint modestride
)
8916 GET_CURRENT_CONTEXT(ctx
);
8917 FLUSH_VERTICES(ctx
, 0);
8918 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8919 (mode
, count
, type
, indices
, primcount
,
8926 * Setup the given dispatch table to point to Mesa's display list
8927 * building functions.
8929 * This does not include any of the tnl functions - they are
8930 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8933 struct _glapi_table
*
8934 _mesa_create_save_table(void)
8936 struct _glapi_table
*table
;
8938 table
= _mesa_alloc_dispatch_table(sizeof *table
);
8942 _mesa_loopback_init_api_table(table
);
8945 SET_Accum(table
, save_Accum
);
8946 SET_AlphaFunc(table
, save_AlphaFunc
);
8947 SET_Bitmap(table
, save_Bitmap
);
8948 SET_BlendFunc(table
, save_BlendFunc
);
8949 SET_CallList(table
, save_CallList
);
8950 SET_CallLists(table
, save_CallLists
);
8951 SET_Clear(table
, save_Clear
);
8952 SET_ClearAccum(table
, save_ClearAccum
);
8953 SET_ClearColor(table
, save_ClearColor
);
8954 SET_ClearDepth(table
, save_ClearDepth
);
8955 SET_ClearIndex(table
, save_ClearIndex
);
8956 SET_ClearStencil(table
, save_ClearStencil
);
8957 SET_ClipPlane(table
, save_ClipPlane
);
8958 SET_ColorMask(table
, save_ColorMask
);
8959 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
8960 SET_ColorMaterial(table
, save_ColorMaterial
);
8961 SET_CopyPixels(table
, save_CopyPixels
);
8962 SET_CullFace(table
, save_CullFace
);
8963 SET_DeleteLists(table
, _mesa_DeleteLists
);
8964 SET_DepthFunc(table
, save_DepthFunc
);
8965 SET_DepthMask(table
, save_DepthMask
);
8966 SET_DepthRange(table
, save_DepthRange
);
8967 SET_Disable(table
, save_Disable
);
8968 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
8969 SET_DrawBuffer(table
, save_DrawBuffer
);
8970 SET_DrawPixels(table
, save_DrawPixels
);
8971 SET_Enable(table
, save_Enable
);
8972 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
8973 SET_EndList(table
, _mesa_EndList
);
8974 SET_EvalMesh1(table
, save_EvalMesh1
);
8975 SET_EvalMesh2(table
, save_EvalMesh2
);
8976 SET_Finish(table
, exec_Finish
);
8977 SET_Flush(table
, exec_Flush
);
8978 SET_Fogf(table
, save_Fogf
);
8979 SET_Fogfv(table
, save_Fogfv
);
8980 SET_Fogi(table
, save_Fogi
);
8981 SET_Fogiv(table
, save_Fogiv
);
8982 SET_FrontFace(table
, save_FrontFace
);
8983 SET_Frustum(table
, save_Frustum
);
8984 SET_GenLists(table
, _mesa_GenLists
);
8985 SET_GetBooleanv(table
, exec_GetBooleanv
);
8986 SET_GetClipPlane(table
, exec_GetClipPlane
);
8987 SET_GetDoublev(table
, exec_GetDoublev
);
8988 SET_GetError(table
, exec_GetError
);
8989 SET_GetFloatv(table
, exec_GetFloatv
);
8990 SET_GetIntegerv(table
, exec_GetIntegerv
);
8991 SET_GetLightfv(table
, exec_GetLightfv
);
8992 SET_GetLightiv(table
, exec_GetLightiv
);
8993 SET_GetMapdv(table
, exec_GetMapdv
);
8994 SET_GetMapfv(table
, exec_GetMapfv
);
8995 SET_GetMapiv(table
, exec_GetMapiv
);
8996 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8997 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8998 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8999 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
9000 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
9001 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
9002 SET_GetString(table
, exec_GetString
);
9003 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
9004 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
9005 SET_GetTexGendv(table
, exec_GetTexGendv
);
9006 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
9007 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
9008 SET_GetTexImage(table
, exec_GetTexImage
);
9009 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
9010 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
9011 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
9012 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
9013 SET_Hint(table
, save_Hint
);
9014 SET_IndexMask(table
, save_IndexMask
);
9015 SET_InitNames(table
, save_InitNames
);
9016 SET_IsEnabled(table
, exec_IsEnabled
);
9017 SET_IsList(table
, _mesa_IsList
);
9018 SET_LightModelf(table
, save_LightModelf
);
9019 SET_LightModelfv(table
, save_LightModelfv
);
9020 SET_LightModeli(table
, save_LightModeli
);
9021 SET_LightModeliv(table
, save_LightModeliv
);
9022 SET_Lightf(table
, save_Lightf
);
9023 SET_Lightfv(table
, save_Lightfv
);
9024 SET_Lighti(table
, save_Lighti
);
9025 SET_Lightiv(table
, save_Lightiv
);
9026 SET_LineStipple(table
, save_LineStipple
);
9027 SET_LineWidth(table
, save_LineWidth
);
9028 SET_ListBase(table
, save_ListBase
);
9029 SET_LoadIdentity(table
, save_LoadIdentity
);
9030 SET_LoadMatrixd(table
, save_LoadMatrixd
);
9031 SET_LoadMatrixf(table
, save_LoadMatrixf
);
9032 SET_LoadName(table
, save_LoadName
);
9033 SET_LogicOp(table
, save_LogicOp
);
9034 SET_Map1d(table
, save_Map1d
);
9035 SET_Map1f(table
, save_Map1f
);
9036 SET_Map2d(table
, save_Map2d
);
9037 SET_Map2f(table
, save_Map2f
);
9038 SET_MapGrid1d(table
, save_MapGrid1d
);
9039 SET_MapGrid1f(table
, save_MapGrid1f
);
9040 SET_MapGrid2d(table
, save_MapGrid2d
);
9041 SET_MapGrid2f(table
, save_MapGrid2f
);
9042 SET_MatrixMode(table
, save_MatrixMode
);
9043 SET_MultMatrixd(table
, save_MultMatrixd
);
9044 SET_MultMatrixf(table
, save_MultMatrixf
);
9045 SET_NewList(table
, save_NewList
);
9046 SET_Ortho(table
, save_Ortho
);
9047 SET_PassThrough(table
, save_PassThrough
);
9048 SET_PixelMapfv(table
, save_PixelMapfv
);
9049 SET_PixelMapuiv(table
, save_PixelMapuiv
);
9050 SET_PixelMapusv(table
, save_PixelMapusv
);
9051 SET_PixelStoref(table
, exec_PixelStoref
);
9052 SET_PixelStorei(table
, exec_PixelStorei
);
9053 SET_PixelTransferf(table
, save_PixelTransferf
);
9054 SET_PixelTransferi(table
, save_PixelTransferi
);
9055 SET_PixelZoom(table
, save_PixelZoom
);
9056 SET_PointSize(table
, save_PointSize
);
9057 SET_PolygonMode(table
, save_PolygonMode
);
9058 SET_PolygonOffset(table
, save_PolygonOffset
);
9059 SET_PolygonStipple(table
, save_PolygonStipple
);
9060 SET_PopAttrib(table
, save_PopAttrib
);
9061 SET_PopMatrix(table
, save_PopMatrix
);
9062 SET_PopName(table
, save_PopName
);
9063 SET_PushAttrib(table
, save_PushAttrib
);
9064 SET_PushMatrix(table
, save_PushMatrix
);
9065 SET_PushName(table
, save_PushName
);
9066 SET_RasterPos2d(table
, save_RasterPos2d
);
9067 SET_RasterPos2dv(table
, save_RasterPos2dv
);
9068 SET_RasterPos2f(table
, save_RasterPos2f
);
9069 SET_RasterPos2fv(table
, save_RasterPos2fv
);
9070 SET_RasterPos2i(table
, save_RasterPos2i
);
9071 SET_RasterPos2iv(table
, save_RasterPos2iv
);
9072 SET_RasterPos2s(table
, save_RasterPos2s
);
9073 SET_RasterPos2sv(table
, save_RasterPos2sv
);
9074 SET_RasterPos3d(table
, save_RasterPos3d
);
9075 SET_RasterPos3dv(table
, save_RasterPos3dv
);
9076 SET_RasterPos3f(table
, save_RasterPos3f
);
9077 SET_RasterPos3fv(table
, save_RasterPos3fv
);
9078 SET_RasterPos3i(table
, save_RasterPos3i
);
9079 SET_RasterPos3iv(table
, save_RasterPos3iv
);
9080 SET_RasterPos3s(table
, save_RasterPos3s
);
9081 SET_RasterPos3sv(table
, save_RasterPos3sv
);
9082 SET_RasterPos4d(table
, save_RasterPos4d
);
9083 SET_RasterPos4dv(table
, save_RasterPos4dv
);
9084 SET_RasterPos4f(table
, save_RasterPos4f
);
9085 SET_RasterPos4fv(table
, save_RasterPos4fv
);
9086 SET_RasterPos4i(table
, save_RasterPos4i
);
9087 SET_RasterPos4iv(table
, save_RasterPos4iv
);
9088 SET_RasterPos4s(table
, save_RasterPos4s
);
9089 SET_RasterPos4sv(table
, save_RasterPos4sv
);
9090 SET_ReadBuffer(table
, save_ReadBuffer
);
9091 SET_ReadPixels(table
, exec_ReadPixels
);
9092 SET_RenderMode(table
, exec_RenderMode
);
9093 SET_Rotated(table
, save_Rotated
);
9094 SET_Rotatef(table
, save_Rotatef
);
9095 SET_Scaled(table
, save_Scaled
);
9096 SET_Scalef(table
, save_Scalef
);
9097 SET_Scissor(table
, save_Scissor
);
9098 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
9099 SET_SelectBuffer(table
, exec_SelectBuffer
);
9100 SET_ShadeModel(table
, save_ShadeModel
);
9101 SET_StencilFunc(table
, save_StencilFunc
);
9102 SET_StencilMask(table
, save_StencilMask
);
9103 SET_StencilOp(table
, save_StencilOp
);
9104 SET_TexEnvf(table
, save_TexEnvf
);
9105 SET_TexEnvfv(table
, save_TexEnvfv
);
9106 SET_TexEnvi(table
, save_TexEnvi
);
9107 SET_TexEnviv(table
, save_TexEnviv
);
9108 SET_TexGend(table
, save_TexGend
);
9109 SET_TexGendv(table
, save_TexGendv
);
9110 SET_TexGenf(table
, save_TexGenf
);
9111 SET_TexGenfv(table
, save_TexGenfv
);
9112 SET_TexGeni(table
, save_TexGeni
);
9113 SET_TexGeniv(table
, save_TexGeniv
);
9114 SET_TexImage1D(table
, save_TexImage1D
);
9115 SET_TexImage2D(table
, save_TexImage2D
);
9116 SET_TexParameterf(table
, save_TexParameterf
);
9117 SET_TexParameterfv(table
, save_TexParameterfv
);
9118 SET_TexParameteri(table
, save_TexParameteri
);
9119 SET_TexParameteriv(table
, save_TexParameteriv
);
9120 SET_Translated(table
, save_Translated
);
9121 SET_Translatef(table
, save_Translatef
);
9122 SET_Viewport(table
, save_Viewport
);
9125 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
9126 SET_BindTexture(table
, save_BindTexture
);
9127 SET_ColorPointer(table
, exec_ColorPointer
);
9128 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
9129 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
9130 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
9131 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
9132 SET_DeleteTextures(table
, exec_DeleteTextures
);
9133 SET_DisableClientState(table
, exec_DisableClientState
);
9134 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
9135 SET_EnableClientState(table
, exec_EnableClientState
);
9136 SET_GenTextures(table
, exec_GenTextures
);
9137 SET_GetPointerv(table
, exec_GetPointerv
);
9138 SET_IndexPointer(table
, exec_IndexPointer
);
9139 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
9140 SET_IsTexture(table
, exec_IsTexture
);
9141 SET_NormalPointer(table
, exec_NormalPointer
);
9142 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
9143 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
9144 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
9145 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
9146 SET_TexSubImage1D(table
, save_TexSubImage1D
);
9147 SET_TexSubImage2D(table
, save_TexSubImage2D
);
9148 SET_VertexPointer(table
, exec_VertexPointer
);
9151 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
9152 SET_TexImage3D(table
, save_TexImage3D
);
9153 SET_TexSubImage3D(table
, save_TexSubImage3D
);
9156 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
9157 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
9158 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
9160 /* ATI_separate_stencil */
9161 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
9163 /* GL_ARB_imaging */
9164 /* Not all are supported */
9165 SET_BlendColor(table
, save_BlendColor
);
9166 SET_BlendEquation(table
, save_BlendEquation
);
9167 SET_ColorSubTable(table
, save_ColorSubTable
);
9168 SET_ColorTable(table
, save_ColorTable
);
9169 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
9170 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
9171 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
9172 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
9173 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
9174 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
9175 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
9176 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
9177 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
9178 SET_CopyColorTable(table
, save_CopyColorTable
);
9179 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
9180 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
9181 SET_GetColorTable(table
, exec_GetColorTable
);
9182 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
9183 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
9184 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
9185 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
9186 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
9187 SET_GetHistogram(table
, exec_GetHistogram
);
9188 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
9189 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
9190 SET_GetMinmax(table
, exec_GetMinmax
);
9191 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
9192 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
9193 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
9194 SET_Histogram(table
, save_Histogram
);
9195 SET_Minmax(table
, save_Minmax
);
9196 SET_ResetHistogram(table
, save_ResetHistogram
);
9197 SET_ResetMinmax(table
, save_ResetMinmax
);
9198 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
9200 /* 2. GL_EXT_blend_color */
9202 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9205 /* 3. GL_EXT_polygon_offset */
9206 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9208 /* 6. GL_EXT_texture3d */
9210 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9211 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9212 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9215 /* 14. GL_SGI_color_table */
9217 SET_ColorTableSGI(table
, save_ColorTable
);
9218 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9219 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9220 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9221 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9224 /* 30. GL_EXT_vertex_array */
9225 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9226 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9227 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9228 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9229 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9230 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9232 /* 37. GL_EXT_blend_minmax */
9234 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9237 /* 54. GL_EXT_point_parameters */
9238 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9239 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9241 /* 97. GL_EXT_compiled_vertex_array */
9242 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9243 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9245 /* 145. GL_EXT_secondary_color */
9246 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9248 /* 148. GL_EXT_multi_draw_arrays */
9249 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9251 /* 149. GL_EXT_fog_coord */
9252 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9254 /* 173. GL_EXT_blend_func_separate */
9255 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9257 /* 196. GL_MESA_resize_buffers */
9258 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9260 /* 197. GL_MESA_window_pos */
9261 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9262 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9263 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9264 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9265 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9266 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9267 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9268 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9269 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9270 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9271 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9272 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9273 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9274 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9275 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9276 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9277 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9278 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9279 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9280 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9281 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9282 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9283 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9284 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9286 /* 200. GL_IBM_multimode_draw_arrays */
9287 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9288 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9290 #if FEATURE_NV_vertex_program
9291 /* 233. GL_NV_vertex_program */
9292 /* The following commands DO NOT go into display lists:
9293 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9294 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9296 SET_BindProgramNV(table
, save_BindProgramNV
);
9297 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9298 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
9299 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9300 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
9301 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
9302 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
9303 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
9304 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
9305 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
9306 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
9307 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9308 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9309 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9310 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9311 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9312 SET_LoadProgramNV(table
, save_LoadProgramNV
);
9313 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9314 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9315 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9316 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9317 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
9318 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
9319 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
9320 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
9323 /* 244. GL_ATI_envmap_bumpmap */
9324 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9325 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9327 /* 245. GL_ATI_fragment_shader */
9328 #if FEATURE_ATI_fragment_shader
9329 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9330 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9333 /* 282. GL_NV_fragment_program */
9334 #if FEATURE_NV_fragment_program
9335 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
9336 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
9337 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
9338 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
9339 SET_GetProgramNamedParameterfvNV(table
,
9340 _mesa_GetProgramNamedParameterfvNV
);
9341 SET_GetProgramNamedParameterdvNV(table
,
9342 _mesa_GetProgramNamedParameterdvNV
);
9343 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9344 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9345 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9346 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9347 SET_GetProgramLocalParameterdvARB(table
,
9348 _mesa_GetProgramLocalParameterdvARB
);
9349 SET_GetProgramLocalParameterfvARB(table
,
9350 _mesa_GetProgramLocalParameterfvARB
);
9353 /* 262. GL_NV_point_sprite */
9354 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9355 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9357 /* 268. GL_EXT_stencil_two_side */
9358 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9360 /* 273. GL_APPLE_vertex_array_object */
9361 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9362 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9363 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9364 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9366 /* ???. GL_EXT_depth_bounds_test */
9367 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9369 /* ARB 1. GL_ARB_multitexture */
9370 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9371 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9373 /* ARB 3. GL_ARB_transpose_matrix */
9374 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9375 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9376 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9377 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9379 /* ARB 5. GL_ARB_multisample */
9380 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9382 /* ARB 12. GL_ARB_texture_compression */
9383 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9384 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9385 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9386 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9387 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9388 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9389 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9391 /* ARB 14. GL_ARB_point_parameters */
9392 /* aliased with EXT_point_parameters functions */
9394 /* ARB 25. GL_ARB_window_pos */
9395 /* aliased with MESA_window_pos functions */
9397 /* ARB 26. GL_ARB_vertex_program */
9398 /* ARB 27. GL_ARB_fragment_program */
9399 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9400 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9401 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9402 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9403 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9404 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9405 SET_BindProgramNV(table
, save_BindProgramNV
);
9406 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9407 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9408 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9409 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9410 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9411 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9412 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9413 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9414 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9415 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9416 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9417 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9418 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9419 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9420 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9421 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9422 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9423 SET_GetProgramLocalParameterdvARB(table
,
9424 _mesa_GetProgramLocalParameterdvARB
);
9425 SET_GetProgramLocalParameterfvARB(table
,
9426 _mesa_GetProgramLocalParameterfvARB
);
9427 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9428 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9431 /* ARB 28. GL_ARB_vertex_buffer_object */
9432 #if FEATURE_ARB_vertex_buffer_object
9433 /* None of the extension's functions get compiled */
9434 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9435 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9436 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9437 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9438 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9439 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9440 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9441 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9442 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9443 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9444 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9447 #if FEATURE_queryobj
9448 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9449 SET_EndQueryARB(table
, save_EndQueryARB
);
9450 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9451 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9452 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9453 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9454 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9455 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9457 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9459 #if FEATURE_EXT_framebuffer_blit
9460 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9463 /* GL_ARB_shader_objects */
9464 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9465 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9466 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9467 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9468 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9469 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9470 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9471 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9472 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9473 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9474 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9475 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9476 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9477 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9478 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9479 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9480 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9481 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9482 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9483 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9484 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9485 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9486 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9487 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9488 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9489 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9491 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9492 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9493 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9494 /* XXX additional functions need to be implemented here! */
9496 /* 299. GL_EXT_blend_equation_separate */
9497 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9499 /* GL_EXT_gpu_program_parameters */
9500 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9501 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9502 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9505 /* ARB 50. GL_ARB_map_buffer_range */
9506 #if FEATURE_ARB_map_buffer_range
9507 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9508 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9511 /* ARB 59. GL_ARB_copy_buffer */
9512 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9514 /* 352. GL_EXT_transform_feedback */
9515 #if FEATURE_EXT_transform_feedback
9516 SET_BeginTransformFeedbackEXT(table
, save_BeginTransformFeedback
);
9517 SET_EndTransformFeedbackEXT(table
, save_EndTransformFeedback
);
9520 /* 364. GL_EXT_provoking_vertex */
9521 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9523 /* 371. GL_APPLE_object_purgeable */
9524 #if FEATURE_APPLE_object_purgeable
9525 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
9526 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
9531 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9532 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9533 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9534 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9535 SET_Uniform1ui(table
, save_Uniform1ui
);
9536 SET_Uniform2ui(table
, save_Uniform2ui
);
9537 SET_Uniform3ui(table
, save_Uniform3ui
);
9538 SET_Uniform4ui(table
, save_Uniform4ui
);
9539 SET_Uniform1uiv(table
, save_Uniform1uiv
);
9540 SET_Uniform2uiv(table
, save_Uniform2uiv
);
9541 SET_Uniform3uiv(table
, save_Uniform3uiv
);
9542 SET_Uniform4uiv(table
, save_Uniform4uiv
);
9544 (void) save_ClearBufferiv
;
9545 (void) save_ClearBufferuiv
;
9546 (void) save_ClearBufferfv
;
9547 (void) save_ClearBufferfi
;
9548 (void) save_Uniform1ui
;
9549 (void) save_Uniform2ui
;
9550 (void) save_Uniform3ui
;
9551 (void) save_Uniform4ui
;
9552 (void) save_Uniform1uiv
;
9553 (void) save_Uniform2uiv
;
9554 (void) save_Uniform3uiv
;
9555 (void) save_Uniform4uiv
;
9564 enum_string(GLenum k
)
9566 return _mesa_lookup_enum_by_nr(k
);
9571 * Print the commands in a display list. For debugging only.
9572 * TODO: many commands aren't handled yet.
9574 static void GLAPIENTRY
9575 print_list(GLcontext
*ctx
, GLuint list
)
9577 struct gl_display_list
*dlist
;
9581 if (!islist(ctx
, list
)) {
9582 printf("%u is not a display list ID\n", list
);
9586 dlist
= lookup_list(ctx
, list
);
9592 printf("START-LIST %u, address %p\n", list
, (void *) n
);
9594 done
= n
? GL_FALSE
: GL_TRUE
;
9596 const OpCode opcode
= n
[0].opcode
;
9598 if (is_ext_opcode(opcode
)) {
9599 n
+= ext_opcode_print(ctx
, n
);
9604 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9607 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9608 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9610 case OPCODE_CALL_LIST
:
9611 printf("CallList %d\n", (int) n
[1].ui
);
9613 case OPCODE_CALL_LIST_OFFSET
:
9614 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9615 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9617 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9618 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9619 enum_string(n
[1].e
), enum_string(n
[2].e
),
9620 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9622 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9623 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9624 enum_string(n
[1].e
), enum_string(n
[2].e
),
9625 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9627 case OPCODE_DISABLE
:
9628 printf("Disable %s\n", enum_string(n
[1].e
));
9631 printf("Enable %s\n", enum_string(n
[1].e
));
9633 case OPCODE_FRUSTUM
:
9634 printf("Frustum %g %g %g %g %g %g\n",
9635 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9637 case OPCODE_LINE_STIPPLE
:
9638 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9640 case OPCODE_LOAD_IDENTITY
:
9641 printf("LoadIdentity\n");
9643 case OPCODE_LOAD_MATRIX
:
9644 printf("LoadMatrix\n");
9645 printf(" %8f %8f %8f %8f\n",
9646 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9647 printf(" %8f %8f %8f %8f\n",
9648 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9649 printf(" %8f %8f %8f %8f\n",
9650 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9651 printf(" %8f %8f %8f %8f\n",
9652 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9654 case OPCODE_MULT_MATRIX
:
9655 printf("MultMatrix (or Rotate)\n");
9656 printf(" %8f %8f %8f %8f\n",
9657 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9658 printf(" %8f %8f %8f %8f\n",
9659 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9660 printf(" %8f %8f %8f %8f\n",
9661 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9662 printf(" %8f %8f %8f %8f\n",
9663 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9666 printf("Ortho %g %g %g %g %g %g\n",
9667 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9669 case OPCODE_POP_ATTRIB
:
9670 printf("PopAttrib\n");
9672 case OPCODE_POP_MATRIX
:
9673 printf("PopMatrix\n");
9675 case OPCODE_POP_NAME
:
9676 printf("PopName\n");
9678 case OPCODE_PUSH_ATTRIB
:
9679 printf("PushAttrib %x\n", n
[1].bf
);
9681 case OPCODE_PUSH_MATRIX
:
9682 printf("PushMatrix\n");
9684 case OPCODE_PUSH_NAME
:
9685 printf("PushName %d\n", (int) n
[1].ui
);
9687 case OPCODE_RASTER_POS
:
9688 printf("RasterPos %g %g %g %g\n",
9689 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9692 printf("Rotate %g %g %g %g\n",
9693 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9696 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9698 case OPCODE_TRANSLATE
:
9699 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9701 case OPCODE_BIND_TEXTURE
:
9702 printf("BindTexture %s %d\n",
9703 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9705 case OPCODE_SHADE_MODEL
:
9706 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9709 printf("Map1 %s %.3f %.3f %d %d\n",
9710 _mesa_lookup_enum_by_nr(n
[1].ui
),
9711 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9714 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9715 _mesa_lookup_enum_by_nr(n
[1].ui
),
9716 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9717 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9719 case OPCODE_MAPGRID1
:
9720 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9722 case OPCODE_MAPGRID2
:
9723 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9724 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9726 case OPCODE_EVALMESH1
:
9727 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9729 case OPCODE_EVALMESH2
:
9730 printf("EvalMesh2 %d %d %d %d\n",
9731 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9734 case OPCODE_ATTR_1F_NV
:
9735 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9737 case OPCODE_ATTR_2F_NV
:
9738 printf("ATTR_2F_NV attr %d: %f %f\n",
9739 n
[1].i
, n
[2].f
, n
[3].f
);
9741 case OPCODE_ATTR_3F_NV
:
9742 printf("ATTR_3F_NV attr %d: %f %f %f\n",
9743 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9745 case OPCODE_ATTR_4F_NV
:
9746 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9747 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9749 case OPCODE_ATTR_1F_ARB
:
9750 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9752 case OPCODE_ATTR_2F_ARB
:
9753 printf("ATTR_2F_ARB attr %d: %f %f\n",
9754 n
[1].i
, n
[2].f
, n
[3].f
);
9756 case OPCODE_ATTR_3F_ARB
:
9757 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9758 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9760 case OPCODE_ATTR_4F_ARB
:
9761 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9762 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9765 case OPCODE_MATERIAL
:
9766 printf("MATERIAL %x %x: %f %f %f %f\n",
9767 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9770 printf("BEGIN %x\n", n
[1].i
);
9776 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9779 case OPCODE_EVAL_C1
:
9780 printf("EVAL_C1 %f\n", n
[1].f
);
9782 case OPCODE_EVAL_C2
:
9783 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9785 case OPCODE_EVAL_P1
:
9786 printf("EVAL_P1 %d\n", n
[1].i
);
9788 case OPCODE_EVAL_P2
:
9789 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9792 case OPCODE_PROVOKING_VERTEX
:
9793 printf("ProvokingVertex %s\n",
9794 _mesa_lookup_enum_by_nr(n
[1].ui
));
9798 * meta opcodes/commands
9801 printf("Error: %s %s\n",
9802 enum_string(n
[1].e
), (const char *) n
[2].data
);
9804 case OPCODE_CONTINUE
:
9805 printf("DISPLAY-LIST-CONTINUE\n");
9806 n
= (Node
*) n
[1].next
;
9808 case OPCODE_END_OF_LIST
:
9809 printf("END-LIST %u\n", list
);
9813 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9815 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9816 opcode
, (void *) n
);
9820 printf("command %d, %u operands\n", opcode
,
9824 /* increment n to point to next compiled command */
9825 if (opcode
!= OPCODE_CONTINUE
) {
9826 n
+= InstSize
[opcode
];
9835 * Clients may call this function to help debug display list problems.
9836 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9837 * changed, or break in the future without notice.
9840 mesa_print_display_list(GLuint list
)
9842 GET_CURRENT_CONTEXT(ctx
);
9843 print_list(ctx
, list
);
9847 /**********************************************************************/
9848 /***** Initialization *****/
9849 /**********************************************************************/
9852 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9854 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9856 vfmt
->Begin
= save_Begin
;
9858 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9860 vfmt
->Color3f
= save_Color3f
;
9861 vfmt
->Color3fv
= save_Color3fv
;
9862 vfmt
->Color4f
= save_Color4f
;
9863 vfmt
->Color4fv
= save_Color4fv
;
9864 vfmt
->EdgeFlag
= save_EdgeFlag
;
9865 vfmt
->End
= save_End
;
9867 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9869 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9870 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9871 vfmt
->Indexf
= save_Indexf
;
9872 vfmt
->Indexfv
= save_Indexfv
;
9873 vfmt
->Materialfv
= save_Materialfv
;
9874 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9875 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9876 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9877 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9878 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9879 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9880 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9881 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9882 vfmt
->Normal3f
= save_Normal3f
;
9883 vfmt
->Normal3fv
= save_Normal3fv
;
9884 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9885 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9886 vfmt
->TexCoord1f
= save_TexCoord1f
;
9887 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9888 vfmt
->TexCoord2f
= save_TexCoord2f
;
9889 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9890 vfmt
->TexCoord3f
= save_TexCoord3f
;
9891 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9892 vfmt
->TexCoord4f
= save_TexCoord4f
;
9893 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9894 vfmt
->Vertex2f
= save_Vertex2f
;
9895 vfmt
->Vertex2fv
= save_Vertex2fv
;
9896 vfmt
->Vertex3f
= save_Vertex3f
;
9897 vfmt
->Vertex3fv
= save_Vertex3fv
;
9898 vfmt
->Vertex4f
= save_Vertex4f
;
9899 vfmt
->Vertex4fv
= save_Vertex4fv
;
9900 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9901 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9902 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9903 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9904 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9905 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9906 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9907 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9908 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9909 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9910 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9911 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9912 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9913 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9914 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9915 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9917 vfmt
->Rectf
= save_Rectf
;
9919 /* The driver is required to implement these as
9920 * 1) They can probably do a better job.
9921 * 2) A lot of new mechanisms would have to be added to this module
9922 * to support it. That code would probably never get used,
9926 vfmt
->DrawArrays
= 0;
9927 vfmt
->DrawElements
= 0;
9928 vfmt
->DrawRangeElements
= 0;
9929 vfmt
->MultiDrawElemementsEXT
= 0;
9930 vfmt
->DrawElementsBaseVertex
= 0;
9931 vfmt
->DrawRangeElementsBaseVertex
= 0;
9932 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9938 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9939 const GLvertexformat
*vfmt
)
9941 SET_CallList(disp
, vfmt
->CallList
);
9942 SET_CallLists(disp
, vfmt
->CallLists
);
9946 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9948 SET_CallList(disp
, _mesa_CallList
);
9949 SET_CallLists(disp
, _mesa_CallLists
);
9951 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9952 SET_EndList(disp
, _mesa_EndList
);
9953 SET_GenLists(disp
, _mesa_GenLists
);
9954 SET_IsList(disp
, _mesa_IsList
);
9955 SET_ListBase(disp
, _mesa_ListBase
);
9956 SET_NewList(disp
, _mesa_NewList
);
9960 #endif /* FEATURE_dlist */
9964 * Initialize display list state for given context.
9967 _mesa_init_display_list(GLcontext
*ctx
)
9969 static GLboolean tableInitialized
= GL_FALSE
;
9971 /* zero-out the instruction size table, just once */
9972 if (!tableInitialized
) {
9973 memset(InstSize
, 0, sizeof(InstSize
));
9974 tableInitialized
= GL_TRUE
;
9977 /* extension info */
9978 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9981 ctx
->ListState
.CallDepth
= 0;
9982 ctx
->ExecuteFlag
= GL_TRUE
;
9983 ctx
->CompileFlag
= GL_FALSE
;
9984 ctx
->ListState
.CurrentBlock
= NULL
;
9985 ctx
->ListState
.CurrentPos
= 0;
9987 /* Display List group */
9988 ctx
->List
.ListBase
= 0;
9991 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9997 _mesa_free_display_list_data(GLcontext
*ctx
)
10000 ctx
->ListExt
= NULL
;