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"
35 #include "api_loopback.h"
37 #include "mfeatures.h"
38 #if FEATURE_ARB_vertex_buffer_object
39 #include "bufferobj.h"
46 #include "framebuffer.h"
47 #include "glapi/glapi.h"
57 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
58 #include "shader/arbprogram.h"
60 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
61 #include "shader/nvprogram.h"
63 #if FEATURE_ATI_fragment_shader
64 #include "shader/atifragshader.h"
67 #include "math/m_matrix.h"
69 #include "main/dispatch.h"
74 * Other parts of Mesa (such as the VBO module) can plug into the display
75 * list system. This structure describes new display list instructions.
77 struct gl_list_instruction
80 void (*Execute
)( GLcontext
*ctx
, void *data
);
81 void (*Destroy
)( GLcontext
*ctx
, void *data
);
82 void (*Print
)( GLcontext
*ctx
, void *data
);
86 #define MAX_DLIST_EXT_OPCODES 16
89 * Used by device drivers to hook new commands into display lists.
91 struct gl_list_extensions
93 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
102 * \param ctx GL context.
104 * Checks if dd_function_table::SaveNeedFlush is marked to flush
105 * stored (save) vertices, and calls
106 * dd_function_table::SaveFlushVertices if so.
108 #define SAVE_FLUSH_VERTICES(ctx) \
110 if (ctx->Driver.SaveNeedFlush) \
111 ctx->Driver.SaveFlushVertices(ctx); \
116 * Macro to assert that the API call was made outside the
117 * glBegin()/glEnd() pair, with return value.
119 * \param ctx GL context.
120 * \param retval value to return value in case the assertion fails.
122 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
124 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
125 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
126 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
132 * Macro to assert that the API call was made outside the
133 * glBegin()/glEnd() pair.
135 * \param ctx GL context.
137 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
139 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
140 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
141 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
147 * Macro to assert that the API call was made outside the
148 * glBegin()/glEnd() pair and flush the vertices.
150 * \param ctx GL context.
152 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
154 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
155 SAVE_FLUSH_VERTICES(ctx); \
159 * Macro to assert that the API call was made outside the
160 * glBegin()/glEnd() pair and flush the vertices, with return value.
162 * \param ctx GL context.
163 * \param retval value to return value in case the assertion fails.
165 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
167 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
168 SAVE_FLUSH_VERTICES(ctx); \
174 * Display list opcodes.
176 * The fact that these identifiers are assigned consecutive
177 * integer values starting at 0 is very important, see InstSize array usage)
181 OPCODE_INVALID
= -1, /* Force signed enum */
187 OPCODE_BLEND_EQUATION
,
188 OPCODE_BLEND_EQUATION_SEPARATE
,
189 OPCODE_BLEND_FUNC_SEPARATE
,
191 OPCODE_CALL_LIST_OFFSET
,
197 OPCODE_CLEAR_STENCIL
,
198 OPCODE_CLEAR_BUFFER_IV
,
199 OPCODE_CLEAR_BUFFER_UIV
,
200 OPCODE_CLEAR_BUFFER_FV
,
201 OPCODE_CLEAR_BUFFER_FI
,
204 OPCODE_COLOR_MASK_INDEXED
,
205 OPCODE_COLOR_MATERIAL
,
207 OPCODE_COLOR_TABLE_PARAMETER_FV
,
208 OPCODE_COLOR_TABLE_PARAMETER_IV
,
209 OPCODE_COLOR_SUB_TABLE
,
210 OPCODE_CONVOLUTION_FILTER_1D
,
211 OPCODE_CONVOLUTION_FILTER_2D
,
212 OPCODE_CONVOLUTION_PARAMETER_I
,
213 OPCODE_CONVOLUTION_PARAMETER_IV
,
214 OPCODE_CONVOLUTION_PARAMETER_F
,
215 OPCODE_CONVOLUTION_PARAMETER_FV
,
216 OPCODE_COPY_COLOR_SUB_TABLE
,
217 OPCODE_COPY_COLOR_TABLE
,
219 OPCODE_COPY_TEX_IMAGE1D
,
220 OPCODE_COPY_TEX_IMAGE2D
,
221 OPCODE_COPY_TEX_SUB_IMAGE1D
,
222 OPCODE_COPY_TEX_SUB_IMAGE2D
,
223 OPCODE_COPY_TEX_SUB_IMAGE3D
,
229 OPCODE_DISABLE_INDEXED
,
233 OPCODE_ENABLE_INDEXED
,
248 OPCODE_LOAD_IDENTITY
,
262 OPCODE_PIXEL_TRANSFER
,
265 OPCODE_POINT_PARAMETERS
,
267 OPCODE_POLYGON_STIPPLE
,
268 OPCODE_POLYGON_OFFSET
,
272 OPCODE_PRIORITIZE_TEXTURE
,
278 OPCODE_RESET_HISTOGRAM
,
279 OPCODE_RESET_MIN_MAX
,
283 OPCODE_SELECT_TEXTURE_SGIS
,
284 OPCODE_SELECT_TEXTURE_COORD_SET
,
295 OPCODE_TEX_SUB_IMAGE1D
,
296 OPCODE_TEX_SUB_IMAGE2D
,
297 OPCODE_TEX_SUB_IMAGE3D
,
301 /* GL_ARB_multitexture */
302 OPCODE_ACTIVE_TEXTURE
,
303 /* GL_ARB_texture_compression */
304 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
305 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
306 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
307 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
308 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
310 /* GL_ARB_multisample */
311 OPCODE_SAMPLE_COVERAGE
,
312 /* GL_ARB_window_pos */
313 OPCODE_WINDOW_POS_ARB
,
314 /* GL_NV_vertex_program */
315 OPCODE_BIND_PROGRAM_NV
,
316 OPCODE_EXECUTE_PROGRAM_NV
,
317 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
318 OPCODE_LOAD_PROGRAM_NV
,
319 OPCODE_TRACK_MATRIX_NV
,
320 /* GL_NV_fragment_program */
321 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
322 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
323 /* GL_EXT_stencil_two_side */
324 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
325 /* GL_EXT_depth_bounds_test */
326 OPCODE_DEPTH_BOUNDS_EXT
,
327 /* GL_ARB_vertex/fragment_program */
328 OPCODE_PROGRAM_STRING_ARB
,
329 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
330 /* GL_ARB_occlusion_query */
331 OPCODE_BEGIN_QUERY_ARB
,
332 OPCODE_END_QUERY_ARB
,
333 /* GL_ARB_draw_buffers */
334 OPCODE_DRAW_BUFFERS_ARB
,
335 /* GL_ATI_fragment_shader */
336 OPCODE_TEX_BUMP_PARAMETER_ATI
,
337 /* GL_ATI_fragment_shader */
338 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
339 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
341 OPCODE_STENCIL_FUNC_SEPARATE
,
342 OPCODE_STENCIL_OP_SEPARATE
,
343 OPCODE_STENCIL_MASK_SEPARATE
,
345 /* GL_ARB_shader_objects */
363 OPCODE_UNIFORM_MATRIX22
,
364 OPCODE_UNIFORM_MATRIX33
,
365 OPCODE_UNIFORM_MATRIX44
,
366 OPCODE_UNIFORM_MATRIX23
,
367 OPCODE_UNIFORM_MATRIX32
,
368 OPCODE_UNIFORM_MATRIX24
,
369 OPCODE_UNIFORM_MATRIX42
,
370 OPCODE_UNIFORM_MATRIX34
,
371 OPCODE_UNIFORM_MATRIX43
,
373 /* GL_EXT_framebuffer_blit */
374 OPCODE_BLIT_FRAMEBUFFER
,
376 /* Vertex attributes -- fallback for when optimized display
377 * list build isn't active.
396 /* GL_EXT_provoking_vertex */
397 OPCODE_PROVOKING_VERTEX
,
399 /* The following three are meta instructions */
400 OPCODE_ERROR
, /* raise compiled-in error */
411 * Display list instructions are stored as sequences of "nodes". Nodes
412 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
413 * are linked together with a pointer.
415 * Each instruction in the display list is stored as a sequence of
416 * contiguous nodes in memory.
417 * Each node is the union of a variety of data types.
432 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
436 typedef union gl_dlist_node Node
;
440 * How many nodes to allocate at a time.
442 * \note Reduced now that we hold vertices etc. elsewhere.
444 #define BLOCK_SIZE 256
449 * Number of nodes of storage needed for each instruction.
450 * Sizes for dynamically allocated opcodes are stored in the context struct.
452 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
458 void mesa_print_display_list(GLuint list
);
461 /**********************************************************************/
462 /***** Private *****/
463 /**********************************************************************/
467 * Make an empty display list. This is used by glGenLists() to
468 * reserve display list IDs.
470 static struct gl_display_list
*
471 make_list(GLuint name
, GLuint count
)
473 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
475 dlist
->Head
= (Node
*) malloc(sizeof(Node
) * count
);
476 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
482 * Lookup function to just encapsulate casting.
484 static INLINE
struct gl_display_list
*
485 lookup_list(GLcontext
*ctx
, GLuint list
)
487 return (struct gl_display_list
*)
488 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
492 /** Is the given opcode an extension code? */
493 static INLINE GLboolean
494 is_ext_opcode(OpCode opcode
)
496 return (opcode
>= OPCODE_EXT_0
);
500 /** Destroy an extended opcode instruction */
502 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
504 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
506 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
507 step
= ctx
->ListExt
->Opcode
[i
].Size
;
512 /** Execute an extended opcode instruction */
514 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
516 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
518 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
519 step
= ctx
->ListExt
->Opcode
[i
].Size
;
524 /** Print an extended opcode instruction */
526 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
528 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
530 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
531 step
= ctx
->ListExt
->Opcode
[i
].Size
;
537 * Delete the named display list, but don't remove from hash table.
538 * \param dlist - display list pointer
541 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
546 n
= block
= dlist
->Head
;
548 done
= block
? GL_FALSE
: GL_TRUE
;
550 const OpCode opcode
= n
[0].opcode
;
552 /* check for extension opcodes first */
553 if (is_ext_opcode(opcode
)) {
554 n
+= ext_opcode_destroy(ctx
, n
);
558 /* for some commands, we need to free malloc'd memory */
561 n
+= InstSize
[n
[0].opcode
];
565 n
+= InstSize
[n
[0].opcode
];
567 case OPCODE_DRAW_PIXELS
:
569 n
+= InstSize
[n
[0].opcode
];
573 n
+= InstSize
[n
[0].opcode
];
575 case OPCODE_COLOR_TABLE
:
577 n
+= InstSize
[n
[0].opcode
];
579 case OPCODE_COLOR_SUB_TABLE
:
581 n
+= InstSize
[n
[0].opcode
];
583 case OPCODE_CONVOLUTION_FILTER_1D
:
585 n
+= InstSize
[n
[0].opcode
];
587 case OPCODE_CONVOLUTION_FILTER_2D
:
589 n
+= InstSize
[n
[0].opcode
];
591 case OPCODE_POLYGON_STIPPLE
:
593 n
+= InstSize
[n
[0].opcode
];
595 case OPCODE_TEX_IMAGE1D
:
597 n
+= InstSize
[n
[0].opcode
];
599 case OPCODE_TEX_IMAGE2D
:
601 n
+= InstSize
[n
[0].opcode
];
603 case OPCODE_TEX_IMAGE3D
:
605 n
+= InstSize
[n
[0].opcode
];
607 case OPCODE_TEX_SUB_IMAGE1D
:
609 n
+= InstSize
[n
[0].opcode
];
611 case OPCODE_TEX_SUB_IMAGE2D
:
613 n
+= InstSize
[n
[0].opcode
];
615 case OPCODE_TEX_SUB_IMAGE3D
:
617 n
+= InstSize
[n
[0].opcode
];
619 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
621 n
+= InstSize
[n
[0].opcode
];
623 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
625 n
+= InstSize
[n
[0].opcode
];
627 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
629 n
+= InstSize
[n
[0].opcode
];
631 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
633 n
+= InstSize
[n
[0].opcode
];
635 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
637 n
+= InstSize
[n
[0].opcode
];
639 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
641 n
+= InstSize
[n
[0].opcode
];
643 #if FEATURE_NV_vertex_program
644 case OPCODE_LOAD_PROGRAM_NV
:
645 free(n
[4].data
); /* program string */
646 n
+= InstSize
[n
[0].opcode
];
648 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
649 free(n
[2].data
); /* array of program ids */
650 n
+= InstSize
[n
[0].opcode
];
653 #if FEATURE_NV_fragment_program
654 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
655 free(n
[3].data
); /* parameter name */
656 n
+= InstSize
[n
[0].opcode
];
659 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
660 case OPCODE_PROGRAM_STRING_ARB
:
661 free(n
[4].data
); /* program string */
662 n
+= InstSize
[n
[0].opcode
];
665 case OPCODE_UNIFORM_1FV
:
666 case OPCODE_UNIFORM_2FV
:
667 case OPCODE_UNIFORM_3FV
:
668 case OPCODE_UNIFORM_4FV
:
669 case OPCODE_UNIFORM_1IV
:
670 case OPCODE_UNIFORM_2IV
:
671 case OPCODE_UNIFORM_3IV
:
672 case OPCODE_UNIFORM_4IV
:
674 n
+= InstSize
[n
[0].opcode
];
676 case OPCODE_UNIFORM_MATRIX22
:
677 case OPCODE_UNIFORM_MATRIX33
:
678 case OPCODE_UNIFORM_MATRIX44
:
679 case OPCODE_UNIFORM_MATRIX24
:
680 case OPCODE_UNIFORM_MATRIX42
:
681 case OPCODE_UNIFORM_MATRIX23
:
682 case OPCODE_UNIFORM_MATRIX32
:
683 case OPCODE_UNIFORM_MATRIX34
:
684 case OPCODE_UNIFORM_MATRIX43
:
686 n
+= InstSize
[n
[0].opcode
];
689 case OPCODE_CONTINUE
:
690 n
= (Node
*) n
[1].next
;
694 case OPCODE_END_OF_LIST
:
699 /* Most frequent case */
700 n
+= InstSize
[n
[0].opcode
];
711 * Destroy a display list and remove from hash table.
712 * \param list - display list number
715 destroy_list(GLcontext
*ctx
, GLuint list
)
717 struct gl_display_list
*dlist
;
722 dlist
= lookup_list(ctx
, list
);
726 _mesa_delete_list(ctx
, dlist
);
727 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
732 * Translate the nth element of list from <type> to GLint.
735 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
747 bptr
= (GLbyte
*) list
;
748 return (GLint
) bptr
[n
];
749 case GL_UNSIGNED_BYTE
:
750 ubptr
= (GLubyte
*) list
;
751 return (GLint
) ubptr
[n
];
753 sptr
= (GLshort
*) list
;
754 return (GLint
) sptr
[n
];
755 case GL_UNSIGNED_SHORT
:
756 usptr
= (GLushort
*) list
;
757 return (GLint
) usptr
[n
];
759 iptr
= (GLint
*) list
;
761 case GL_UNSIGNED_INT
:
762 uiptr
= (GLuint
*) list
;
763 return (GLint
) uiptr
[n
];
765 fptr
= (GLfloat
*) list
;
766 return (GLint
) FLOORF(fptr
[n
]);
768 ubptr
= ((GLubyte
*) list
) + 2 * n
;
769 return (GLint
) ubptr
[0] * 256
772 ubptr
= ((GLubyte
*) list
) + 3 * n
;
773 return (GLint
) ubptr
[0] * 65536
774 + (GLint
) ubptr
[1] * 256
777 ubptr
= ((GLubyte
*) list
) + 4 * n
;
778 return (GLint
) ubptr
[0] * 16777216
779 + (GLint
) ubptr
[1] * 65536
780 + (GLint
) ubptr
[2] * 256
790 /**********************************************************************/
792 /**********************************************************************/
795 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
796 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
799 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
800 GLsizei width
, GLsizei height
, GLsizei depth
,
801 GLenum format
, GLenum type
, const GLvoid
* pixels
,
802 const struct gl_pixelstore_attrib
*unpack
)
804 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
806 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
807 format
, type
, pixels
, unpack
);
808 if (pixels
&& !image
) {
809 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
813 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
814 format
, type
, pixels
)) {
815 const GLubyte
*map
, *src
;
819 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
820 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
822 /* unable to map src buffer! */
823 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
827 src
= ADD_POINTERS(map
, pixels
);
828 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
829 format
, type
, src
, unpack
);
831 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
835 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
845 * Allocate space for a display list instruction (opcode + payload space).
846 * \param opcode the instruction opcode (OPCODE_* value)
847 * \param bytes instruction payload size (not counting opcode)
848 * \return pointer to allocated memory (the opcode space)
851 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
853 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
856 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
857 if (InstSize
[opcode
] == 0) {
858 /* save instruction size now */
859 InstSize
[opcode
] = numNodes
;
862 /* make sure instruction size agrees */
863 ASSERT(numNodes
== InstSize
[opcode
]);
867 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
868 /* This block is full. Allocate a new block and chain to it */
870 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
871 n
[0].opcode
= OPCODE_CONTINUE
;
872 newblock
= (Node
*) malloc(sizeof(Node
) * BLOCK_SIZE
);
874 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
877 n
[1].next
= (Node
*) newblock
;
878 ctx
->ListState
.CurrentBlock
= newblock
;
879 ctx
->ListState
.CurrentPos
= 0;
882 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
883 ctx
->ListState
.CurrentPos
+= numNodes
;
885 n
[0].opcode
= opcode
;
893 * Allocate space for a display list instruction. Used by callers outside
894 * this file for things like VBO vertex data.
896 * \param opcode the instruction opcode (OPCODE_* value)
897 * \param bytes instruction size in bytes, not counting opcode.
898 * \return pointer to the usable data area (not including the internal
902 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
904 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
906 return n
+ 1; /* return pointer to payload area, after opcode */
913 * This function allows modules and drivers to get their own opcodes
914 * for extending display list functionality.
915 * \param ctx the rendering context
916 * \param size number of bytes for storing the new display list command
917 * \param execute function to execute the new display list command
918 * \param destroy function to destroy the new display list command
919 * \param print function to print the new display list command
920 * \return the new opcode number or -1 if error
923 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
925 void (*execute
) (GLcontext
*, void *),
926 void (*destroy
) (GLcontext
*, void *),
927 void (*print
) (GLcontext
*, void *))
929 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
930 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
931 ctx
->ListExt
->Opcode
[i
].Size
=
932 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
933 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
934 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
935 ctx
->ListExt
->Opcode
[i
].Print
= print
;
936 return i
+ OPCODE_EXT_0
;
943 * Allocate space for a display list instruction. The space is basically
944 * an array of Nodes where node[0] holds the opcode, node[1] is the first
945 * function parameter, node[2] is the second parameter, etc.
947 * \param opcode one of OPCODE_x
948 * \param nparams number of function parameters
949 * \return pointer to start of instruction space
952 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
954 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
960 * Display List compilation functions
962 static void GLAPIENTRY
963 save_Accum(GLenum op
, GLfloat value
)
965 GET_CURRENT_CONTEXT(ctx
);
967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
968 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
973 if (ctx
->ExecuteFlag
) {
974 CALL_Accum(ctx
->Exec
, (op
, value
));
979 static void GLAPIENTRY
980 save_AlphaFunc(GLenum func
, GLclampf ref
)
982 GET_CURRENT_CONTEXT(ctx
);
984 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
985 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
988 n
[2].f
= (GLfloat
) ref
;
990 if (ctx
->ExecuteFlag
) {
991 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
996 static void GLAPIENTRY
997 save_BindTexture(GLenum target
, GLuint texture
)
999 GET_CURRENT_CONTEXT(ctx
);
1001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1002 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1007 if (ctx
->ExecuteFlag
) {
1008 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1013 static void GLAPIENTRY
1014 save_Bitmap(GLsizei width
, GLsizei height
,
1015 GLfloat xorig
, GLfloat yorig
,
1016 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1018 GET_CURRENT_CONTEXT(ctx
);
1020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1021 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1023 n
[1].i
= (GLint
) width
;
1024 n
[2].i
= (GLint
) height
;
1029 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1031 if (ctx
->ExecuteFlag
) {
1032 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1033 xorig
, yorig
, xmove
, ymove
, pixels
));
1038 static void GLAPIENTRY
1039 save_BlendEquation(GLenum mode
)
1041 GET_CURRENT_CONTEXT(ctx
);
1043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1044 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1048 if (ctx
->ExecuteFlag
) {
1049 CALL_BlendEquation(ctx
->Exec
, (mode
));
1054 static void GLAPIENTRY
1055 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1057 GET_CURRENT_CONTEXT(ctx
);
1059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1060 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1065 if (ctx
->ExecuteFlag
) {
1066 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1071 static void GLAPIENTRY
1072 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1073 GLenum sfactorA
, GLenum dfactorA
)
1075 GET_CURRENT_CONTEXT(ctx
);
1077 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1078 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1080 n
[1].e
= sfactorRGB
;
1081 n
[2].e
= dfactorRGB
;
1085 if (ctx
->ExecuteFlag
) {
1086 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1087 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1092 static void GLAPIENTRY
1093 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1095 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1099 static void GLAPIENTRY
1100 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1102 GET_CURRENT_CONTEXT(ctx
);
1104 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1105 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1112 if (ctx
->ExecuteFlag
) {
1113 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1117 static void invalidate_saved_current_state( GLcontext
*ctx
)
1121 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1122 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1124 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1125 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1127 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1129 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1132 static void GLAPIENTRY
1133 save_CallList(GLuint list
)
1135 GET_CURRENT_CONTEXT(ctx
);
1137 SAVE_FLUSH_VERTICES(ctx
);
1139 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1144 /* After this, we don't know what state we're in. Invalidate all
1145 * cached information previously gathered:
1147 invalidate_saved_current_state( ctx
);
1149 if (ctx
->ExecuteFlag
) {
1150 _mesa_CallList(list
);
1155 static void GLAPIENTRY
1156 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1158 GET_CURRENT_CONTEXT(ctx
);
1160 GLboolean typeErrorFlag
;
1162 SAVE_FLUSH_VERTICES(ctx
);
1166 case GL_UNSIGNED_BYTE
:
1168 case GL_UNSIGNED_SHORT
:
1170 case GL_UNSIGNED_INT
:
1175 typeErrorFlag
= GL_FALSE
;
1178 typeErrorFlag
= GL_TRUE
;
1181 for (i
= 0; i
< num
; i
++) {
1182 GLint list
= translate_id(i
, type
, lists
);
1183 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1186 n
[2].b
= typeErrorFlag
;
1190 /* After this, we don't know what state we're in. Invalidate all
1191 * cached information previously gathered:
1193 invalidate_saved_current_state( ctx
);
1195 if (ctx
->ExecuteFlag
) {
1196 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1201 static void GLAPIENTRY
1202 save_Clear(GLbitfield mask
)
1204 GET_CURRENT_CONTEXT(ctx
);
1206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1207 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1211 if (ctx
->ExecuteFlag
) {
1212 CALL_Clear(ctx
->Exec
, (mask
));
1217 static void GLAPIENTRY
1218 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1220 GET_CURRENT_CONTEXT(ctx
);
1222 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1223 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1226 n
[2].i
= drawbuffer
;
1228 if (buffer
== GL_COLOR
) {
1239 if (ctx
->ExecuteFlag
) {
1240 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1245 static void GLAPIENTRY
1246 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1248 GET_CURRENT_CONTEXT(ctx
);
1250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1251 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1254 n
[2].i
= drawbuffer
;
1256 if (buffer
== GL_COLOR
) {
1267 if (ctx
->ExecuteFlag
) {
1268 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1273 static void GLAPIENTRY
1274 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1276 GET_CURRENT_CONTEXT(ctx
);
1278 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1279 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1282 n
[2].i
= drawbuffer
;
1284 if (buffer
== GL_COLOR
) {
1295 if (ctx
->ExecuteFlag
) {
1296 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1301 static void GLAPIENTRY
1302 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1303 GLfloat depth
, GLint stencil
)
1305 GET_CURRENT_CONTEXT(ctx
);
1307 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1308 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1311 n
[2].i
= drawbuffer
;
1315 if (ctx
->ExecuteFlag
) {
1316 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1321 static void GLAPIENTRY
1322 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1324 GET_CURRENT_CONTEXT(ctx
);
1326 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1327 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1334 if (ctx
->ExecuteFlag
) {
1335 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1340 static void GLAPIENTRY
1341 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1343 GET_CURRENT_CONTEXT(ctx
);
1345 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1346 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1353 if (ctx
->ExecuteFlag
) {
1354 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1359 static void GLAPIENTRY
1360 save_ClearDepth(GLclampd depth
)
1362 GET_CURRENT_CONTEXT(ctx
);
1364 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1365 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1367 n
[1].f
= (GLfloat
) depth
;
1369 if (ctx
->ExecuteFlag
) {
1370 CALL_ClearDepth(ctx
->Exec
, (depth
));
1375 static void GLAPIENTRY
1376 save_ClearIndex(GLfloat c
)
1378 GET_CURRENT_CONTEXT(ctx
);
1380 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1381 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1385 if (ctx
->ExecuteFlag
) {
1386 CALL_ClearIndex(ctx
->Exec
, (c
));
1391 static void GLAPIENTRY
1392 save_ClearStencil(GLint s
)
1394 GET_CURRENT_CONTEXT(ctx
);
1396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1397 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1401 if (ctx
->ExecuteFlag
) {
1402 CALL_ClearStencil(ctx
->Exec
, (s
));
1407 static void GLAPIENTRY
1408 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1410 GET_CURRENT_CONTEXT(ctx
);
1412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1413 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1416 n
[2].f
= (GLfloat
) equ
[0];
1417 n
[3].f
= (GLfloat
) equ
[1];
1418 n
[4].f
= (GLfloat
) equ
[2];
1419 n
[5].f
= (GLfloat
) equ
[3];
1421 if (ctx
->ExecuteFlag
) {
1422 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1428 static void GLAPIENTRY
1429 save_ColorMask(GLboolean red
, GLboolean green
,
1430 GLboolean blue
, GLboolean alpha
)
1432 GET_CURRENT_CONTEXT(ctx
);
1434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1435 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1442 if (ctx
->ExecuteFlag
) {
1443 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1448 static void GLAPIENTRY
1449 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1450 GLboolean blue
, GLboolean alpha
)
1452 GET_CURRENT_CONTEXT(ctx
);
1454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1455 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1463 if (ctx
->ExecuteFlag
) {
1464 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1469 static void GLAPIENTRY
1470 save_ColorMaterial(GLenum face
, GLenum mode
)
1472 GET_CURRENT_CONTEXT(ctx
);
1474 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1476 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1481 if (ctx
->ExecuteFlag
) {
1482 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1487 static void GLAPIENTRY
1488 save_ColorTable(GLenum target
, GLenum internalFormat
,
1489 GLsizei width
, GLenum format
, GLenum type
,
1490 const GLvoid
* table
)
1492 GET_CURRENT_CONTEXT(ctx
);
1493 if (_mesa_is_proxy_texture(target
)) {
1494 /* execute immediately */
1495 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1496 format
, type
, table
));
1500 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1501 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1504 n
[2].e
= internalFormat
;
1508 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1511 if (ctx
->ExecuteFlag
) {
1512 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1513 format
, type
, table
));
1520 static void GLAPIENTRY
1521 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1522 const GLfloat
*params
)
1524 GET_CURRENT_CONTEXT(ctx
);
1527 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1529 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1534 if (pname
== GL_COLOR_TABLE_SGI
||
1535 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1536 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1537 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1544 if (ctx
->ExecuteFlag
) {
1545 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1550 static void GLAPIENTRY
1551 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1553 GET_CURRENT_CONTEXT(ctx
);
1556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1558 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1563 if (pname
== GL_COLOR_TABLE_SGI
||
1564 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1565 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1566 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1573 if (ctx
->ExecuteFlag
) {
1574 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1580 static void GLAPIENTRY
1581 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1582 GLenum format
, GLenum type
, const GLvoid
* table
)
1584 GET_CURRENT_CONTEXT(ctx
);
1586 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1587 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1594 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1597 if (ctx
->ExecuteFlag
) {
1598 CALL_ColorSubTable(ctx
->Exec
,
1599 (target
, start
, count
, format
, type
, table
));
1604 static void GLAPIENTRY
1605 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1606 GLint x
, GLint y
, GLsizei width
)
1608 GET_CURRENT_CONTEXT(ctx
);
1611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1612 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1620 if (ctx
->ExecuteFlag
) {
1621 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1626 static void GLAPIENTRY
1627 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1628 GLint x
, GLint y
, GLsizei width
)
1630 GET_CURRENT_CONTEXT(ctx
);
1633 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1634 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1637 n
[2].e
= internalformat
;
1642 if (ctx
->ExecuteFlag
) {
1643 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1648 static void GLAPIENTRY
1649 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1650 GLenum format
, GLenum type
, const GLvoid
* filter
)
1652 GET_CURRENT_CONTEXT(ctx
);
1655 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1657 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1660 n
[2].e
= internalFormat
;
1664 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1667 if (ctx
->ExecuteFlag
) {
1668 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1669 format
, type
, filter
));
1674 static void GLAPIENTRY
1675 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1676 GLsizei width
, GLsizei height
, GLenum format
,
1677 GLenum type
, const GLvoid
* filter
)
1679 GET_CURRENT_CONTEXT(ctx
);
1682 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1684 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1687 n
[2].e
= internalFormat
;
1692 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1695 if (ctx
->ExecuteFlag
) {
1696 CALL_ConvolutionFilter2D(ctx
->Exec
,
1697 (target
, internalFormat
, width
, height
, format
,
1703 static void GLAPIENTRY
1704 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1706 GET_CURRENT_CONTEXT(ctx
);
1708 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1709 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1715 if (ctx
->ExecuteFlag
) {
1716 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1721 static void GLAPIENTRY
1722 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1724 GET_CURRENT_CONTEXT(ctx
);
1726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1727 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1732 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1733 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1734 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1740 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1743 if (ctx
->ExecuteFlag
) {
1744 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1749 static void GLAPIENTRY
1750 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1752 GET_CURRENT_CONTEXT(ctx
);
1754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1755 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1761 if (ctx
->ExecuteFlag
) {
1762 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1767 static void GLAPIENTRY
1768 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1769 const GLfloat
*params
)
1771 GET_CURRENT_CONTEXT(ctx
);
1773 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1774 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1779 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1780 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1781 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1787 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1790 if (ctx
->ExecuteFlag
) {
1791 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1796 static void GLAPIENTRY
1797 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1799 GET_CURRENT_CONTEXT(ctx
);
1801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1802 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1806 n
[3].i
= (GLint
) width
;
1807 n
[4].i
= (GLint
) height
;
1810 if (ctx
->ExecuteFlag
) {
1811 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1817 static void GLAPIENTRY
1818 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1819 GLint x
, GLint y
, GLsizei width
, GLint border
)
1821 GET_CURRENT_CONTEXT(ctx
);
1823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1824 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1828 n
[3].e
= internalformat
;
1834 if (ctx
->ExecuteFlag
) {
1835 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1836 x
, y
, width
, border
));
1841 static void GLAPIENTRY
1842 save_CopyTexImage2D(GLenum target
, GLint level
,
1843 GLenum internalformat
,
1844 GLint x
, GLint y
, GLsizei width
,
1845 GLsizei height
, GLint border
)
1847 GET_CURRENT_CONTEXT(ctx
);
1849 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1850 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1854 n
[3].e
= internalformat
;
1861 if (ctx
->ExecuteFlag
) {
1862 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1863 x
, y
, width
, height
, border
));
1869 static void GLAPIENTRY
1870 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1871 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1873 GET_CURRENT_CONTEXT(ctx
);
1875 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1876 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1885 if (ctx
->ExecuteFlag
) {
1886 CALL_CopyTexSubImage1D(ctx
->Exec
,
1887 (target
, level
, xoffset
, x
, y
, width
));
1892 static void GLAPIENTRY
1893 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1894 GLint xoffset
, GLint yoffset
,
1895 GLint x
, GLint y
, GLsizei width
, GLint height
)
1897 GET_CURRENT_CONTEXT(ctx
);
1899 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1900 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1911 if (ctx
->ExecuteFlag
) {
1912 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1913 x
, y
, width
, height
));
1918 static void GLAPIENTRY
1919 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1920 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1921 GLint x
, GLint y
, GLsizei width
, GLint height
)
1923 GET_CURRENT_CONTEXT(ctx
);
1925 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1926 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1938 if (ctx
->ExecuteFlag
) {
1939 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1940 xoffset
, yoffset
, zoffset
,
1941 x
, y
, width
, height
));
1946 static void GLAPIENTRY
1947 save_CullFace(GLenum mode
)
1949 GET_CURRENT_CONTEXT(ctx
);
1951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1952 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1956 if (ctx
->ExecuteFlag
) {
1957 CALL_CullFace(ctx
->Exec
, (mode
));
1962 static void GLAPIENTRY
1963 save_DepthFunc(GLenum func
)
1965 GET_CURRENT_CONTEXT(ctx
);
1967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1968 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1972 if (ctx
->ExecuteFlag
) {
1973 CALL_DepthFunc(ctx
->Exec
, (func
));
1978 static void GLAPIENTRY
1979 save_DepthMask(GLboolean mask
)
1981 GET_CURRENT_CONTEXT(ctx
);
1983 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1984 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
1988 if (ctx
->ExecuteFlag
) {
1989 CALL_DepthMask(ctx
->Exec
, (mask
));
1994 static void GLAPIENTRY
1995 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1997 GET_CURRENT_CONTEXT(ctx
);
1999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2000 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2002 n
[1].f
= (GLfloat
) nearval
;
2003 n
[2].f
= (GLfloat
) farval
;
2005 if (ctx
->ExecuteFlag
) {
2006 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2011 static void GLAPIENTRY
2012 save_Disable(GLenum cap
)
2014 GET_CURRENT_CONTEXT(ctx
);
2016 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2017 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2021 if (ctx
->ExecuteFlag
) {
2022 CALL_Disable(ctx
->Exec
, (cap
));
2027 static void GLAPIENTRY
2028 save_DisableIndexed(GLuint index
, GLenum cap
)
2030 GET_CURRENT_CONTEXT(ctx
);
2032 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2033 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2038 if (ctx
->ExecuteFlag
) {
2039 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2044 static void GLAPIENTRY
2045 save_DrawBuffer(GLenum mode
)
2047 GET_CURRENT_CONTEXT(ctx
);
2049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2050 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2054 if (ctx
->ExecuteFlag
) {
2055 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2060 static void GLAPIENTRY
2061 save_DrawPixels(GLsizei width
, GLsizei height
,
2062 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2064 GET_CURRENT_CONTEXT(ctx
);
2067 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2069 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2075 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2076 pixels
, &ctx
->Unpack
);
2078 if (ctx
->ExecuteFlag
) {
2079 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2085 static void GLAPIENTRY
2086 save_Enable(GLenum cap
)
2088 GET_CURRENT_CONTEXT(ctx
);
2090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2091 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2095 if (ctx
->ExecuteFlag
) {
2096 CALL_Enable(ctx
->Exec
, (cap
));
2102 static void GLAPIENTRY
2103 save_EnableIndexed(GLuint index
, GLenum cap
)
2105 GET_CURRENT_CONTEXT(ctx
);
2107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2108 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2113 if (ctx
->ExecuteFlag
) {
2114 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2120 static void GLAPIENTRY
2121 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2123 GET_CURRENT_CONTEXT(ctx
);
2125 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2126 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2132 if (ctx
->ExecuteFlag
) {
2133 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2138 static void GLAPIENTRY
2139 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2141 GET_CURRENT_CONTEXT(ctx
);
2143 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2144 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2152 if (ctx
->ExecuteFlag
) {
2153 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2160 static void GLAPIENTRY
2161 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2163 GET_CURRENT_CONTEXT(ctx
);
2165 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2166 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2174 if (ctx
->ExecuteFlag
) {
2175 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2180 static void GLAPIENTRY
2181 save_Fogf(GLenum pname
, GLfloat param
)
2185 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2186 save_Fogfv(pname
, parray
);
2190 static void GLAPIENTRY
2191 save_Fogiv(GLenum pname
, const GLint
*params
)
2196 case GL_FOG_DENSITY
:
2200 p
[0] = (GLfloat
) *params
;
2206 p
[0] = INT_TO_FLOAT(params
[0]);
2207 p
[1] = INT_TO_FLOAT(params
[1]);
2208 p
[2] = INT_TO_FLOAT(params
[2]);
2209 p
[3] = INT_TO_FLOAT(params
[3]);
2212 /* Error will be caught later in gl_Fogfv */
2213 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2215 save_Fogfv(pname
, p
);
2219 static void GLAPIENTRY
2220 save_Fogi(GLenum pname
, GLint param
)
2224 parray
[1] = parray
[2] = parray
[3] = 0;
2225 save_Fogiv(pname
, parray
);
2229 static void GLAPIENTRY
2230 save_FrontFace(GLenum mode
)
2232 GET_CURRENT_CONTEXT(ctx
);
2234 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2235 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2239 if (ctx
->ExecuteFlag
) {
2240 CALL_FrontFace(ctx
->Exec
, (mode
));
2245 static void GLAPIENTRY
2246 save_Frustum(GLdouble left
, GLdouble right
,
2247 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2249 GET_CURRENT_CONTEXT(ctx
);
2251 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2252 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2254 n
[1].f
= (GLfloat
) left
;
2255 n
[2].f
= (GLfloat
) right
;
2256 n
[3].f
= (GLfloat
) bottom
;
2257 n
[4].f
= (GLfloat
) top
;
2258 n
[5].f
= (GLfloat
) nearval
;
2259 n
[6].f
= (GLfloat
) farval
;
2261 if (ctx
->ExecuteFlag
) {
2262 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2267 static void GLAPIENTRY
2268 save_Hint(GLenum target
, GLenum mode
)
2270 GET_CURRENT_CONTEXT(ctx
);
2272 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2273 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2278 if (ctx
->ExecuteFlag
) {
2279 CALL_Hint(ctx
->Exec
, (target
, mode
));
2284 static void GLAPIENTRY
2285 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2288 GET_CURRENT_CONTEXT(ctx
);
2291 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2292 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2296 n
[3].e
= internalFormat
;
2299 if (ctx
->ExecuteFlag
) {
2300 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2305 static void GLAPIENTRY
2306 save_IndexMask(GLuint mask
)
2308 GET_CURRENT_CONTEXT(ctx
);
2310 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2311 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2315 if (ctx
->ExecuteFlag
) {
2316 CALL_IndexMask(ctx
->Exec
, (mask
));
2321 static void GLAPIENTRY
2322 save_InitNames(void)
2324 GET_CURRENT_CONTEXT(ctx
);
2325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2326 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2327 if (ctx
->ExecuteFlag
) {
2328 CALL_InitNames(ctx
->Exec
, ());
2333 static void GLAPIENTRY
2334 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2336 GET_CURRENT_CONTEXT(ctx
);
2338 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2339 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2357 case GL_SPOT_DIRECTION
:
2360 case GL_SPOT_EXPONENT
:
2363 case GL_SPOT_CUTOFF
:
2366 case GL_CONSTANT_ATTENUATION
:
2369 case GL_LINEAR_ATTENUATION
:
2372 case GL_QUADRATIC_ATTENUATION
:
2378 for (i
= 0; i
< nParams
; i
++) {
2379 n
[3 + i
].f
= params
[i
];
2382 if (ctx
->ExecuteFlag
) {
2383 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2388 static void GLAPIENTRY
2389 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2393 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2394 save_Lightfv(light
, pname
, parray
);
2398 static void GLAPIENTRY
2399 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2406 fparam
[0] = INT_TO_FLOAT(params
[0]);
2407 fparam
[1] = INT_TO_FLOAT(params
[1]);
2408 fparam
[2] = INT_TO_FLOAT(params
[2]);
2409 fparam
[3] = INT_TO_FLOAT(params
[3]);
2412 fparam
[0] = (GLfloat
) params
[0];
2413 fparam
[1] = (GLfloat
) params
[1];
2414 fparam
[2] = (GLfloat
) params
[2];
2415 fparam
[3] = (GLfloat
) params
[3];
2417 case GL_SPOT_DIRECTION
:
2418 fparam
[0] = (GLfloat
) params
[0];
2419 fparam
[1] = (GLfloat
) params
[1];
2420 fparam
[2] = (GLfloat
) params
[2];
2422 case GL_SPOT_EXPONENT
:
2423 case GL_SPOT_CUTOFF
:
2424 case GL_CONSTANT_ATTENUATION
:
2425 case GL_LINEAR_ATTENUATION
:
2426 case GL_QUADRATIC_ATTENUATION
:
2427 fparam
[0] = (GLfloat
) params
[0];
2430 /* error will be caught later in gl_Lightfv */
2433 save_Lightfv(light
, pname
, fparam
);
2437 static void GLAPIENTRY
2438 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2442 parray
[1] = parray
[2] = parray
[3] = 0;
2443 save_Lightiv(light
, pname
, parray
);
2447 static void GLAPIENTRY
2448 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2450 GET_CURRENT_CONTEXT(ctx
);
2452 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2453 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2461 if (ctx
->ExecuteFlag
) {
2462 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2467 static void GLAPIENTRY
2468 save_LightModelf(GLenum pname
, GLfloat param
)
2472 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2473 save_LightModelfv(pname
, parray
);
2477 static void GLAPIENTRY
2478 save_LightModeliv(GLenum pname
, const GLint
*params
)
2482 case GL_LIGHT_MODEL_AMBIENT
:
2483 fparam
[0] = INT_TO_FLOAT(params
[0]);
2484 fparam
[1] = INT_TO_FLOAT(params
[1]);
2485 fparam
[2] = INT_TO_FLOAT(params
[2]);
2486 fparam
[3] = INT_TO_FLOAT(params
[3]);
2488 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2489 case GL_LIGHT_MODEL_TWO_SIDE
:
2490 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2491 fparam
[0] = (GLfloat
) params
[0];
2497 /* Error will be caught later in gl_LightModelfv */
2498 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2500 save_LightModelfv(pname
, fparam
);
2504 static void GLAPIENTRY
2505 save_LightModeli(GLenum pname
, GLint param
)
2509 parray
[1] = parray
[2] = parray
[3] = 0;
2510 save_LightModeliv(pname
, parray
);
2514 static void GLAPIENTRY
2515 save_LineStipple(GLint factor
, GLushort pattern
)
2517 GET_CURRENT_CONTEXT(ctx
);
2519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2520 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2525 if (ctx
->ExecuteFlag
) {
2526 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2531 static void GLAPIENTRY
2532 save_LineWidth(GLfloat width
)
2534 GET_CURRENT_CONTEXT(ctx
);
2536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2537 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2541 if (ctx
->ExecuteFlag
) {
2542 CALL_LineWidth(ctx
->Exec
, (width
));
2547 static void GLAPIENTRY
2548 save_ListBase(GLuint base
)
2550 GET_CURRENT_CONTEXT(ctx
);
2552 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2553 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2557 if (ctx
->ExecuteFlag
) {
2558 CALL_ListBase(ctx
->Exec
, (base
));
2563 static void GLAPIENTRY
2564 save_LoadIdentity(void)
2566 GET_CURRENT_CONTEXT(ctx
);
2567 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2568 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2569 if (ctx
->ExecuteFlag
) {
2570 CALL_LoadIdentity(ctx
->Exec
, ());
2575 static void GLAPIENTRY
2576 save_LoadMatrixf(const GLfloat
* m
)
2578 GET_CURRENT_CONTEXT(ctx
);
2580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2581 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2584 for (i
= 0; i
< 16; i
++) {
2588 if (ctx
->ExecuteFlag
) {
2589 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2594 static void GLAPIENTRY
2595 save_LoadMatrixd(const GLdouble
* m
)
2599 for (i
= 0; i
< 16; i
++) {
2600 f
[i
] = (GLfloat
) m
[i
];
2602 save_LoadMatrixf(f
);
2606 static void GLAPIENTRY
2607 save_LoadName(GLuint name
)
2609 GET_CURRENT_CONTEXT(ctx
);
2611 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2612 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2616 if (ctx
->ExecuteFlag
) {
2617 CALL_LoadName(ctx
->Exec
, (name
));
2622 static void GLAPIENTRY
2623 save_LogicOp(GLenum opcode
)
2625 GET_CURRENT_CONTEXT(ctx
);
2627 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2628 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2632 if (ctx
->ExecuteFlag
) {
2633 CALL_LogicOp(ctx
->Exec
, (opcode
));
2638 static void GLAPIENTRY
2639 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2640 GLint order
, const GLdouble
* points
)
2642 GET_CURRENT_CONTEXT(ctx
);
2644 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2645 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2647 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2649 n
[2].f
= (GLfloat
) u1
;
2650 n
[3].f
= (GLfloat
) u2
;
2651 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2653 n
[6].data
= (void *) pnts
;
2655 if (ctx
->ExecuteFlag
) {
2656 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2660 static void GLAPIENTRY
2661 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2662 GLint order
, const GLfloat
* points
)
2664 GET_CURRENT_CONTEXT(ctx
);
2666 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2667 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2669 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2673 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2675 n
[6].data
= (void *) pnts
;
2677 if (ctx
->ExecuteFlag
) {
2678 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2683 static void GLAPIENTRY
2684 save_Map2d(GLenum target
,
2685 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2686 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2687 const GLdouble
* points
)
2689 GET_CURRENT_CONTEXT(ctx
);
2691 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2692 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2694 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2695 vstride
, vorder
, points
);
2697 n
[2].f
= (GLfloat
) u1
;
2698 n
[3].f
= (GLfloat
) u2
;
2699 n
[4].f
= (GLfloat
) v1
;
2700 n
[5].f
= (GLfloat
) v2
;
2701 /* XXX verify these strides are correct */
2702 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2703 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2706 n
[10].data
= (void *) pnts
;
2708 if (ctx
->ExecuteFlag
) {
2709 CALL_Map2d(ctx
->Exec
, (target
,
2710 u1
, u2
, ustride
, uorder
,
2711 v1
, v2
, vstride
, vorder
, points
));
2716 static void GLAPIENTRY
2717 save_Map2f(GLenum target
,
2718 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2719 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2720 const GLfloat
* points
)
2722 GET_CURRENT_CONTEXT(ctx
);
2724 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2725 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2727 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2728 vstride
, vorder
, points
);
2734 /* XXX verify these strides are correct */
2735 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2736 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2739 n
[10].data
= (void *) pnts
;
2741 if (ctx
->ExecuteFlag
) {
2742 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2743 v1
, v2
, vstride
, vorder
, points
));
2748 static void GLAPIENTRY
2749 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2751 GET_CURRENT_CONTEXT(ctx
);
2753 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2754 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2760 if (ctx
->ExecuteFlag
) {
2761 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2766 static void GLAPIENTRY
2767 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2769 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2773 static void GLAPIENTRY
2774 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2775 GLint vn
, GLfloat v1
, GLfloat v2
)
2777 GET_CURRENT_CONTEXT(ctx
);
2779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2780 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2789 if (ctx
->ExecuteFlag
) {
2790 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2796 static void GLAPIENTRY
2797 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2798 GLint vn
, GLdouble v1
, GLdouble v2
)
2800 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2801 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2805 static void GLAPIENTRY
2806 save_MatrixMode(GLenum mode
)
2808 GET_CURRENT_CONTEXT(ctx
);
2810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2811 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2815 if (ctx
->ExecuteFlag
) {
2816 CALL_MatrixMode(ctx
->Exec
, (mode
));
2821 static void GLAPIENTRY
2822 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2824 GET_CURRENT_CONTEXT(ctx
);
2827 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2828 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2831 n
[2].e
= internalFormat
;
2834 if (ctx
->ExecuteFlag
) {
2835 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2840 static void GLAPIENTRY
2841 save_MultMatrixf(const GLfloat
* m
)
2843 GET_CURRENT_CONTEXT(ctx
);
2845 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2846 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2849 for (i
= 0; i
< 16; i
++) {
2853 if (ctx
->ExecuteFlag
) {
2854 CALL_MultMatrixf(ctx
->Exec
, (m
));
2859 static void GLAPIENTRY
2860 save_MultMatrixd(const GLdouble
* m
)
2864 for (i
= 0; i
< 16; i
++) {
2865 f
[i
] = (GLfloat
) m
[i
];
2867 save_MultMatrixf(f
);
2871 static void GLAPIENTRY
2872 save_NewList(GLuint name
, GLenum mode
)
2874 GET_CURRENT_CONTEXT(ctx
);
2875 /* It's an error to call this function while building a display list */
2876 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2883 static void GLAPIENTRY
2884 save_Ortho(GLdouble left
, GLdouble right
,
2885 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2887 GET_CURRENT_CONTEXT(ctx
);
2889 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2890 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2892 n
[1].f
= (GLfloat
) left
;
2893 n
[2].f
= (GLfloat
) right
;
2894 n
[3].f
= (GLfloat
) bottom
;
2895 n
[4].f
= (GLfloat
) top
;
2896 n
[5].f
= (GLfloat
) nearval
;
2897 n
[6].f
= (GLfloat
) farval
;
2899 if (ctx
->ExecuteFlag
) {
2900 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2905 static void GLAPIENTRY
2906 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2908 GET_CURRENT_CONTEXT(ctx
);
2910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2911 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2915 n
[3].data
= (void *) malloc(mapsize
* sizeof(GLfloat
));
2916 memcpy(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2918 if (ctx
->ExecuteFlag
) {
2919 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2924 static void GLAPIENTRY
2925 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2927 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2929 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2930 for (i
= 0; i
< mapsize
; i
++) {
2931 fvalues
[i
] = (GLfloat
) values
[i
];
2935 for (i
= 0; i
< mapsize
; i
++) {
2936 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2939 save_PixelMapfv(map
, mapsize
, fvalues
);
2943 static void GLAPIENTRY
2944 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*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
] = USHORT_TO_FLOAT(values
[i
]);
2958 save_PixelMapfv(map
, mapsize
, fvalues
);
2962 static void GLAPIENTRY
2963 save_PixelTransferf(GLenum pname
, GLfloat param
)
2965 GET_CURRENT_CONTEXT(ctx
);
2967 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2968 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2973 if (ctx
->ExecuteFlag
) {
2974 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2979 static void GLAPIENTRY
2980 save_PixelTransferi(GLenum pname
, GLint param
)
2982 save_PixelTransferf(pname
, (GLfloat
) param
);
2986 static void GLAPIENTRY
2987 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2989 GET_CURRENT_CONTEXT(ctx
);
2991 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2992 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2997 if (ctx
->ExecuteFlag
) {
2998 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3003 static void GLAPIENTRY
3004 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3006 GET_CURRENT_CONTEXT(ctx
);
3008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3009 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3016 if (ctx
->ExecuteFlag
) {
3017 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3022 static void GLAPIENTRY
3023 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3027 parray
[1] = parray
[2] = 0.0F
;
3028 save_PointParameterfvEXT(pname
, parray
);
3031 static void GLAPIENTRY
3032 save_PointParameteriNV(GLenum pname
, GLint param
)
3035 parray
[0] = (GLfloat
) param
;
3036 parray
[1] = parray
[2] = 0.0F
;
3037 save_PointParameterfvEXT(pname
, parray
);
3040 static void GLAPIENTRY
3041 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3044 parray
[0] = (GLfloat
) param
[0];
3045 parray
[1] = parray
[2] = 0.0F
;
3046 save_PointParameterfvEXT(pname
, parray
);
3050 static void GLAPIENTRY
3051 save_PointSize(GLfloat size
)
3053 GET_CURRENT_CONTEXT(ctx
);
3055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3056 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3060 if (ctx
->ExecuteFlag
) {
3061 CALL_PointSize(ctx
->Exec
, (size
));
3066 static void GLAPIENTRY
3067 save_PolygonMode(GLenum face
, GLenum mode
)
3069 GET_CURRENT_CONTEXT(ctx
);
3071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3072 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3077 if (ctx
->ExecuteFlag
) {
3078 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3083 static void GLAPIENTRY
3084 save_PolygonStipple(const GLubyte
* pattern
)
3086 GET_CURRENT_CONTEXT(ctx
);
3089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3091 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3093 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3094 pattern
, &ctx
->Unpack
);
3096 if (ctx
->ExecuteFlag
) {
3097 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3102 static void GLAPIENTRY
3103 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3105 GET_CURRENT_CONTEXT(ctx
);
3107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3108 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3113 if (ctx
->ExecuteFlag
) {
3114 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3119 static void GLAPIENTRY
3120 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3122 GET_CURRENT_CONTEXT(ctx
);
3123 /* XXX mult by DepthMaxF here??? */
3124 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3128 static void GLAPIENTRY
3129 save_PopAttrib(void)
3131 GET_CURRENT_CONTEXT(ctx
);
3132 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3133 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3134 if (ctx
->ExecuteFlag
) {
3135 CALL_PopAttrib(ctx
->Exec
, ());
3140 static void GLAPIENTRY
3141 save_PopMatrix(void)
3143 GET_CURRENT_CONTEXT(ctx
);
3144 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3145 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3146 if (ctx
->ExecuteFlag
) {
3147 CALL_PopMatrix(ctx
->Exec
, ());
3152 static void GLAPIENTRY
3155 GET_CURRENT_CONTEXT(ctx
);
3156 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3157 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3158 if (ctx
->ExecuteFlag
) {
3159 CALL_PopName(ctx
->Exec
, ());
3164 static void GLAPIENTRY
3165 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3166 const GLclampf
* priorities
)
3168 GET_CURRENT_CONTEXT(ctx
);
3170 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3172 for (i
= 0; i
< num
; i
++) {
3174 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3176 n
[1].ui
= textures
[i
];
3177 n
[2].f
= priorities
[i
];
3180 if (ctx
->ExecuteFlag
) {
3181 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3186 static void GLAPIENTRY
3187 save_PushAttrib(GLbitfield mask
)
3189 GET_CURRENT_CONTEXT(ctx
);
3191 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3192 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3196 if (ctx
->ExecuteFlag
) {
3197 CALL_PushAttrib(ctx
->Exec
, (mask
));
3202 static void GLAPIENTRY
3203 save_PushMatrix(void)
3205 GET_CURRENT_CONTEXT(ctx
);
3206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3207 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3208 if (ctx
->ExecuteFlag
) {
3209 CALL_PushMatrix(ctx
->Exec
, ());
3214 static void GLAPIENTRY
3215 save_PushName(GLuint name
)
3217 GET_CURRENT_CONTEXT(ctx
);
3219 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3220 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3224 if (ctx
->ExecuteFlag
) {
3225 CALL_PushName(ctx
->Exec
, (name
));
3230 static void GLAPIENTRY
3231 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3233 GET_CURRENT_CONTEXT(ctx
);
3235 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3236 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3243 if (ctx
->ExecuteFlag
) {
3244 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3248 static void GLAPIENTRY
3249 save_RasterPos2d(GLdouble x
, GLdouble y
)
3251 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3254 static void GLAPIENTRY
3255 save_RasterPos2f(GLfloat x
, GLfloat y
)
3257 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3260 static void GLAPIENTRY
3261 save_RasterPos2i(GLint x
, GLint y
)
3263 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3266 static void GLAPIENTRY
3267 save_RasterPos2s(GLshort x
, GLshort y
)
3269 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3272 static void GLAPIENTRY
3273 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3275 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3278 static void GLAPIENTRY
3279 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3281 save_RasterPos4f(x
, y
, z
, 1.0F
);
3284 static void GLAPIENTRY
3285 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3287 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3290 static void GLAPIENTRY
3291 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3293 save_RasterPos4f(x
, y
, z
, 1.0F
);
3296 static void GLAPIENTRY
3297 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3299 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3302 static void GLAPIENTRY
3303 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3305 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3308 static void GLAPIENTRY
3309 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3311 save_RasterPos4f(x
, y
, z
, w
);
3314 static void GLAPIENTRY
3315 save_RasterPos2dv(const GLdouble
* v
)
3317 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3320 static void GLAPIENTRY
3321 save_RasterPos2fv(const GLfloat
* v
)
3323 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3326 static void GLAPIENTRY
3327 save_RasterPos2iv(const GLint
* v
)
3329 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3332 static void GLAPIENTRY
3333 save_RasterPos2sv(const GLshort
* v
)
3335 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3338 static void GLAPIENTRY
3339 save_RasterPos3dv(const GLdouble
* v
)
3341 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3344 static void GLAPIENTRY
3345 save_RasterPos3fv(const GLfloat
* v
)
3347 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3350 static void GLAPIENTRY
3351 save_RasterPos3iv(const GLint
* v
)
3353 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3356 static void GLAPIENTRY
3357 save_RasterPos3sv(const GLshort
* v
)
3359 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3362 static void GLAPIENTRY
3363 save_RasterPos4dv(const GLdouble
* v
)
3365 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3366 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3369 static void GLAPIENTRY
3370 save_RasterPos4fv(const GLfloat
* v
)
3372 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3375 static void GLAPIENTRY
3376 save_RasterPos4iv(const GLint
* v
)
3378 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3379 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3382 static void GLAPIENTRY
3383 save_RasterPos4sv(const GLshort
* v
)
3385 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3389 static void GLAPIENTRY
3390 save_PassThrough(GLfloat token
)
3392 GET_CURRENT_CONTEXT(ctx
);
3394 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3395 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3399 if (ctx
->ExecuteFlag
) {
3400 CALL_PassThrough(ctx
->Exec
, (token
));
3405 static void GLAPIENTRY
3406 save_ReadBuffer(GLenum mode
)
3408 GET_CURRENT_CONTEXT(ctx
);
3410 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3411 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3415 if (ctx
->ExecuteFlag
) {
3416 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3421 static void GLAPIENTRY
3422 save_ResetHistogram(GLenum target
)
3424 GET_CURRENT_CONTEXT(ctx
);
3426 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3427 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3431 if (ctx
->ExecuteFlag
) {
3432 CALL_ResetHistogram(ctx
->Exec
, (target
));
3437 static void GLAPIENTRY
3438 save_ResetMinmax(GLenum target
)
3440 GET_CURRENT_CONTEXT(ctx
);
3442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3443 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3447 if (ctx
->ExecuteFlag
) {
3448 CALL_ResetMinmax(ctx
->Exec
, (target
));
3453 static void GLAPIENTRY
3454 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3456 GET_CURRENT_CONTEXT(ctx
);
3458 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3459 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3466 if (ctx
->ExecuteFlag
) {
3467 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3472 static void GLAPIENTRY
3473 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3475 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3479 static void GLAPIENTRY
3480 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3482 GET_CURRENT_CONTEXT(ctx
);
3484 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3485 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3491 if (ctx
->ExecuteFlag
) {
3492 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3497 static void GLAPIENTRY
3498 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3500 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3504 static void GLAPIENTRY
3505 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3507 GET_CURRENT_CONTEXT(ctx
);
3509 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3510 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3517 if (ctx
->ExecuteFlag
) {
3518 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3523 static void GLAPIENTRY
3524 save_ShadeModel(GLenum mode
)
3526 GET_CURRENT_CONTEXT(ctx
);
3528 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3530 if (ctx
->ExecuteFlag
) {
3531 CALL_ShadeModel(ctx
->Exec
, (mode
));
3534 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3537 SAVE_FLUSH_VERTICES(ctx
);
3539 /* Only save the value if we know the statechange will take effect:
3541 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3542 ctx
->ListState
.Current
.ShadeModel
= mode
;
3544 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3551 static void GLAPIENTRY
3552 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3554 GET_CURRENT_CONTEXT(ctx
);
3556 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3557 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3563 if (ctx
->ExecuteFlag
) {
3564 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3569 static void GLAPIENTRY
3570 save_StencilMask(GLuint mask
)
3572 GET_CURRENT_CONTEXT(ctx
);
3574 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3575 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3579 if (ctx
->ExecuteFlag
) {
3580 CALL_StencilMask(ctx
->Exec
, (mask
));
3585 static void GLAPIENTRY
3586 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3588 GET_CURRENT_CONTEXT(ctx
);
3590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3591 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3597 if (ctx
->ExecuteFlag
) {
3598 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3603 static void GLAPIENTRY
3604 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3606 GET_CURRENT_CONTEXT(ctx
);
3608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3609 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3616 if (ctx
->ExecuteFlag
) {
3617 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3622 static void GLAPIENTRY
3623 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3626 GET_CURRENT_CONTEXT(ctx
);
3628 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3630 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3638 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3645 if (ctx
->ExecuteFlag
) {
3646 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3647 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3652 static void GLAPIENTRY
3653 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3655 GET_CURRENT_CONTEXT(ctx
);
3657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3658 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3663 if (ctx
->ExecuteFlag
) {
3664 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3669 static void GLAPIENTRY
3670 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3672 GET_CURRENT_CONTEXT(ctx
);
3674 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3675 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3682 if (ctx
->ExecuteFlag
) {
3683 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3688 static void GLAPIENTRY
3689 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3691 GET_CURRENT_CONTEXT(ctx
);
3693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3694 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3698 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3706 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3709 if (ctx
->ExecuteFlag
) {
3710 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3715 static void GLAPIENTRY
3716 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3719 parray
[0] = (GLfloat
) param
;
3720 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3721 save_TexEnvfv(target
, pname
, parray
);
3725 static void GLAPIENTRY
3726 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3729 p
[0] = (GLfloat
) param
;
3730 p
[1] = p
[2] = p
[3] = 0.0F
;
3731 save_TexEnvfv(target
, pname
, p
);
3735 static void GLAPIENTRY
3736 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3739 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3740 p
[0] = INT_TO_FLOAT(param
[0]);
3741 p
[1] = INT_TO_FLOAT(param
[1]);
3742 p
[2] = INT_TO_FLOAT(param
[2]);
3743 p
[3] = INT_TO_FLOAT(param
[3]);
3746 p
[0] = (GLfloat
) param
[0];
3747 p
[1] = p
[2] = p
[3] = 0.0F
;
3749 save_TexEnvfv(target
, pname
, p
);
3753 static void GLAPIENTRY
3754 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3756 GET_CURRENT_CONTEXT(ctx
);
3758 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3759 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3768 if (ctx
->ExecuteFlag
) {
3769 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3774 static void GLAPIENTRY
3775 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3778 p
[0] = (GLfloat
) params
[0];
3779 p
[1] = (GLfloat
) params
[1];
3780 p
[2] = (GLfloat
) params
[2];
3781 p
[3] = (GLfloat
) params
[3];
3782 save_TexGenfv(coord
, pname
, p
);
3786 static void GLAPIENTRY
3787 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3790 parray
[0] = (GLfloat
) param
;
3791 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3792 save_TexGenfv(coord
, pname
, parray
);
3796 static void GLAPIENTRY
3797 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3800 p
[0] = (GLfloat
) params
[0];
3801 p
[1] = (GLfloat
) params
[1];
3802 p
[2] = (GLfloat
) params
[2];
3803 p
[3] = (GLfloat
) params
[3];
3804 save_TexGenfv(coord
, pname
, p
);
3808 static void GLAPIENTRY
3809 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3813 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3814 save_TexGenfv(coord
, pname
, parray
);
3818 static void GLAPIENTRY
3819 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3823 parray
[1] = parray
[2] = parray
[3] = 0;
3824 save_TexGeniv(coord
, pname
, parray
);
3828 static void GLAPIENTRY
3829 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3831 GET_CURRENT_CONTEXT(ctx
);
3833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3834 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3843 if (ctx
->ExecuteFlag
) {
3844 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3849 static void GLAPIENTRY
3850 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3854 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3855 save_TexParameterfv(target
, pname
, parray
);
3859 static void GLAPIENTRY
3860 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3863 fparam
[0] = (GLfloat
) param
;
3864 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3865 save_TexParameterfv(target
, pname
, fparam
);
3869 static void GLAPIENTRY
3870 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3873 fparam
[0] = (GLfloat
) params
[0];
3874 fparam
[1] = fparam
[2] = fparam
[3] = 0.0F
;
3875 save_TexParameterfv(target
, pname
, fparam
);
3879 static void GLAPIENTRY
3880 save_TexImage1D(GLenum target
,
3881 GLint level
, GLint components
,
3882 GLsizei width
, GLint border
,
3883 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3885 GET_CURRENT_CONTEXT(ctx
);
3886 if (target
== GL_PROXY_TEXTURE_1D
) {
3887 /* don't compile, execute immediately */
3888 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3889 border
, format
, type
, pixels
));
3893 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3894 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3898 n
[3].i
= components
;
3899 n
[4].i
= (GLint
) width
;
3903 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3904 pixels
, &ctx
->Unpack
);
3906 if (ctx
->ExecuteFlag
) {
3907 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3908 border
, format
, type
, pixels
));
3914 static void GLAPIENTRY
3915 save_TexImage2D(GLenum target
,
3916 GLint level
, GLint components
,
3917 GLsizei width
, GLsizei height
, GLint border
,
3918 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3920 GET_CURRENT_CONTEXT(ctx
);
3921 if (target
== GL_PROXY_TEXTURE_2D
) {
3922 /* don't compile, execute immediately */
3923 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3924 height
, border
, format
, type
, pixels
));
3928 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3929 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3933 n
[3].i
= components
;
3934 n
[4].i
= (GLint
) width
;
3935 n
[5].i
= (GLint
) height
;
3939 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3940 pixels
, &ctx
->Unpack
);
3942 if (ctx
->ExecuteFlag
) {
3943 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3944 height
, border
, format
, type
, pixels
));
3950 static void GLAPIENTRY
3951 save_TexImage3D(GLenum target
,
3952 GLint level
, GLint internalFormat
,
3953 GLsizei width
, GLsizei height
, GLsizei depth
,
3955 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3957 GET_CURRENT_CONTEXT(ctx
);
3958 if (target
== GL_PROXY_TEXTURE_3D
) {
3959 /* don't compile, execute immediately */
3960 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3961 height
, depth
, border
, format
, type
,
3966 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3967 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3971 n
[3].i
= (GLint
) internalFormat
;
3972 n
[4].i
= (GLint
) width
;
3973 n
[5].i
= (GLint
) height
;
3974 n
[6].i
= (GLint
) depth
;
3978 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3979 pixels
, &ctx
->Unpack
);
3981 if (ctx
->ExecuteFlag
) {
3982 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3983 height
, depth
, border
, format
, type
,
3990 static void GLAPIENTRY
3991 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3992 GLsizei width
, GLenum format
, GLenum type
,
3993 const GLvoid
* pixels
)
3995 GET_CURRENT_CONTEXT(ctx
);
3998 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4000 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4005 n
[4].i
= (GLint
) width
;
4008 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4009 pixels
, &ctx
->Unpack
);
4011 if (ctx
->ExecuteFlag
) {
4012 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4013 format
, type
, pixels
));
4018 static void GLAPIENTRY
4019 save_TexSubImage2D(GLenum target
, GLint level
,
4020 GLint xoffset
, GLint yoffset
,
4021 GLsizei width
, GLsizei height
,
4022 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4024 GET_CURRENT_CONTEXT(ctx
);
4027 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4029 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4035 n
[5].i
= (GLint
) width
;
4036 n
[6].i
= (GLint
) height
;
4039 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4040 pixels
, &ctx
->Unpack
);
4042 if (ctx
->ExecuteFlag
) {
4043 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4044 width
, height
, format
, type
, pixels
));
4049 static void GLAPIENTRY
4050 save_TexSubImage3D(GLenum target
, GLint level
,
4051 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4052 GLsizei width
, GLsizei height
, GLsizei depth
,
4053 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4055 GET_CURRENT_CONTEXT(ctx
);
4058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4060 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4067 n
[6].i
= (GLint
) width
;
4068 n
[7].i
= (GLint
) height
;
4069 n
[8].i
= (GLint
) depth
;
4072 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4073 pixels
, &ctx
->Unpack
);
4075 if (ctx
->ExecuteFlag
) {
4076 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4077 xoffset
, yoffset
, zoffset
,
4078 width
, height
, depth
, format
, type
,
4084 static void GLAPIENTRY
4085 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4087 GET_CURRENT_CONTEXT(ctx
);
4089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4090 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4096 if (ctx
->ExecuteFlag
) {
4097 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4102 static void GLAPIENTRY
4103 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4105 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4110 static void GLAPIENTRY
4111 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4113 GET_CURRENT_CONTEXT(ctx
);
4115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4116 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4120 n
[3].i
= (GLint
) width
;
4121 n
[4].i
= (GLint
) height
;
4123 if (ctx
->ExecuteFlag
) {
4124 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4129 static void GLAPIENTRY
4130 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4132 GET_CURRENT_CONTEXT(ctx
);
4134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4135 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4142 if (ctx
->ExecuteFlag
) {
4143 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4147 static void GLAPIENTRY
4148 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4150 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4153 static void GLAPIENTRY
4154 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4156 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4159 static void GLAPIENTRY
4160 save_WindowPos2iMESA(GLint x
, GLint y
)
4162 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4165 static void GLAPIENTRY
4166 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4168 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4171 static void GLAPIENTRY
4172 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4174 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4177 static void GLAPIENTRY
4178 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4180 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4183 static void GLAPIENTRY
4184 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4186 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4189 static void GLAPIENTRY
4190 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4192 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4195 static void GLAPIENTRY
4196 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4198 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4201 static void GLAPIENTRY
4202 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4204 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4207 static void GLAPIENTRY
4208 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4210 save_WindowPos4fMESA(x
, y
, z
, w
);
4213 static void GLAPIENTRY
4214 save_WindowPos2dvMESA(const GLdouble
* v
)
4216 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4219 static void GLAPIENTRY
4220 save_WindowPos2fvMESA(const GLfloat
* v
)
4222 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4225 static void GLAPIENTRY
4226 save_WindowPos2ivMESA(const GLint
* v
)
4228 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4231 static void GLAPIENTRY
4232 save_WindowPos2svMESA(const GLshort
* v
)
4234 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4237 static void GLAPIENTRY
4238 save_WindowPos3dvMESA(const GLdouble
* v
)
4240 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4243 static void GLAPIENTRY
4244 save_WindowPos3fvMESA(const GLfloat
* v
)
4246 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4249 static void GLAPIENTRY
4250 save_WindowPos3ivMESA(const GLint
* v
)
4252 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4255 static void GLAPIENTRY
4256 save_WindowPos3svMESA(const GLshort
* v
)
4258 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4261 static void GLAPIENTRY
4262 save_WindowPos4dvMESA(const GLdouble
* v
)
4264 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4265 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4268 static void GLAPIENTRY
4269 save_WindowPos4fvMESA(const GLfloat
* v
)
4271 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4274 static void GLAPIENTRY
4275 save_WindowPos4ivMESA(const GLint
* v
)
4277 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4278 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4281 static void GLAPIENTRY
4282 save_WindowPos4svMESA(const GLshort
* v
)
4284 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4289 /* GL_ARB_multitexture */
4290 static void GLAPIENTRY
4291 save_ActiveTextureARB(GLenum target
)
4293 GET_CURRENT_CONTEXT(ctx
);
4295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4296 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4300 if (ctx
->ExecuteFlag
) {
4301 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4306 /* GL_ARB_transpose_matrix */
4308 static void GLAPIENTRY
4309 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4312 _math_transposefd(tm
, m
);
4313 save_LoadMatrixf(tm
);
4317 static void GLAPIENTRY
4318 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4321 _math_transposef(tm
, m
);
4322 save_LoadMatrixf(tm
);
4326 static void GLAPIENTRY
4327 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4330 _math_transposefd(tm
, m
);
4331 save_MultMatrixf(tm
);
4335 static void GLAPIENTRY
4336 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4339 _math_transposef(tm
, m
);
4340 save_MultMatrixf(tm
);
4344 /* GL_ARB_texture_compression */
4345 static void GLAPIENTRY
4346 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4347 GLenum internalFormat
, GLsizei width
,
4348 GLint border
, GLsizei imageSize
,
4349 const GLvoid
* data
)
4351 GET_CURRENT_CONTEXT(ctx
);
4352 if (target
== GL_PROXY_TEXTURE_1D
) {
4353 /* don't compile, execute immediately */
4354 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4355 width
, border
, imageSize
,
4361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4362 /* make copy of image */
4363 image
= malloc(imageSize
);
4365 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4368 memcpy(image
, data
, imageSize
);
4369 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4373 n
[3].e
= internalFormat
;
4374 n
[4].i
= (GLint
) width
;
4382 if (ctx
->ExecuteFlag
) {
4383 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4384 (target
, level
, internalFormat
, width
,
4385 border
, imageSize
, data
));
4391 static void GLAPIENTRY
4392 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4393 GLenum internalFormat
, GLsizei width
,
4394 GLsizei height
, GLint border
, GLsizei imageSize
,
4395 const GLvoid
* data
)
4397 GET_CURRENT_CONTEXT(ctx
);
4398 if (target
== GL_PROXY_TEXTURE_2D
) {
4399 /* don't compile, execute immediately */
4400 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4401 width
, height
, border
,
4407 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4408 /* make copy of image */
4409 image
= malloc(imageSize
);
4411 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4414 memcpy(image
, data
, imageSize
);
4415 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4419 n
[3].e
= internalFormat
;
4420 n
[4].i
= (GLint
) width
;
4421 n
[5].i
= (GLint
) height
;
4429 if (ctx
->ExecuteFlag
) {
4430 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4431 (target
, level
, internalFormat
, width
,
4432 height
, border
, imageSize
, data
));
4438 static void GLAPIENTRY
4439 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4440 GLenum internalFormat
, GLsizei width
,
4441 GLsizei height
, GLsizei depth
, GLint border
,
4442 GLsizei imageSize
, const GLvoid
* data
)
4444 GET_CURRENT_CONTEXT(ctx
);
4445 if (target
== GL_PROXY_TEXTURE_3D
) {
4446 /* don't compile, execute immediately */
4447 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4448 width
, height
, depth
, border
,
4454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4455 /* make copy of image */
4456 image
= malloc(imageSize
);
4458 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4461 memcpy(image
, data
, imageSize
);
4462 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4466 n
[3].e
= internalFormat
;
4467 n
[4].i
= (GLint
) width
;
4468 n
[5].i
= (GLint
) height
;
4469 n
[6].i
= (GLint
) depth
;
4477 if (ctx
->ExecuteFlag
) {
4478 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4479 (target
, level
, internalFormat
, width
,
4480 height
, depth
, border
, imageSize
,
4487 static void GLAPIENTRY
4488 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4489 GLsizei width
, GLenum format
,
4490 GLsizei imageSize
, const GLvoid
* data
)
4495 GET_CURRENT_CONTEXT(ctx
);
4496 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4498 /* make copy of image */
4499 image
= malloc(imageSize
);
4501 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4504 memcpy(image
, data
, imageSize
);
4505 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4510 n
[4].i
= (GLint
) width
;
4518 if (ctx
->ExecuteFlag
) {
4519 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4520 width
, format
, imageSize
,
4526 static void GLAPIENTRY
4527 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4528 GLint yoffset
, GLsizei width
, GLsizei height
,
4529 GLenum format
, GLsizei imageSize
,
4530 const GLvoid
* data
)
4535 GET_CURRENT_CONTEXT(ctx
);
4536 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4538 /* make copy of image */
4539 image
= malloc(imageSize
);
4541 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4544 memcpy(image
, data
, imageSize
);
4545 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4551 n
[5].i
= (GLint
) width
;
4552 n
[6].i
= (GLint
) height
;
4560 if (ctx
->ExecuteFlag
) {
4561 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4562 (target
, level
, xoffset
, yoffset
, width
,
4563 height
, format
, imageSize
, data
));
4568 static void GLAPIENTRY
4569 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4570 GLint yoffset
, GLint zoffset
, GLsizei width
,
4571 GLsizei height
, GLsizei depth
, GLenum format
,
4572 GLsizei imageSize
, const GLvoid
* data
)
4577 GET_CURRENT_CONTEXT(ctx
);
4578 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4580 /* make copy of image */
4581 image
= malloc(imageSize
);
4583 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4586 memcpy(image
, data
, imageSize
);
4587 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4594 n
[6].i
= (GLint
) width
;
4595 n
[7].i
= (GLint
) height
;
4596 n
[8].i
= (GLint
) depth
;
4598 n
[10].i
= imageSize
;
4604 if (ctx
->ExecuteFlag
) {
4605 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4606 (target
, level
, xoffset
, yoffset
,
4607 zoffset
, width
, height
, depth
, format
,
4613 /* GL_ARB_multisample */
4614 static void GLAPIENTRY
4615 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4617 GET_CURRENT_CONTEXT(ctx
);
4619 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4620 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4625 if (ctx
->ExecuteFlag
) {
4626 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4632 * GL_NV_vertex_program
4634 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4635 static void GLAPIENTRY
4636 save_BindProgramNV(GLenum target
, GLuint id
)
4638 GET_CURRENT_CONTEXT(ctx
);
4640 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4641 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4646 if (ctx
->ExecuteFlag
) {
4647 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4651 static void GLAPIENTRY
4652 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4653 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4655 GET_CURRENT_CONTEXT(ctx
);
4657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4658 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4667 if (ctx
->ExecuteFlag
) {
4668 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4673 static void GLAPIENTRY
4674 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4675 const GLfloat
*params
)
4677 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4678 params
[2], params
[3]);
4682 static void GLAPIENTRY
4683 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4684 const GLfloat
* params
)
4686 GET_CURRENT_CONTEXT(ctx
);
4688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4692 const GLfloat
* p
= params
;
4694 for (i
= 0 ; i
< count
; i
++) {
4695 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4708 if (ctx
->ExecuteFlag
) {
4709 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4714 static void GLAPIENTRY
4715 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4716 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4718 save_ProgramEnvParameter4fARB(target
, index
,
4720 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4724 static void GLAPIENTRY
4725 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4726 const GLdouble
*params
)
4728 save_ProgramEnvParameter4fARB(target
, index
,
4729 (GLfloat
) params
[0],
4730 (GLfloat
) params
[1],
4731 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4734 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4736 #if FEATURE_NV_vertex_program
4737 static void GLAPIENTRY
4738 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4740 GET_CURRENT_CONTEXT(ctx
);
4742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4743 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4752 if (ctx
->ExecuteFlag
) {
4753 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4758 static void GLAPIENTRY
4759 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4760 GLuint num
, const GLdouble
*params
)
4763 for (i
= 0; i
< num
; i
++) {
4764 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4769 static void GLAPIENTRY
4770 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4771 GLuint num
, const GLfloat
*params
)
4774 for (i
= 0; i
< num
; i
++) {
4775 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4780 static void GLAPIENTRY
4781 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4782 const GLubyte
* program
)
4784 GET_CURRENT_CONTEXT(ctx
);
4787 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4789 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4791 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
4793 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4796 memcpy(programCopy
, program
, len
);
4800 n
[4].data
= programCopy
;
4802 if (ctx
->ExecuteFlag
) {
4803 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4808 static void GLAPIENTRY
4809 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4811 GET_CURRENT_CONTEXT(ctx
);
4814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4816 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4818 GLuint
*idCopy
= (GLuint
*) malloc(num
* sizeof(GLuint
));
4820 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4823 memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4827 if (ctx
->ExecuteFlag
) {
4828 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4833 static void GLAPIENTRY
4834 save_TrackMatrixNV(GLenum target
, GLuint address
,
4835 GLenum matrix
, GLenum transform
)
4837 GET_CURRENT_CONTEXT(ctx
);
4839 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4840 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4847 if (ctx
->ExecuteFlag
) {
4848 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4851 #endif /* FEATURE_NV_vertex_program */
4855 * GL_NV_fragment_program
4857 #if FEATURE_NV_fragment_program
4858 static void GLAPIENTRY
4859 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4860 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4862 GET_CURRENT_CONTEXT(ctx
);
4864 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4865 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4874 if (ctx
->ExecuteFlag
) {
4875 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4880 static void GLAPIENTRY
4881 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4882 const GLfloat
*params
)
4884 GET_CURRENT_CONTEXT(ctx
);
4886 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4887 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4896 if (ctx
->ExecuteFlag
) {
4897 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4902 static void GLAPIENTRY
4903 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4904 const GLfloat
*params
)
4906 GET_CURRENT_CONTEXT(ctx
);
4908 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4912 const GLfloat
* p
= params
;
4914 for (i
= 0 ; i
< count
; i
++) {
4915 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4928 if (ctx
->ExecuteFlag
) {
4929 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4934 static void GLAPIENTRY
4935 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4936 GLdouble x
, GLdouble y
,
4937 GLdouble z
, GLdouble w
)
4939 GET_CURRENT_CONTEXT(ctx
);
4941 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4942 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4946 n
[3].f
= (GLfloat
) x
;
4947 n
[4].f
= (GLfloat
) y
;
4948 n
[5].f
= (GLfloat
) z
;
4949 n
[6].f
= (GLfloat
) w
;
4951 if (ctx
->ExecuteFlag
) {
4952 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4957 static void GLAPIENTRY
4958 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4959 const GLdouble
*params
)
4961 GET_CURRENT_CONTEXT(ctx
);
4963 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4964 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4968 n
[3].f
= (GLfloat
) params
[0];
4969 n
[4].f
= (GLfloat
) params
[1];
4970 n
[5].f
= (GLfloat
) params
[2];
4971 n
[6].f
= (GLfloat
) params
[3];
4973 if (ctx
->ExecuteFlag
) {
4974 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4978 static void GLAPIENTRY
4979 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4980 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4982 GET_CURRENT_CONTEXT(ctx
);
4985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4987 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4989 GLubyte
*nameCopy
= (GLubyte
*) malloc(len
);
4991 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4994 memcpy(nameCopy
, name
, len
);
4997 n
[3].data
= nameCopy
;
5003 if (ctx
->ExecuteFlag
) {
5004 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5009 static void GLAPIENTRY
5010 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5013 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5017 static void GLAPIENTRY
5018 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5019 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5021 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5022 (GLfloat
) z
, (GLfloat
) w
);
5026 static void GLAPIENTRY
5027 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5030 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5031 (GLfloat
) v
[1], (GLfloat
) v
[2],
5035 #endif /* FEATURE_NV_fragment_program */
5039 /* GL_EXT_stencil_two_side */
5040 static void GLAPIENTRY
5041 save_ActiveStencilFaceEXT(GLenum face
)
5043 GET_CURRENT_CONTEXT(ctx
);
5045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5046 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5050 if (ctx
->ExecuteFlag
) {
5051 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5056 /* GL_EXT_depth_bounds_test */
5057 static void GLAPIENTRY
5058 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5060 GET_CURRENT_CONTEXT(ctx
);
5062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5063 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5065 n
[1].f
= (GLfloat
) zmin
;
5066 n
[2].f
= (GLfloat
) zmax
;
5068 if (ctx
->ExecuteFlag
) {
5069 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5075 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5077 static void GLAPIENTRY
5078 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5079 const GLvoid
* string
)
5081 GET_CURRENT_CONTEXT(ctx
);
5084 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5086 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5088 GLubyte
*programCopy
= (GLubyte
*) malloc(len
);
5090 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5093 memcpy(programCopy
, string
, len
);
5097 n
[4].data
= programCopy
;
5099 if (ctx
->ExecuteFlag
) {
5100 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5104 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5107 #if FEATURE_queryobj
5109 static void GLAPIENTRY
5110 save_BeginQueryARB(GLenum target
, GLuint id
)
5112 GET_CURRENT_CONTEXT(ctx
);
5114 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5115 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5120 if (ctx
->ExecuteFlag
) {
5121 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5126 static void GLAPIENTRY
5127 save_EndQueryARB(GLenum target
)
5129 GET_CURRENT_CONTEXT(ctx
);
5131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5132 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5136 if (ctx
->ExecuteFlag
) {
5137 CALL_EndQueryARB(ctx
->Exec
, (target
));
5141 #endif /* FEATURE_queryobj */
5144 static void GLAPIENTRY
5145 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5147 GET_CURRENT_CONTEXT(ctx
);
5149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5150 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5154 if (count
> MAX_DRAW_BUFFERS
)
5155 count
= MAX_DRAW_BUFFERS
;
5156 for (i
= 0; i
< count
; i
++) {
5157 n
[2 + i
].e
= buffers
[i
];
5160 if (ctx
->ExecuteFlag
) {
5161 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5165 static void GLAPIENTRY
5166 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5168 GET_CURRENT_CONTEXT(ctx
);
5171 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5179 if (ctx
->ExecuteFlag
) {
5180 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5184 static void GLAPIENTRY
5185 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5188 p
[0] = INT_TO_FLOAT(param
[0]);
5189 p
[1] = INT_TO_FLOAT(param
[1]);
5190 p
[2] = INT_TO_FLOAT(param
[2]);
5191 p
[3] = INT_TO_FLOAT(param
[3]);
5192 save_TexBumpParameterfvATI(pname
, p
);
5195 #if FEATURE_ATI_fragment_shader
5196 static void GLAPIENTRY
5197 save_BindFragmentShaderATI(GLuint id
)
5199 GET_CURRENT_CONTEXT(ctx
);
5202 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5206 if (ctx
->ExecuteFlag
) {
5207 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5211 static void GLAPIENTRY
5212 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5214 GET_CURRENT_CONTEXT(ctx
);
5217 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5225 if (ctx
->ExecuteFlag
) {
5226 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5232 save_Attr1fNV(GLenum attr
, GLfloat x
)
5234 GET_CURRENT_CONTEXT(ctx
);
5236 SAVE_FLUSH_VERTICES(ctx
);
5237 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5243 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5244 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5245 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5247 if (ctx
->ExecuteFlag
) {
5248 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5253 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5255 GET_CURRENT_CONTEXT(ctx
);
5257 SAVE_FLUSH_VERTICES(ctx
);
5258 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5265 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5266 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5267 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5269 if (ctx
->ExecuteFlag
) {
5270 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5275 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5277 GET_CURRENT_CONTEXT(ctx
);
5279 SAVE_FLUSH_VERTICES(ctx
);
5280 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5288 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5289 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5290 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5292 if (ctx
->ExecuteFlag
) {
5293 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5298 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5300 GET_CURRENT_CONTEXT(ctx
);
5302 SAVE_FLUSH_VERTICES(ctx
);
5303 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5312 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5313 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5314 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5316 if (ctx
->ExecuteFlag
) {
5317 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5323 save_Attr1fARB(GLenum attr
, GLfloat x
)
5325 GET_CURRENT_CONTEXT(ctx
);
5327 SAVE_FLUSH_VERTICES(ctx
);
5328 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5334 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5335 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5336 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5338 if (ctx
->ExecuteFlag
) {
5339 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5344 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5346 GET_CURRENT_CONTEXT(ctx
);
5348 SAVE_FLUSH_VERTICES(ctx
);
5349 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5356 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5357 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5358 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5360 if (ctx
->ExecuteFlag
) {
5361 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5366 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5368 GET_CURRENT_CONTEXT(ctx
);
5370 SAVE_FLUSH_VERTICES(ctx
);
5371 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5379 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5380 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5381 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5383 if (ctx
->ExecuteFlag
) {
5384 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5389 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5391 GET_CURRENT_CONTEXT(ctx
);
5393 SAVE_FLUSH_VERTICES(ctx
);
5394 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5403 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5404 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5405 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5407 if (ctx
->ExecuteFlag
) {
5408 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5413 static void GLAPIENTRY
5414 save_EvalCoord1f(GLfloat x
)
5416 GET_CURRENT_CONTEXT(ctx
);
5418 SAVE_FLUSH_VERTICES(ctx
);
5419 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5423 if (ctx
->ExecuteFlag
) {
5424 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5428 static void GLAPIENTRY
5429 save_EvalCoord1fv(const GLfloat
* v
)
5431 save_EvalCoord1f(v
[0]);
5434 static void GLAPIENTRY
5435 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5437 GET_CURRENT_CONTEXT(ctx
);
5439 SAVE_FLUSH_VERTICES(ctx
);
5440 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5445 if (ctx
->ExecuteFlag
) {
5446 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5450 static void GLAPIENTRY
5451 save_EvalCoord2fv(const GLfloat
* v
)
5453 save_EvalCoord2f(v
[0], v
[1]);
5457 static void GLAPIENTRY
5458 save_EvalPoint1(GLint x
)
5460 GET_CURRENT_CONTEXT(ctx
);
5462 SAVE_FLUSH_VERTICES(ctx
);
5463 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5467 if (ctx
->ExecuteFlag
) {
5468 CALL_EvalPoint1(ctx
->Exec
, (x
));
5472 static void GLAPIENTRY
5473 save_EvalPoint2(GLint x
, GLint y
)
5475 GET_CURRENT_CONTEXT(ctx
);
5477 SAVE_FLUSH_VERTICES(ctx
);
5478 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5483 if (ctx
->ExecuteFlag
) {
5484 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5488 static void GLAPIENTRY
5489 save_Indexf(GLfloat x
)
5491 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5494 static void GLAPIENTRY
5495 save_Indexfv(const GLfloat
* v
)
5497 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5500 static void GLAPIENTRY
5501 save_EdgeFlag(GLboolean x
)
5503 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5506 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5510 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5514 static void GLAPIENTRY
5515 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5517 GET_CURRENT_CONTEXT(ctx
);
5525 case GL_FRONT_AND_BACK
:
5528 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5537 case GL_AMBIENT_AND_DIFFUSE
:
5543 case GL_COLOR_INDEXES
:
5547 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5551 if (ctx
->ExecuteFlag
) {
5552 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5555 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5557 /* Try to eliminate redundant statechanges. Because it is legal to
5558 * call glMaterial even inside begin/end calls, don't need to worry
5559 * about ctx->Driver.CurrentSavePrimitive here.
5561 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5562 if (bitmask
& (1 << i
)) {
5563 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5564 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5565 bitmask
&= ~(1 << i
);
5568 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5569 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5574 /* If this call has effect, return early:
5579 SAVE_FLUSH_VERTICES(ctx
);
5581 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5585 for (i
= 0; i
< args
; i
++)
5586 n
[3 + i
].f
= param
[i
];
5590 static void GLAPIENTRY
5591 save_Begin(GLenum mode
)
5593 GET_CURRENT_CONTEXT(ctx
);
5595 GLboolean error
= GL_FALSE
;
5597 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5598 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5601 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5602 /* Typically the first begin. This may raise an error on
5603 * playback, depending on whether CallList is issued from inside
5604 * a begin/end or not.
5606 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5608 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5609 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5612 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5617 /* Give the driver an opportunity to hook in an optimized
5618 * display list compiler.
5620 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5623 SAVE_FLUSH_VERTICES(ctx
);
5624 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5630 if (ctx
->ExecuteFlag
) {
5631 CALL_Begin(ctx
->Exec
, (mode
));
5635 static void GLAPIENTRY
5638 GET_CURRENT_CONTEXT(ctx
);
5639 SAVE_FLUSH_VERTICES(ctx
);
5640 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5641 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5642 if (ctx
->ExecuteFlag
) {
5643 CALL_End(ctx
->Exec
, ());
5647 static void GLAPIENTRY
5648 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5650 GET_CURRENT_CONTEXT(ctx
);
5652 SAVE_FLUSH_VERTICES(ctx
);
5653 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5660 if (ctx
->ExecuteFlag
) {
5661 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5666 static void GLAPIENTRY
5667 save_Vertex2f(GLfloat x
, GLfloat y
)
5669 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5672 static void GLAPIENTRY
5673 save_Vertex2fv(const GLfloat
* v
)
5675 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5678 static void GLAPIENTRY
5679 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5681 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5684 static void GLAPIENTRY
5685 save_Vertex3fv(const GLfloat
* v
)
5687 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5690 static void GLAPIENTRY
5691 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5693 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5696 static void GLAPIENTRY
5697 save_Vertex4fv(const GLfloat
* v
)
5699 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5702 static void GLAPIENTRY
5703 save_TexCoord1f(GLfloat x
)
5705 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5708 static void GLAPIENTRY
5709 save_TexCoord1fv(const GLfloat
* v
)
5711 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5714 static void GLAPIENTRY
5715 save_TexCoord2f(GLfloat x
, GLfloat y
)
5717 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5720 static void GLAPIENTRY
5721 save_TexCoord2fv(const GLfloat
* v
)
5723 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5726 static void GLAPIENTRY
5727 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5729 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5732 static void GLAPIENTRY
5733 save_TexCoord3fv(const GLfloat
* v
)
5735 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5738 static void GLAPIENTRY
5739 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5741 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5744 static void GLAPIENTRY
5745 save_TexCoord4fv(const GLfloat
* v
)
5747 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5750 static void GLAPIENTRY
5751 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5753 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5756 static void GLAPIENTRY
5757 save_Normal3fv(const GLfloat
* v
)
5759 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5762 static void GLAPIENTRY
5763 save_FogCoordfEXT(GLfloat x
)
5765 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5768 static void GLAPIENTRY
5769 save_FogCoordfvEXT(const GLfloat
* v
)
5771 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5774 static void GLAPIENTRY
5775 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5777 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5780 static void GLAPIENTRY
5781 save_Color3fv(const GLfloat
* v
)
5783 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5786 static void GLAPIENTRY
5787 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5789 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5792 static void GLAPIENTRY
5793 save_Color4fv(const GLfloat
* v
)
5795 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5798 static void GLAPIENTRY
5799 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5801 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5804 static void GLAPIENTRY
5805 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5807 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5811 /* Just call the respective ATTR for texcoord
5813 static void GLAPIENTRY
5814 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5816 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5817 save_Attr1fNV(attr
, x
);
5820 static void GLAPIENTRY
5821 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5823 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5824 save_Attr1fNV(attr
, v
[0]);
5827 static void GLAPIENTRY
5828 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5830 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5831 save_Attr2fNV(attr
, x
, y
);
5834 static void GLAPIENTRY
5835 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5837 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5838 save_Attr2fNV(attr
, v
[0], v
[1]);
5841 static void GLAPIENTRY
5842 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5844 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5845 save_Attr3fNV(attr
, x
, y
, z
);
5848 static void GLAPIENTRY
5849 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5851 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5852 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5855 static void GLAPIENTRY
5856 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5857 GLfloat z
, GLfloat w
)
5859 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5860 save_Attr4fNV(attr
, x
, y
, z
, w
);
5863 static void GLAPIENTRY
5864 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5866 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5867 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5872 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5878 GET_CURRENT_CONTEXT(ctx
);
5879 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5883 /* First level for NV_vertex_program:
5885 * Check for errors at compile time?.
5887 static void GLAPIENTRY
5888 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5890 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5891 save_Attr1fNV(index
, x
);
5896 static void GLAPIENTRY
5897 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5899 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5900 save_Attr1fNV(index
, v
[0]);
5905 static void GLAPIENTRY
5906 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5908 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5909 save_Attr2fNV(index
, x
, y
);
5914 static void GLAPIENTRY
5915 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5917 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5918 save_Attr2fNV(index
, v
[0], v
[1]);
5923 static void GLAPIENTRY
5924 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5926 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5927 save_Attr3fNV(index
, x
, y
, z
);
5932 static void GLAPIENTRY
5933 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5935 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5936 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5941 static void GLAPIENTRY
5942 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5943 GLfloat z
, GLfloat w
)
5945 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5946 save_Attr4fNV(index
, x
, y
, z
, w
);
5951 static void GLAPIENTRY
5952 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5954 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5955 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5963 static void GLAPIENTRY
5964 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5966 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5967 save_Attr1fARB(index
, x
);
5972 static void GLAPIENTRY
5973 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5975 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5976 save_Attr1fARB(index
, v
[0]);
5981 static void GLAPIENTRY
5982 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5984 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5985 save_Attr2fARB(index
, x
, y
);
5990 static void GLAPIENTRY
5991 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5993 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5994 save_Attr2fARB(index
, v
[0], v
[1]);
5999 static void GLAPIENTRY
6000 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6002 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6003 save_Attr3fARB(index
, x
, y
, z
);
6008 static void GLAPIENTRY
6009 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6011 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6012 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6017 static void GLAPIENTRY
6018 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6021 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6022 save_Attr4fARB(index
, x
, y
, z
, w
);
6027 static void GLAPIENTRY
6028 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6030 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6031 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6037 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6039 static void GLAPIENTRY
6040 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6042 GET_CURRENT_CONTEXT(ctx
);
6043 FLUSH_VERTICES(ctx
, 0);
6044 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6047 static GLint GLAPIENTRY
6048 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6050 GET_CURRENT_CONTEXT(ctx
);
6051 FLUSH_VERTICES(ctx
, 0);
6052 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6054 /* XXX more shader functions needed here */
6058 #if FEATURE_EXT_framebuffer_blit
6059 static void GLAPIENTRY
6060 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6061 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6062 GLbitfield mask
, GLenum filter
)
6064 GET_CURRENT_CONTEXT(ctx
);
6066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6067 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6080 if (ctx
->ExecuteFlag
) {
6081 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6082 dstX0
, dstY0
, dstX1
, dstY1
,
6089 /** GL_EXT_provoking_vertex */
6090 static void GLAPIENTRY
6091 save_ProvokingVertexEXT(GLenum mode
)
6093 GET_CURRENT_CONTEXT(ctx
);
6095 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6096 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6100 if (ctx
->ExecuteFlag
) {
6101 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6102 _mesa_ProvokingVertexEXT(mode
);
6107 /* aka UseProgram() */
6108 static void GLAPIENTRY
6109 save_UseProgramObjectARB(GLhandleARB program
)
6111 GET_CURRENT_CONTEXT(ctx
);
6113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6114 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6118 if (ctx
->ExecuteFlag
) {
6119 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6124 static void GLAPIENTRY
6125 save_Uniform1fARB(GLint location
, GLfloat x
)
6127 GET_CURRENT_CONTEXT(ctx
);
6129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6130 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6135 if (ctx
->ExecuteFlag
) {
6136 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6141 static void GLAPIENTRY
6142 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6144 GET_CURRENT_CONTEXT(ctx
);
6146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6147 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6153 if (ctx
->ExecuteFlag
) {
6154 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6159 static void GLAPIENTRY
6160 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6162 GET_CURRENT_CONTEXT(ctx
);
6164 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6165 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6172 if (ctx
->ExecuteFlag
) {
6173 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6178 static void GLAPIENTRY
6179 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6181 GET_CURRENT_CONTEXT(ctx
);
6183 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6184 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6192 if (ctx
->ExecuteFlag
) {
6193 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6198 /** Return copy of memory */
6200 memdup(const void *src
, GLsizei bytes
)
6202 void *b
= bytes
>= 0 ? malloc(bytes
) : NULL
;
6204 memcpy(b
, src
, bytes
);
6209 static void GLAPIENTRY
6210 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6212 GET_CURRENT_CONTEXT(ctx
);
6214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6215 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6219 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6221 if (ctx
->ExecuteFlag
) {
6222 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6226 static void GLAPIENTRY
6227 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6229 GET_CURRENT_CONTEXT(ctx
);
6231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6232 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6236 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6238 if (ctx
->ExecuteFlag
) {
6239 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6243 static void GLAPIENTRY
6244 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6246 GET_CURRENT_CONTEXT(ctx
);
6248 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6249 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6253 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6255 if (ctx
->ExecuteFlag
) {
6256 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6260 static void GLAPIENTRY
6261 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6263 GET_CURRENT_CONTEXT(ctx
);
6265 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6266 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6270 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6272 if (ctx
->ExecuteFlag
) {
6273 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6278 static void GLAPIENTRY
6279 save_Uniform1iARB(GLint location
, GLint x
)
6281 GET_CURRENT_CONTEXT(ctx
);
6283 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6284 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6289 if (ctx
->ExecuteFlag
) {
6290 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6294 static void GLAPIENTRY
6295 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6297 GET_CURRENT_CONTEXT(ctx
);
6299 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6300 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6306 if (ctx
->ExecuteFlag
) {
6307 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6311 static void GLAPIENTRY
6312 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6314 GET_CURRENT_CONTEXT(ctx
);
6316 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6317 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6324 if (ctx
->ExecuteFlag
) {
6325 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6329 static void GLAPIENTRY
6330 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6332 GET_CURRENT_CONTEXT(ctx
);
6334 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6335 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6343 if (ctx
->ExecuteFlag
) {
6344 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6350 static void GLAPIENTRY
6351 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6353 GET_CURRENT_CONTEXT(ctx
);
6355 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6356 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6360 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6362 if (ctx
->ExecuteFlag
) {
6363 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6367 static void GLAPIENTRY
6368 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6370 GET_CURRENT_CONTEXT(ctx
);
6372 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6373 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6377 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6379 if (ctx
->ExecuteFlag
) {
6380 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6384 static void GLAPIENTRY
6385 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6387 GET_CURRENT_CONTEXT(ctx
);
6389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6390 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6394 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6396 if (ctx
->ExecuteFlag
) {
6397 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6401 static void GLAPIENTRY
6402 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6404 GET_CURRENT_CONTEXT(ctx
);
6406 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6407 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6411 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6413 if (ctx
->ExecuteFlag
) {
6414 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6419 static void GLAPIENTRY
6420 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6423 GET_CURRENT_CONTEXT(ctx
);
6425 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6426 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6431 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6433 if (ctx
->ExecuteFlag
) {
6434 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6438 static void GLAPIENTRY
6439 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6442 GET_CURRENT_CONTEXT(ctx
);
6444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6445 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6450 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6452 if (ctx
->ExecuteFlag
) {
6453 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6457 static void GLAPIENTRY
6458 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6461 GET_CURRENT_CONTEXT(ctx
);
6463 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6464 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6469 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6471 if (ctx
->ExecuteFlag
) {
6472 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6477 static void GLAPIENTRY
6478 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6481 GET_CURRENT_CONTEXT(ctx
);
6483 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6484 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6489 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6491 if (ctx
->ExecuteFlag
) {
6492 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6496 static void GLAPIENTRY
6497 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6500 GET_CURRENT_CONTEXT(ctx
);
6502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6503 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6508 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6510 if (ctx
->ExecuteFlag
) {
6511 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6516 static void GLAPIENTRY
6517 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6520 GET_CURRENT_CONTEXT(ctx
);
6522 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6523 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6528 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6530 if (ctx
->ExecuteFlag
) {
6531 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6535 static void GLAPIENTRY
6536 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6539 GET_CURRENT_CONTEXT(ctx
);
6541 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6542 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6547 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6549 if (ctx
->ExecuteFlag
) {
6550 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6555 static void GLAPIENTRY
6556 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6559 GET_CURRENT_CONTEXT(ctx
);
6561 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6562 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6567 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6569 if (ctx
->ExecuteFlag
) {
6570 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6574 static void GLAPIENTRY
6575 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6578 GET_CURRENT_CONTEXT(ctx
);
6580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6581 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6586 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6588 if (ctx
->ExecuteFlag
) {
6589 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6596 * Save an error-generating command into display list.
6598 * KW: Will appear in the list before the vertex buffer containing the
6599 * command that provoked the error. I don't see this as a problem.
6602 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6605 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6608 n
[2].data
= (void *) s
;
6614 * Compile an error into current display list.
6617 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6619 if (ctx
->CompileFlag
)
6620 save_error(ctx
, error
, s
);
6621 if (ctx
->ExecuteFlag
)
6622 _mesa_error(ctx
, error
, s
);
6627 * Test if ID names a display list.
6630 islist(GLcontext
*ctx
, GLuint list
)
6632 if (list
> 0 && lookup_list(ctx
, list
)) {
6642 /**********************************************************************/
6643 /* Display list execution */
6644 /**********************************************************************/
6648 * Execute a display list. Note that the ListBase offset must have already
6649 * been added before calling this function. I.e. the list argument is
6650 * the absolute list number, not relative to ListBase.
6651 * \param list - display list number
6654 execute_list(GLcontext
*ctx
, GLuint list
)
6656 struct gl_display_list
*dlist
;
6660 if (list
== 0 || !islist(ctx
, list
))
6663 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6664 /* raise an error? */
6668 dlist
= lookup_list(ctx
, list
);
6672 ctx
->ListState
.CallDepth
++;
6674 if (ctx
->Driver
.BeginCallList
)
6675 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6681 const OpCode opcode
= n
[0].opcode
;
6683 if (is_ext_opcode(opcode
)) {
6684 n
+= ext_opcode_execute(ctx
, n
);
6689 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6692 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6694 case OPCODE_ALPHA_FUNC
:
6695 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6697 case OPCODE_BIND_TEXTURE
:
6698 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6702 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6703 ctx
->Unpack
= ctx
->DefaultPacking
;
6704 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6705 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6706 (const GLubyte
*) n
[7].data
));
6707 ctx
->Unpack
= save
; /* restore */
6710 case OPCODE_BLEND_COLOR
:
6711 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6713 case OPCODE_BLEND_EQUATION
:
6714 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6716 case OPCODE_BLEND_EQUATION_SEPARATE
:
6717 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6719 case OPCODE_BLEND_FUNC_SEPARATE
:
6720 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6721 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6723 case OPCODE_CALL_LIST
:
6724 /* Generated by glCallList(), don't add ListBase */
6725 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6726 execute_list(ctx
, n
[1].ui
);
6729 case OPCODE_CALL_LIST_OFFSET
:
6730 /* Generated by glCallLists() so we must add ListBase */
6732 /* user specified a bad data type at compile time */
6733 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6735 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6736 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6737 execute_list(ctx
, list
);
6741 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6743 case OPCODE_CLEAR_BUFFER_IV
:
6750 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6753 case OPCODE_CLEAR_BUFFER_UIV
:
6760 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6763 case OPCODE_CLEAR_BUFFER_FV
:
6770 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
6773 case OPCODE_CLEAR_BUFFER_FI
:
6774 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
6776 case OPCODE_CLEAR_COLOR
:
6777 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6779 case OPCODE_CLEAR_ACCUM
:
6780 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6782 case OPCODE_CLEAR_DEPTH
:
6783 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6785 case OPCODE_CLEAR_INDEX
:
6786 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6788 case OPCODE_CLEAR_STENCIL
:
6789 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6791 case OPCODE_CLIP_PLANE
:
6798 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6801 case OPCODE_COLOR_MASK
:
6802 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6804 case OPCODE_COLOR_MASK_INDEXED
:
6805 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
6808 case OPCODE_COLOR_MATERIAL
:
6809 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6811 case OPCODE_COLOR_TABLE
:
6813 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6814 ctx
->Unpack
= ctx
->DefaultPacking
;
6815 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6816 n
[5].e
, n
[6].data
));
6817 ctx
->Unpack
= save
; /* restore */
6820 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6827 CALL_ColorTableParameterfv(ctx
->Exec
,
6828 (n
[1].e
, n
[2].e
, params
));
6831 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6838 CALL_ColorTableParameteriv(ctx
->Exec
,
6839 (n
[1].e
, n
[2].e
, params
));
6842 case OPCODE_COLOR_SUB_TABLE
:
6844 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6845 ctx
->Unpack
= ctx
->DefaultPacking
;
6846 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6847 n
[4].e
, n
[5].e
, n
[6].data
));
6848 ctx
->Unpack
= save
; /* restore */
6851 case OPCODE_CONVOLUTION_FILTER_1D
:
6853 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6854 ctx
->Unpack
= ctx
->DefaultPacking
;
6855 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6858 ctx
->Unpack
= save
; /* restore */
6861 case OPCODE_CONVOLUTION_FILTER_2D
:
6863 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6864 ctx
->Unpack
= ctx
->DefaultPacking
;
6865 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6866 n
[4].i
, n
[5].e
, n
[6].e
,
6868 ctx
->Unpack
= save
; /* restore */
6871 case OPCODE_CONVOLUTION_PARAMETER_I
:
6872 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6874 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6881 CALL_ConvolutionParameteriv(ctx
->Exec
,
6882 (n
[1].e
, n
[2].e
, params
));
6885 case OPCODE_CONVOLUTION_PARAMETER_F
:
6886 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6888 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6895 CALL_ConvolutionParameterfv(ctx
->Exec
,
6896 (n
[1].e
, n
[2].e
, params
));
6899 case OPCODE_COPY_COLOR_SUB_TABLE
:
6900 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6901 n
[3].i
, n
[4].i
, n
[5].i
));
6903 case OPCODE_COPY_COLOR_TABLE
:
6904 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6905 n
[3].i
, n
[4].i
, n
[5].i
));
6907 case OPCODE_COPY_PIXELS
:
6908 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6909 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6912 case OPCODE_COPY_TEX_IMAGE1D
:
6913 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6914 n
[5].i
, n
[6].i
, n
[7].i
));
6916 case OPCODE_COPY_TEX_IMAGE2D
:
6917 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6918 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6920 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6921 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6922 n
[4].i
, n
[5].i
, n
[6].i
));
6924 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6925 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6926 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6929 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6930 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6931 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6934 case OPCODE_CULL_FACE
:
6935 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6937 case OPCODE_DEPTH_FUNC
:
6938 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6940 case OPCODE_DEPTH_MASK
:
6941 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6943 case OPCODE_DEPTH_RANGE
:
6944 CALL_DepthRange(ctx
->Exec
,
6945 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6947 case OPCODE_DISABLE
:
6948 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6950 case OPCODE_DISABLE_INDEXED
:
6951 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6953 case OPCODE_DRAW_BUFFER
:
6954 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6956 case OPCODE_DRAW_PIXELS
:
6958 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6959 ctx
->Unpack
= ctx
->DefaultPacking
;
6960 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6962 ctx
->Unpack
= save
; /* restore */
6966 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6968 case OPCODE_ENABLE_INDEXED
:
6969 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6971 case OPCODE_EVALMESH1
:
6972 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6974 case OPCODE_EVALMESH2
:
6975 CALL_EvalMesh2(ctx
->Exec
,
6976 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6985 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6988 case OPCODE_FRONT_FACE
:
6989 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6991 case OPCODE_FRUSTUM
:
6992 CALL_Frustum(ctx
->Exec
,
6993 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6996 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6998 case OPCODE_HISTOGRAM
:
6999 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7001 case OPCODE_INDEX_MASK
:
7002 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7004 case OPCODE_INIT_NAMES
:
7005 CALL_InitNames(ctx
->Exec
, ());
7014 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7017 case OPCODE_LIGHT_MODEL
:
7024 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7027 case OPCODE_LINE_STIPPLE
:
7028 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7030 case OPCODE_LINE_WIDTH
:
7031 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7033 case OPCODE_LIST_BASE
:
7034 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7036 case OPCODE_LOAD_IDENTITY
:
7037 CALL_LoadIdentity(ctx
->Exec
, ());
7039 case OPCODE_LOAD_MATRIX
:
7040 if (sizeof(Node
) == sizeof(GLfloat
)) {
7041 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7046 for (i
= 0; i
< 16; i
++) {
7049 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7052 case OPCODE_LOAD_NAME
:
7053 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7055 case OPCODE_LOGIC_OP
:
7056 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7060 GLenum target
= n
[1].e
;
7061 GLint ustride
= _mesa_evaluator_components(target
);
7062 GLint uorder
= n
[5].i
;
7063 GLfloat u1
= n
[2].f
;
7064 GLfloat u2
= n
[3].f
;
7065 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7066 (GLfloat
*) n
[6].data
));
7071 GLenum target
= n
[1].e
;
7072 GLfloat u1
= n
[2].f
;
7073 GLfloat u2
= n
[3].f
;
7074 GLfloat v1
= n
[4].f
;
7075 GLfloat v2
= n
[5].f
;
7076 GLint ustride
= n
[6].i
;
7077 GLint vstride
= n
[7].i
;
7078 GLint uorder
= n
[8].i
;
7079 GLint vorder
= n
[9].i
;
7080 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7081 v1
, v2
, vstride
, vorder
,
7082 (GLfloat
*) n
[10].data
));
7085 case OPCODE_MAPGRID1
:
7086 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7088 case OPCODE_MAPGRID2
:
7089 CALL_MapGrid2f(ctx
->Exec
,
7090 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7092 case OPCODE_MATRIX_MODE
:
7093 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7095 case OPCODE_MIN_MAX
:
7096 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7098 case OPCODE_MULT_MATRIX
:
7099 if (sizeof(Node
) == sizeof(GLfloat
)) {
7100 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7105 for (i
= 0; i
< 16; i
++) {
7108 CALL_MultMatrixf(ctx
->Exec
, (m
));
7112 CALL_Ortho(ctx
->Exec
,
7113 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7115 case OPCODE_PASSTHROUGH
:
7116 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7118 case OPCODE_PIXEL_MAP
:
7119 CALL_PixelMapfv(ctx
->Exec
,
7120 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7122 case OPCODE_PIXEL_TRANSFER
:
7123 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7125 case OPCODE_PIXEL_ZOOM
:
7126 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7128 case OPCODE_POINT_SIZE
:
7129 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7131 case OPCODE_POINT_PARAMETERS
:
7137 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7140 case OPCODE_POLYGON_MODE
:
7141 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7143 case OPCODE_POLYGON_STIPPLE
:
7145 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7146 ctx
->Unpack
= ctx
->DefaultPacking
;
7147 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7148 ctx
->Unpack
= save
; /* restore */
7151 case OPCODE_POLYGON_OFFSET
:
7152 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7154 case OPCODE_POP_ATTRIB
:
7155 CALL_PopAttrib(ctx
->Exec
, ());
7157 case OPCODE_POP_MATRIX
:
7158 CALL_PopMatrix(ctx
->Exec
, ());
7160 case OPCODE_POP_NAME
:
7161 CALL_PopName(ctx
->Exec
, ());
7163 case OPCODE_PRIORITIZE_TEXTURE
:
7164 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7166 case OPCODE_PUSH_ATTRIB
:
7167 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7169 case OPCODE_PUSH_MATRIX
:
7170 CALL_PushMatrix(ctx
->Exec
, ());
7172 case OPCODE_PUSH_NAME
:
7173 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7175 case OPCODE_RASTER_POS
:
7176 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7178 case OPCODE_READ_BUFFER
:
7179 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7181 case OPCODE_RESET_HISTOGRAM
:
7182 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7184 case OPCODE_RESET_MIN_MAX
:
7185 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7188 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7191 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7193 case OPCODE_SCISSOR
:
7194 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7196 case OPCODE_SHADE_MODEL
:
7197 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7199 case OPCODE_PROVOKING_VERTEX
:
7200 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7202 case OPCODE_STENCIL_FUNC
:
7203 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7205 case OPCODE_STENCIL_MASK
:
7206 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7208 case OPCODE_STENCIL_OP
:
7209 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7211 case OPCODE_STENCIL_FUNC_SEPARATE
:
7212 CALL_StencilFuncSeparate(ctx
->Exec
,
7213 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7215 case OPCODE_STENCIL_MASK_SEPARATE
:
7216 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7218 case OPCODE_STENCIL_OP_SEPARATE
:
7219 CALL_StencilOpSeparate(ctx
->Exec
,
7220 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7229 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7239 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7242 case OPCODE_TEXPARAMETER
:
7249 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7252 case OPCODE_TEX_IMAGE1D
:
7254 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7255 ctx
->Unpack
= ctx
->DefaultPacking
;
7256 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7258 n
[3].i
, /* components */
7260 n
[5].e
, /* border */
7261 n
[6].e
, /* format */
7264 ctx
->Unpack
= save
; /* restore */
7267 case OPCODE_TEX_IMAGE2D
:
7269 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7270 ctx
->Unpack
= ctx
->DefaultPacking
;
7271 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7273 n
[3].i
, /* components */
7275 n
[5].i
, /* height */
7276 n
[6].e
, /* border */
7277 n
[7].e
, /* format */
7280 ctx
->Unpack
= save
; /* restore */
7283 case OPCODE_TEX_IMAGE3D
:
7285 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7286 ctx
->Unpack
= ctx
->DefaultPacking
;
7287 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7289 n
[3].i
, /* components */
7291 n
[5].i
, /* height */
7293 n
[7].e
, /* border */
7294 n
[8].e
, /* format */
7297 ctx
->Unpack
= save
; /* restore */
7300 case OPCODE_TEX_SUB_IMAGE1D
:
7302 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7303 ctx
->Unpack
= ctx
->DefaultPacking
;
7304 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7306 n
[6].e
, n
[7].data
));
7307 ctx
->Unpack
= save
; /* restore */
7310 case OPCODE_TEX_SUB_IMAGE2D
:
7312 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7313 ctx
->Unpack
= ctx
->DefaultPacking
;
7314 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7316 n
[6].i
, n
[7].e
, n
[8].e
,
7318 ctx
->Unpack
= save
; /* restore */
7321 case OPCODE_TEX_SUB_IMAGE3D
:
7323 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7324 ctx
->Unpack
= ctx
->DefaultPacking
;
7325 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7326 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7327 n
[8].i
, n
[9].e
, n
[10].e
,
7329 ctx
->Unpack
= save
; /* restore */
7332 case OPCODE_TRANSLATE
:
7333 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7335 case OPCODE_VIEWPORT
:
7336 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7337 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7339 case OPCODE_WINDOW_POS
:
7340 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7342 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7343 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7345 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7346 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7347 n
[4].i
, n
[5].i
, n
[6].i
,
7350 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7351 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7352 n
[4].i
, n
[5].i
, n
[6].i
,
7353 n
[7].i
, n
[8].data
));
7355 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7356 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7357 n
[4].i
, n
[5].i
, n
[6].i
,
7361 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7362 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7363 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7364 n
[5].e
, n
[6].i
, n
[7].data
));
7366 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7367 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7368 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7369 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7372 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7373 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7374 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7375 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7376 n
[9].e
, n
[10].i
, n
[11].data
));
7378 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7379 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7381 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7382 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7384 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7385 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7386 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7389 #if FEATURE_NV_vertex_program
7390 case OPCODE_EXECUTE_PROGRAM_NV
:
7397 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7400 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7401 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7402 (GLuint
*) n
[2].data
));
7404 case OPCODE_LOAD_PROGRAM_NV
:
7405 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7406 (const GLubyte
*) n
[4].data
));
7408 case OPCODE_TRACK_MATRIX_NV
:
7409 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7413 #if FEATURE_NV_fragment_program
7414 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7415 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7416 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7419 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7420 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7421 (const GLubyte
*) n
[3].
7422 data
, n
[4].f
, n
[5].f
,
7427 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7428 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7430 case OPCODE_DEPTH_BOUNDS_EXT
:
7431 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7433 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7434 case OPCODE_PROGRAM_STRING_ARB
:
7435 CALL_ProgramStringARB(ctx
->Exec
,
7436 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7439 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7440 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7441 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7446 #if FEATURE_queryobj
7447 case OPCODE_BEGIN_QUERY_ARB
:
7448 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7450 case OPCODE_END_QUERY_ARB
:
7451 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7454 case OPCODE_DRAW_BUFFERS_ARB
:
7456 GLenum buffers
[MAX_DRAW_BUFFERS
];
7457 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7458 for (i
= 0; i
< count
; i
++)
7459 buffers
[i
] = n
[2 + i
].e
;
7460 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7463 #if FEATURE_EXT_framebuffer_blit
7464 case OPCODE_BLIT_FRAMEBUFFER
:
7465 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7466 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7471 case OPCODE_USE_PROGRAM
:
7472 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7474 case OPCODE_UNIFORM_1F
:
7475 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7477 case OPCODE_UNIFORM_2F
:
7478 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7480 case OPCODE_UNIFORM_3F
:
7481 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7483 case OPCODE_UNIFORM_4F
:
7484 CALL_Uniform4fARB(ctx
->Exec
,
7485 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7487 case OPCODE_UNIFORM_1FV
:
7488 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7490 case OPCODE_UNIFORM_2FV
:
7491 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7493 case OPCODE_UNIFORM_3FV
:
7494 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7496 case OPCODE_UNIFORM_4FV
:
7497 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7499 case OPCODE_UNIFORM_1I
:
7500 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7502 case OPCODE_UNIFORM_2I
:
7503 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7505 case OPCODE_UNIFORM_3I
:
7506 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7508 case OPCODE_UNIFORM_4I
:
7509 CALL_Uniform4iARB(ctx
->Exec
,
7510 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7512 case OPCODE_UNIFORM_1IV
:
7513 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7515 case OPCODE_UNIFORM_2IV
:
7516 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7518 case OPCODE_UNIFORM_3IV
:
7519 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7521 case OPCODE_UNIFORM_4IV
:
7522 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7525 case OPCODE_UNIFORM_MATRIX22
:
7526 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7527 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7529 case OPCODE_UNIFORM_MATRIX33
:
7530 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7531 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7533 case OPCODE_UNIFORM_MATRIX44
:
7534 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7535 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7537 case OPCODE_UNIFORM_MATRIX23
:
7538 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7539 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7541 case OPCODE_UNIFORM_MATRIX32
:
7542 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7543 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7545 case OPCODE_UNIFORM_MATRIX24
:
7546 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7547 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7549 case OPCODE_UNIFORM_MATRIX42
:
7550 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7551 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7553 case OPCODE_UNIFORM_MATRIX34
:
7554 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7555 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7557 case OPCODE_UNIFORM_MATRIX43
:
7558 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7559 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7562 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7565 GLuint i
, pname
= n
[1].ui
;
7567 for (i
= 0; i
< 4; i
++)
7568 values
[i
] = n
[1 + i
].f
;
7569 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7572 #if FEATURE_ATI_fragment_shader
7573 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7574 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7576 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7579 GLuint i
, dst
= n
[1].ui
;
7581 for (i
= 0; i
< 4; i
++)
7582 values
[i
] = n
[1 + i
].f
;
7583 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7587 case OPCODE_ATTR_1F_NV
:
7588 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7590 case OPCODE_ATTR_2F_NV
:
7591 /* Really shouldn't have to do this - the Node structure
7592 * is convenient, but it would be better to store the data
7593 * packed appropriately so that it can be sent directly
7594 * on. With x86_64 becoming common, this will start to
7597 if (sizeof(Node
) == sizeof(GLfloat
))
7598 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7600 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7602 case OPCODE_ATTR_3F_NV
:
7603 if (sizeof(Node
) == sizeof(GLfloat
))
7604 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7606 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7609 case OPCODE_ATTR_4F_NV
:
7610 if (sizeof(Node
) == sizeof(GLfloat
))
7611 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7613 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7616 case OPCODE_ATTR_1F_ARB
:
7617 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7619 case OPCODE_ATTR_2F_ARB
:
7620 /* Really shouldn't have to do this - the Node structure
7621 * is convenient, but it would be better to store the data
7622 * packed appropriately so that it can be sent directly
7623 * on. With x86_64 becoming common, this will start to
7626 if (sizeof(Node
) == sizeof(GLfloat
))
7627 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7629 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7631 case OPCODE_ATTR_3F_ARB
:
7632 if (sizeof(Node
) == sizeof(GLfloat
))
7633 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7635 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7638 case OPCODE_ATTR_4F_ARB
:
7639 if (sizeof(Node
) == sizeof(GLfloat
))
7640 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7642 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7645 case OPCODE_MATERIAL
:
7646 if (sizeof(Node
) == sizeof(GLfloat
))
7647 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7654 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7658 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7661 CALL_End(ctx
->Exec
, ());
7664 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7666 case OPCODE_EVAL_C1
:
7667 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7669 case OPCODE_EVAL_C2
:
7670 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7672 case OPCODE_EVAL_P1
:
7673 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7675 case OPCODE_EVAL_P2
:
7676 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7679 case OPCODE_CONTINUE
:
7680 n
= (Node
*) n
[1].next
;
7682 case OPCODE_END_OF_LIST
:
7688 sprintf(msg
, "Error in execute_list: opcode=%d",
7690 _mesa_problem(ctx
, msg
);
7695 /* increment n to point to next compiled command */
7696 if (opcode
!= OPCODE_CONTINUE
) {
7697 n
+= InstSize
[opcode
];
7702 if (ctx
->Driver
.EndCallList
)
7703 ctx
->Driver
.EndCallList(ctx
);
7705 ctx
->ListState
.CallDepth
--;
7710 /**********************************************************************/
7712 /**********************************************************************/
7715 * Test if a display list number is valid.
7717 static GLboolean GLAPIENTRY
7718 _mesa_IsList(GLuint list
)
7720 GET_CURRENT_CONTEXT(ctx
);
7721 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7722 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7723 return islist(ctx
, list
);
7728 * Delete a sequence of consecutive display lists.
7730 static void GLAPIENTRY
7731 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7733 GET_CURRENT_CONTEXT(ctx
);
7735 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7736 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7739 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7742 for (i
= list
; i
< list
+ range
; i
++) {
7743 destroy_list(ctx
, i
);
7749 * Return a display list number, n, such that lists n through n+range-1
7752 static GLuint GLAPIENTRY
7753 _mesa_GenLists(GLsizei range
)
7755 GET_CURRENT_CONTEXT(ctx
);
7757 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7758 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7761 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7769 * Make this an atomic operation
7771 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7773 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7775 /* reserve the list IDs by with empty/dummy lists */
7777 for (i
= 0; i
< range
; i
++) {
7778 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7779 make_list(base
+ i
, 1));
7783 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7790 * Begin a new display list.
7792 static void GLAPIENTRY
7793 _mesa_NewList(GLuint name
, GLenum mode
)
7795 GET_CURRENT_CONTEXT(ctx
);
7797 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7798 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7800 if (MESA_VERBOSE
& VERBOSE_API
)
7801 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7802 _mesa_lookup_enum_by_nr(mode
));
7805 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7809 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7810 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7814 if (ctx
->ListState
.CurrentList
) {
7815 /* already compiling a display list */
7816 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7820 ctx
->CompileFlag
= GL_TRUE
;
7821 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7823 /* Reset acumulated list state:
7825 invalidate_saved_current_state( ctx
);
7827 /* Allocate new display list */
7828 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7829 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7830 ctx
->ListState
.CurrentPos
= 0;
7832 ctx
->Driver
.NewList(ctx
, name
, mode
);
7834 ctx
->CurrentDispatch
= ctx
->Save
;
7835 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7840 * End definition of current display list.
7842 static void GLAPIENTRY
7845 GET_CURRENT_CONTEXT(ctx
);
7846 SAVE_FLUSH_VERTICES(ctx
);
7847 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7849 if (MESA_VERBOSE
& VERBOSE_API
)
7850 _mesa_debug(ctx
, "glEndList\n");
7852 /* Check that a list is under construction */
7853 if (!ctx
->ListState
.CurrentList
) {
7854 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7858 /* Call before emitting END_OF_LIST, in case the driver wants to
7859 * emit opcodes itself.
7861 ctx
->Driver
.EndList(ctx
);
7863 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
7865 /* Destroy old list, if any */
7866 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7868 /* Install the new list */
7869 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7870 ctx
->ListState
.CurrentList
->Name
,
7871 ctx
->ListState
.CurrentList
);
7874 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7875 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7877 ctx
->ListState
.CurrentList
= NULL
;
7878 ctx
->ExecuteFlag
= GL_TRUE
;
7879 ctx
->CompileFlag
= GL_FALSE
;
7881 ctx
->CurrentDispatch
= ctx
->Exec
;
7882 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7887 _mesa_CallList(GLuint list
)
7889 GLboolean save_compile_flag
;
7890 GET_CURRENT_CONTEXT(ctx
);
7891 FLUSH_CURRENT(ctx
, 0);
7892 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7893 /* execute the display list, and restore the CompileFlag. */
7895 if (MESA_VERBOSE
& VERBOSE_API
)
7896 _mesa_debug(ctx
, "glCallList %d\n", list
);
7899 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7903 /* mesa_print_display_list( list ); */
7905 save_compile_flag
= ctx
->CompileFlag
;
7906 if (save_compile_flag
) {
7907 ctx
->CompileFlag
= GL_FALSE
;
7910 execute_list(ctx
, list
);
7911 ctx
->CompileFlag
= save_compile_flag
;
7913 /* also restore API function pointers to point to "save" versions */
7914 if (save_compile_flag
) {
7915 ctx
->CurrentDispatch
= ctx
->Save
;
7916 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7922 * Execute glCallLists: call multiple display lists.
7925 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7927 GET_CURRENT_CONTEXT(ctx
);
7929 GLboolean save_compile_flag
;
7931 if (MESA_VERBOSE
& VERBOSE_API
)
7932 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7936 case GL_UNSIGNED_BYTE
:
7938 case GL_UNSIGNED_SHORT
:
7940 case GL_UNSIGNED_INT
:
7948 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7952 /* Save the CompileFlag status, turn it off, execute display list,
7953 * and restore the CompileFlag.
7955 save_compile_flag
= ctx
->CompileFlag
;
7956 ctx
->CompileFlag
= GL_FALSE
;
7958 for (i
= 0; i
< n
; i
++) {
7959 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7960 execute_list(ctx
, list
);
7963 ctx
->CompileFlag
= save_compile_flag
;
7965 /* also restore API function pointers to point to "save" versions */
7966 if (save_compile_flag
) {
7967 ctx
->CurrentDispatch
= ctx
->Save
;
7968 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7974 * Set the offset added to list numbers in glCallLists.
7976 static void GLAPIENTRY
7977 _mesa_ListBase(GLuint base
)
7979 GET_CURRENT_CONTEXT(ctx
);
7980 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7981 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7982 ctx
->List
.ListBase
= base
;
7986 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7988 static void GLAPIENTRY
7991 GET_CURRENT_CONTEXT(ctx
);
7992 FLUSH_VERTICES(ctx
, 0);
7993 CALL_Finish(ctx
->Exec
, ());
7996 static void GLAPIENTRY
7999 GET_CURRENT_CONTEXT(ctx
);
8000 FLUSH_VERTICES(ctx
, 0);
8001 CALL_Flush(ctx
->Exec
, ());
8004 static void GLAPIENTRY
8005 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8007 GET_CURRENT_CONTEXT(ctx
);
8008 FLUSH_VERTICES(ctx
, 0);
8009 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8012 static void GLAPIENTRY
8013 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8015 GET_CURRENT_CONTEXT(ctx
);
8016 FLUSH_VERTICES(ctx
, 0);
8017 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8020 static void GLAPIENTRY
8021 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8023 GET_CURRENT_CONTEXT(ctx
);
8024 FLUSH_VERTICES(ctx
, 0);
8025 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8028 static GLenum GLAPIENTRY
8031 GET_CURRENT_CONTEXT(ctx
);
8032 FLUSH_VERTICES(ctx
, 0);
8033 return CALL_GetError(ctx
->Exec
, ());
8036 static void GLAPIENTRY
8037 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8039 GET_CURRENT_CONTEXT(ctx
);
8040 FLUSH_VERTICES(ctx
, 0);
8041 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8044 static void GLAPIENTRY
8045 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8047 GET_CURRENT_CONTEXT(ctx
);
8048 FLUSH_VERTICES(ctx
, 0);
8049 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8052 static void GLAPIENTRY
8053 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8055 GET_CURRENT_CONTEXT(ctx
);
8056 FLUSH_VERTICES(ctx
, 0);
8057 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8060 static void GLAPIENTRY
8061 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8063 GET_CURRENT_CONTEXT(ctx
);
8064 FLUSH_VERTICES(ctx
, 0);
8065 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8068 static void GLAPIENTRY
8069 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8071 GET_CURRENT_CONTEXT(ctx
);
8072 FLUSH_VERTICES(ctx
, 0);
8073 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8076 static void GLAPIENTRY
8077 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8079 GET_CURRENT_CONTEXT(ctx
);
8080 FLUSH_VERTICES(ctx
, 0);
8081 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8084 static void GLAPIENTRY
8085 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8087 GET_CURRENT_CONTEXT(ctx
);
8088 FLUSH_VERTICES(ctx
, 0);
8089 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8092 static void GLAPIENTRY
8093 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8095 GET_CURRENT_CONTEXT(ctx
);
8096 FLUSH_VERTICES(ctx
, 0);
8097 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8100 static void GLAPIENTRY
8101 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8103 GET_CURRENT_CONTEXT(ctx
);
8104 FLUSH_VERTICES(ctx
, 0);
8105 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8108 static void GLAPIENTRY
8109 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8111 GET_CURRENT_CONTEXT(ctx
);
8112 FLUSH_VERTICES(ctx
, 0);
8113 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8116 static void GLAPIENTRY
8117 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8119 GET_CURRENT_CONTEXT(ctx
);
8120 FLUSH_VERTICES(ctx
, 0);
8121 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8124 static void GLAPIENTRY
8125 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8127 GET_CURRENT_CONTEXT(ctx
);
8128 FLUSH_VERTICES(ctx
, 0);
8129 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8132 static void GLAPIENTRY
8133 exec_GetPolygonStipple(GLubyte
* dest
)
8135 GET_CURRENT_CONTEXT(ctx
);
8136 FLUSH_VERTICES(ctx
, 0);
8137 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8140 static const GLubyte
*GLAPIENTRY
8141 exec_GetString(GLenum name
)
8143 GET_CURRENT_CONTEXT(ctx
);
8144 FLUSH_VERTICES(ctx
, 0);
8145 return CALL_GetString(ctx
->Exec
, (name
));
8148 static void GLAPIENTRY
8149 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8151 GET_CURRENT_CONTEXT(ctx
);
8152 FLUSH_VERTICES(ctx
, 0);
8153 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8156 static void GLAPIENTRY
8157 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8159 GET_CURRENT_CONTEXT(ctx
);
8160 FLUSH_VERTICES(ctx
, 0);
8161 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8164 static void GLAPIENTRY
8165 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8167 GET_CURRENT_CONTEXT(ctx
);
8168 FLUSH_VERTICES(ctx
, 0);
8169 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8172 static void GLAPIENTRY
8173 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8175 GET_CURRENT_CONTEXT(ctx
);
8176 FLUSH_VERTICES(ctx
, 0);
8177 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8180 static void GLAPIENTRY
8181 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8183 GET_CURRENT_CONTEXT(ctx
);
8184 FLUSH_VERTICES(ctx
, 0);
8185 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8188 static void GLAPIENTRY
8189 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8190 GLenum type
, GLvoid
* pixels
)
8192 GET_CURRENT_CONTEXT(ctx
);
8193 FLUSH_VERTICES(ctx
, 0);
8194 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8197 static void GLAPIENTRY
8198 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8199 GLenum pname
, GLfloat
*params
)
8201 GET_CURRENT_CONTEXT(ctx
);
8202 FLUSH_VERTICES(ctx
, 0);
8203 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8206 static void GLAPIENTRY
8207 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8208 GLenum pname
, GLint
*params
)
8210 GET_CURRENT_CONTEXT(ctx
);
8211 FLUSH_VERTICES(ctx
, 0);
8212 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8215 static void GLAPIENTRY
8216 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8218 GET_CURRENT_CONTEXT(ctx
);
8219 FLUSH_VERTICES(ctx
, 0);
8220 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8223 static void GLAPIENTRY
8224 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8226 GET_CURRENT_CONTEXT(ctx
);
8227 FLUSH_VERTICES(ctx
, 0);
8228 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8231 static GLboolean GLAPIENTRY
8232 exec_IsEnabled(GLenum cap
)
8234 GET_CURRENT_CONTEXT(ctx
);
8235 FLUSH_VERTICES(ctx
, 0);
8236 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8239 static void GLAPIENTRY
8240 exec_PixelStoref(GLenum pname
, GLfloat param
)
8242 GET_CURRENT_CONTEXT(ctx
);
8243 FLUSH_VERTICES(ctx
, 0);
8244 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8247 static void GLAPIENTRY
8248 exec_PixelStorei(GLenum pname
, GLint param
)
8250 GET_CURRENT_CONTEXT(ctx
);
8251 FLUSH_VERTICES(ctx
, 0);
8252 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8255 static void GLAPIENTRY
8256 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8257 GLenum format
, GLenum type
, GLvoid
* pixels
)
8259 GET_CURRENT_CONTEXT(ctx
);
8260 FLUSH_VERTICES(ctx
, 0);
8261 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8264 static GLint GLAPIENTRY
8265 exec_RenderMode(GLenum mode
)
8267 GET_CURRENT_CONTEXT(ctx
);
8268 FLUSH_VERTICES(ctx
, 0);
8269 return CALL_RenderMode(ctx
->Exec
, (mode
));
8272 static void GLAPIENTRY
8273 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8275 GET_CURRENT_CONTEXT(ctx
);
8276 FLUSH_VERTICES(ctx
, 0);
8277 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8280 static void GLAPIENTRY
8281 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8283 GET_CURRENT_CONTEXT(ctx
);
8284 FLUSH_VERTICES(ctx
, 0);
8285 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8288 static GLboolean GLAPIENTRY
8289 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8290 GLboolean
* residences
)
8292 GET_CURRENT_CONTEXT(ctx
);
8293 FLUSH_VERTICES(ctx
, 0);
8294 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8297 static void GLAPIENTRY
8298 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8300 GET_CURRENT_CONTEXT(ctx
);
8301 FLUSH_VERTICES(ctx
, 0);
8302 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8305 static void GLAPIENTRY
8306 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8308 GET_CURRENT_CONTEXT(ctx
);
8309 FLUSH_VERTICES(ctx
, 0);
8310 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8313 static void GLAPIENTRY
8314 exec_DisableClientState(GLenum cap
)
8316 GET_CURRENT_CONTEXT(ctx
);
8317 FLUSH_VERTICES(ctx
, 0);
8318 CALL_DisableClientState(ctx
->Exec
, (cap
));
8321 static void GLAPIENTRY
8322 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8324 GET_CURRENT_CONTEXT(ctx
);
8325 FLUSH_VERTICES(ctx
, 0);
8326 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8329 static void GLAPIENTRY
8330 exec_EnableClientState(GLenum cap
)
8332 GET_CURRENT_CONTEXT(ctx
);
8333 FLUSH_VERTICES(ctx
, 0);
8334 CALL_EnableClientState(ctx
->Exec
, (cap
));
8337 static void GLAPIENTRY
8338 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8340 GET_CURRENT_CONTEXT(ctx
);
8341 FLUSH_VERTICES(ctx
, 0);
8342 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8345 static void GLAPIENTRY
8346 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8348 GET_CURRENT_CONTEXT(ctx
);
8349 FLUSH_VERTICES(ctx
, 0);
8350 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8353 static void GLAPIENTRY
8354 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8356 GET_CURRENT_CONTEXT(ctx
);
8357 FLUSH_VERTICES(ctx
, 0);
8358 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8361 static void GLAPIENTRY
8362 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8364 GET_CURRENT_CONTEXT(ctx
);
8365 FLUSH_VERTICES(ctx
, 0);
8366 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8369 static GLboolean GLAPIENTRY
8370 exec_IsTexture(GLuint texture
)
8372 GET_CURRENT_CONTEXT(ctx
);
8373 FLUSH_VERTICES(ctx
, 0);
8374 return CALL_IsTexture(ctx
->Exec
, (texture
));
8377 static void GLAPIENTRY
8378 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8380 GET_CURRENT_CONTEXT(ctx
);
8381 FLUSH_VERTICES(ctx
, 0);
8382 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8385 static void GLAPIENTRY
8386 exec_PopClientAttrib(void)
8388 GET_CURRENT_CONTEXT(ctx
);
8389 FLUSH_VERTICES(ctx
, 0);
8390 CALL_PopClientAttrib(ctx
->Exec
, ());
8393 static void GLAPIENTRY
8394 exec_PushClientAttrib(GLbitfield mask
)
8396 GET_CURRENT_CONTEXT(ctx
);
8397 FLUSH_VERTICES(ctx
, 0);
8398 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8401 static void GLAPIENTRY
8402 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8405 GET_CURRENT_CONTEXT(ctx
);
8406 FLUSH_VERTICES(ctx
, 0);
8407 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8410 static void GLAPIENTRY
8411 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8413 GET_CURRENT_CONTEXT(ctx
);
8414 FLUSH_VERTICES(ctx
, 0);
8415 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8418 static void GLAPIENTRY
8419 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8422 GET_CURRENT_CONTEXT(ctx
);
8423 FLUSH_VERTICES(ctx
, 0);
8424 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8427 static void GLAPIENTRY
8428 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8429 GLint x
, GLint y
, GLsizei width
)
8431 GET_CURRENT_CONTEXT(ctx
);
8432 FLUSH_VERTICES(ctx
, 0);
8433 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8434 (target
, internalFormat
, x
, y
, width
));
8437 static void GLAPIENTRY
8438 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8439 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8441 GET_CURRENT_CONTEXT(ctx
);
8442 FLUSH_VERTICES(ctx
, 0);
8443 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8444 (target
, internalFormat
, x
, y
, width
,
8448 static void GLAPIENTRY
8449 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8451 GET_CURRENT_CONTEXT(ctx
);
8452 FLUSH_VERTICES(ctx
, 0);
8453 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8456 static void GLAPIENTRY
8457 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8459 GET_CURRENT_CONTEXT(ctx
);
8460 FLUSH_VERTICES(ctx
, 0);
8461 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8464 static void GLAPIENTRY
8465 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8467 GET_CURRENT_CONTEXT(ctx
);
8468 FLUSH_VERTICES(ctx
, 0);
8469 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8472 static void GLAPIENTRY
8473 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8476 GET_CURRENT_CONTEXT(ctx
);
8477 FLUSH_VERTICES(ctx
, 0);
8478 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8481 static void GLAPIENTRY
8482 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8484 GET_CURRENT_CONTEXT(ctx
);
8485 FLUSH_VERTICES(ctx
, 0);
8486 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8489 static void GLAPIENTRY
8490 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8492 GET_CURRENT_CONTEXT(ctx
);
8493 FLUSH_VERTICES(ctx
, 0);
8494 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8497 static void GLAPIENTRY
8498 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8499 GLenum type
, GLvoid
*values
)
8501 GET_CURRENT_CONTEXT(ctx
);
8502 FLUSH_VERTICES(ctx
, 0);
8503 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8506 static void GLAPIENTRY
8507 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8509 GET_CURRENT_CONTEXT(ctx
);
8510 FLUSH_VERTICES(ctx
, 0);
8511 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8514 static void GLAPIENTRY
8515 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8517 GET_CURRENT_CONTEXT(ctx
);
8518 FLUSH_VERTICES(ctx
, 0);
8519 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8522 static void GLAPIENTRY
8523 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8524 GLenum type
, GLvoid
*values
)
8526 GET_CURRENT_CONTEXT(ctx
);
8527 FLUSH_VERTICES(ctx
, 0);
8528 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8531 static void GLAPIENTRY
8532 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8534 GET_CURRENT_CONTEXT(ctx
);
8535 FLUSH_VERTICES(ctx
, 0);
8536 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8539 static void GLAPIENTRY
8540 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8542 GET_CURRENT_CONTEXT(ctx
);
8543 FLUSH_VERTICES(ctx
, 0);
8544 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8547 static void GLAPIENTRY
8548 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8549 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8551 GET_CURRENT_CONTEXT(ctx
);
8552 FLUSH_VERTICES(ctx
, 0);
8553 CALL_GetSeparableFilter(ctx
->Exec
,
8554 (target
, format
, type
, row
, column
, span
));
8557 static void GLAPIENTRY
8558 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8559 GLsizei width
, GLsizei height
, GLenum format
,
8560 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8562 GET_CURRENT_CONTEXT(ctx
);
8563 FLUSH_VERTICES(ctx
, 0);
8564 CALL_SeparableFilter2D(ctx
->Exec
,
8565 (target
, internalFormat
, width
, height
, format
,
8566 type
, row
, column
));
8569 static void GLAPIENTRY
8570 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8571 GLsizei count
, const GLvoid
*ptr
)
8573 GET_CURRENT_CONTEXT(ctx
);
8574 FLUSH_VERTICES(ctx
, 0);
8575 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8578 static void GLAPIENTRY
8579 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8581 GET_CURRENT_CONTEXT(ctx
);
8582 FLUSH_VERTICES(ctx
, 0);
8583 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8586 static void GLAPIENTRY
8587 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8590 GET_CURRENT_CONTEXT(ctx
);
8591 FLUSH_VERTICES(ctx
, 0);
8592 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8595 static void GLAPIENTRY
8596 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8599 GET_CURRENT_CONTEXT(ctx
);
8600 FLUSH_VERTICES(ctx
, 0);
8601 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8604 static void GLAPIENTRY
8605 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8606 GLsizei count
, const GLvoid
*ptr
)
8608 GET_CURRENT_CONTEXT(ctx
);
8609 FLUSH_VERTICES(ctx
, 0);
8610 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8613 static void GLAPIENTRY
8614 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8615 GLsizei count
, const GLvoid
*ptr
)
8617 GET_CURRENT_CONTEXT(ctx
);
8618 FLUSH_VERTICES(ctx
, 0);
8619 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8622 static void GLAPIENTRY
8623 exec_LockArraysEXT(GLint first
, GLsizei count
)
8625 GET_CURRENT_CONTEXT(ctx
);
8626 FLUSH_VERTICES(ctx
, 0);
8627 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8630 static void GLAPIENTRY
8631 exec_UnlockArraysEXT(void)
8633 GET_CURRENT_CONTEXT(ctx
);
8634 FLUSH_VERTICES(ctx
, 0);
8635 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8638 static void GLAPIENTRY
8639 exec_ClientActiveTextureARB(GLenum target
)
8641 GET_CURRENT_CONTEXT(ctx
);
8642 FLUSH_VERTICES(ctx
, 0);
8643 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8646 static void GLAPIENTRY
8647 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8648 GLsizei stride
, const GLvoid
*ptr
)
8650 GET_CURRENT_CONTEXT(ctx
);
8651 FLUSH_VERTICES(ctx
, 0);
8652 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8655 static void GLAPIENTRY
8656 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8658 GET_CURRENT_CONTEXT(ctx
);
8659 FLUSH_VERTICES(ctx
, 0);
8660 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8663 /* GL_EXT_multi_draw_arrays */
8664 static void GLAPIENTRY
8665 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8666 GLsizei
* count
, GLsizei primcount
)
8668 GET_CURRENT_CONTEXT(ctx
);
8669 FLUSH_VERTICES(ctx
, 0);
8670 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8673 /* GL_IBM_multimode_draw_arrays */
8674 static void GLAPIENTRY
8675 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8676 const GLsizei
* count
, GLsizei primcount
,
8679 GET_CURRENT_CONTEXT(ctx
);
8680 FLUSH_VERTICES(ctx
, 0);
8681 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8682 (mode
, first
, count
, primcount
, modestride
));
8685 /* GL_IBM_multimode_draw_arrays */
8686 static void GLAPIENTRY
8687 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8688 const GLsizei
* count
,
8690 const GLvoid
* const *indices
,
8691 GLsizei primcount
, GLint modestride
)
8693 GET_CURRENT_CONTEXT(ctx
);
8694 FLUSH_VERTICES(ctx
, 0);
8695 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8696 (mode
, count
, type
, indices
, primcount
,
8703 * Setup the given dispatch table to point to Mesa's display list
8704 * building functions.
8706 * This does not include any of the tnl functions - they are
8707 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8711 _mesa_init_save_table(struct _glapi_table
*table
)
8713 _mesa_loopback_init_api_table(table
);
8716 SET_Accum(table
, save_Accum
);
8717 SET_AlphaFunc(table
, save_AlphaFunc
);
8718 SET_Bitmap(table
, save_Bitmap
);
8719 SET_BlendFunc(table
, save_BlendFunc
);
8720 SET_CallList(table
, save_CallList
);
8721 SET_CallLists(table
, save_CallLists
);
8722 SET_Clear(table
, save_Clear
);
8723 SET_ClearAccum(table
, save_ClearAccum
);
8724 SET_ClearColor(table
, save_ClearColor
);
8725 SET_ClearDepth(table
, save_ClearDepth
);
8726 SET_ClearIndex(table
, save_ClearIndex
);
8727 SET_ClearStencil(table
, save_ClearStencil
);
8728 SET_ClipPlane(table
, save_ClipPlane
);
8729 SET_ColorMask(table
, save_ColorMask
);
8730 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
8731 SET_ColorMaterial(table
, save_ColorMaterial
);
8732 SET_CopyPixels(table
, save_CopyPixels
);
8733 SET_CullFace(table
, save_CullFace
);
8734 SET_DeleteLists(table
, _mesa_DeleteLists
);
8735 SET_DepthFunc(table
, save_DepthFunc
);
8736 SET_DepthMask(table
, save_DepthMask
);
8737 SET_DepthRange(table
, save_DepthRange
);
8738 SET_Disable(table
, save_Disable
);
8739 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
8740 SET_DrawBuffer(table
, save_DrawBuffer
);
8741 SET_DrawPixels(table
, save_DrawPixels
);
8742 SET_Enable(table
, save_Enable
);
8743 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
8744 SET_EndList(table
, _mesa_EndList
);
8745 SET_EvalMesh1(table
, save_EvalMesh1
);
8746 SET_EvalMesh2(table
, save_EvalMesh2
);
8747 SET_Finish(table
, exec_Finish
);
8748 SET_Flush(table
, exec_Flush
);
8749 SET_Fogf(table
, save_Fogf
);
8750 SET_Fogfv(table
, save_Fogfv
);
8751 SET_Fogi(table
, save_Fogi
);
8752 SET_Fogiv(table
, save_Fogiv
);
8753 SET_FrontFace(table
, save_FrontFace
);
8754 SET_Frustum(table
, save_Frustum
);
8755 SET_GenLists(table
, _mesa_GenLists
);
8756 SET_GetBooleanv(table
, exec_GetBooleanv
);
8757 SET_GetClipPlane(table
, exec_GetClipPlane
);
8758 SET_GetDoublev(table
, exec_GetDoublev
);
8759 SET_GetError(table
, exec_GetError
);
8760 SET_GetFloatv(table
, exec_GetFloatv
);
8761 SET_GetIntegerv(table
, exec_GetIntegerv
);
8762 SET_GetLightfv(table
, exec_GetLightfv
);
8763 SET_GetLightiv(table
, exec_GetLightiv
);
8764 SET_GetMapdv(table
, exec_GetMapdv
);
8765 SET_GetMapfv(table
, exec_GetMapfv
);
8766 SET_GetMapiv(table
, exec_GetMapiv
);
8767 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8768 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8769 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8770 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8771 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8772 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8773 SET_GetString(table
, exec_GetString
);
8774 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8775 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8776 SET_GetTexGendv(table
, exec_GetTexGendv
);
8777 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8778 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8779 SET_GetTexImage(table
, exec_GetTexImage
);
8780 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8781 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8782 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8783 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8784 SET_Hint(table
, save_Hint
);
8785 SET_IndexMask(table
, save_IndexMask
);
8786 SET_InitNames(table
, save_InitNames
);
8787 SET_IsEnabled(table
, exec_IsEnabled
);
8788 SET_IsList(table
, _mesa_IsList
);
8789 SET_LightModelf(table
, save_LightModelf
);
8790 SET_LightModelfv(table
, save_LightModelfv
);
8791 SET_LightModeli(table
, save_LightModeli
);
8792 SET_LightModeliv(table
, save_LightModeliv
);
8793 SET_Lightf(table
, save_Lightf
);
8794 SET_Lightfv(table
, save_Lightfv
);
8795 SET_Lighti(table
, save_Lighti
);
8796 SET_Lightiv(table
, save_Lightiv
);
8797 SET_LineStipple(table
, save_LineStipple
);
8798 SET_LineWidth(table
, save_LineWidth
);
8799 SET_ListBase(table
, save_ListBase
);
8800 SET_LoadIdentity(table
, save_LoadIdentity
);
8801 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8802 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8803 SET_LoadName(table
, save_LoadName
);
8804 SET_LogicOp(table
, save_LogicOp
);
8805 SET_Map1d(table
, save_Map1d
);
8806 SET_Map1f(table
, save_Map1f
);
8807 SET_Map2d(table
, save_Map2d
);
8808 SET_Map2f(table
, save_Map2f
);
8809 SET_MapGrid1d(table
, save_MapGrid1d
);
8810 SET_MapGrid1f(table
, save_MapGrid1f
);
8811 SET_MapGrid2d(table
, save_MapGrid2d
);
8812 SET_MapGrid2f(table
, save_MapGrid2f
);
8813 SET_MatrixMode(table
, save_MatrixMode
);
8814 SET_MultMatrixd(table
, save_MultMatrixd
);
8815 SET_MultMatrixf(table
, save_MultMatrixf
);
8816 SET_NewList(table
, save_NewList
);
8817 SET_Ortho(table
, save_Ortho
);
8818 SET_PassThrough(table
, save_PassThrough
);
8819 SET_PixelMapfv(table
, save_PixelMapfv
);
8820 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8821 SET_PixelMapusv(table
, save_PixelMapusv
);
8822 SET_PixelStoref(table
, exec_PixelStoref
);
8823 SET_PixelStorei(table
, exec_PixelStorei
);
8824 SET_PixelTransferf(table
, save_PixelTransferf
);
8825 SET_PixelTransferi(table
, save_PixelTransferi
);
8826 SET_PixelZoom(table
, save_PixelZoom
);
8827 SET_PointSize(table
, save_PointSize
);
8828 SET_PolygonMode(table
, save_PolygonMode
);
8829 SET_PolygonOffset(table
, save_PolygonOffset
);
8830 SET_PolygonStipple(table
, save_PolygonStipple
);
8831 SET_PopAttrib(table
, save_PopAttrib
);
8832 SET_PopMatrix(table
, save_PopMatrix
);
8833 SET_PopName(table
, save_PopName
);
8834 SET_PushAttrib(table
, save_PushAttrib
);
8835 SET_PushMatrix(table
, save_PushMatrix
);
8836 SET_PushName(table
, save_PushName
);
8837 SET_RasterPos2d(table
, save_RasterPos2d
);
8838 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8839 SET_RasterPos2f(table
, save_RasterPos2f
);
8840 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8841 SET_RasterPos2i(table
, save_RasterPos2i
);
8842 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8843 SET_RasterPos2s(table
, save_RasterPos2s
);
8844 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8845 SET_RasterPos3d(table
, save_RasterPos3d
);
8846 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8847 SET_RasterPos3f(table
, save_RasterPos3f
);
8848 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8849 SET_RasterPos3i(table
, save_RasterPos3i
);
8850 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8851 SET_RasterPos3s(table
, save_RasterPos3s
);
8852 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8853 SET_RasterPos4d(table
, save_RasterPos4d
);
8854 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8855 SET_RasterPos4f(table
, save_RasterPos4f
);
8856 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8857 SET_RasterPos4i(table
, save_RasterPos4i
);
8858 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8859 SET_RasterPos4s(table
, save_RasterPos4s
);
8860 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8861 SET_ReadBuffer(table
, save_ReadBuffer
);
8862 SET_ReadPixels(table
, exec_ReadPixels
);
8863 SET_RenderMode(table
, exec_RenderMode
);
8864 SET_Rotated(table
, save_Rotated
);
8865 SET_Rotatef(table
, save_Rotatef
);
8866 SET_Scaled(table
, save_Scaled
);
8867 SET_Scalef(table
, save_Scalef
);
8868 SET_Scissor(table
, save_Scissor
);
8869 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8870 SET_SelectBuffer(table
, exec_SelectBuffer
);
8871 SET_ShadeModel(table
, save_ShadeModel
);
8872 SET_StencilFunc(table
, save_StencilFunc
);
8873 SET_StencilMask(table
, save_StencilMask
);
8874 SET_StencilOp(table
, save_StencilOp
);
8875 SET_TexEnvf(table
, save_TexEnvf
);
8876 SET_TexEnvfv(table
, save_TexEnvfv
);
8877 SET_TexEnvi(table
, save_TexEnvi
);
8878 SET_TexEnviv(table
, save_TexEnviv
);
8879 SET_TexGend(table
, save_TexGend
);
8880 SET_TexGendv(table
, save_TexGendv
);
8881 SET_TexGenf(table
, save_TexGenf
);
8882 SET_TexGenfv(table
, save_TexGenfv
);
8883 SET_TexGeni(table
, save_TexGeni
);
8884 SET_TexGeniv(table
, save_TexGeniv
);
8885 SET_TexImage1D(table
, save_TexImage1D
);
8886 SET_TexImage2D(table
, save_TexImage2D
);
8887 SET_TexParameterf(table
, save_TexParameterf
);
8888 SET_TexParameterfv(table
, save_TexParameterfv
);
8889 SET_TexParameteri(table
, save_TexParameteri
);
8890 SET_TexParameteriv(table
, save_TexParameteriv
);
8891 SET_Translated(table
, save_Translated
);
8892 SET_Translatef(table
, save_Translatef
);
8893 SET_Viewport(table
, save_Viewport
);
8896 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8897 SET_BindTexture(table
, save_BindTexture
);
8898 SET_ColorPointer(table
, exec_ColorPointer
);
8899 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8900 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8901 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8902 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8903 SET_DeleteTextures(table
, exec_DeleteTextures
);
8904 SET_DisableClientState(table
, exec_DisableClientState
);
8905 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8906 SET_EnableClientState(table
, exec_EnableClientState
);
8907 SET_GenTextures(table
, exec_GenTextures
);
8908 SET_GetPointerv(table
, exec_GetPointerv
);
8909 SET_IndexPointer(table
, exec_IndexPointer
);
8910 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8911 SET_IsTexture(table
, exec_IsTexture
);
8912 SET_NormalPointer(table
, exec_NormalPointer
);
8913 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8914 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8915 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8916 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8917 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8918 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8919 SET_VertexPointer(table
, exec_VertexPointer
);
8922 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8923 SET_TexImage3D(table
, save_TexImage3D
);
8924 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8927 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8928 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8929 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8931 /* ATI_separate_stencil */
8932 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8934 /* GL_ARB_imaging */
8935 /* Not all are supported */
8936 SET_BlendColor(table
, save_BlendColor
);
8937 SET_BlendEquation(table
, save_BlendEquation
);
8938 SET_ColorSubTable(table
, save_ColorSubTable
);
8939 SET_ColorTable(table
, save_ColorTable
);
8940 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8941 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8942 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8943 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8944 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8945 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8946 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8947 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8948 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8949 SET_CopyColorTable(table
, save_CopyColorTable
);
8950 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8951 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8952 SET_GetColorTable(table
, exec_GetColorTable
);
8953 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8954 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8955 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8956 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8957 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8958 SET_GetHistogram(table
, exec_GetHistogram
);
8959 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8960 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8961 SET_GetMinmax(table
, exec_GetMinmax
);
8962 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8963 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8964 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8965 SET_Histogram(table
, save_Histogram
);
8966 SET_Minmax(table
, save_Minmax
);
8967 SET_ResetHistogram(table
, save_ResetHistogram
);
8968 SET_ResetMinmax(table
, save_ResetMinmax
);
8969 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8971 /* 2. GL_EXT_blend_color */
8973 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8976 /* 3. GL_EXT_polygon_offset */
8977 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8979 /* 6. GL_EXT_texture3d */
8981 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8982 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8983 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8986 /* 14. GL_SGI_color_table */
8988 SET_ColorTableSGI(table
, save_ColorTable
);
8989 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8990 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8991 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8992 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8995 /* 30. GL_EXT_vertex_array */
8996 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8997 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8998 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8999 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9000 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9001 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9003 /* 37. GL_EXT_blend_minmax */
9005 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9008 /* 54. GL_EXT_point_parameters */
9009 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9010 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9012 /* 97. GL_EXT_compiled_vertex_array */
9013 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9014 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9016 /* 145. GL_EXT_secondary_color */
9017 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9019 /* 148. GL_EXT_multi_draw_arrays */
9020 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9022 /* 149. GL_EXT_fog_coord */
9023 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9025 /* 173. GL_EXT_blend_func_separate */
9026 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9028 /* 196. GL_MESA_resize_buffers */
9029 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9031 /* 197. GL_MESA_window_pos */
9032 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9033 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9034 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9035 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9036 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9037 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9038 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9039 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9040 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9041 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9042 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9043 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9044 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9045 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9046 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9047 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9048 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9049 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9050 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9051 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9052 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9053 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9054 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9055 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9057 /* 200. GL_IBM_multimode_draw_arrays */
9058 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9059 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9061 #if FEATURE_NV_vertex_program
9062 /* 233. GL_NV_vertex_program */
9063 /* The following commands DO NOT go into display lists:
9064 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9065 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9067 SET_BindProgramNV(table
, save_BindProgramNV
);
9068 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9069 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
9070 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9071 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
9072 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
9073 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
9074 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
9075 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
9076 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
9077 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
9078 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9079 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9080 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9081 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9082 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9083 SET_LoadProgramNV(table
, save_LoadProgramNV
);
9084 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9085 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9086 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9087 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9088 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
9089 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
9090 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
9091 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
9094 /* 244. GL_ATI_envmap_bumpmap */
9095 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9096 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9098 /* 245. GL_ATI_fragment_shader */
9099 #if FEATURE_ATI_fragment_shader
9100 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9101 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9104 /* 282. GL_NV_fragment_program */
9105 #if FEATURE_NV_fragment_program
9106 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
9107 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
9108 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
9109 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
9110 SET_GetProgramNamedParameterfvNV(table
,
9111 _mesa_GetProgramNamedParameterfvNV
);
9112 SET_GetProgramNamedParameterdvNV(table
,
9113 _mesa_GetProgramNamedParameterdvNV
);
9114 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9115 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9116 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9117 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9118 SET_GetProgramLocalParameterdvARB(table
,
9119 _mesa_GetProgramLocalParameterdvARB
);
9120 SET_GetProgramLocalParameterfvARB(table
,
9121 _mesa_GetProgramLocalParameterfvARB
);
9124 /* 262. GL_NV_point_sprite */
9125 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9126 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9128 /* 268. GL_EXT_stencil_two_side */
9129 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9131 /* 273. GL_APPLE_vertex_array_object */
9132 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9133 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9134 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9135 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9137 /* ???. GL_EXT_depth_bounds_test */
9138 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9140 /* ARB 1. GL_ARB_multitexture */
9141 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9142 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9144 /* ARB 3. GL_ARB_transpose_matrix */
9145 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9146 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9147 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9148 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9150 /* ARB 5. GL_ARB_multisample */
9151 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9153 /* ARB 12. GL_ARB_texture_compression */
9154 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9155 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9156 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9157 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9158 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9159 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9160 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9162 /* ARB 14. GL_ARB_point_parameters */
9163 /* aliased with EXT_point_parameters functions */
9165 /* ARB 25. GL_ARB_window_pos */
9166 /* aliased with MESA_window_pos functions */
9168 /* ARB 26. GL_ARB_vertex_program */
9169 /* ARB 27. GL_ARB_fragment_program */
9170 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9171 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9172 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9173 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9174 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9175 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9176 SET_BindProgramNV(table
, save_BindProgramNV
);
9177 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9178 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9179 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9180 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9181 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9182 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9183 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9184 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9185 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9186 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9187 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9188 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9189 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9190 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9191 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9192 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9193 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9194 SET_GetProgramLocalParameterdvARB(table
,
9195 _mesa_GetProgramLocalParameterdvARB
);
9196 SET_GetProgramLocalParameterfvARB(table
,
9197 _mesa_GetProgramLocalParameterfvARB
);
9198 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9199 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9202 /* ARB 28. GL_ARB_vertex_buffer_object */
9203 #if FEATURE_ARB_vertex_buffer_object
9204 /* None of the extension's functions get compiled */
9205 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9206 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9207 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9208 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9209 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9210 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9211 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9212 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9213 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9214 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9215 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9218 #if FEATURE_queryobj
9219 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9220 SET_EndQueryARB(table
, save_EndQueryARB
);
9221 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9222 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9223 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9224 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9225 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9226 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9228 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9230 #if FEATURE_EXT_framebuffer_blit
9231 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9234 /* GL_ARB_shader_objects */
9235 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9236 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9237 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9238 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9239 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9240 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9241 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9242 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9243 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9244 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9245 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9246 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9247 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9248 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9249 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9250 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9251 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9252 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9253 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9254 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9255 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9256 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9257 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9258 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9259 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9260 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9262 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9263 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9264 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9265 /* XXX additional functions need to be implemented here! */
9267 /* 299. GL_EXT_blend_equation_separate */
9268 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9270 /* GL_EXT_gpu_program_parmaeters */
9271 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9272 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9273 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9276 /* ARB 50. GL_ARB_map_buffer_range */
9277 #if FEATURE_ARB_map_buffer_range
9278 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9279 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9282 /* ARB 59. GL_ARB_copy_buffer */
9283 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9285 /* 364. GL_EXT_provoking_vertex */
9286 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9288 /* 371. GL_APPLE_object_purgeable */
9289 #if FEATURE_APPLE_object_purgeable
9290 SET_ObjectPurgeableAPPLE(table
, _mesa_ObjectPurgeableAPPLE
);
9291 SET_ObjectUnpurgeableAPPLE(table
, _mesa_ObjectUnpurgeableAPPLE
);
9296 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9297 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9298 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9299 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9301 (void) save_ClearBufferiv
;
9302 (void) save_ClearBufferuiv
;
9303 (void) save_ClearBufferfv
;
9304 (void) save_ClearBufferfi
;
9311 enum_string(GLenum k
)
9313 return _mesa_lookup_enum_by_nr(k
);
9318 * Print the commands in a display list. For debugging only.
9319 * TODO: many commands aren't handled yet.
9321 static void GLAPIENTRY
9322 print_list(GLcontext
*ctx
, GLuint list
)
9324 struct gl_display_list
*dlist
;
9328 if (!islist(ctx
, list
)) {
9329 printf("%u is not a display list ID\n", list
);
9333 dlist
= lookup_list(ctx
, list
);
9339 printf("START-LIST %u, address %p\n", list
, (void *) n
);
9341 done
= n
? GL_FALSE
: GL_TRUE
;
9343 const OpCode opcode
= n
[0].opcode
;
9345 if (is_ext_opcode(opcode
)) {
9346 n
+= ext_opcode_print(ctx
, n
);
9351 printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9354 printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9355 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9357 case OPCODE_CALL_LIST
:
9358 printf("CallList %d\n", (int) n
[1].ui
);
9360 case OPCODE_CALL_LIST_OFFSET
:
9361 printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9362 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9364 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9365 printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9366 enum_string(n
[1].e
), enum_string(n
[2].e
),
9367 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9369 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9370 printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9371 enum_string(n
[1].e
), enum_string(n
[2].e
),
9372 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9374 case OPCODE_DISABLE
:
9375 printf("Disable %s\n", enum_string(n
[1].e
));
9378 printf("Enable %s\n", enum_string(n
[1].e
));
9380 case OPCODE_FRUSTUM
:
9381 printf("Frustum %g %g %g %g %g %g\n",
9382 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9384 case OPCODE_LINE_STIPPLE
:
9385 printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9387 case OPCODE_LOAD_IDENTITY
:
9388 printf("LoadIdentity\n");
9390 case OPCODE_LOAD_MATRIX
:
9391 printf("LoadMatrix\n");
9392 printf(" %8f %8f %8f %8f\n",
9393 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9394 printf(" %8f %8f %8f %8f\n",
9395 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9396 printf(" %8f %8f %8f %8f\n",
9397 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9398 printf(" %8f %8f %8f %8f\n",
9399 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9401 case OPCODE_MULT_MATRIX
:
9402 printf("MultMatrix (or Rotate)\n");
9403 printf(" %8f %8f %8f %8f\n",
9404 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9405 printf(" %8f %8f %8f %8f\n",
9406 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9407 printf(" %8f %8f %8f %8f\n",
9408 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9409 printf(" %8f %8f %8f %8f\n",
9410 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9413 printf("Ortho %g %g %g %g %g %g\n",
9414 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9416 case OPCODE_POP_ATTRIB
:
9417 printf("PopAttrib\n");
9419 case OPCODE_POP_MATRIX
:
9420 printf("PopMatrix\n");
9422 case OPCODE_POP_NAME
:
9423 printf("PopName\n");
9425 case OPCODE_PUSH_ATTRIB
:
9426 printf("PushAttrib %x\n", n
[1].bf
);
9428 case OPCODE_PUSH_MATRIX
:
9429 printf("PushMatrix\n");
9431 case OPCODE_PUSH_NAME
:
9432 printf("PushName %d\n", (int) n
[1].ui
);
9434 case OPCODE_RASTER_POS
:
9435 printf("RasterPos %g %g %g %g\n",
9436 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9439 printf("Rotate %g %g %g %g\n",
9440 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9443 printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9445 case OPCODE_TRANSLATE
:
9446 printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9448 case OPCODE_BIND_TEXTURE
:
9449 printf("BindTexture %s %d\n",
9450 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9452 case OPCODE_SHADE_MODEL
:
9453 printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9456 printf("Map1 %s %.3f %.3f %d %d\n",
9457 _mesa_lookup_enum_by_nr(n
[1].ui
),
9458 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9461 printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9462 _mesa_lookup_enum_by_nr(n
[1].ui
),
9463 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9464 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9466 case OPCODE_MAPGRID1
:
9467 printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9469 case OPCODE_MAPGRID2
:
9470 printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9471 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9473 case OPCODE_EVALMESH1
:
9474 printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9476 case OPCODE_EVALMESH2
:
9477 printf("EvalMesh2 %d %d %d %d\n",
9478 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9481 case OPCODE_ATTR_1F_NV
:
9482 printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9484 case OPCODE_ATTR_2F_NV
:
9485 printf("ATTR_2F_NV attr %d: %f %f\n",
9486 n
[1].i
, n
[2].f
, n
[3].f
);
9488 case OPCODE_ATTR_3F_NV
:
9489 printf("ATTR_3F_NV attr %d: %f %f %f\n",
9490 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9492 case OPCODE_ATTR_4F_NV
:
9493 printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9494 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9496 case OPCODE_ATTR_1F_ARB
:
9497 printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9499 case OPCODE_ATTR_2F_ARB
:
9500 printf("ATTR_2F_ARB attr %d: %f %f\n",
9501 n
[1].i
, n
[2].f
, n
[3].f
);
9503 case OPCODE_ATTR_3F_ARB
:
9504 printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9505 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9507 case OPCODE_ATTR_4F_ARB
:
9508 printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9509 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9512 case OPCODE_MATERIAL
:
9513 printf("MATERIAL %x %x: %f %f %f %f\n",
9514 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9517 printf("BEGIN %x\n", n
[1].i
);
9523 printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9526 case OPCODE_EVAL_C1
:
9527 printf("EVAL_C1 %f\n", n
[1].f
);
9529 case OPCODE_EVAL_C2
:
9530 printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9532 case OPCODE_EVAL_P1
:
9533 printf("EVAL_P1 %d\n", n
[1].i
);
9535 case OPCODE_EVAL_P2
:
9536 printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9539 case OPCODE_PROVOKING_VERTEX
:
9540 printf("ProvokingVertex %s\n",
9541 _mesa_lookup_enum_by_nr(n
[1].ui
));
9545 * meta opcodes/commands
9548 printf("Error: %s %s\n",
9549 enum_string(n
[1].e
), (const char *) n
[2].data
);
9551 case OPCODE_CONTINUE
:
9552 printf("DISPLAY-LIST-CONTINUE\n");
9553 n
= (Node
*) n
[1].next
;
9555 case OPCODE_END_OF_LIST
:
9556 printf("END-LIST %u\n", list
);
9560 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9562 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9563 opcode
, (void *) n
);
9567 printf("command %d, %u operands\n", opcode
,
9571 /* increment n to point to next compiled command */
9572 if (opcode
!= OPCODE_CONTINUE
) {
9573 n
+= InstSize
[opcode
];
9582 * Clients may call this function to help debug display list problems.
9583 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9584 * changed, or break in the future without notice.
9587 mesa_print_display_list(GLuint list
)
9589 GET_CURRENT_CONTEXT(ctx
);
9590 print_list(ctx
, list
);
9594 /**********************************************************************/
9595 /***** Initialization *****/
9596 /**********************************************************************/
9599 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9601 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9603 vfmt
->Begin
= save_Begin
;
9605 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9607 vfmt
->Color3f
= save_Color3f
;
9608 vfmt
->Color3fv
= save_Color3fv
;
9609 vfmt
->Color4f
= save_Color4f
;
9610 vfmt
->Color4fv
= save_Color4fv
;
9611 vfmt
->EdgeFlag
= save_EdgeFlag
;
9612 vfmt
->End
= save_End
;
9614 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9616 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9617 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9618 vfmt
->Indexf
= save_Indexf
;
9619 vfmt
->Indexfv
= save_Indexfv
;
9620 vfmt
->Materialfv
= save_Materialfv
;
9621 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9622 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9623 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9624 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9625 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9626 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9627 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9628 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9629 vfmt
->Normal3f
= save_Normal3f
;
9630 vfmt
->Normal3fv
= save_Normal3fv
;
9631 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9632 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9633 vfmt
->TexCoord1f
= save_TexCoord1f
;
9634 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9635 vfmt
->TexCoord2f
= save_TexCoord2f
;
9636 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9637 vfmt
->TexCoord3f
= save_TexCoord3f
;
9638 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9639 vfmt
->TexCoord4f
= save_TexCoord4f
;
9640 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9641 vfmt
->Vertex2f
= save_Vertex2f
;
9642 vfmt
->Vertex2fv
= save_Vertex2fv
;
9643 vfmt
->Vertex3f
= save_Vertex3f
;
9644 vfmt
->Vertex3fv
= save_Vertex3fv
;
9645 vfmt
->Vertex4f
= save_Vertex4f
;
9646 vfmt
->Vertex4fv
= save_Vertex4fv
;
9647 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9648 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9649 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9650 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9651 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9652 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9653 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9654 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9655 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9656 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9657 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9658 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9659 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9660 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9661 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9662 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9664 vfmt
->Rectf
= save_Rectf
;
9666 /* The driver is required to implement these as
9667 * 1) They can probably do a better job.
9668 * 2) A lot of new mechanisms would have to be added to this module
9669 * to support it. That code would probably never get used,
9673 vfmt
->DrawArrays
= 0;
9674 vfmt
->DrawElements
= 0;
9675 vfmt
->DrawRangeElements
= 0;
9676 vfmt
->MultiDrawElemementsEXT
= 0;
9677 vfmt
->DrawElementsBaseVertex
= 0;
9678 vfmt
->DrawRangeElementsBaseVertex
= 0;
9679 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9685 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9686 const GLvertexformat
*vfmt
)
9688 SET_CallList(disp
, vfmt
->CallList
);
9689 SET_CallLists(disp
, vfmt
->CallLists
);
9693 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9695 SET_CallList(disp
, _mesa_CallList
);
9696 SET_CallLists(disp
, _mesa_CallLists
);
9698 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9699 SET_EndList(disp
, _mesa_EndList
);
9700 SET_GenLists(disp
, _mesa_GenLists
);
9701 SET_IsList(disp
, _mesa_IsList
);
9702 SET_ListBase(disp
, _mesa_ListBase
);
9703 SET_NewList(disp
, _mesa_NewList
);
9707 #endif /* FEATURE_dlist */
9711 * Initialize display list state for given context.
9714 _mesa_init_display_list(GLcontext
*ctx
)
9716 static GLboolean tableInitialized
= GL_FALSE
;
9718 /* zero-out the instruction size table, just once */
9719 if (!tableInitialized
) {
9720 memset(InstSize
, 0, sizeof(InstSize
));
9721 tableInitialized
= GL_TRUE
;
9724 /* extension info */
9725 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9728 ctx
->ListState
.CallDepth
= 0;
9729 ctx
->ExecuteFlag
= GL_TRUE
;
9730 ctx
->CompileFlag
= GL_FALSE
;
9731 ctx
->ListState
.CurrentBlock
= NULL
;
9732 ctx
->ListState
.CurrentPos
= 0;
9734 /* Display List group */
9735 ctx
->List
.ListBase
= 0;
9738 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9744 _mesa_free_display_list_data(GLcontext
*ctx
)
9747 ctx
->ListExt
= NULL
;