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"
41 #if FEATURE_ARB_vertex_buffer_object
42 #include "bufferobj.h"
54 #include "extensions.h"
56 #include "framebuffer.h"
58 #include "glapi/glapi.h"
60 #include "histogram.h"
78 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
79 #include "shader/arbprogram.h"
80 #include "shader/program.h"
82 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
83 #include "shader/nvprogram.h"
84 #include "shader/program.h"
86 #if FEATURE_ATI_fragment_shader
87 #include "shader/atifragshader.h"
90 #include "math/m_matrix.h"
92 #include "glapi/dispatch.h"
97 * Other parts of Mesa (such as the VBO module) can plug into the display
98 * list system. This structure describes new display list instructions.
100 struct gl_list_instruction
103 void (*Execute
)( GLcontext
*ctx
, void *data
);
104 void (*Destroy
)( GLcontext
*ctx
, void *data
);
105 void (*Print
)( GLcontext
*ctx
, void *data
);
109 #define MAX_DLIST_EXT_OPCODES 16
112 * Used by device drivers to hook new commands into display lists.
114 struct gl_list_extensions
116 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
125 * \param ctx GL context.
127 * Checks if dd_function_table::SaveNeedFlush is marked to flush
128 * stored (save) vertices, and calls
129 * dd_function_table::SaveFlushVertices if so.
131 #define SAVE_FLUSH_VERTICES(ctx) \
133 if (ctx->Driver.SaveNeedFlush) \
134 ctx->Driver.SaveFlushVertices(ctx); \
139 * Macro to assert that the API call was made outside the
140 * glBegin()/glEnd() pair, with return value.
142 * \param ctx GL context.
143 * \param retval value to return value in case the assertion fails.
145 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
147 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
148 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
149 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
155 * Macro to assert that the API call was made outside the
156 * glBegin()/glEnd() pair.
158 * \param ctx GL context.
160 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
162 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
163 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
164 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
170 * Macro to assert that the API call was made outside the
171 * glBegin()/glEnd() pair and flush the vertices.
173 * \param ctx GL context.
175 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
177 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
178 SAVE_FLUSH_VERTICES(ctx); \
182 * Macro to assert that the API call was made outside the
183 * glBegin()/glEnd() pair and flush the vertices, with return value.
185 * \param ctx GL context.
186 * \param retval value to return value in case the assertion fails.
188 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
190 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
191 SAVE_FLUSH_VERTICES(ctx); \
197 * Display list opcodes.
199 * The fact that these identifiers are assigned consecutive
200 * integer values starting at 0 is very important, see InstSize array usage)
204 OPCODE_INVALID
= -1, /* Force signed enum */
210 OPCODE_BLEND_EQUATION
,
211 OPCODE_BLEND_EQUATION_SEPARATE
,
212 OPCODE_BLEND_FUNC_SEPARATE
,
214 OPCODE_CALL_LIST_OFFSET
,
220 OPCODE_CLEAR_STENCIL
,
221 OPCODE_CLEAR_BUFFER_IV
,
222 OPCODE_CLEAR_BUFFER_UIV
,
223 OPCODE_CLEAR_BUFFER_FV
,
224 OPCODE_CLEAR_BUFFER_FI
,
227 OPCODE_COLOR_MASK_INDEXED
,
228 OPCODE_COLOR_MATERIAL
,
230 OPCODE_COLOR_TABLE_PARAMETER_FV
,
231 OPCODE_COLOR_TABLE_PARAMETER_IV
,
232 OPCODE_COLOR_SUB_TABLE
,
233 OPCODE_CONVOLUTION_FILTER_1D
,
234 OPCODE_CONVOLUTION_FILTER_2D
,
235 OPCODE_CONVOLUTION_PARAMETER_I
,
236 OPCODE_CONVOLUTION_PARAMETER_IV
,
237 OPCODE_CONVOLUTION_PARAMETER_F
,
238 OPCODE_CONVOLUTION_PARAMETER_FV
,
239 OPCODE_COPY_COLOR_SUB_TABLE
,
240 OPCODE_COPY_COLOR_TABLE
,
242 OPCODE_COPY_TEX_IMAGE1D
,
243 OPCODE_COPY_TEX_IMAGE2D
,
244 OPCODE_COPY_TEX_SUB_IMAGE1D
,
245 OPCODE_COPY_TEX_SUB_IMAGE2D
,
246 OPCODE_COPY_TEX_SUB_IMAGE3D
,
252 OPCODE_DISABLE_INDEXED
,
256 OPCODE_ENABLE_INDEXED
,
271 OPCODE_LOAD_IDENTITY
,
285 OPCODE_PIXEL_TRANSFER
,
288 OPCODE_POINT_PARAMETERS
,
290 OPCODE_POLYGON_STIPPLE
,
291 OPCODE_POLYGON_OFFSET
,
295 OPCODE_PRIORITIZE_TEXTURE
,
301 OPCODE_RESET_HISTOGRAM
,
302 OPCODE_RESET_MIN_MAX
,
306 OPCODE_SELECT_TEXTURE_SGIS
,
307 OPCODE_SELECT_TEXTURE_COORD_SET
,
318 OPCODE_TEX_SUB_IMAGE1D
,
319 OPCODE_TEX_SUB_IMAGE2D
,
320 OPCODE_TEX_SUB_IMAGE3D
,
324 /* GL_ARB_multitexture */
325 OPCODE_ACTIVE_TEXTURE
,
326 /* GL_ARB_texture_compression */
327 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
328 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
329 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
330 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
331 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
332 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
333 /* GL_ARB_multisample */
334 OPCODE_SAMPLE_COVERAGE
,
335 /* GL_ARB_window_pos */
336 OPCODE_WINDOW_POS_ARB
,
337 /* GL_NV_vertex_program */
338 OPCODE_BIND_PROGRAM_NV
,
339 OPCODE_EXECUTE_PROGRAM_NV
,
340 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
341 OPCODE_LOAD_PROGRAM_NV
,
342 OPCODE_TRACK_MATRIX_NV
,
343 /* GL_NV_fragment_program */
344 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
345 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
346 /* GL_EXT_stencil_two_side */
347 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
348 /* GL_EXT_depth_bounds_test */
349 OPCODE_DEPTH_BOUNDS_EXT
,
350 /* GL_ARB_vertex/fragment_program */
351 OPCODE_PROGRAM_STRING_ARB
,
352 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
353 /* GL_ARB_occlusion_query */
354 OPCODE_BEGIN_QUERY_ARB
,
355 OPCODE_END_QUERY_ARB
,
356 /* GL_ARB_draw_buffers */
357 OPCODE_DRAW_BUFFERS_ARB
,
358 /* GL_ATI_fragment_shader */
359 OPCODE_TEX_BUMP_PARAMETER_ATI
,
360 /* GL_ATI_fragment_shader */
361 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
362 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
364 OPCODE_STENCIL_FUNC_SEPARATE
,
365 OPCODE_STENCIL_OP_SEPARATE
,
366 OPCODE_STENCIL_MASK_SEPARATE
,
368 /* GL_ARB_shader_objects */
386 OPCODE_UNIFORM_MATRIX22
,
387 OPCODE_UNIFORM_MATRIX33
,
388 OPCODE_UNIFORM_MATRIX44
,
389 OPCODE_UNIFORM_MATRIX23
,
390 OPCODE_UNIFORM_MATRIX32
,
391 OPCODE_UNIFORM_MATRIX24
,
392 OPCODE_UNIFORM_MATRIX42
,
393 OPCODE_UNIFORM_MATRIX34
,
394 OPCODE_UNIFORM_MATRIX43
,
396 /* GL_EXT_framebuffer_blit */
397 OPCODE_BLIT_FRAMEBUFFER
,
399 /* Vertex attributes -- fallback for when optimized display
400 * list build isn't active.
419 /* GL_EXT_provoking_vertex */
420 OPCODE_PROVOKING_VERTEX
,
422 /* The following three are meta instructions */
423 OPCODE_ERROR
, /* raise compiled-in error */
434 * Display list instructions are stored as sequences of "nodes". Nodes
435 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
436 * are linked together with a pointer.
438 * Each instruction in the display list is stored as a sequence of
439 * contiguous nodes in memory.
440 * Each node is the union of a variety of data types.
455 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
459 typedef union gl_dlist_node Node
;
463 * How many nodes to allocate at a time.
465 * \note Reduced now that we hold vertices etc. elsewhere.
467 #define BLOCK_SIZE 256
472 * Number of nodes of storage needed for each instruction.
473 * Sizes for dynamically allocated opcodes are stored in the context struct.
475 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
481 void mesa_print_display_list(GLuint list
);
484 /**********************************************************************/
485 /***** Private *****/
486 /**********************************************************************/
490 * Make an empty display list. This is used by glGenLists() to
491 * reserve display list IDs.
493 static struct gl_display_list
*
494 make_list(GLuint name
, GLuint count
)
496 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
498 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
499 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
505 * Lookup function to just encapsulate casting.
507 static INLINE
struct gl_display_list
*
508 lookup_list(GLcontext
*ctx
, GLuint list
)
510 return (struct gl_display_list
*)
511 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
515 /** Is the given opcode an extension code? */
516 static INLINE GLboolean
517 is_ext_opcode(OpCode opcode
)
519 return (opcode
>= OPCODE_EXT_0
);
523 /** Destroy an extended opcode instruction */
525 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
527 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
529 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
530 step
= ctx
->ListExt
->Opcode
[i
].Size
;
535 /** Execute an extended opcode instruction */
537 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
539 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
541 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
542 step
= ctx
->ListExt
->Opcode
[i
].Size
;
547 /** Print an extended opcode instruction */
549 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
551 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
553 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
554 step
= ctx
->ListExt
->Opcode
[i
].Size
;
560 * Delete the named display list, but don't remove from hash table.
561 * \param dlist - display list pointer
564 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
569 n
= block
= dlist
->Head
;
571 done
= block
? GL_FALSE
: GL_TRUE
;
573 const OpCode opcode
= n
[0].opcode
;
575 /* check for extension opcodes first */
576 if (is_ext_opcode(opcode
)) {
577 n
+= ext_opcode_destroy(ctx
, n
);
581 /* for some commands, we need to free malloc'd memory */
583 _mesa_free(n
[6].data
);
584 n
+= InstSize
[n
[0].opcode
];
587 _mesa_free(n
[10].data
);
588 n
+= InstSize
[n
[0].opcode
];
590 case OPCODE_DRAW_PIXELS
:
591 _mesa_free(n
[5].data
);
592 n
+= InstSize
[n
[0].opcode
];
595 _mesa_free(n
[7].data
);
596 n
+= InstSize
[n
[0].opcode
];
598 case OPCODE_COLOR_TABLE
:
599 _mesa_free(n
[6].data
);
600 n
+= InstSize
[n
[0].opcode
];
602 case OPCODE_COLOR_SUB_TABLE
:
603 _mesa_free(n
[6].data
);
604 n
+= InstSize
[n
[0].opcode
];
606 case OPCODE_CONVOLUTION_FILTER_1D
:
607 _mesa_free(n
[6].data
);
608 n
+= InstSize
[n
[0].opcode
];
610 case OPCODE_CONVOLUTION_FILTER_2D
:
611 _mesa_free(n
[7].data
);
612 n
+= InstSize
[n
[0].opcode
];
614 case OPCODE_POLYGON_STIPPLE
:
615 _mesa_free(n
[1].data
);
616 n
+= InstSize
[n
[0].opcode
];
618 case OPCODE_TEX_IMAGE1D
:
619 _mesa_free(n
[8].data
);
620 n
+= InstSize
[n
[0].opcode
];
622 case OPCODE_TEX_IMAGE2D
:
623 _mesa_free(n
[9].data
);
624 n
+= InstSize
[n
[0].opcode
];
626 case OPCODE_TEX_IMAGE3D
:
627 _mesa_free(n
[10].data
);
628 n
+= InstSize
[n
[0].opcode
];
630 case OPCODE_TEX_SUB_IMAGE1D
:
631 _mesa_free(n
[7].data
);
632 n
+= InstSize
[n
[0].opcode
];
634 case OPCODE_TEX_SUB_IMAGE2D
:
635 _mesa_free(n
[9].data
);
636 n
+= InstSize
[n
[0].opcode
];
638 case OPCODE_TEX_SUB_IMAGE3D
:
639 _mesa_free(n
[11].data
);
640 n
+= InstSize
[n
[0].opcode
];
642 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
643 _mesa_free(n
[7].data
);
644 n
+= InstSize
[n
[0].opcode
];
646 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
647 _mesa_free(n
[8].data
);
648 n
+= InstSize
[n
[0].opcode
];
650 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
651 _mesa_free(n
[9].data
);
652 n
+= InstSize
[n
[0].opcode
];
654 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
655 _mesa_free(n
[7].data
);
656 n
+= InstSize
[n
[0].opcode
];
658 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
659 _mesa_free(n
[9].data
);
660 n
+= InstSize
[n
[0].opcode
];
662 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
663 _mesa_free(n
[11].data
);
664 n
+= InstSize
[n
[0].opcode
];
666 #if FEATURE_NV_vertex_program
667 case OPCODE_LOAD_PROGRAM_NV
:
668 _mesa_free(n
[4].data
); /* program string */
669 n
+= InstSize
[n
[0].opcode
];
671 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
672 _mesa_free(n
[2].data
); /* array of program ids */
673 n
+= InstSize
[n
[0].opcode
];
676 #if FEATURE_NV_fragment_program
677 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
678 _mesa_free(n
[3].data
); /* parameter name */
679 n
+= InstSize
[n
[0].opcode
];
682 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
683 case OPCODE_PROGRAM_STRING_ARB
:
684 _mesa_free(n
[4].data
); /* program string */
685 n
+= InstSize
[n
[0].opcode
];
688 case OPCODE_UNIFORM_1FV
:
689 case OPCODE_UNIFORM_2FV
:
690 case OPCODE_UNIFORM_3FV
:
691 case OPCODE_UNIFORM_4FV
:
692 case OPCODE_UNIFORM_1IV
:
693 case OPCODE_UNIFORM_2IV
:
694 case OPCODE_UNIFORM_3IV
:
695 case OPCODE_UNIFORM_4IV
:
696 _mesa_free(n
[3].data
);
697 n
+= InstSize
[n
[0].opcode
];
699 case OPCODE_UNIFORM_MATRIX22
:
700 case OPCODE_UNIFORM_MATRIX33
:
701 case OPCODE_UNIFORM_MATRIX44
:
702 case OPCODE_UNIFORM_MATRIX24
:
703 case OPCODE_UNIFORM_MATRIX42
:
704 case OPCODE_UNIFORM_MATRIX23
:
705 case OPCODE_UNIFORM_MATRIX32
:
706 case OPCODE_UNIFORM_MATRIX34
:
707 case OPCODE_UNIFORM_MATRIX43
:
708 _mesa_free(n
[4].data
);
709 n
+= InstSize
[n
[0].opcode
];
712 case OPCODE_CONTINUE
:
713 n
= (Node
*) n
[1].next
;
717 case OPCODE_END_OF_LIST
:
722 /* Most frequent case */
723 n
+= InstSize
[n
[0].opcode
];
734 * Destroy a display list and remove from hash table.
735 * \param list - display list number
738 destroy_list(GLcontext
*ctx
, GLuint list
)
740 struct gl_display_list
*dlist
;
745 dlist
= lookup_list(ctx
, list
);
749 _mesa_delete_list(ctx
, dlist
);
750 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
755 * Translate the nth element of list from <type> to GLint.
758 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
770 bptr
= (GLbyte
*) list
;
771 return (GLint
) bptr
[n
];
772 case GL_UNSIGNED_BYTE
:
773 ubptr
= (GLubyte
*) list
;
774 return (GLint
) ubptr
[n
];
776 sptr
= (GLshort
*) list
;
777 return (GLint
) sptr
[n
];
778 case GL_UNSIGNED_SHORT
:
779 usptr
= (GLushort
*) list
;
780 return (GLint
) usptr
[n
];
782 iptr
= (GLint
*) list
;
784 case GL_UNSIGNED_INT
:
785 uiptr
= (GLuint
*) list
;
786 return (GLint
) uiptr
[n
];
788 fptr
= (GLfloat
*) list
;
789 return (GLint
) FLOORF(fptr
[n
]);
791 ubptr
= ((GLubyte
*) list
) + 2 * n
;
792 return (GLint
) ubptr
[0] * 256
795 ubptr
= ((GLubyte
*) list
) + 3 * n
;
796 return (GLint
) ubptr
[0] * 65536
797 + (GLint
) ubptr
[1] * 256
800 ubptr
= ((GLubyte
*) list
) + 4 * n
;
801 return (GLint
) ubptr
[0] * 16777216
802 + (GLint
) ubptr
[1] * 65536
803 + (GLint
) ubptr
[2] * 256
813 /**********************************************************************/
815 /**********************************************************************/
818 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
819 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
822 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
823 GLsizei width
, GLsizei height
, GLsizei depth
,
824 GLenum format
, GLenum type
, const GLvoid
* pixels
,
825 const struct gl_pixelstore_attrib
*unpack
)
827 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
829 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
830 format
, type
, pixels
, unpack
);
831 if (pixels
&& !image
) {
832 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
836 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
837 format
, type
, pixels
)) {
838 const GLubyte
*map
, *src
;
842 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
843 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
845 /* unable to map src buffer! */
846 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
850 src
= ADD_POINTERS(map
, pixels
);
851 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
852 format
, type
, src
, unpack
);
854 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
858 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
868 * Allocate space for a display list instruction (opcode + payload space).
869 * \param opcode the instruction opcode (OPCODE_* value)
870 * \param bytes instruction payload size (not counting opcode)
871 * \return pointer to allocated memory (the opcode space)
874 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
876 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
879 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
880 if (InstSize
[opcode
] == 0) {
881 /* save instruction size now */
882 InstSize
[opcode
] = numNodes
;
885 /* make sure instruction size agrees */
886 ASSERT(numNodes
== InstSize
[opcode
]);
890 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
891 /* This block is full. Allocate a new block and chain to it */
893 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
894 n
[0].opcode
= OPCODE_CONTINUE
;
895 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
897 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
900 n
[1].next
= (Node
*) newblock
;
901 ctx
->ListState
.CurrentBlock
= newblock
;
902 ctx
->ListState
.CurrentPos
= 0;
905 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
906 ctx
->ListState
.CurrentPos
+= numNodes
;
908 n
[0].opcode
= opcode
;
916 * Allocate space for a display list instruction. Used by callers outside
917 * this file for things like VBO vertex data.
919 * \param opcode the instruction opcode (OPCODE_* value)
920 * \param bytes instruction size in bytes, not counting opcode.
921 * \return pointer to the usable data area (not including the internal
925 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
927 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
929 return n
+ 1; /* return pointer to payload area, after opcode */
936 * This function allows modules and drivers to get their own opcodes
937 * for extending display list functionality.
938 * \param ctx the rendering context
939 * \param size number of bytes for storing the new display list command
940 * \param execute function to execute the new display list command
941 * \param destroy function to destroy the new display list command
942 * \param print function to print the new display list command
943 * \return the new opcode number or -1 if error
946 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
948 void (*execute
) (GLcontext
*, void *),
949 void (*destroy
) (GLcontext
*, void *),
950 void (*print
) (GLcontext
*, void *))
952 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
953 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
954 ctx
->ListExt
->Opcode
[i
].Size
=
955 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
956 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
957 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
958 ctx
->ListExt
->Opcode
[i
].Print
= print
;
959 return i
+ OPCODE_EXT_0
;
966 * Allocate space for a display list instruction. The space is basically
967 * an array of Nodes where node[0] holds the opcode, node[1] is the first
968 * function parameter, node[2] is the second parameter, etc.
970 * \param opcode one of OPCODE_x
971 * \param nparams number of function parameters
972 * \return pointer to start of instruction space
975 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
977 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
983 * Display List compilation functions
985 static void GLAPIENTRY
986 save_Accum(GLenum op
, GLfloat value
)
988 GET_CURRENT_CONTEXT(ctx
);
990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
991 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
996 if (ctx
->ExecuteFlag
) {
997 CALL_Accum(ctx
->Exec
, (op
, value
));
1002 static void GLAPIENTRY
1003 save_AlphaFunc(GLenum func
, GLclampf ref
)
1005 GET_CURRENT_CONTEXT(ctx
);
1007 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1008 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1011 n
[2].f
= (GLfloat
) ref
;
1013 if (ctx
->ExecuteFlag
) {
1014 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1019 static void GLAPIENTRY
1020 save_BindTexture(GLenum target
, GLuint texture
)
1022 GET_CURRENT_CONTEXT(ctx
);
1024 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1025 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1030 if (ctx
->ExecuteFlag
) {
1031 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1036 static void GLAPIENTRY
1037 save_Bitmap(GLsizei width
, GLsizei height
,
1038 GLfloat xorig
, GLfloat yorig
,
1039 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1041 GET_CURRENT_CONTEXT(ctx
);
1043 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1044 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1046 n
[1].i
= (GLint
) width
;
1047 n
[2].i
= (GLint
) height
;
1052 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1054 if (ctx
->ExecuteFlag
) {
1055 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1056 xorig
, yorig
, xmove
, ymove
, pixels
));
1061 static void GLAPIENTRY
1062 save_BlendEquation(GLenum mode
)
1064 GET_CURRENT_CONTEXT(ctx
);
1066 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1067 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1071 if (ctx
->ExecuteFlag
) {
1072 CALL_BlendEquation(ctx
->Exec
, (mode
));
1077 static void GLAPIENTRY
1078 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1080 GET_CURRENT_CONTEXT(ctx
);
1082 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1083 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1088 if (ctx
->ExecuteFlag
) {
1089 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1094 static void GLAPIENTRY
1095 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1096 GLenum sfactorA
, GLenum dfactorA
)
1098 GET_CURRENT_CONTEXT(ctx
);
1100 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1101 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1103 n
[1].e
= sfactorRGB
;
1104 n
[2].e
= dfactorRGB
;
1108 if (ctx
->ExecuteFlag
) {
1109 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1110 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1115 static void GLAPIENTRY
1116 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1118 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1122 static void GLAPIENTRY
1123 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1125 GET_CURRENT_CONTEXT(ctx
);
1127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1128 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1135 if (ctx
->ExecuteFlag
) {
1136 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1140 static void invalidate_saved_current_state( GLcontext
*ctx
)
1144 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1145 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1147 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1148 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1150 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1152 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1155 static void GLAPIENTRY
1156 save_CallList(GLuint list
)
1158 GET_CURRENT_CONTEXT(ctx
);
1160 SAVE_FLUSH_VERTICES(ctx
);
1162 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1167 /* After this, we don't know what state we're in. Invalidate all
1168 * cached information previously gathered:
1170 invalidate_saved_current_state( ctx
);
1172 if (ctx
->ExecuteFlag
) {
1173 _mesa_CallList(list
);
1178 static void GLAPIENTRY
1179 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1181 GET_CURRENT_CONTEXT(ctx
);
1183 GLboolean typeErrorFlag
;
1185 SAVE_FLUSH_VERTICES(ctx
);
1189 case GL_UNSIGNED_BYTE
:
1191 case GL_UNSIGNED_SHORT
:
1193 case GL_UNSIGNED_INT
:
1198 typeErrorFlag
= GL_FALSE
;
1201 typeErrorFlag
= GL_TRUE
;
1204 for (i
= 0; i
< num
; i
++) {
1205 GLint list
= translate_id(i
, type
, lists
);
1206 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1209 n
[2].b
= typeErrorFlag
;
1213 /* After this, we don't know what state we're in. Invalidate all
1214 * cached information previously gathered:
1216 invalidate_saved_current_state( ctx
);
1218 if (ctx
->ExecuteFlag
) {
1219 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1224 static void GLAPIENTRY
1225 save_Clear(GLbitfield mask
)
1227 GET_CURRENT_CONTEXT(ctx
);
1229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1230 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1234 if (ctx
->ExecuteFlag
) {
1235 CALL_Clear(ctx
->Exec
, (mask
));
1240 static void GLAPIENTRY
1241 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1243 GET_CURRENT_CONTEXT(ctx
);
1245 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1246 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1249 n
[2].i
= drawbuffer
;
1251 if (buffer
== GL_COLOR
) {
1262 if (ctx
->ExecuteFlag
) {
1263 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1268 static void GLAPIENTRY
1269 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1271 GET_CURRENT_CONTEXT(ctx
);
1273 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1274 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1277 n
[2].i
= drawbuffer
;
1279 if (buffer
== GL_COLOR
) {
1290 if (ctx
->ExecuteFlag
) {
1291 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1296 static void GLAPIENTRY
1297 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1299 GET_CURRENT_CONTEXT(ctx
);
1301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1302 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1305 n
[2].i
= drawbuffer
;
1307 if (buffer
== GL_COLOR
) {
1318 if (ctx
->ExecuteFlag
) {
1319 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1324 static void GLAPIENTRY
1325 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1326 GLfloat depth
, GLint stencil
)
1328 GET_CURRENT_CONTEXT(ctx
);
1330 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1331 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1334 n
[2].i
= drawbuffer
;
1338 if (ctx
->ExecuteFlag
) {
1339 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1344 static void GLAPIENTRY
1345 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1347 GET_CURRENT_CONTEXT(ctx
);
1349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1357 if (ctx
->ExecuteFlag
) {
1358 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1363 static void GLAPIENTRY
1364 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1366 GET_CURRENT_CONTEXT(ctx
);
1368 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1369 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1376 if (ctx
->ExecuteFlag
) {
1377 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1382 static void GLAPIENTRY
1383 save_ClearDepth(GLclampd depth
)
1385 GET_CURRENT_CONTEXT(ctx
);
1387 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1388 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1390 n
[1].f
= (GLfloat
) depth
;
1392 if (ctx
->ExecuteFlag
) {
1393 CALL_ClearDepth(ctx
->Exec
, (depth
));
1398 static void GLAPIENTRY
1399 save_ClearIndex(GLfloat c
)
1401 GET_CURRENT_CONTEXT(ctx
);
1403 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1404 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1408 if (ctx
->ExecuteFlag
) {
1409 CALL_ClearIndex(ctx
->Exec
, (c
));
1414 static void GLAPIENTRY
1415 save_ClearStencil(GLint s
)
1417 GET_CURRENT_CONTEXT(ctx
);
1419 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1420 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1424 if (ctx
->ExecuteFlag
) {
1425 CALL_ClearStencil(ctx
->Exec
, (s
));
1430 static void GLAPIENTRY
1431 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1433 GET_CURRENT_CONTEXT(ctx
);
1435 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1436 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1439 n
[2].f
= (GLfloat
) equ
[0];
1440 n
[3].f
= (GLfloat
) equ
[1];
1441 n
[4].f
= (GLfloat
) equ
[2];
1442 n
[5].f
= (GLfloat
) equ
[3];
1444 if (ctx
->ExecuteFlag
) {
1445 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1451 static void GLAPIENTRY
1452 save_ColorMask(GLboolean red
, GLboolean green
,
1453 GLboolean blue
, GLboolean alpha
)
1455 GET_CURRENT_CONTEXT(ctx
);
1457 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1458 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1465 if (ctx
->ExecuteFlag
) {
1466 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1471 static void GLAPIENTRY
1472 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1473 GLboolean blue
, GLboolean alpha
)
1475 GET_CURRENT_CONTEXT(ctx
);
1477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1478 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1486 if (ctx
->ExecuteFlag
) {
1487 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1492 static void GLAPIENTRY
1493 save_ColorMaterial(GLenum face
, GLenum mode
)
1495 GET_CURRENT_CONTEXT(ctx
);
1497 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1499 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1504 if (ctx
->ExecuteFlag
) {
1505 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1510 static void GLAPIENTRY
1511 save_ColorTable(GLenum target
, GLenum internalFormat
,
1512 GLsizei width
, GLenum format
, GLenum type
,
1513 const GLvoid
* table
)
1515 GET_CURRENT_CONTEXT(ctx
);
1516 if (_mesa_is_proxy_texture(target
)) {
1517 /* execute immediately */
1518 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1519 format
, type
, table
));
1523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1524 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1527 n
[2].e
= internalFormat
;
1531 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1534 if (ctx
->ExecuteFlag
) {
1535 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1536 format
, type
, table
));
1543 static void GLAPIENTRY
1544 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1545 const GLfloat
*params
)
1547 GET_CURRENT_CONTEXT(ctx
);
1550 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1552 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1557 if (pname
== GL_COLOR_TABLE_SGI
||
1558 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1559 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1560 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1567 if (ctx
->ExecuteFlag
) {
1568 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1573 static void GLAPIENTRY
1574 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1576 GET_CURRENT_CONTEXT(ctx
);
1579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1581 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1586 if (pname
== GL_COLOR_TABLE_SGI
||
1587 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1588 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1589 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1596 if (ctx
->ExecuteFlag
) {
1597 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1603 static void GLAPIENTRY
1604 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1605 GLenum format
, GLenum type
, const GLvoid
* table
)
1607 GET_CURRENT_CONTEXT(ctx
);
1609 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1610 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1617 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1620 if (ctx
->ExecuteFlag
) {
1621 CALL_ColorSubTable(ctx
->Exec
,
1622 (target
, start
, count
, format
, type
, table
));
1627 static void GLAPIENTRY
1628 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1629 GLint x
, GLint y
, GLsizei width
)
1631 GET_CURRENT_CONTEXT(ctx
);
1634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1635 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1643 if (ctx
->ExecuteFlag
) {
1644 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1649 static void GLAPIENTRY
1650 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1651 GLint x
, GLint y
, GLsizei width
)
1653 GET_CURRENT_CONTEXT(ctx
);
1656 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1657 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1660 n
[2].e
= internalformat
;
1665 if (ctx
->ExecuteFlag
) {
1666 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1671 static void GLAPIENTRY
1672 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1673 GLenum format
, GLenum type
, const GLvoid
* filter
)
1675 GET_CURRENT_CONTEXT(ctx
);
1678 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1680 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1683 n
[2].e
= internalFormat
;
1687 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1690 if (ctx
->ExecuteFlag
) {
1691 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1692 format
, type
, filter
));
1697 static void GLAPIENTRY
1698 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1699 GLsizei width
, GLsizei height
, GLenum format
,
1700 GLenum type
, const GLvoid
* filter
)
1702 GET_CURRENT_CONTEXT(ctx
);
1705 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1707 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1710 n
[2].e
= internalFormat
;
1715 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1718 if (ctx
->ExecuteFlag
) {
1719 CALL_ConvolutionFilter2D(ctx
->Exec
,
1720 (target
, internalFormat
, width
, height
, format
,
1726 static void GLAPIENTRY
1727 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1729 GET_CURRENT_CONTEXT(ctx
);
1731 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1732 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1738 if (ctx
->ExecuteFlag
) {
1739 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1744 static void GLAPIENTRY
1745 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1747 GET_CURRENT_CONTEXT(ctx
);
1749 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1750 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1755 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1756 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1757 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1763 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1766 if (ctx
->ExecuteFlag
) {
1767 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1772 static void GLAPIENTRY
1773 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1775 GET_CURRENT_CONTEXT(ctx
);
1777 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1778 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1784 if (ctx
->ExecuteFlag
) {
1785 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1790 static void GLAPIENTRY
1791 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1792 const GLfloat
*params
)
1794 GET_CURRENT_CONTEXT(ctx
);
1796 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1797 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1802 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1803 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1804 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1810 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1813 if (ctx
->ExecuteFlag
) {
1814 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1819 static void GLAPIENTRY
1820 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1822 GET_CURRENT_CONTEXT(ctx
);
1824 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1825 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1829 n
[3].i
= (GLint
) width
;
1830 n
[4].i
= (GLint
) height
;
1833 if (ctx
->ExecuteFlag
) {
1834 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1840 static void GLAPIENTRY
1841 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1842 GLint x
, GLint y
, GLsizei width
, GLint border
)
1844 GET_CURRENT_CONTEXT(ctx
);
1846 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1847 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1851 n
[3].e
= internalformat
;
1857 if (ctx
->ExecuteFlag
) {
1858 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1859 x
, y
, width
, border
));
1864 static void GLAPIENTRY
1865 save_CopyTexImage2D(GLenum target
, GLint level
,
1866 GLenum internalformat
,
1867 GLint x
, GLint y
, GLsizei width
,
1868 GLsizei height
, GLint border
)
1870 GET_CURRENT_CONTEXT(ctx
);
1872 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1873 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1877 n
[3].e
= internalformat
;
1884 if (ctx
->ExecuteFlag
) {
1885 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1886 x
, y
, width
, height
, border
));
1892 static void GLAPIENTRY
1893 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1894 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1896 GET_CURRENT_CONTEXT(ctx
);
1898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1899 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1908 if (ctx
->ExecuteFlag
) {
1909 CALL_CopyTexSubImage1D(ctx
->Exec
,
1910 (target
, level
, xoffset
, x
, y
, width
));
1915 static void GLAPIENTRY
1916 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1917 GLint xoffset
, GLint yoffset
,
1918 GLint x
, GLint y
, GLsizei width
, GLint height
)
1920 GET_CURRENT_CONTEXT(ctx
);
1922 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1923 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1934 if (ctx
->ExecuteFlag
) {
1935 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1936 x
, y
, width
, height
));
1941 static void GLAPIENTRY
1942 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1943 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1944 GLint x
, GLint y
, GLsizei width
, GLint height
)
1946 GET_CURRENT_CONTEXT(ctx
);
1948 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1949 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1961 if (ctx
->ExecuteFlag
) {
1962 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1963 xoffset
, yoffset
, zoffset
,
1964 x
, y
, width
, height
));
1969 static void GLAPIENTRY
1970 save_CullFace(GLenum mode
)
1972 GET_CURRENT_CONTEXT(ctx
);
1974 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1975 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1979 if (ctx
->ExecuteFlag
) {
1980 CALL_CullFace(ctx
->Exec
, (mode
));
1985 static void GLAPIENTRY
1986 save_DepthFunc(GLenum func
)
1988 GET_CURRENT_CONTEXT(ctx
);
1990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1991 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1995 if (ctx
->ExecuteFlag
) {
1996 CALL_DepthFunc(ctx
->Exec
, (func
));
2001 static void GLAPIENTRY
2002 save_DepthMask(GLboolean mask
)
2004 GET_CURRENT_CONTEXT(ctx
);
2006 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2007 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
2011 if (ctx
->ExecuteFlag
) {
2012 CALL_DepthMask(ctx
->Exec
, (mask
));
2017 static void GLAPIENTRY
2018 save_DepthRange(GLclampd nearval
, GLclampd farval
)
2020 GET_CURRENT_CONTEXT(ctx
);
2022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2023 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2025 n
[1].f
= (GLfloat
) nearval
;
2026 n
[2].f
= (GLfloat
) farval
;
2028 if (ctx
->ExecuteFlag
) {
2029 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2034 static void GLAPIENTRY
2035 save_Disable(GLenum cap
)
2037 GET_CURRENT_CONTEXT(ctx
);
2039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2040 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2044 if (ctx
->ExecuteFlag
) {
2045 CALL_Disable(ctx
->Exec
, (cap
));
2050 static void GLAPIENTRY
2051 save_DisableIndexed(GLuint index
, GLenum cap
)
2053 GET_CURRENT_CONTEXT(ctx
);
2055 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2056 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2061 if (ctx
->ExecuteFlag
) {
2062 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2067 static void GLAPIENTRY
2068 save_DrawBuffer(GLenum mode
)
2070 GET_CURRENT_CONTEXT(ctx
);
2072 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2073 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2077 if (ctx
->ExecuteFlag
) {
2078 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2083 static void GLAPIENTRY
2084 save_DrawPixels(GLsizei width
, GLsizei height
,
2085 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2087 GET_CURRENT_CONTEXT(ctx
);
2090 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2092 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2098 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2099 pixels
, &ctx
->Unpack
);
2101 if (ctx
->ExecuteFlag
) {
2102 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2108 static void GLAPIENTRY
2109 save_Enable(GLenum cap
)
2111 GET_CURRENT_CONTEXT(ctx
);
2113 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2114 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2118 if (ctx
->ExecuteFlag
) {
2119 CALL_Enable(ctx
->Exec
, (cap
));
2125 static void GLAPIENTRY
2126 save_EnableIndexed(GLuint index
, GLenum cap
)
2128 GET_CURRENT_CONTEXT(ctx
);
2130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2131 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2136 if (ctx
->ExecuteFlag
) {
2137 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2143 static void GLAPIENTRY
2144 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2146 GET_CURRENT_CONTEXT(ctx
);
2148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2149 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2155 if (ctx
->ExecuteFlag
) {
2156 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2161 static void GLAPIENTRY
2162 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2164 GET_CURRENT_CONTEXT(ctx
);
2166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2167 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2175 if (ctx
->ExecuteFlag
) {
2176 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2183 static void GLAPIENTRY
2184 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2186 GET_CURRENT_CONTEXT(ctx
);
2188 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2189 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2197 if (ctx
->ExecuteFlag
) {
2198 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2203 static void GLAPIENTRY
2204 save_Fogf(GLenum pname
, GLfloat param
)
2208 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2209 save_Fogfv(pname
, parray
);
2213 static void GLAPIENTRY
2214 save_Fogiv(GLenum pname
, const GLint
*params
)
2219 case GL_FOG_DENSITY
:
2223 p
[0] = (GLfloat
) *params
;
2229 p
[0] = INT_TO_FLOAT(params
[0]);
2230 p
[1] = INT_TO_FLOAT(params
[1]);
2231 p
[2] = INT_TO_FLOAT(params
[2]);
2232 p
[3] = INT_TO_FLOAT(params
[3]);
2235 /* Error will be caught later in gl_Fogfv */
2236 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2238 save_Fogfv(pname
, p
);
2242 static void GLAPIENTRY
2243 save_Fogi(GLenum pname
, GLint param
)
2247 parray
[1] = parray
[2] = parray
[3] = 0;
2248 save_Fogiv(pname
, parray
);
2252 static void GLAPIENTRY
2253 save_FrontFace(GLenum mode
)
2255 GET_CURRENT_CONTEXT(ctx
);
2257 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2258 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2262 if (ctx
->ExecuteFlag
) {
2263 CALL_FrontFace(ctx
->Exec
, (mode
));
2268 static void GLAPIENTRY
2269 save_Frustum(GLdouble left
, GLdouble right
,
2270 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2277 n
[1].f
= (GLfloat
) left
;
2278 n
[2].f
= (GLfloat
) right
;
2279 n
[3].f
= (GLfloat
) bottom
;
2280 n
[4].f
= (GLfloat
) top
;
2281 n
[5].f
= (GLfloat
) nearval
;
2282 n
[6].f
= (GLfloat
) farval
;
2284 if (ctx
->ExecuteFlag
) {
2285 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2290 static void GLAPIENTRY
2291 save_Hint(GLenum target
, GLenum mode
)
2293 GET_CURRENT_CONTEXT(ctx
);
2295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2296 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2301 if (ctx
->ExecuteFlag
) {
2302 CALL_Hint(ctx
->Exec
, (target
, mode
));
2307 static void GLAPIENTRY
2308 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2311 GET_CURRENT_CONTEXT(ctx
);
2314 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2315 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2319 n
[3].e
= internalFormat
;
2322 if (ctx
->ExecuteFlag
) {
2323 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2328 static void GLAPIENTRY
2329 save_IndexMask(GLuint mask
)
2331 GET_CURRENT_CONTEXT(ctx
);
2333 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2334 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2338 if (ctx
->ExecuteFlag
) {
2339 CALL_IndexMask(ctx
->Exec
, (mask
));
2344 static void GLAPIENTRY
2345 save_InitNames(void)
2347 GET_CURRENT_CONTEXT(ctx
);
2348 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2349 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2350 if (ctx
->ExecuteFlag
) {
2351 CALL_InitNames(ctx
->Exec
, ());
2356 static void GLAPIENTRY
2357 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2359 GET_CURRENT_CONTEXT(ctx
);
2361 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2362 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2380 case GL_SPOT_DIRECTION
:
2383 case GL_SPOT_EXPONENT
:
2386 case GL_SPOT_CUTOFF
:
2389 case GL_CONSTANT_ATTENUATION
:
2392 case GL_LINEAR_ATTENUATION
:
2395 case GL_QUADRATIC_ATTENUATION
:
2401 for (i
= 0; i
< nParams
; i
++) {
2402 n
[3 + i
].f
= params
[i
];
2405 if (ctx
->ExecuteFlag
) {
2406 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2411 static void GLAPIENTRY
2412 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2416 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2417 save_Lightfv(light
, pname
, parray
);
2421 static void GLAPIENTRY
2422 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2429 fparam
[0] = INT_TO_FLOAT(params
[0]);
2430 fparam
[1] = INT_TO_FLOAT(params
[1]);
2431 fparam
[2] = INT_TO_FLOAT(params
[2]);
2432 fparam
[3] = INT_TO_FLOAT(params
[3]);
2435 fparam
[0] = (GLfloat
) params
[0];
2436 fparam
[1] = (GLfloat
) params
[1];
2437 fparam
[2] = (GLfloat
) params
[2];
2438 fparam
[3] = (GLfloat
) params
[3];
2440 case GL_SPOT_DIRECTION
:
2441 fparam
[0] = (GLfloat
) params
[0];
2442 fparam
[1] = (GLfloat
) params
[1];
2443 fparam
[2] = (GLfloat
) params
[2];
2445 case GL_SPOT_EXPONENT
:
2446 case GL_SPOT_CUTOFF
:
2447 case GL_CONSTANT_ATTENUATION
:
2448 case GL_LINEAR_ATTENUATION
:
2449 case GL_QUADRATIC_ATTENUATION
:
2450 fparam
[0] = (GLfloat
) params
[0];
2453 /* error will be caught later in gl_Lightfv */
2456 save_Lightfv(light
, pname
, fparam
);
2460 static void GLAPIENTRY
2461 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2465 parray
[1] = parray
[2] = parray
[3] = 0;
2466 save_Lightiv(light
, pname
, parray
);
2470 static void GLAPIENTRY
2471 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2473 GET_CURRENT_CONTEXT(ctx
);
2475 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2476 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2484 if (ctx
->ExecuteFlag
) {
2485 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2490 static void GLAPIENTRY
2491 save_LightModelf(GLenum pname
, GLfloat param
)
2495 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2496 save_LightModelfv(pname
, parray
);
2500 static void GLAPIENTRY
2501 save_LightModeliv(GLenum pname
, const GLint
*params
)
2505 case GL_LIGHT_MODEL_AMBIENT
:
2506 fparam
[0] = INT_TO_FLOAT(params
[0]);
2507 fparam
[1] = INT_TO_FLOAT(params
[1]);
2508 fparam
[2] = INT_TO_FLOAT(params
[2]);
2509 fparam
[3] = INT_TO_FLOAT(params
[3]);
2511 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2512 case GL_LIGHT_MODEL_TWO_SIDE
:
2513 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2514 fparam
[0] = (GLfloat
) params
[0];
2520 /* Error will be caught later in gl_LightModelfv */
2521 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2523 save_LightModelfv(pname
, fparam
);
2527 static void GLAPIENTRY
2528 save_LightModeli(GLenum pname
, GLint param
)
2532 parray
[1] = parray
[2] = parray
[3] = 0;
2533 save_LightModeliv(pname
, parray
);
2537 static void GLAPIENTRY
2538 save_LineStipple(GLint factor
, GLushort pattern
)
2540 GET_CURRENT_CONTEXT(ctx
);
2542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2543 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2548 if (ctx
->ExecuteFlag
) {
2549 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2554 static void GLAPIENTRY
2555 save_LineWidth(GLfloat width
)
2557 GET_CURRENT_CONTEXT(ctx
);
2559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2560 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2564 if (ctx
->ExecuteFlag
) {
2565 CALL_LineWidth(ctx
->Exec
, (width
));
2570 static void GLAPIENTRY
2571 save_ListBase(GLuint base
)
2573 GET_CURRENT_CONTEXT(ctx
);
2575 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2576 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2580 if (ctx
->ExecuteFlag
) {
2581 CALL_ListBase(ctx
->Exec
, (base
));
2586 static void GLAPIENTRY
2587 save_LoadIdentity(void)
2589 GET_CURRENT_CONTEXT(ctx
);
2590 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2591 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2592 if (ctx
->ExecuteFlag
) {
2593 CALL_LoadIdentity(ctx
->Exec
, ());
2598 static void GLAPIENTRY
2599 save_LoadMatrixf(const GLfloat
* m
)
2601 GET_CURRENT_CONTEXT(ctx
);
2603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2604 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2607 for (i
= 0; i
< 16; i
++) {
2611 if (ctx
->ExecuteFlag
) {
2612 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2617 static void GLAPIENTRY
2618 save_LoadMatrixd(const GLdouble
* m
)
2622 for (i
= 0; i
< 16; i
++) {
2623 f
[i
] = (GLfloat
) m
[i
];
2625 save_LoadMatrixf(f
);
2629 static void GLAPIENTRY
2630 save_LoadName(GLuint name
)
2632 GET_CURRENT_CONTEXT(ctx
);
2634 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2635 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2639 if (ctx
->ExecuteFlag
) {
2640 CALL_LoadName(ctx
->Exec
, (name
));
2645 static void GLAPIENTRY
2646 save_LogicOp(GLenum opcode
)
2648 GET_CURRENT_CONTEXT(ctx
);
2650 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2651 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2655 if (ctx
->ExecuteFlag
) {
2656 CALL_LogicOp(ctx
->Exec
, (opcode
));
2661 static void GLAPIENTRY
2662 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2663 GLint order
, const GLdouble
* points
)
2665 GET_CURRENT_CONTEXT(ctx
);
2667 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2668 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2670 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2672 n
[2].f
= (GLfloat
) u1
;
2673 n
[3].f
= (GLfloat
) u2
;
2674 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2676 n
[6].data
= (void *) pnts
;
2678 if (ctx
->ExecuteFlag
) {
2679 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2683 static void GLAPIENTRY
2684 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2685 GLint order
, const GLfloat
* points
)
2687 GET_CURRENT_CONTEXT(ctx
);
2689 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2690 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2692 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2696 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2698 n
[6].data
= (void *) pnts
;
2700 if (ctx
->ExecuteFlag
) {
2701 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2706 static void GLAPIENTRY
2707 save_Map2d(GLenum target
,
2708 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2709 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2710 const GLdouble
* points
)
2712 GET_CURRENT_CONTEXT(ctx
);
2714 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2715 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2717 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2718 vstride
, vorder
, points
);
2720 n
[2].f
= (GLfloat
) u1
;
2721 n
[3].f
= (GLfloat
) u2
;
2722 n
[4].f
= (GLfloat
) v1
;
2723 n
[5].f
= (GLfloat
) v2
;
2724 /* XXX verify these strides are correct */
2725 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2726 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2729 n
[10].data
= (void *) pnts
;
2731 if (ctx
->ExecuteFlag
) {
2732 CALL_Map2d(ctx
->Exec
, (target
,
2733 u1
, u2
, ustride
, uorder
,
2734 v1
, v2
, vstride
, vorder
, points
));
2739 static void GLAPIENTRY
2740 save_Map2f(GLenum target
,
2741 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2742 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2743 const GLfloat
* points
)
2745 GET_CURRENT_CONTEXT(ctx
);
2747 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2748 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2750 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2751 vstride
, vorder
, points
);
2757 /* XXX verify these strides are correct */
2758 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2759 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2762 n
[10].data
= (void *) pnts
;
2764 if (ctx
->ExecuteFlag
) {
2765 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2766 v1
, v2
, vstride
, vorder
, points
));
2771 static void GLAPIENTRY
2772 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2774 GET_CURRENT_CONTEXT(ctx
);
2776 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2777 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2783 if (ctx
->ExecuteFlag
) {
2784 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2789 static void GLAPIENTRY
2790 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2792 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2796 static void GLAPIENTRY
2797 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2798 GLint vn
, GLfloat v1
, GLfloat v2
)
2800 GET_CURRENT_CONTEXT(ctx
);
2802 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2803 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2812 if (ctx
->ExecuteFlag
) {
2813 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2819 static void GLAPIENTRY
2820 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2821 GLint vn
, GLdouble v1
, GLdouble v2
)
2823 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2824 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2828 static void GLAPIENTRY
2829 save_MatrixMode(GLenum mode
)
2831 GET_CURRENT_CONTEXT(ctx
);
2833 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2834 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2838 if (ctx
->ExecuteFlag
) {
2839 CALL_MatrixMode(ctx
->Exec
, (mode
));
2844 static void GLAPIENTRY
2845 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2847 GET_CURRENT_CONTEXT(ctx
);
2850 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2851 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2854 n
[2].e
= internalFormat
;
2857 if (ctx
->ExecuteFlag
) {
2858 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2863 static void GLAPIENTRY
2864 save_MultMatrixf(const GLfloat
* m
)
2866 GET_CURRENT_CONTEXT(ctx
);
2868 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2869 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2872 for (i
= 0; i
< 16; i
++) {
2876 if (ctx
->ExecuteFlag
) {
2877 CALL_MultMatrixf(ctx
->Exec
, (m
));
2882 static void GLAPIENTRY
2883 save_MultMatrixd(const GLdouble
* m
)
2887 for (i
= 0; i
< 16; i
++) {
2888 f
[i
] = (GLfloat
) m
[i
];
2890 save_MultMatrixf(f
);
2894 static void GLAPIENTRY
2895 save_NewList(GLuint name
, GLenum mode
)
2897 GET_CURRENT_CONTEXT(ctx
);
2898 /* It's an error to call this function while building a display list */
2899 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2906 static void GLAPIENTRY
2907 save_Ortho(GLdouble left
, GLdouble right
,
2908 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2910 GET_CURRENT_CONTEXT(ctx
);
2912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2913 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2915 n
[1].f
= (GLfloat
) left
;
2916 n
[2].f
= (GLfloat
) right
;
2917 n
[3].f
= (GLfloat
) bottom
;
2918 n
[4].f
= (GLfloat
) top
;
2919 n
[5].f
= (GLfloat
) nearval
;
2920 n
[6].f
= (GLfloat
) farval
;
2922 if (ctx
->ExecuteFlag
) {
2923 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2928 static void GLAPIENTRY
2929 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2931 GET_CURRENT_CONTEXT(ctx
);
2933 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2934 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2938 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2939 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2941 if (ctx
->ExecuteFlag
) {
2942 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2947 static void GLAPIENTRY
2948 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2950 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2952 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2953 for (i
= 0; i
< mapsize
; i
++) {
2954 fvalues
[i
] = (GLfloat
) values
[i
];
2958 for (i
= 0; i
< mapsize
; i
++) {
2959 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2962 save_PixelMapfv(map
, mapsize
, fvalues
);
2966 static void GLAPIENTRY
2967 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2969 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2971 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2972 for (i
= 0; i
< mapsize
; i
++) {
2973 fvalues
[i
] = (GLfloat
) values
[i
];
2977 for (i
= 0; i
< mapsize
; i
++) {
2978 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2981 save_PixelMapfv(map
, mapsize
, fvalues
);
2985 static void GLAPIENTRY
2986 save_PixelTransferf(GLenum pname
, GLfloat param
)
2988 GET_CURRENT_CONTEXT(ctx
);
2990 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2991 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2996 if (ctx
->ExecuteFlag
) {
2997 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
3002 static void GLAPIENTRY
3003 save_PixelTransferi(GLenum pname
, GLint param
)
3005 save_PixelTransferf(pname
, (GLfloat
) param
);
3009 static void GLAPIENTRY
3010 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
3012 GET_CURRENT_CONTEXT(ctx
);
3014 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3015 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
3020 if (ctx
->ExecuteFlag
) {
3021 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3026 static void GLAPIENTRY
3027 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3029 GET_CURRENT_CONTEXT(ctx
);
3031 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3032 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3039 if (ctx
->ExecuteFlag
) {
3040 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3045 static void GLAPIENTRY
3046 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3050 parray
[1] = parray
[2] = 0.0F
;
3051 save_PointParameterfvEXT(pname
, parray
);
3054 static void GLAPIENTRY
3055 save_PointParameteriNV(GLenum pname
, GLint param
)
3058 parray
[0] = (GLfloat
) param
;
3059 parray
[1] = parray
[2] = 0.0F
;
3060 save_PointParameterfvEXT(pname
, parray
);
3063 static void GLAPIENTRY
3064 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3067 parray
[0] = (GLfloat
) param
[0];
3068 parray
[1] = parray
[2] = 0.0F
;
3069 save_PointParameterfvEXT(pname
, parray
);
3073 static void GLAPIENTRY
3074 save_PointSize(GLfloat size
)
3076 GET_CURRENT_CONTEXT(ctx
);
3078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3079 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3083 if (ctx
->ExecuteFlag
) {
3084 CALL_PointSize(ctx
->Exec
, (size
));
3089 static void GLAPIENTRY
3090 save_PolygonMode(GLenum face
, GLenum mode
)
3092 GET_CURRENT_CONTEXT(ctx
);
3094 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3095 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3100 if (ctx
->ExecuteFlag
) {
3101 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3106 static void GLAPIENTRY
3107 save_PolygonStipple(const GLubyte
* pattern
)
3109 GET_CURRENT_CONTEXT(ctx
);
3112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3114 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3116 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3117 pattern
, &ctx
->Unpack
);
3119 if (ctx
->ExecuteFlag
) {
3120 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3125 static void GLAPIENTRY
3126 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3128 GET_CURRENT_CONTEXT(ctx
);
3130 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3131 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3136 if (ctx
->ExecuteFlag
) {
3137 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3142 static void GLAPIENTRY
3143 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3145 GET_CURRENT_CONTEXT(ctx
);
3146 /* XXX mult by DepthMaxF here??? */
3147 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3151 static void GLAPIENTRY
3152 save_PopAttrib(void)
3154 GET_CURRENT_CONTEXT(ctx
);
3155 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3156 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3157 if (ctx
->ExecuteFlag
) {
3158 CALL_PopAttrib(ctx
->Exec
, ());
3163 static void GLAPIENTRY
3164 save_PopMatrix(void)
3166 GET_CURRENT_CONTEXT(ctx
);
3167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3168 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3169 if (ctx
->ExecuteFlag
) {
3170 CALL_PopMatrix(ctx
->Exec
, ());
3175 static void GLAPIENTRY
3178 GET_CURRENT_CONTEXT(ctx
);
3179 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3180 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3181 if (ctx
->ExecuteFlag
) {
3182 CALL_PopName(ctx
->Exec
, ());
3187 static void GLAPIENTRY
3188 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3189 const GLclampf
* priorities
)
3191 GET_CURRENT_CONTEXT(ctx
);
3193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3195 for (i
= 0; i
< num
; i
++) {
3197 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3199 n
[1].ui
= textures
[i
];
3200 n
[2].f
= priorities
[i
];
3203 if (ctx
->ExecuteFlag
) {
3204 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3209 static void GLAPIENTRY
3210 save_PushAttrib(GLbitfield mask
)
3212 GET_CURRENT_CONTEXT(ctx
);
3214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3215 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3219 if (ctx
->ExecuteFlag
) {
3220 CALL_PushAttrib(ctx
->Exec
, (mask
));
3225 static void GLAPIENTRY
3226 save_PushMatrix(void)
3228 GET_CURRENT_CONTEXT(ctx
);
3229 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3230 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3231 if (ctx
->ExecuteFlag
) {
3232 CALL_PushMatrix(ctx
->Exec
, ());
3237 static void GLAPIENTRY
3238 save_PushName(GLuint name
)
3240 GET_CURRENT_CONTEXT(ctx
);
3242 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3243 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3247 if (ctx
->ExecuteFlag
) {
3248 CALL_PushName(ctx
->Exec
, (name
));
3253 static void GLAPIENTRY
3254 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3256 GET_CURRENT_CONTEXT(ctx
);
3258 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3259 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3266 if (ctx
->ExecuteFlag
) {
3267 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3271 static void GLAPIENTRY
3272 save_RasterPos2d(GLdouble x
, GLdouble y
)
3274 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3277 static void GLAPIENTRY
3278 save_RasterPos2f(GLfloat x
, GLfloat y
)
3280 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3283 static void GLAPIENTRY
3284 save_RasterPos2i(GLint x
, GLint y
)
3286 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3289 static void GLAPIENTRY
3290 save_RasterPos2s(GLshort x
, GLshort y
)
3292 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3295 static void GLAPIENTRY
3296 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3298 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3301 static void GLAPIENTRY
3302 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3304 save_RasterPos4f(x
, y
, z
, 1.0F
);
3307 static void GLAPIENTRY
3308 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3310 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3313 static void GLAPIENTRY
3314 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3316 save_RasterPos4f(x
, y
, z
, 1.0F
);
3319 static void GLAPIENTRY
3320 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3322 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3325 static void GLAPIENTRY
3326 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3328 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3331 static void GLAPIENTRY
3332 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3334 save_RasterPos4f(x
, y
, z
, w
);
3337 static void GLAPIENTRY
3338 save_RasterPos2dv(const GLdouble
* v
)
3340 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3343 static void GLAPIENTRY
3344 save_RasterPos2fv(const GLfloat
* v
)
3346 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3349 static void GLAPIENTRY
3350 save_RasterPos2iv(const GLint
* v
)
3352 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3355 static void GLAPIENTRY
3356 save_RasterPos2sv(const GLshort
* v
)
3358 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3361 static void GLAPIENTRY
3362 save_RasterPos3dv(const GLdouble
* v
)
3364 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3367 static void GLAPIENTRY
3368 save_RasterPos3fv(const GLfloat
* v
)
3370 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3373 static void GLAPIENTRY
3374 save_RasterPos3iv(const GLint
* v
)
3376 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3379 static void GLAPIENTRY
3380 save_RasterPos3sv(const GLshort
* v
)
3382 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3385 static void GLAPIENTRY
3386 save_RasterPos4dv(const GLdouble
* v
)
3388 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3389 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3392 static void GLAPIENTRY
3393 save_RasterPos4fv(const GLfloat
* v
)
3395 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3398 static void GLAPIENTRY
3399 save_RasterPos4iv(const GLint
* v
)
3401 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3402 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3405 static void GLAPIENTRY
3406 save_RasterPos4sv(const GLshort
* v
)
3408 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3412 static void GLAPIENTRY
3413 save_PassThrough(GLfloat token
)
3415 GET_CURRENT_CONTEXT(ctx
);
3417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3418 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3422 if (ctx
->ExecuteFlag
) {
3423 CALL_PassThrough(ctx
->Exec
, (token
));
3428 static void GLAPIENTRY
3429 save_ReadBuffer(GLenum mode
)
3431 GET_CURRENT_CONTEXT(ctx
);
3433 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3434 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3438 if (ctx
->ExecuteFlag
) {
3439 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3444 static void GLAPIENTRY
3445 save_ResetHistogram(GLenum target
)
3447 GET_CURRENT_CONTEXT(ctx
);
3449 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3450 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3454 if (ctx
->ExecuteFlag
) {
3455 CALL_ResetHistogram(ctx
->Exec
, (target
));
3460 static void GLAPIENTRY
3461 save_ResetMinmax(GLenum target
)
3463 GET_CURRENT_CONTEXT(ctx
);
3465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3466 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3470 if (ctx
->ExecuteFlag
) {
3471 CALL_ResetMinmax(ctx
->Exec
, (target
));
3476 static void GLAPIENTRY
3477 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3479 GET_CURRENT_CONTEXT(ctx
);
3481 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3482 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3489 if (ctx
->ExecuteFlag
) {
3490 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3495 static void GLAPIENTRY
3496 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3498 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3502 static void GLAPIENTRY
3503 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3505 GET_CURRENT_CONTEXT(ctx
);
3507 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3508 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3514 if (ctx
->ExecuteFlag
) {
3515 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3520 static void GLAPIENTRY
3521 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3523 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3527 static void GLAPIENTRY
3528 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3530 GET_CURRENT_CONTEXT(ctx
);
3532 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3533 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3540 if (ctx
->ExecuteFlag
) {
3541 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3546 static void GLAPIENTRY
3547 save_ShadeModel(GLenum mode
)
3549 GET_CURRENT_CONTEXT(ctx
);
3551 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3553 if (ctx
->ExecuteFlag
) {
3554 CALL_ShadeModel(ctx
->Exec
, (mode
));
3557 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3560 SAVE_FLUSH_VERTICES(ctx
);
3562 /* Only save the value if we know the statechange will take effect:
3564 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3565 ctx
->ListState
.Current
.ShadeModel
= mode
;
3567 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3574 static void GLAPIENTRY
3575 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3577 GET_CURRENT_CONTEXT(ctx
);
3579 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3580 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3586 if (ctx
->ExecuteFlag
) {
3587 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3592 static void GLAPIENTRY
3593 save_StencilMask(GLuint mask
)
3595 GET_CURRENT_CONTEXT(ctx
);
3597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3598 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3602 if (ctx
->ExecuteFlag
) {
3603 CALL_StencilMask(ctx
->Exec
, (mask
));
3608 static void GLAPIENTRY
3609 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3611 GET_CURRENT_CONTEXT(ctx
);
3613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3614 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3620 if (ctx
->ExecuteFlag
) {
3621 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3626 static void GLAPIENTRY
3627 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3629 GET_CURRENT_CONTEXT(ctx
);
3631 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3632 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3639 if (ctx
->ExecuteFlag
) {
3640 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3645 static void GLAPIENTRY
3646 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3649 GET_CURRENT_CONTEXT(ctx
);
3651 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3653 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3661 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3668 if (ctx
->ExecuteFlag
) {
3669 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3670 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3675 static void GLAPIENTRY
3676 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3678 GET_CURRENT_CONTEXT(ctx
);
3680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3681 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3686 if (ctx
->ExecuteFlag
) {
3687 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3692 static void GLAPIENTRY
3693 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3695 GET_CURRENT_CONTEXT(ctx
);
3697 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3698 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3705 if (ctx
->ExecuteFlag
) {
3706 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3711 static void GLAPIENTRY
3712 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3714 GET_CURRENT_CONTEXT(ctx
);
3716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3717 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3721 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3729 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3732 if (ctx
->ExecuteFlag
) {
3733 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3738 static void GLAPIENTRY
3739 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3742 parray
[0] = (GLfloat
) param
;
3743 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3744 save_TexEnvfv(target
, pname
, parray
);
3748 static void GLAPIENTRY
3749 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3752 p
[0] = (GLfloat
) param
;
3753 p
[1] = p
[2] = p
[3] = 0.0;
3754 save_TexEnvfv(target
, pname
, p
);
3758 static void GLAPIENTRY
3759 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3762 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3763 p
[0] = INT_TO_FLOAT(param
[0]);
3764 p
[1] = INT_TO_FLOAT(param
[1]);
3765 p
[2] = INT_TO_FLOAT(param
[2]);
3766 p
[3] = INT_TO_FLOAT(param
[3]);
3769 p
[0] = (GLfloat
) param
[0];
3770 p
[1] = p
[2] = p
[3] = 0.0F
;
3772 save_TexEnvfv(target
, pname
, p
);
3776 static void GLAPIENTRY
3777 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3779 GET_CURRENT_CONTEXT(ctx
);
3781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3782 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3791 if (ctx
->ExecuteFlag
) {
3792 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3797 static void GLAPIENTRY
3798 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3801 p
[0] = (GLfloat
) params
[0];
3802 p
[1] = (GLfloat
) params
[1];
3803 p
[2] = (GLfloat
) params
[2];
3804 p
[3] = (GLfloat
) params
[3];
3805 save_TexGenfv(coord
, pname
, p
);
3809 static void GLAPIENTRY
3810 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3813 parray
[0] = (GLfloat
) param
;
3814 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3815 save_TexGenfv(coord
, pname
, parray
);
3819 static void GLAPIENTRY
3820 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3823 p
[0] = (GLfloat
) params
[0];
3824 p
[1] = (GLfloat
) params
[1];
3825 p
[2] = (GLfloat
) params
[2];
3826 p
[3] = (GLfloat
) params
[3];
3827 save_TexGenfv(coord
, pname
, p
);
3831 static void GLAPIENTRY
3832 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3836 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3837 save_TexGenfv(coord
, pname
, parray
);
3841 static void GLAPIENTRY
3842 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3846 parray
[1] = parray
[2] = parray
[3] = 0;
3847 save_TexGeniv(coord
, pname
, parray
);
3851 static void GLAPIENTRY
3852 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3854 GET_CURRENT_CONTEXT(ctx
);
3856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3857 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3866 if (ctx
->ExecuteFlag
) {
3867 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3872 static void GLAPIENTRY
3873 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3877 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3878 save_TexParameterfv(target
, pname
, parray
);
3882 static void GLAPIENTRY
3883 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3886 fparam
[0] = (GLfloat
) param
;
3887 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3888 save_TexParameterfv(target
, pname
, fparam
);
3892 static void GLAPIENTRY
3893 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3896 fparam
[0] = (GLfloat
) params
[0];
3897 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3898 save_TexParameterfv(target
, pname
, fparam
);
3902 static void GLAPIENTRY
3903 save_TexImage1D(GLenum target
,
3904 GLint level
, GLint components
,
3905 GLsizei width
, GLint border
,
3906 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3908 GET_CURRENT_CONTEXT(ctx
);
3909 if (target
== GL_PROXY_TEXTURE_1D
) {
3910 /* don't compile, execute immediately */
3911 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3912 border
, format
, type
, pixels
));
3916 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3917 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3921 n
[3].i
= components
;
3922 n
[4].i
= (GLint
) width
;
3926 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3927 pixels
, &ctx
->Unpack
);
3929 if (ctx
->ExecuteFlag
) {
3930 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3931 border
, format
, type
, pixels
));
3937 static void GLAPIENTRY
3938 save_TexImage2D(GLenum target
,
3939 GLint level
, GLint components
,
3940 GLsizei width
, GLsizei height
, GLint border
,
3941 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3943 GET_CURRENT_CONTEXT(ctx
);
3944 if (target
== GL_PROXY_TEXTURE_2D
) {
3945 /* don't compile, execute immediately */
3946 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3947 height
, border
, format
, type
, pixels
));
3951 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3952 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3956 n
[3].i
= components
;
3957 n
[4].i
= (GLint
) width
;
3958 n
[5].i
= (GLint
) height
;
3962 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3963 pixels
, &ctx
->Unpack
);
3965 if (ctx
->ExecuteFlag
) {
3966 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3967 height
, border
, format
, type
, pixels
));
3973 static void GLAPIENTRY
3974 save_TexImage3D(GLenum target
,
3975 GLint level
, GLint internalFormat
,
3976 GLsizei width
, GLsizei height
, GLsizei depth
,
3978 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3980 GET_CURRENT_CONTEXT(ctx
);
3981 if (target
== GL_PROXY_TEXTURE_3D
) {
3982 /* don't compile, execute immediately */
3983 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3984 height
, depth
, border
, format
, type
,
3989 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3990 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3994 n
[3].i
= (GLint
) internalFormat
;
3995 n
[4].i
= (GLint
) width
;
3996 n
[5].i
= (GLint
) height
;
3997 n
[6].i
= (GLint
) depth
;
4001 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4002 pixels
, &ctx
->Unpack
);
4004 if (ctx
->ExecuteFlag
) {
4005 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
4006 height
, depth
, border
, format
, type
,
4013 static void GLAPIENTRY
4014 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
4015 GLsizei width
, GLenum format
, GLenum type
,
4016 const GLvoid
* pixels
)
4018 GET_CURRENT_CONTEXT(ctx
);
4021 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4023 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4028 n
[4].i
= (GLint
) width
;
4031 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4032 pixels
, &ctx
->Unpack
);
4034 if (ctx
->ExecuteFlag
) {
4035 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4036 format
, type
, pixels
));
4041 static void GLAPIENTRY
4042 save_TexSubImage2D(GLenum target
, GLint level
,
4043 GLint xoffset
, GLint yoffset
,
4044 GLsizei width
, GLsizei height
,
4045 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4047 GET_CURRENT_CONTEXT(ctx
);
4050 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4052 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4058 n
[5].i
= (GLint
) width
;
4059 n
[6].i
= (GLint
) height
;
4062 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4063 pixels
, &ctx
->Unpack
);
4065 if (ctx
->ExecuteFlag
) {
4066 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4067 width
, height
, format
, type
, pixels
));
4072 static void GLAPIENTRY
4073 save_TexSubImage3D(GLenum target
, GLint level
,
4074 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4075 GLsizei width
, GLsizei height
, GLsizei depth
,
4076 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4078 GET_CURRENT_CONTEXT(ctx
);
4081 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4083 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4090 n
[6].i
= (GLint
) width
;
4091 n
[7].i
= (GLint
) height
;
4092 n
[8].i
= (GLint
) depth
;
4095 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4096 pixels
, &ctx
->Unpack
);
4098 if (ctx
->ExecuteFlag
) {
4099 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4100 xoffset
, yoffset
, zoffset
,
4101 width
, height
, depth
, format
, type
,
4107 static void GLAPIENTRY
4108 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4110 GET_CURRENT_CONTEXT(ctx
);
4112 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4113 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4119 if (ctx
->ExecuteFlag
) {
4120 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4125 static void GLAPIENTRY
4126 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4128 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4133 static void GLAPIENTRY
4134 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4136 GET_CURRENT_CONTEXT(ctx
);
4138 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4139 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4143 n
[3].i
= (GLint
) width
;
4144 n
[4].i
= (GLint
) height
;
4146 if (ctx
->ExecuteFlag
) {
4147 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4152 static void GLAPIENTRY
4153 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4155 GET_CURRENT_CONTEXT(ctx
);
4157 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4158 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4165 if (ctx
->ExecuteFlag
) {
4166 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4170 static void GLAPIENTRY
4171 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4173 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4176 static void GLAPIENTRY
4177 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4179 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4182 static void GLAPIENTRY
4183 save_WindowPos2iMESA(GLint x
, GLint y
)
4185 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4188 static void GLAPIENTRY
4189 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4191 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4194 static void GLAPIENTRY
4195 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4197 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4200 static void GLAPIENTRY
4201 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4203 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4206 static void GLAPIENTRY
4207 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4209 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4212 static void GLAPIENTRY
4213 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4215 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4218 static void GLAPIENTRY
4219 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4221 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4224 static void GLAPIENTRY
4225 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4227 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4230 static void GLAPIENTRY
4231 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4233 save_WindowPos4fMESA(x
, y
, z
, w
);
4236 static void GLAPIENTRY
4237 save_WindowPos2dvMESA(const GLdouble
* v
)
4239 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4242 static void GLAPIENTRY
4243 save_WindowPos2fvMESA(const GLfloat
* v
)
4245 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4248 static void GLAPIENTRY
4249 save_WindowPos2ivMESA(const GLint
* v
)
4251 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4254 static void GLAPIENTRY
4255 save_WindowPos2svMESA(const GLshort
* v
)
4257 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4260 static void GLAPIENTRY
4261 save_WindowPos3dvMESA(const GLdouble
* v
)
4263 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4266 static void GLAPIENTRY
4267 save_WindowPos3fvMESA(const GLfloat
* v
)
4269 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4272 static void GLAPIENTRY
4273 save_WindowPos3ivMESA(const GLint
* v
)
4275 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4278 static void GLAPIENTRY
4279 save_WindowPos3svMESA(const GLshort
* v
)
4281 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4284 static void GLAPIENTRY
4285 save_WindowPos4dvMESA(const GLdouble
* v
)
4287 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4288 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4291 static void GLAPIENTRY
4292 save_WindowPos4fvMESA(const GLfloat
* v
)
4294 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4297 static void GLAPIENTRY
4298 save_WindowPos4ivMESA(const GLint
* v
)
4300 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4301 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4304 static void GLAPIENTRY
4305 save_WindowPos4svMESA(const GLshort
* v
)
4307 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4312 /* GL_ARB_multitexture */
4313 static void GLAPIENTRY
4314 save_ActiveTextureARB(GLenum target
)
4316 GET_CURRENT_CONTEXT(ctx
);
4318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4319 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4323 if (ctx
->ExecuteFlag
) {
4324 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4329 /* GL_ARB_transpose_matrix */
4331 static void GLAPIENTRY
4332 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4335 _math_transposefd(tm
, m
);
4336 save_LoadMatrixf(tm
);
4340 static void GLAPIENTRY
4341 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4344 _math_transposef(tm
, m
);
4345 save_LoadMatrixf(tm
);
4349 static void GLAPIENTRY
4350 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4353 _math_transposefd(tm
, m
);
4354 save_MultMatrixf(tm
);
4358 static void GLAPIENTRY
4359 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4362 _math_transposef(tm
, m
);
4363 save_MultMatrixf(tm
);
4367 /* GL_ARB_texture_compression */
4368 static void GLAPIENTRY
4369 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4370 GLenum internalFormat
, GLsizei width
,
4371 GLint border
, GLsizei imageSize
,
4372 const GLvoid
* data
)
4374 GET_CURRENT_CONTEXT(ctx
);
4375 if (target
== GL_PROXY_TEXTURE_1D
) {
4376 /* don't compile, execute immediately */
4377 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4378 width
, border
, imageSize
,
4384 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4385 /* make copy of image */
4386 image
= _mesa_malloc(imageSize
);
4388 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4391 MEMCPY(image
, data
, imageSize
);
4392 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4396 n
[3].e
= internalFormat
;
4397 n
[4].i
= (GLint
) width
;
4405 if (ctx
->ExecuteFlag
) {
4406 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4407 (target
, level
, internalFormat
, width
,
4408 border
, imageSize
, data
));
4414 static void GLAPIENTRY
4415 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4416 GLenum internalFormat
, GLsizei width
,
4417 GLsizei height
, GLint border
, GLsizei imageSize
,
4418 const GLvoid
* data
)
4420 GET_CURRENT_CONTEXT(ctx
);
4421 if (target
== GL_PROXY_TEXTURE_2D
) {
4422 /* don't compile, execute immediately */
4423 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4424 width
, height
, border
,
4430 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4431 /* make copy of image */
4432 image
= _mesa_malloc(imageSize
);
4434 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4437 MEMCPY(image
, data
, imageSize
);
4438 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4442 n
[3].e
= internalFormat
;
4443 n
[4].i
= (GLint
) width
;
4444 n
[5].i
= (GLint
) height
;
4452 if (ctx
->ExecuteFlag
) {
4453 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4454 (target
, level
, internalFormat
, width
,
4455 height
, border
, imageSize
, data
));
4461 static void GLAPIENTRY
4462 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4463 GLenum internalFormat
, GLsizei width
,
4464 GLsizei height
, GLsizei depth
, GLint border
,
4465 GLsizei imageSize
, const GLvoid
* data
)
4467 GET_CURRENT_CONTEXT(ctx
);
4468 if (target
== GL_PROXY_TEXTURE_3D
) {
4469 /* don't compile, execute immediately */
4470 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4471 width
, height
, depth
, border
,
4477 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4478 /* make copy of image */
4479 image
= _mesa_malloc(imageSize
);
4481 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4484 MEMCPY(image
, data
, imageSize
);
4485 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4489 n
[3].e
= internalFormat
;
4490 n
[4].i
= (GLint
) width
;
4491 n
[5].i
= (GLint
) height
;
4492 n
[6].i
= (GLint
) depth
;
4500 if (ctx
->ExecuteFlag
) {
4501 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4502 (target
, level
, internalFormat
, width
,
4503 height
, depth
, border
, imageSize
,
4510 static void GLAPIENTRY
4511 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4512 GLsizei width
, GLenum format
,
4513 GLsizei imageSize
, const GLvoid
* data
)
4518 GET_CURRENT_CONTEXT(ctx
);
4519 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4521 /* make copy of image */
4522 image
= _mesa_malloc(imageSize
);
4524 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4527 MEMCPY(image
, data
, imageSize
);
4528 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4533 n
[4].i
= (GLint
) width
;
4541 if (ctx
->ExecuteFlag
) {
4542 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4543 width
, format
, imageSize
,
4549 static void GLAPIENTRY
4550 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4551 GLint yoffset
, GLsizei width
, GLsizei height
,
4552 GLenum format
, GLsizei imageSize
,
4553 const GLvoid
* data
)
4558 GET_CURRENT_CONTEXT(ctx
);
4559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4561 /* make copy of image */
4562 image
= _mesa_malloc(imageSize
);
4564 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4567 MEMCPY(image
, data
, imageSize
);
4568 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4574 n
[5].i
= (GLint
) width
;
4575 n
[6].i
= (GLint
) height
;
4583 if (ctx
->ExecuteFlag
) {
4584 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4585 (target
, level
, xoffset
, yoffset
, width
,
4586 height
, format
, imageSize
, data
));
4591 static void GLAPIENTRY
4592 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4593 GLint yoffset
, GLint zoffset
, GLsizei width
,
4594 GLsizei height
, GLsizei depth
, GLenum format
,
4595 GLsizei imageSize
, const GLvoid
* data
)
4600 GET_CURRENT_CONTEXT(ctx
);
4601 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4603 /* make copy of image */
4604 image
= _mesa_malloc(imageSize
);
4606 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4609 MEMCPY(image
, data
, imageSize
);
4610 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4617 n
[6].i
= (GLint
) width
;
4618 n
[7].i
= (GLint
) height
;
4619 n
[8].i
= (GLint
) depth
;
4621 n
[10].i
= imageSize
;
4627 if (ctx
->ExecuteFlag
) {
4628 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4629 (target
, level
, xoffset
, yoffset
,
4630 zoffset
, width
, height
, depth
, format
,
4636 /* GL_ARB_multisample */
4637 static void GLAPIENTRY
4638 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4640 GET_CURRENT_CONTEXT(ctx
);
4642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4643 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4655 * GL_NV_vertex_program
4657 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4658 static void GLAPIENTRY
4659 save_BindProgramNV(GLenum target
, GLuint id
)
4661 GET_CURRENT_CONTEXT(ctx
);
4663 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4664 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4669 if (ctx
->ExecuteFlag
) {
4670 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4674 static void GLAPIENTRY
4675 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4676 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4678 GET_CURRENT_CONTEXT(ctx
);
4680 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4681 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4690 if (ctx
->ExecuteFlag
) {
4691 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4696 static void GLAPIENTRY
4697 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4698 const GLfloat
*params
)
4700 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4701 params
[2], params
[3]);
4705 static void GLAPIENTRY
4706 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4707 const GLfloat
* params
)
4709 GET_CURRENT_CONTEXT(ctx
);
4711 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4715 const GLfloat
* p
= params
;
4717 for (i
= 0 ; i
< count
; i
++) {
4718 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4731 if (ctx
->ExecuteFlag
) {
4732 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4737 static void GLAPIENTRY
4738 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4739 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4741 save_ProgramEnvParameter4fARB(target
, index
,
4743 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4747 static void GLAPIENTRY
4748 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4749 const GLdouble
*params
)
4751 save_ProgramEnvParameter4fARB(target
, index
,
4752 (GLfloat
) params
[0],
4753 (GLfloat
) params
[1],
4754 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4757 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4759 #if FEATURE_NV_vertex_program
4760 static void GLAPIENTRY
4761 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4763 GET_CURRENT_CONTEXT(ctx
);
4765 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4766 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4775 if (ctx
->ExecuteFlag
) {
4776 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4781 static void GLAPIENTRY
4782 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4783 GLuint num
, const GLdouble
*params
)
4786 for (i
= 0; i
< num
; i
++) {
4787 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4792 static void GLAPIENTRY
4793 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4794 GLuint num
, const GLfloat
*params
)
4797 for (i
= 0; i
< num
; i
++) {
4798 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4803 static void GLAPIENTRY
4804 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4805 const GLubyte
* program
)
4807 GET_CURRENT_CONTEXT(ctx
);
4810 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4812 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4814 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4816 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4819 _mesa_memcpy(programCopy
, program
, len
);
4823 n
[4].data
= programCopy
;
4825 if (ctx
->ExecuteFlag
) {
4826 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4831 static void GLAPIENTRY
4832 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4834 GET_CURRENT_CONTEXT(ctx
);
4837 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4839 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4841 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4843 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4846 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4850 if (ctx
->ExecuteFlag
) {
4851 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4856 static void GLAPIENTRY
4857 save_TrackMatrixNV(GLenum target
, GLuint address
,
4858 GLenum matrix
, GLenum transform
)
4860 GET_CURRENT_CONTEXT(ctx
);
4862 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4863 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4870 if (ctx
->ExecuteFlag
) {
4871 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4874 #endif /* FEATURE_NV_vertex_program */
4878 * GL_NV_fragment_program
4880 #if FEATURE_NV_fragment_program
4881 static void GLAPIENTRY
4882 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4883 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4885 GET_CURRENT_CONTEXT(ctx
);
4887 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4888 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4897 if (ctx
->ExecuteFlag
) {
4898 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4903 static void GLAPIENTRY
4904 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4905 const GLfloat
*params
)
4907 GET_CURRENT_CONTEXT(ctx
);
4909 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4910 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4919 if (ctx
->ExecuteFlag
) {
4920 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4925 static void GLAPIENTRY
4926 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4927 const GLfloat
*params
)
4929 GET_CURRENT_CONTEXT(ctx
);
4931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4935 const GLfloat
* p
= params
;
4937 for (i
= 0 ; i
< count
; i
++) {
4938 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4951 if (ctx
->ExecuteFlag
) {
4952 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4957 static void GLAPIENTRY
4958 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4959 GLdouble x
, GLdouble y
,
4960 GLdouble z
, GLdouble w
)
4962 GET_CURRENT_CONTEXT(ctx
);
4964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4965 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4969 n
[3].f
= (GLfloat
) x
;
4970 n
[4].f
= (GLfloat
) y
;
4971 n
[5].f
= (GLfloat
) z
;
4972 n
[6].f
= (GLfloat
) w
;
4974 if (ctx
->ExecuteFlag
) {
4975 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4980 static void GLAPIENTRY
4981 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4982 const GLdouble
*params
)
4984 GET_CURRENT_CONTEXT(ctx
);
4986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4987 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4991 n
[3].f
= (GLfloat
) params
[0];
4992 n
[4].f
= (GLfloat
) params
[1];
4993 n
[5].f
= (GLfloat
) params
[2];
4994 n
[6].f
= (GLfloat
) params
[3];
4996 if (ctx
->ExecuteFlag
) {
4997 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
5001 static void GLAPIENTRY
5002 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5003 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5005 GET_CURRENT_CONTEXT(ctx
);
5008 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5010 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
5012 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
5014 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
5017 _mesa_memcpy(nameCopy
, name
, len
);
5020 n
[3].data
= nameCopy
;
5026 if (ctx
->ExecuteFlag
) {
5027 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5032 static void GLAPIENTRY
5033 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5036 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5040 static void GLAPIENTRY
5041 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5042 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5044 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5045 (GLfloat
) z
, (GLfloat
) w
);
5049 static void GLAPIENTRY
5050 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5053 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5054 (GLfloat
) v
[1], (GLfloat
) v
[2],
5058 #endif /* FEATURE_NV_fragment_program */
5062 /* GL_EXT_stencil_two_side */
5063 static void GLAPIENTRY
5064 save_ActiveStencilFaceEXT(GLenum face
)
5066 GET_CURRENT_CONTEXT(ctx
);
5068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5069 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5073 if (ctx
->ExecuteFlag
) {
5074 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5079 /* GL_EXT_depth_bounds_test */
5080 static void GLAPIENTRY
5081 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5083 GET_CURRENT_CONTEXT(ctx
);
5085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5086 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5088 n
[1].f
= (GLfloat
) zmin
;
5089 n
[2].f
= (GLfloat
) zmax
;
5091 if (ctx
->ExecuteFlag
) {
5092 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5098 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5100 static void GLAPIENTRY
5101 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5102 const GLvoid
* string
)
5104 GET_CURRENT_CONTEXT(ctx
);
5107 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5109 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5111 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
5113 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5116 _mesa_memcpy(programCopy
, string
, len
);
5120 n
[4].data
= programCopy
;
5122 if (ctx
->ExecuteFlag
) {
5123 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5127 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5130 #if FEATURE_queryobj
5132 static void GLAPIENTRY
5133 save_BeginQueryARB(GLenum target
, GLuint id
)
5135 GET_CURRENT_CONTEXT(ctx
);
5137 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5138 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5143 if (ctx
->ExecuteFlag
) {
5144 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5149 static void GLAPIENTRY
5150 save_EndQueryARB(GLenum target
)
5152 GET_CURRENT_CONTEXT(ctx
);
5154 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5155 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5159 if (ctx
->ExecuteFlag
) {
5160 CALL_EndQueryARB(ctx
->Exec
, (target
));
5164 #endif /* FEATURE_queryobj */
5167 static void GLAPIENTRY
5168 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5170 GET_CURRENT_CONTEXT(ctx
);
5172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5173 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5177 if (count
> MAX_DRAW_BUFFERS
)
5178 count
= MAX_DRAW_BUFFERS
;
5179 for (i
= 0; i
< count
; i
++) {
5180 n
[2 + i
].e
= buffers
[i
];
5183 if (ctx
->ExecuteFlag
) {
5184 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5188 static void GLAPIENTRY
5189 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5191 GET_CURRENT_CONTEXT(ctx
);
5194 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5202 if (ctx
->ExecuteFlag
) {
5203 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5207 static void GLAPIENTRY
5208 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5211 p
[0] = INT_TO_FLOAT(param
[0]);
5212 p
[1] = INT_TO_FLOAT(param
[1]);
5213 p
[2] = INT_TO_FLOAT(param
[2]);
5214 p
[3] = INT_TO_FLOAT(param
[3]);
5215 save_TexBumpParameterfvATI(pname
, p
);
5218 #if FEATURE_ATI_fragment_shader
5219 static void GLAPIENTRY
5220 save_BindFragmentShaderATI(GLuint id
)
5222 GET_CURRENT_CONTEXT(ctx
);
5225 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5229 if (ctx
->ExecuteFlag
) {
5230 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5234 static void GLAPIENTRY
5235 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5237 GET_CURRENT_CONTEXT(ctx
);
5240 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5248 if (ctx
->ExecuteFlag
) {
5249 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5255 save_Attr1fNV(GLenum attr
, GLfloat x
)
5257 GET_CURRENT_CONTEXT(ctx
);
5259 SAVE_FLUSH_VERTICES(ctx
);
5260 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5266 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5267 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5268 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5270 if (ctx
->ExecuteFlag
) {
5271 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5276 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5278 GET_CURRENT_CONTEXT(ctx
);
5280 SAVE_FLUSH_VERTICES(ctx
);
5281 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5288 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5289 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5290 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5292 if (ctx
->ExecuteFlag
) {
5293 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5298 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5300 GET_CURRENT_CONTEXT(ctx
);
5302 SAVE_FLUSH_VERTICES(ctx
);
5303 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5311 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5312 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5313 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5315 if (ctx
->ExecuteFlag
) {
5316 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5321 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5323 GET_CURRENT_CONTEXT(ctx
);
5325 SAVE_FLUSH_VERTICES(ctx
);
5326 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5335 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5336 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5337 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5339 if (ctx
->ExecuteFlag
) {
5340 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5346 save_Attr1fARB(GLenum attr
, GLfloat x
)
5348 GET_CURRENT_CONTEXT(ctx
);
5350 SAVE_FLUSH_VERTICES(ctx
);
5351 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5357 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5358 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5359 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5361 if (ctx
->ExecuteFlag
) {
5362 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5367 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5369 GET_CURRENT_CONTEXT(ctx
);
5371 SAVE_FLUSH_VERTICES(ctx
);
5372 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5379 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5380 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5381 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5383 if (ctx
->ExecuteFlag
) {
5384 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5389 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5391 GET_CURRENT_CONTEXT(ctx
);
5393 SAVE_FLUSH_VERTICES(ctx
);
5394 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5402 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5403 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5404 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5406 if (ctx
->ExecuteFlag
) {
5407 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5412 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5414 GET_CURRENT_CONTEXT(ctx
);
5416 SAVE_FLUSH_VERTICES(ctx
);
5417 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5426 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5427 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5428 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5430 if (ctx
->ExecuteFlag
) {
5431 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5436 static void GLAPIENTRY
5437 save_EvalCoord1f(GLfloat x
)
5439 GET_CURRENT_CONTEXT(ctx
);
5441 SAVE_FLUSH_VERTICES(ctx
);
5442 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5446 if (ctx
->ExecuteFlag
) {
5447 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5451 static void GLAPIENTRY
5452 save_EvalCoord1fv(const GLfloat
* v
)
5454 save_EvalCoord1f(v
[0]);
5457 static void GLAPIENTRY
5458 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5460 GET_CURRENT_CONTEXT(ctx
);
5462 SAVE_FLUSH_VERTICES(ctx
);
5463 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5468 if (ctx
->ExecuteFlag
) {
5469 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5473 static void GLAPIENTRY
5474 save_EvalCoord2fv(const GLfloat
* v
)
5476 save_EvalCoord2f(v
[0], v
[1]);
5480 static void GLAPIENTRY
5481 save_EvalPoint1(GLint x
)
5483 GET_CURRENT_CONTEXT(ctx
);
5485 SAVE_FLUSH_VERTICES(ctx
);
5486 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5490 if (ctx
->ExecuteFlag
) {
5491 CALL_EvalPoint1(ctx
->Exec
, (x
));
5495 static void GLAPIENTRY
5496 save_EvalPoint2(GLint x
, GLint y
)
5498 GET_CURRENT_CONTEXT(ctx
);
5500 SAVE_FLUSH_VERTICES(ctx
);
5501 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5506 if (ctx
->ExecuteFlag
) {
5507 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5511 static void GLAPIENTRY
5512 save_Indexf(GLfloat x
)
5514 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5517 static void GLAPIENTRY
5518 save_Indexfv(const GLfloat
* v
)
5520 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5523 static void GLAPIENTRY
5524 save_EdgeFlag(GLboolean x
)
5526 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5529 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5533 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5537 static void GLAPIENTRY
5538 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5540 GET_CURRENT_CONTEXT(ctx
);
5548 case GL_FRONT_AND_BACK
:
5551 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5560 case GL_AMBIENT_AND_DIFFUSE
:
5566 case GL_COLOR_INDEXES
:
5570 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5574 if (ctx
->ExecuteFlag
) {
5575 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5578 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5580 /* Try to eliminate redundant statechanges. Because it is legal to
5581 * call glMaterial even inside begin/end calls, don't need to worry
5582 * about ctx->Driver.CurrentSavePrimitive here.
5584 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5585 if (bitmask
& (1 << i
)) {
5586 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5587 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5588 bitmask
&= ~(1 << i
);
5591 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5592 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5597 /* If this call has effect, return early:
5602 SAVE_FLUSH_VERTICES(ctx
);
5604 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5608 for (i
= 0; i
< args
; i
++)
5609 n
[3 + i
].f
= param
[i
];
5613 static void GLAPIENTRY
5614 save_Begin(GLenum mode
)
5616 GET_CURRENT_CONTEXT(ctx
);
5618 GLboolean error
= GL_FALSE
;
5620 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5621 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5624 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5625 /* Typically the first begin. This may raise an error on
5626 * playback, depending on whether CallList is issued from inside
5627 * a begin/end or not.
5629 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5631 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5632 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5635 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5640 /* Give the driver an opportunity to hook in an optimized
5641 * display list compiler.
5643 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5646 SAVE_FLUSH_VERTICES(ctx
);
5647 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5653 if (ctx
->ExecuteFlag
) {
5654 CALL_Begin(ctx
->Exec
, (mode
));
5658 static void GLAPIENTRY
5661 GET_CURRENT_CONTEXT(ctx
);
5662 SAVE_FLUSH_VERTICES(ctx
);
5663 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5664 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5665 if (ctx
->ExecuteFlag
) {
5666 CALL_End(ctx
->Exec
, ());
5670 static void GLAPIENTRY
5671 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5673 GET_CURRENT_CONTEXT(ctx
);
5675 SAVE_FLUSH_VERTICES(ctx
);
5676 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5683 if (ctx
->ExecuteFlag
) {
5684 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5689 static void GLAPIENTRY
5690 save_Vertex2f(GLfloat x
, GLfloat y
)
5692 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5695 static void GLAPIENTRY
5696 save_Vertex2fv(const GLfloat
* v
)
5698 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5701 static void GLAPIENTRY
5702 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5704 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5707 static void GLAPIENTRY
5708 save_Vertex3fv(const GLfloat
* v
)
5710 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5713 static void GLAPIENTRY
5714 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5716 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5719 static void GLAPIENTRY
5720 save_Vertex4fv(const GLfloat
* v
)
5722 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5725 static void GLAPIENTRY
5726 save_TexCoord1f(GLfloat x
)
5728 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5731 static void GLAPIENTRY
5732 save_TexCoord1fv(const GLfloat
* v
)
5734 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5737 static void GLAPIENTRY
5738 save_TexCoord2f(GLfloat x
, GLfloat y
)
5740 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5743 static void GLAPIENTRY
5744 save_TexCoord2fv(const GLfloat
* v
)
5746 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5749 static void GLAPIENTRY
5750 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5752 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5755 static void GLAPIENTRY
5756 save_TexCoord3fv(const GLfloat
* v
)
5758 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5761 static void GLAPIENTRY
5762 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5764 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5767 static void GLAPIENTRY
5768 save_TexCoord4fv(const GLfloat
* v
)
5770 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5773 static void GLAPIENTRY
5774 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5776 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5779 static void GLAPIENTRY
5780 save_Normal3fv(const GLfloat
* v
)
5782 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5785 static void GLAPIENTRY
5786 save_FogCoordfEXT(GLfloat x
)
5788 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5791 static void GLAPIENTRY
5792 save_FogCoordfvEXT(const GLfloat
* v
)
5794 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5797 static void GLAPIENTRY
5798 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5800 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5803 static void GLAPIENTRY
5804 save_Color3fv(const GLfloat
* v
)
5806 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5809 static void GLAPIENTRY
5810 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5812 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5815 static void GLAPIENTRY
5816 save_Color4fv(const GLfloat
* v
)
5818 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5821 static void GLAPIENTRY
5822 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5824 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5827 static void GLAPIENTRY
5828 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5830 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5834 /* Just call the respective ATTR for texcoord
5836 static void GLAPIENTRY
5837 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5839 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5840 save_Attr1fNV(attr
, x
);
5843 static void GLAPIENTRY
5844 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5846 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5847 save_Attr1fNV(attr
, v
[0]);
5850 static void GLAPIENTRY
5851 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5853 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5854 save_Attr2fNV(attr
, x
, y
);
5857 static void GLAPIENTRY
5858 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5860 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5861 save_Attr2fNV(attr
, v
[0], v
[1]);
5864 static void GLAPIENTRY
5865 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5867 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5868 save_Attr3fNV(attr
, x
, y
, z
);
5871 static void GLAPIENTRY
5872 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5874 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5875 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5878 static void GLAPIENTRY
5879 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5880 GLfloat z
, GLfloat w
)
5882 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5883 save_Attr4fNV(attr
, x
, y
, z
, w
);
5886 static void GLAPIENTRY
5887 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5889 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5890 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5895 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5901 GET_CURRENT_CONTEXT(ctx
);
5902 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5906 /* First level for NV_vertex_program:
5908 * Check for errors at compile time?.
5910 static void GLAPIENTRY
5911 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5913 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5914 save_Attr1fNV(index
, x
);
5919 static void GLAPIENTRY
5920 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5922 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5923 save_Attr1fNV(index
, v
[0]);
5928 static void GLAPIENTRY
5929 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5931 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5932 save_Attr2fNV(index
, x
, y
);
5937 static void GLAPIENTRY
5938 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5940 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5941 save_Attr2fNV(index
, v
[0], v
[1]);
5946 static void GLAPIENTRY
5947 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5949 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5950 save_Attr3fNV(index
, x
, y
, z
);
5955 static void GLAPIENTRY
5956 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5958 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5959 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5964 static void GLAPIENTRY
5965 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5966 GLfloat z
, GLfloat w
)
5968 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5969 save_Attr4fNV(index
, x
, y
, z
, w
);
5974 static void GLAPIENTRY
5975 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5977 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5978 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5986 static void GLAPIENTRY
5987 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5989 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5990 save_Attr1fARB(index
, x
);
5995 static void GLAPIENTRY
5996 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5998 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5999 save_Attr1fARB(index
, v
[0]);
6004 static void GLAPIENTRY
6005 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
6007 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6008 save_Attr2fARB(index
, x
, y
);
6013 static void GLAPIENTRY
6014 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
6016 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6017 save_Attr2fARB(index
, v
[0], v
[1]);
6022 static void GLAPIENTRY
6023 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6025 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6026 save_Attr3fARB(index
, x
, y
, z
);
6031 static void GLAPIENTRY
6032 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6034 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6035 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6040 static void GLAPIENTRY
6041 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6044 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6045 save_Attr4fARB(index
, x
, y
, z
, w
);
6050 static void GLAPIENTRY
6051 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6053 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6054 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6060 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6062 static void GLAPIENTRY
6063 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6065 GET_CURRENT_CONTEXT(ctx
);
6066 FLUSH_VERTICES(ctx
, 0);
6067 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6070 static GLint GLAPIENTRY
6071 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6073 GET_CURRENT_CONTEXT(ctx
);
6074 FLUSH_VERTICES(ctx
, 0);
6075 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6077 /* XXX more shader functions needed here */
6081 #if FEATURE_EXT_framebuffer_blit
6082 static void GLAPIENTRY
6083 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6084 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6085 GLbitfield mask
, GLenum filter
)
6087 GET_CURRENT_CONTEXT(ctx
);
6089 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6090 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6103 if (ctx
->ExecuteFlag
) {
6104 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6105 dstX0
, dstY0
, dstX1
, dstY1
,
6112 /** GL_EXT_provoking_vertex */
6113 static void GLAPIENTRY
6114 save_ProvokingVertexEXT(GLenum mode
)
6116 GET_CURRENT_CONTEXT(ctx
);
6118 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6119 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6123 if (ctx
->ExecuteFlag
) {
6124 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6125 _mesa_ProvokingVertexEXT(mode
);
6130 /* aka UseProgram() */
6131 static void GLAPIENTRY
6132 save_UseProgramObjectARB(GLhandleARB program
)
6134 GET_CURRENT_CONTEXT(ctx
);
6136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6137 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6141 if (ctx
->ExecuteFlag
) {
6142 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6147 static void GLAPIENTRY
6148 save_Uniform1fARB(GLint location
, GLfloat x
)
6150 GET_CURRENT_CONTEXT(ctx
);
6152 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6153 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6158 if (ctx
->ExecuteFlag
) {
6159 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6164 static void GLAPIENTRY
6165 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6167 GET_CURRENT_CONTEXT(ctx
);
6169 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6170 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6176 if (ctx
->ExecuteFlag
) {
6177 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6182 static void GLAPIENTRY
6183 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6185 GET_CURRENT_CONTEXT(ctx
);
6187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6188 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6195 if (ctx
->ExecuteFlag
) {
6196 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6201 static void GLAPIENTRY
6202 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6204 GET_CURRENT_CONTEXT(ctx
);
6206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6207 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6215 if (ctx
->ExecuteFlag
) {
6216 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6221 /** Return copy of memory */
6223 memdup(const void *src
, GLsizei bytes
)
6225 void *b
= bytes
>= 0 ? _mesa_malloc(bytes
) : NULL
;
6227 _mesa_memcpy(b
, src
, bytes
);
6232 static void GLAPIENTRY
6233 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6235 GET_CURRENT_CONTEXT(ctx
);
6237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6238 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6242 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6244 if (ctx
->ExecuteFlag
) {
6245 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6249 static void GLAPIENTRY
6250 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6252 GET_CURRENT_CONTEXT(ctx
);
6254 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6255 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6259 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6261 if (ctx
->ExecuteFlag
) {
6262 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6266 static void GLAPIENTRY
6267 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6269 GET_CURRENT_CONTEXT(ctx
);
6271 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6272 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6276 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6278 if (ctx
->ExecuteFlag
) {
6279 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6283 static void GLAPIENTRY
6284 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6286 GET_CURRENT_CONTEXT(ctx
);
6288 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6289 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6293 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6295 if (ctx
->ExecuteFlag
) {
6296 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6301 static void GLAPIENTRY
6302 save_Uniform1iARB(GLint location
, GLint x
)
6304 GET_CURRENT_CONTEXT(ctx
);
6306 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6307 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6312 if (ctx
->ExecuteFlag
) {
6313 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6317 static void GLAPIENTRY
6318 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6320 GET_CURRENT_CONTEXT(ctx
);
6322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6323 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6329 if (ctx
->ExecuteFlag
) {
6330 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6334 static void GLAPIENTRY
6335 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6337 GET_CURRENT_CONTEXT(ctx
);
6339 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6340 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6347 if (ctx
->ExecuteFlag
) {
6348 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6352 static void GLAPIENTRY
6353 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6355 GET_CURRENT_CONTEXT(ctx
);
6357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6358 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6366 if (ctx
->ExecuteFlag
) {
6367 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6373 static void GLAPIENTRY
6374 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6376 GET_CURRENT_CONTEXT(ctx
);
6378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6379 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6383 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6385 if (ctx
->ExecuteFlag
) {
6386 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6390 static void GLAPIENTRY
6391 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6393 GET_CURRENT_CONTEXT(ctx
);
6395 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6396 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6400 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6402 if (ctx
->ExecuteFlag
) {
6403 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6407 static void GLAPIENTRY
6408 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6410 GET_CURRENT_CONTEXT(ctx
);
6412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6413 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6417 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6419 if (ctx
->ExecuteFlag
) {
6420 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6424 static void GLAPIENTRY
6425 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6427 GET_CURRENT_CONTEXT(ctx
);
6429 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6430 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6434 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6436 if (ctx
->ExecuteFlag
) {
6437 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6442 static void GLAPIENTRY
6443 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6446 GET_CURRENT_CONTEXT(ctx
);
6448 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6449 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6454 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6456 if (ctx
->ExecuteFlag
) {
6457 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6461 static void GLAPIENTRY
6462 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6465 GET_CURRENT_CONTEXT(ctx
);
6467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6468 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6473 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6475 if (ctx
->ExecuteFlag
) {
6476 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6480 static void GLAPIENTRY
6481 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6484 GET_CURRENT_CONTEXT(ctx
);
6486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6487 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6492 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6494 if (ctx
->ExecuteFlag
) {
6495 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6500 static void GLAPIENTRY
6501 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6504 GET_CURRENT_CONTEXT(ctx
);
6506 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6507 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6512 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6514 if (ctx
->ExecuteFlag
) {
6515 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6519 static void GLAPIENTRY
6520 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6523 GET_CURRENT_CONTEXT(ctx
);
6525 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6526 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6531 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6533 if (ctx
->ExecuteFlag
) {
6534 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6539 static void GLAPIENTRY
6540 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6543 GET_CURRENT_CONTEXT(ctx
);
6545 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6546 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6551 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6553 if (ctx
->ExecuteFlag
) {
6554 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6558 static void GLAPIENTRY
6559 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6562 GET_CURRENT_CONTEXT(ctx
);
6564 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6565 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6570 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6572 if (ctx
->ExecuteFlag
) {
6573 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6578 static void GLAPIENTRY
6579 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6582 GET_CURRENT_CONTEXT(ctx
);
6584 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6585 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6590 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6592 if (ctx
->ExecuteFlag
) {
6593 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6597 static void GLAPIENTRY
6598 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6601 GET_CURRENT_CONTEXT(ctx
);
6603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6604 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6609 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6611 if (ctx
->ExecuteFlag
) {
6612 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6619 * Save an error-generating command into display list.
6621 * KW: Will appear in the list before the vertex buffer containing the
6622 * command that provoked the error. I don't see this as a problem.
6625 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6628 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6631 n
[2].data
= (void *) s
;
6637 * Compile an error into current display list.
6640 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6642 if (ctx
->CompileFlag
)
6643 save_error(ctx
, error
, s
);
6644 if (ctx
->ExecuteFlag
)
6645 _mesa_error(ctx
, error
, s
);
6650 * Test if ID names a display list.
6653 islist(GLcontext
*ctx
, GLuint list
)
6655 if (list
> 0 && lookup_list(ctx
, list
)) {
6665 /**********************************************************************/
6666 /* Display list execution */
6667 /**********************************************************************/
6671 * Execute a display list. Note that the ListBase offset must have already
6672 * been added before calling this function. I.e. the list argument is
6673 * the absolute list number, not relative to ListBase.
6674 * \param list - display list number
6677 execute_list(GLcontext
*ctx
, GLuint list
)
6679 struct gl_display_list
*dlist
;
6683 if (list
== 0 || !islist(ctx
, list
))
6686 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6687 /* raise an error? */
6691 dlist
= lookup_list(ctx
, list
);
6695 ctx
->ListState
.CallDepth
++;
6697 if (ctx
->Driver
.BeginCallList
)
6698 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6704 const OpCode opcode
= n
[0].opcode
;
6706 if (is_ext_opcode(opcode
)) {
6707 n
+= ext_opcode_execute(ctx
, n
);
6712 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6715 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6717 case OPCODE_ALPHA_FUNC
:
6718 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6720 case OPCODE_BIND_TEXTURE
:
6721 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6725 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6726 ctx
->Unpack
= ctx
->DefaultPacking
;
6727 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6728 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6729 (const GLubyte
*) n
[7].data
));
6730 ctx
->Unpack
= save
; /* restore */
6733 case OPCODE_BLEND_COLOR
:
6734 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6736 case OPCODE_BLEND_EQUATION
:
6737 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6739 case OPCODE_BLEND_EQUATION_SEPARATE
:
6740 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6742 case OPCODE_BLEND_FUNC_SEPARATE
:
6743 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6744 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6746 case OPCODE_CALL_LIST
:
6747 /* Generated by glCallList(), don't add ListBase */
6748 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6749 execute_list(ctx
, n
[1].ui
);
6752 case OPCODE_CALL_LIST_OFFSET
:
6753 /* Generated by glCallLists() so we must add ListBase */
6755 /* user specified a bad data type at compile time */
6756 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6758 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6759 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6760 execute_list(ctx
, list
);
6764 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6766 case OPCODE_CLEAR_BUFFER_IV
:
6773 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6776 case OPCODE_CLEAR_BUFFER_UIV
:
6783 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6786 case OPCODE_CLEAR_BUFFER_FV
:
6793 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
6796 case OPCODE_CLEAR_BUFFER_FI
:
6797 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
6799 case OPCODE_CLEAR_COLOR
:
6800 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6802 case OPCODE_CLEAR_ACCUM
:
6803 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6805 case OPCODE_CLEAR_DEPTH
:
6806 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6808 case OPCODE_CLEAR_INDEX
:
6809 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6811 case OPCODE_CLEAR_STENCIL
:
6812 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6814 case OPCODE_CLIP_PLANE
:
6821 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6824 case OPCODE_COLOR_MASK
:
6825 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6827 case OPCODE_COLOR_MASK_INDEXED
:
6828 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
6831 case OPCODE_COLOR_MATERIAL
:
6832 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6834 case OPCODE_COLOR_TABLE
:
6836 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6837 ctx
->Unpack
= ctx
->DefaultPacking
;
6838 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6839 n
[5].e
, n
[6].data
));
6840 ctx
->Unpack
= save
; /* restore */
6843 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6850 CALL_ColorTableParameterfv(ctx
->Exec
,
6851 (n
[1].e
, n
[2].e
, params
));
6854 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6861 CALL_ColorTableParameteriv(ctx
->Exec
,
6862 (n
[1].e
, n
[2].e
, params
));
6865 case OPCODE_COLOR_SUB_TABLE
:
6867 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6868 ctx
->Unpack
= ctx
->DefaultPacking
;
6869 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6870 n
[4].e
, n
[5].e
, n
[6].data
));
6871 ctx
->Unpack
= save
; /* restore */
6874 case OPCODE_CONVOLUTION_FILTER_1D
:
6876 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6877 ctx
->Unpack
= ctx
->DefaultPacking
;
6878 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6881 ctx
->Unpack
= save
; /* restore */
6884 case OPCODE_CONVOLUTION_FILTER_2D
:
6886 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6887 ctx
->Unpack
= ctx
->DefaultPacking
;
6888 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6889 n
[4].i
, n
[5].e
, n
[6].e
,
6891 ctx
->Unpack
= save
; /* restore */
6894 case OPCODE_CONVOLUTION_PARAMETER_I
:
6895 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6897 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6904 CALL_ConvolutionParameteriv(ctx
->Exec
,
6905 (n
[1].e
, n
[2].e
, params
));
6908 case OPCODE_CONVOLUTION_PARAMETER_F
:
6909 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6911 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6918 CALL_ConvolutionParameterfv(ctx
->Exec
,
6919 (n
[1].e
, n
[2].e
, params
));
6922 case OPCODE_COPY_COLOR_SUB_TABLE
:
6923 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6924 n
[3].i
, n
[4].i
, n
[5].i
));
6926 case OPCODE_COPY_COLOR_TABLE
:
6927 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6928 n
[3].i
, n
[4].i
, n
[5].i
));
6930 case OPCODE_COPY_PIXELS
:
6931 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6932 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6935 case OPCODE_COPY_TEX_IMAGE1D
:
6936 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6937 n
[5].i
, n
[6].i
, n
[7].i
));
6939 case OPCODE_COPY_TEX_IMAGE2D
:
6940 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6941 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6943 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6944 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6945 n
[4].i
, n
[5].i
, n
[6].i
));
6947 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6948 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6949 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6952 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6953 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6954 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6957 case OPCODE_CULL_FACE
:
6958 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6960 case OPCODE_DEPTH_FUNC
:
6961 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6963 case OPCODE_DEPTH_MASK
:
6964 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6966 case OPCODE_DEPTH_RANGE
:
6967 CALL_DepthRange(ctx
->Exec
,
6968 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6970 case OPCODE_DISABLE
:
6971 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6973 case OPCODE_DISABLE_INDEXED
:
6974 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6976 case OPCODE_DRAW_BUFFER
:
6977 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6979 case OPCODE_DRAW_PIXELS
:
6981 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6982 ctx
->Unpack
= ctx
->DefaultPacking
;
6983 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6985 ctx
->Unpack
= save
; /* restore */
6989 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6991 case OPCODE_ENABLE_INDEXED
:
6992 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6994 case OPCODE_EVALMESH1
:
6995 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6997 case OPCODE_EVALMESH2
:
6998 CALL_EvalMesh2(ctx
->Exec
,
6999 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7008 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
7011 case OPCODE_FRONT_FACE
:
7012 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
7014 case OPCODE_FRUSTUM
:
7015 CALL_Frustum(ctx
->Exec
,
7016 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7019 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7021 case OPCODE_HISTOGRAM
:
7022 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7024 case OPCODE_INDEX_MASK
:
7025 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7027 case OPCODE_INIT_NAMES
:
7028 CALL_InitNames(ctx
->Exec
, ());
7037 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7040 case OPCODE_LIGHT_MODEL
:
7047 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7050 case OPCODE_LINE_STIPPLE
:
7051 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7053 case OPCODE_LINE_WIDTH
:
7054 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7056 case OPCODE_LIST_BASE
:
7057 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7059 case OPCODE_LOAD_IDENTITY
:
7060 CALL_LoadIdentity(ctx
->Exec
, ());
7062 case OPCODE_LOAD_MATRIX
:
7063 if (sizeof(Node
) == sizeof(GLfloat
)) {
7064 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7069 for (i
= 0; i
< 16; i
++) {
7072 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7075 case OPCODE_LOAD_NAME
:
7076 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7078 case OPCODE_LOGIC_OP
:
7079 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7083 GLenum target
= n
[1].e
;
7084 GLint ustride
= _mesa_evaluator_components(target
);
7085 GLint uorder
= n
[5].i
;
7086 GLfloat u1
= n
[2].f
;
7087 GLfloat u2
= n
[3].f
;
7088 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7089 (GLfloat
*) n
[6].data
));
7094 GLenum target
= n
[1].e
;
7095 GLfloat u1
= n
[2].f
;
7096 GLfloat u2
= n
[3].f
;
7097 GLfloat v1
= n
[4].f
;
7098 GLfloat v2
= n
[5].f
;
7099 GLint ustride
= n
[6].i
;
7100 GLint vstride
= n
[7].i
;
7101 GLint uorder
= n
[8].i
;
7102 GLint vorder
= n
[9].i
;
7103 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7104 v1
, v2
, vstride
, vorder
,
7105 (GLfloat
*) n
[10].data
));
7108 case OPCODE_MAPGRID1
:
7109 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7111 case OPCODE_MAPGRID2
:
7112 CALL_MapGrid2f(ctx
->Exec
,
7113 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7115 case OPCODE_MATRIX_MODE
:
7116 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7118 case OPCODE_MIN_MAX
:
7119 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7121 case OPCODE_MULT_MATRIX
:
7122 if (sizeof(Node
) == sizeof(GLfloat
)) {
7123 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7128 for (i
= 0; i
< 16; i
++) {
7131 CALL_MultMatrixf(ctx
->Exec
, (m
));
7135 CALL_Ortho(ctx
->Exec
,
7136 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7138 case OPCODE_PASSTHROUGH
:
7139 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7141 case OPCODE_PIXEL_MAP
:
7142 CALL_PixelMapfv(ctx
->Exec
,
7143 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7145 case OPCODE_PIXEL_TRANSFER
:
7146 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7148 case OPCODE_PIXEL_ZOOM
:
7149 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7151 case OPCODE_POINT_SIZE
:
7152 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7154 case OPCODE_POINT_PARAMETERS
:
7160 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7163 case OPCODE_POLYGON_MODE
:
7164 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7166 case OPCODE_POLYGON_STIPPLE
:
7168 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7169 ctx
->Unpack
= ctx
->DefaultPacking
;
7170 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7171 ctx
->Unpack
= save
; /* restore */
7174 case OPCODE_POLYGON_OFFSET
:
7175 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7177 case OPCODE_POP_ATTRIB
:
7178 CALL_PopAttrib(ctx
->Exec
, ());
7180 case OPCODE_POP_MATRIX
:
7181 CALL_PopMatrix(ctx
->Exec
, ());
7183 case OPCODE_POP_NAME
:
7184 CALL_PopName(ctx
->Exec
, ());
7186 case OPCODE_PRIORITIZE_TEXTURE
:
7187 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7189 case OPCODE_PUSH_ATTRIB
:
7190 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7192 case OPCODE_PUSH_MATRIX
:
7193 CALL_PushMatrix(ctx
->Exec
, ());
7195 case OPCODE_PUSH_NAME
:
7196 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7198 case OPCODE_RASTER_POS
:
7199 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7201 case OPCODE_READ_BUFFER
:
7202 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7204 case OPCODE_RESET_HISTOGRAM
:
7205 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7207 case OPCODE_RESET_MIN_MAX
:
7208 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7211 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7214 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7216 case OPCODE_SCISSOR
:
7217 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7219 case OPCODE_SHADE_MODEL
:
7220 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7222 case OPCODE_PROVOKING_VERTEX
:
7223 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7225 case OPCODE_STENCIL_FUNC
:
7226 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7228 case OPCODE_STENCIL_MASK
:
7229 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7231 case OPCODE_STENCIL_OP
:
7232 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7234 case OPCODE_STENCIL_FUNC_SEPARATE
:
7235 CALL_StencilFuncSeparate(ctx
->Exec
,
7236 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7238 case OPCODE_STENCIL_MASK_SEPARATE
:
7239 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7241 case OPCODE_STENCIL_OP_SEPARATE
:
7242 CALL_StencilOpSeparate(ctx
->Exec
,
7243 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7252 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7262 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7265 case OPCODE_TEXPARAMETER
:
7272 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7275 case OPCODE_TEX_IMAGE1D
:
7277 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7278 ctx
->Unpack
= ctx
->DefaultPacking
;
7279 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7281 n
[3].i
, /* components */
7283 n
[5].e
, /* border */
7284 n
[6].e
, /* format */
7287 ctx
->Unpack
= save
; /* restore */
7290 case OPCODE_TEX_IMAGE2D
:
7292 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7293 ctx
->Unpack
= ctx
->DefaultPacking
;
7294 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7296 n
[3].i
, /* components */
7298 n
[5].i
, /* height */
7299 n
[6].e
, /* border */
7300 n
[7].e
, /* format */
7303 ctx
->Unpack
= save
; /* restore */
7306 case OPCODE_TEX_IMAGE3D
:
7308 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7309 ctx
->Unpack
= ctx
->DefaultPacking
;
7310 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7312 n
[3].i
, /* components */
7314 n
[5].i
, /* height */
7316 n
[7].e
, /* border */
7317 n
[8].e
, /* format */
7320 ctx
->Unpack
= save
; /* restore */
7323 case OPCODE_TEX_SUB_IMAGE1D
:
7325 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7326 ctx
->Unpack
= ctx
->DefaultPacking
;
7327 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7329 n
[6].e
, n
[7].data
));
7330 ctx
->Unpack
= save
; /* restore */
7333 case OPCODE_TEX_SUB_IMAGE2D
:
7335 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7336 ctx
->Unpack
= ctx
->DefaultPacking
;
7337 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7339 n
[6].i
, n
[7].e
, n
[8].e
,
7341 ctx
->Unpack
= save
; /* restore */
7344 case OPCODE_TEX_SUB_IMAGE3D
:
7346 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7347 ctx
->Unpack
= ctx
->DefaultPacking
;
7348 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7349 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7350 n
[8].i
, n
[9].e
, n
[10].e
,
7352 ctx
->Unpack
= save
; /* restore */
7355 case OPCODE_TRANSLATE
:
7356 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7358 case OPCODE_VIEWPORT
:
7359 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7360 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7362 case OPCODE_WINDOW_POS
:
7363 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7365 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7366 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7368 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7369 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7370 n
[4].i
, n
[5].i
, n
[6].i
,
7373 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7374 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7375 n
[4].i
, n
[5].i
, n
[6].i
,
7376 n
[7].i
, n
[8].data
));
7378 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7379 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7380 n
[4].i
, n
[5].i
, n
[6].i
,
7384 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7385 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7386 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7387 n
[5].e
, n
[6].i
, n
[7].data
));
7389 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7390 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7391 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7392 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7395 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7396 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7397 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7398 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7399 n
[9].e
, n
[10].i
, n
[11].data
));
7401 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7402 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7404 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7405 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7407 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7408 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7409 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7412 #if FEATURE_NV_vertex_program
7413 case OPCODE_EXECUTE_PROGRAM_NV
:
7420 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7423 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7424 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7425 (GLuint
*) n
[2].data
));
7427 case OPCODE_LOAD_PROGRAM_NV
:
7428 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7429 (const GLubyte
*) n
[4].data
));
7431 case OPCODE_TRACK_MATRIX_NV
:
7432 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7436 #if FEATURE_NV_fragment_program
7437 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7438 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7439 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7442 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7443 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7444 (const GLubyte
*) n
[3].
7445 data
, n
[4].f
, n
[5].f
,
7450 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7451 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7453 case OPCODE_DEPTH_BOUNDS_EXT
:
7454 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7456 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7457 case OPCODE_PROGRAM_STRING_ARB
:
7458 CALL_ProgramStringARB(ctx
->Exec
,
7459 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7462 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7463 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7464 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7469 #if FEATURE_queryobj
7470 case OPCODE_BEGIN_QUERY_ARB
:
7471 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7473 case OPCODE_END_QUERY_ARB
:
7474 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7477 case OPCODE_DRAW_BUFFERS_ARB
:
7479 GLenum buffers
[MAX_DRAW_BUFFERS
];
7480 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7481 for (i
= 0; i
< count
; i
++)
7482 buffers
[i
] = n
[2 + i
].e
;
7483 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7486 #if FEATURE_EXT_framebuffer_blit
7487 case OPCODE_BLIT_FRAMEBUFFER
:
7488 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7489 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7494 case OPCODE_USE_PROGRAM
:
7495 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7497 case OPCODE_UNIFORM_1F
:
7498 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7500 case OPCODE_UNIFORM_2F
:
7501 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7503 case OPCODE_UNIFORM_3F
:
7504 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7506 case OPCODE_UNIFORM_4F
:
7507 CALL_Uniform4fARB(ctx
->Exec
,
7508 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7510 case OPCODE_UNIFORM_1FV
:
7511 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7513 case OPCODE_UNIFORM_2FV
:
7514 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7516 case OPCODE_UNIFORM_3FV
:
7517 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7519 case OPCODE_UNIFORM_4FV
:
7520 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7522 case OPCODE_UNIFORM_1I
:
7523 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7525 case OPCODE_UNIFORM_2I
:
7526 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7528 case OPCODE_UNIFORM_3I
:
7529 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7531 case OPCODE_UNIFORM_4I
:
7532 CALL_Uniform4iARB(ctx
->Exec
,
7533 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7535 case OPCODE_UNIFORM_1IV
:
7536 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7538 case OPCODE_UNIFORM_2IV
:
7539 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7541 case OPCODE_UNIFORM_3IV
:
7542 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7544 case OPCODE_UNIFORM_4IV
:
7545 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7548 case OPCODE_UNIFORM_MATRIX22
:
7549 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7550 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7552 case OPCODE_UNIFORM_MATRIX33
:
7553 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7554 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7556 case OPCODE_UNIFORM_MATRIX44
:
7557 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7558 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7560 case OPCODE_UNIFORM_MATRIX23
:
7561 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7562 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7564 case OPCODE_UNIFORM_MATRIX32
:
7565 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7566 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7568 case OPCODE_UNIFORM_MATRIX24
:
7569 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7570 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7572 case OPCODE_UNIFORM_MATRIX42
:
7573 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7574 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7576 case OPCODE_UNIFORM_MATRIX34
:
7577 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7578 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7580 case OPCODE_UNIFORM_MATRIX43
:
7581 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7582 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7585 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7588 GLuint i
, pname
= n
[1].ui
;
7590 for (i
= 0; i
< 4; i
++)
7591 values
[i
] = n
[1 + i
].f
;
7592 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7595 #if FEATURE_ATI_fragment_shader
7596 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7597 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7599 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7602 GLuint i
, dst
= n
[1].ui
;
7604 for (i
= 0; i
< 4; i
++)
7605 values
[i
] = n
[1 + i
].f
;
7606 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7610 case OPCODE_ATTR_1F_NV
:
7611 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7613 case OPCODE_ATTR_2F_NV
:
7614 /* Really shouldn't have to do this - the Node structure
7615 * is convenient, but it would be better to store the data
7616 * packed appropriately so that it can be sent directly
7617 * on. With x86_64 becoming common, this will start to
7620 if (sizeof(Node
) == sizeof(GLfloat
))
7621 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7623 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7625 case OPCODE_ATTR_3F_NV
:
7626 if (sizeof(Node
) == sizeof(GLfloat
))
7627 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7629 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7632 case OPCODE_ATTR_4F_NV
:
7633 if (sizeof(Node
) == sizeof(GLfloat
))
7634 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7636 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7639 case OPCODE_ATTR_1F_ARB
:
7640 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7642 case OPCODE_ATTR_2F_ARB
:
7643 /* Really shouldn't have to do this - the Node structure
7644 * is convenient, but it would be better to store the data
7645 * packed appropriately so that it can be sent directly
7646 * on. With x86_64 becoming common, this will start to
7649 if (sizeof(Node
) == sizeof(GLfloat
))
7650 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7652 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7654 case OPCODE_ATTR_3F_ARB
:
7655 if (sizeof(Node
) == sizeof(GLfloat
))
7656 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7658 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7661 case OPCODE_ATTR_4F_ARB
:
7662 if (sizeof(Node
) == sizeof(GLfloat
))
7663 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7665 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7668 case OPCODE_MATERIAL
:
7669 if (sizeof(Node
) == sizeof(GLfloat
))
7670 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7677 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7681 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7684 CALL_End(ctx
->Exec
, ());
7687 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7689 case OPCODE_EVAL_C1
:
7690 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7692 case OPCODE_EVAL_C2
:
7693 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7695 case OPCODE_EVAL_P1
:
7696 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7698 case OPCODE_EVAL_P2
:
7699 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7702 case OPCODE_CONTINUE
:
7703 n
= (Node
*) n
[1].next
;
7705 case OPCODE_END_OF_LIST
:
7711 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
7713 _mesa_problem(ctx
, msg
);
7718 /* increment n to point to next compiled command */
7719 if (opcode
!= OPCODE_CONTINUE
) {
7720 n
+= InstSize
[opcode
];
7725 if (ctx
->Driver
.EndCallList
)
7726 ctx
->Driver
.EndCallList(ctx
);
7728 ctx
->ListState
.CallDepth
--;
7733 /**********************************************************************/
7735 /**********************************************************************/
7738 * Test if a display list number is valid.
7740 static GLboolean GLAPIENTRY
7741 _mesa_IsList(GLuint list
)
7743 GET_CURRENT_CONTEXT(ctx
);
7744 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7745 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7746 return islist(ctx
, list
);
7751 * Delete a sequence of consecutive display lists.
7753 static void GLAPIENTRY
7754 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7756 GET_CURRENT_CONTEXT(ctx
);
7758 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7759 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7762 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7765 for (i
= list
; i
< list
+ range
; i
++) {
7766 destroy_list(ctx
, i
);
7772 * Return a display list number, n, such that lists n through n+range-1
7775 static GLuint GLAPIENTRY
7776 _mesa_GenLists(GLsizei range
)
7778 GET_CURRENT_CONTEXT(ctx
);
7780 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7781 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7784 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7792 * Make this an atomic operation
7794 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7796 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7798 /* reserve the list IDs by with empty/dummy lists */
7800 for (i
= 0; i
< range
; i
++) {
7801 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7802 make_list(base
+ i
, 1));
7806 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7813 * Begin a new display list.
7815 static void GLAPIENTRY
7816 _mesa_NewList(GLuint name
, GLenum mode
)
7818 GET_CURRENT_CONTEXT(ctx
);
7820 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7821 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7823 if (MESA_VERBOSE
& VERBOSE_API
)
7824 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7825 _mesa_lookup_enum_by_nr(mode
));
7828 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7832 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7833 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7837 if (ctx
->ListState
.CurrentList
) {
7838 /* already compiling a display list */
7839 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7843 ctx
->CompileFlag
= GL_TRUE
;
7844 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7846 /* Reset acumulated list state:
7848 invalidate_saved_current_state( ctx
);
7850 /* Allocate new display list */
7851 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7852 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7853 ctx
->ListState
.CurrentPos
= 0;
7855 ctx
->Driver
.NewList(ctx
, name
, mode
);
7857 ctx
->CurrentDispatch
= ctx
->Save
;
7858 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7863 * End definition of current display list.
7865 static void GLAPIENTRY
7868 GET_CURRENT_CONTEXT(ctx
);
7869 SAVE_FLUSH_VERTICES(ctx
);
7870 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7872 if (MESA_VERBOSE
& VERBOSE_API
)
7873 _mesa_debug(ctx
, "glEndList\n");
7875 /* Check that a list is under construction */
7876 if (!ctx
->ListState
.CurrentList
) {
7877 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7881 /* Call before emitting END_OF_LIST, in case the driver wants to
7882 * emit opcodes itself.
7884 ctx
->Driver
.EndList(ctx
);
7886 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
7888 /* Destroy old list, if any */
7889 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7891 /* Install the new list */
7892 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7893 ctx
->ListState
.CurrentList
->Name
,
7894 ctx
->ListState
.CurrentList
);
7897 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7898 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7900 ctx
->ListState
.CurrentList
= NULL
;
7901 ctx
->ExecuteFlag
= GL_TRUE
;
7902 ctx
->CompileFlag
= GL_FALSE
;
7904 ctx
->CurrentDispatch
= ctx
->Exec
;
7905 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7910 _mesa_CallList(GLuint list
)
7912 GLboolean save_compile_flag
;
7913 GET_CURRENT_CONTEXT(ctx
);
7914 FLUSH_CURRENT(ctx
, 0);
7915 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7916 /* execute the display list, and restore the CompileFlag. */
7918 if (MESA_VERBOSE
& VERBOSE_API
)
7919 _mesa_debug(ctx
, "glCallList %d\n", list
);
7922 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7926 /* mesa_print_display_list( list ); */
7928 save_compile_flag
= ctx
->CompileFlag
;
7929 if (save_compile_flag
) {
7930 ctx
->CompileFlag
= GL_FALSE
;
7933 execute_list(ctx
, list
);
7934 ctx
->CompileFlag
= save_compile_flag
;
7936 /* also restore API function pointers to point to "save" versions */
7937 if (save_compile_flag
) {
7938 ctx
->CurrentDispatch
= ctx
->Save
;
7939 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7945 * Execute glCallLists: call multiple display lists.
7948 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7950 GET_CURRENT_CONTEXT(ctx
);
7952 GLboolean save_compile_flag
;
7954 if (MESA_VERBOSE
& VERBOSE_API
)
7955 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7959 case GL_UNSIGNED_BYTE
:
7961 case GL_UNSIGNED_SHORT
:
7963 case GL_UNSIGNED_INT
:
7971 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7975 /* Save the CompileFlag status, turn it off, execute display list,
7976 * and restore the CompileFlag.
7978 save_compile_flag
= ctx
->CompileFlag
;
7979 ctx
->CompileFlag
= GL_FALSE
;
7981 for (i
= 0; i
< n
; i
++) {
7982 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7983 execute_list(ctx
, list
);
7986 ctx
->CompileFlag
= save_compile_flag
;
7988 /* also restore API function pointers to point to "save" versions */
7989 if (save_compile_flag
) {
7990 ctx
->CurrentDispatch
= ctx
->Save
;
7991 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7997 * Set the offset added to list numbers in glCallLists.
7999 static void GLAPIENTRY
8000 _mesa_ListBase(GLuint base
)
8002 GET_CURRENT_CONTEXT(ctx
);
8003 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
8004 ASSERT_OUTSIDE_BEGIN_END(ctx
);
8005 ctx
->List
.ListBase
= base
;
8009 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
8011 static void GLAPIENTRY
8014 GET_CURRENT_CONTEXT(ctx
);
8015 FLUSH_VERTICES(ctx
, 0);
8016 CALL_Finish(ctx
->Exec
, ());
8019 static void GLAPIENTRY
8022 GET_CURRENT_CONTEXT(ctx
);
8023 FLUSH_VERTICES(ctx
, 0);
8024 CALL_Flush(ctx
->Exec
, ());
8027 static void GLAPIENTRY
8028 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8030 GET_CURRENT_CONTEXT(ctx
);
8031 FLUSH_VERTICES(ctx
, 0);
8032 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8035 static void GLAPIENTRY
8036 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8038 GET_CURRENT_CONTEXT(ctx
);
8039 FLUSH_VERTICES(ctx
, 0);
8040 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8043 static void GLAPIENTRY
8044 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8046 GET_CURRENT_CONTEXT(ctx
);
8047 FLUSH_VERTICES(ctx
, 0);
8048 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8051 static GLenum GLAPIENTRY
8054 GET_CURRENT_CONTEXT(ctx
);
8055 FLUSH_VERTICES(ctx
, 0);
8056 return CALL_GetError(ctx
->Exec
, ());
8059 static void GLAPIENTRY
8060 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8062 GET_CURRENT_CONTEXT(ctx
);
8063 FLUSH_VERTICES(ctx
, 0);
8064 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8067 static void GLAPIENTRY
8068 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8070 GET_CURRENT_CONTEXT(ctx
);
8071 FLUSH_VERTICES(ctx
, 0);
8072 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8075 static void GLAPIENTRY
8076 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8078 GET_CURRENT_CONTEXT(ctx
);
8079 FLUSH_VERTICES(ctx
, 0);
8080 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8083 static void GLAPIENTRY
8084 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8086 GET_CURRENT_CONTEXT(ctx
);
8087 FLUSH_VERTICES(ctx
, 0);
8088 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8091 static void GLAPIENTRY
8092 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8094 GET_CURRENT_CONTEXT(ctx
);
8095 FLUSH_VERTICES(ctx
, 0);
8096 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8099 static void GLAPIENTRY
8100 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8102 GET_CURRENT_CONTEXT(ctx
);
8103 FLUSH_VERTICES(ctx
, 0);
8104 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8107 static void GLAPIENTRY
8108 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8110 GET_CURRENT_CONTEXT(ctx
);
8111 FLUSH_VERTICES(ctx
, 0);
8112 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8115 static void GLAPIENTRY
8116 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8118 GET_CURRENT_CONTEXT(ctx
);
8119 FLUSH_VERTICES(ctx
, 0);
8120 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8123 static void GLAPIENTRY
8124 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8126 GET_CURRENT_CONTEXT(ctx
);
8127 FLUSH_VERTICES(ctx
, 0);
8128 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8131 static void GLAPIENTRY
8132 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8134 GET_CURRENT_CONTEXT(ctx
);
8135 FLUSH_VERTICES(ctx
, 0);
8136 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8139 static void GLAPIENTRY
8140 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8142 GET_CURRENT_CONTEXT(ctx
);
8143 FLUSH_VERTICES(ctx
, 0);
8144 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8147 static void GLAPIENTRY
8148 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8150 GET_CURRENT_CONTEXT(ctx
);
8151 FLUSH_VERTICES(ctx
, 0);
8152 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8155 static void GLAPIENTRY
8156 exec_GetPolygonStipple(GLubyte
* dest
)
8158 GET_CURRENT_CONTEXT(ctx
);
8159 FLUSH_VERTICES(ctx
, 0);
8160 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8163 static const GLubyte
*GLAPIENTRY
8164 exec_GetString(GLenum name
)
8166 GET_CURRENT_CONTEXT(ctx
);
8167 FLUSH_VERTICES(ctx
, 0);
8168 return CALL_GetString(ctx
->Exec
, (name
));
8171 static void GLAPIENTRY
8172 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8174 GET_CURRENT_CONTEXT(ctx
);
8175 FLUSH_VERTICES(ctx
, 0);
8176 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8179 static void GLAPIENTRY
8180 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8182 GET_CURRENT_CONTEXT(ctx
);
8183 FLUSH_VERTICES(ctx
, 0);
8184 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8187 static void GLAPIENTRY
8188 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8190 GET_CURRENT_CONTEXT(ctx
);
8191 FLUSH_VERTICES(ctx
, 0);
8192 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8195 static void GLAPIENTRY
8196 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8198 GET_CURRENT_CONTEXT(ctx
);
8199 FLUSH_VERTICES(ctx
, 0);
8200 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8203 static void GLAPIENTRY
8204 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8206 GET_CURRENT_CONTEXT(ctx
);
8207 FLUSH_VERTICES(ctx
, 0);
8208 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8211 static void GLAPIENTRY
8212 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8213 GLenum type
, GLvoid
* pixels
)
8215 GET_CURRENT_CONTEXT(ctx
);
8216 FLUSH_VERTICES(ctx
, 0);
8217 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8220 static void GLAPIENTRY
8221 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8222 GLenum pname
, GLfloat
*params
)
8224 GET_CURRENT_CONTEXT(ctx
);
8225 FLUSH_VERTICES(ctx
, 0);
8226 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8229 static void GLAPIENTRY
8230 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8231 GLenum pname
, GLint
*params
)
8233 GET_CURRENT_CONTEXT(ctx
);
8234 FLUSH_VERTICES(ctx
, 0);
8235 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8238 static void GLAPIENTRY
8239 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8241 GET_CURRENT_CONTEXT(ctx
);
8242 FLUSH_VERTICES(ctx
, 0);
8243 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8246 static void GLAPIENTRY
8247 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8249 GET_CURRENT_CONTEXT(ctx
);
8250 FLUSH_VERTICES(ctx
, 0);
8251 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8254 static GLboolean GLAPIENTRY
8255 exec_IsEnabled(GLenum cap
)
8257 GET_CURRENT_CONTEXT(ctx
);
8258 FLUSH_VERTICES(ctx
, 0);
8259 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8262 static void GLAPIENTRY
8263 exec_PixelStoref(GLenum pname
, GLfloat param
)
8265 GET_CURRENT_CONTEXT(ctx
);
8266 FLUSH_VERTICES(ctx
, 0);
8267 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8270 static void GLAPIENTRY
8271 exec_PixelStorei(GLenum pname
, GLint param
)
8273 GET_CURRENT_CONTEXT(ctx
);
8274 FLUSH_VERTICES(ctx
, 0);
8275 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8278 static void GLAPIENTRY
8279 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8280 GLenum format
, GLenum type
, GLvoid
* pixels
)
8282 GET_CURRENT_CONTEXT(ctx
);
8283 FLUSH_VERTICES(ctx
, 0);
8284 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8287 static GLint GLAPIENTRY
8288 exec_RenderMode(GLenum mode
)
8290 GET_CURRENT_CONTEXT(ctx
);
8291 FLUSH_VERTICES(ctx
, 0);
8292 return CALL_RenderMode(ctx
->Exec
, (mode
));
8295 static void GLAPIENTRY
8296 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8298 GET_CURRENT_CONTEXT(ctx
);
8299 FLUSH_VERTICES(ctx
, 0);
8300 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8303 static void GLAPIENTRY
8304 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8306 GET_CURRENT_CONTEXT(ctx
);
8307 FLUSH_VERTICES(ctx
, 0);
8308 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8311 static GLboolean GLAPIENTRY
8312 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8313 GLboolean
* residences
)
8315 GET_CURRENT_CONTEXT(ctx
);
8316 FLUSH_VERTICES(ctx
, 0);
8317 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8320 static void GLAPIENTRY
8321 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8323 GET_CURRENT_CONTEXT(ctx
);
8324 FLUSH_VERTICES(ctx
, 0);
8325 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8328 static void GLAPIENTRY
8329 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8331 GET_CURRENT_CONTEXT(ctx
);
8332 FLUSH_VERTICES(ctx
, 0);
8333 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8336 static void GLAPIENTRY
8337 exec_DisableClientState(GLenum cap
)
8339 GET_CURRENT_CONTEXT(ctx
);
8340 FLUSH_VERTICES(ctx
, 0);
8341 CALL_DisableClientState(ctx
->Exec
, (cap
));
8344 static void GLAPIENTRY
8345 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8347 GET_CURRENT_CONTEXT(ctx
);
8348 FLUSH_VERTICES(ctx
, 0);
8349 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8352 static void GLAPIENTRY
8353 exec_EnableClientState(GLenum cap
)
8355 GET_CURRENT_CONTEXT(ctx
);
8356 FLUSH_VERTICES(ctx
, 0);
8357 CALL_EnableClientState(ctx
->Exec
, (cap
));
8360 static void GLAPIENTRY
8361 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8363 GET_CURRENT_CONTEXT(ctx
);
8364 FLUSH_VERTICES(ctx
, 0);
8365 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8368 static void GLAPIENTRY
8369 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8371 GET_CURRENT_CONTEXT(ctx
);
8372 FLUSH_VERTICES(ctx
, 0);
8373 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8376 static void GLAPIENTRY
8377 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8379 GET_CURRENT_CONTEXT(ctx
);
8380 FLUSH_VERTICES(ctx
, 0);
8381 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8384 static void GLAPIENTRY
8385 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8387 GET_CURRENT_CONTEXT(ctx
);
8388 FLUSH_VERTICES(ctx
, 0);
8389 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8392 static GLboolean GLAPIENTRY
8393 exec_IsTexture(GLuint texture
)
8395 GET_CURRENT_CONTEXT(ctx
);
8396 FLUSH_VERTICES(ctx
, 0);
8397 return CALL_IsTexture(ctx
->Exec
, (texture
));
8400 static void GLAPIENTRY
8401 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8403 GET_CURRENT_CONTEXT(ctx
);
8404 FLUSH_VERTICES(ctx
, 0);
8405 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8408 static void GLAPIENTRY
8409 exec_PopClientAttrib(void)
8411 GET_CURRENT_CONTEXT(ctx
);
8412 FLUSH_VERTICES(ctx
, 0);
8413 CALL_PopClientAttrib(ctx
->Exec
, ());
8416 static void GLAPIENTRY
8417 exec_PushClientAttrib(GLbitfield mask
)
8419 GET_CURRENT_CONTEXT(ctx
);
8420 FLUSH_VERTICES(ctx
, 0);
8421 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8424 static void GLAPIENTRY
8425 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8428 GET_CURRENT_CONTEXT(ctx
);
8429 FLUSH_VERTICES(ctx
, 0);
8430 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8433 static void GLAPIENTRY
8434 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8436 GET_CURRENT_CONTEXT(ctx
);
8437 FLUSH_VERTICES(ctx
, 0);
8438 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8441 static void GLAPIENTRY
8442 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8445 GET_CURRENT_CONTEXT(ctx
);
8446 FLUSH_VERTICES(ctx
, 0);
8447 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8450 static void GLAPIENTRY
8451 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8452 GLint x
, GLint y
, GLsizei width
)
8454 GET_CURRENT_CONTEXT(ctx
);
8455 FLUSH_VERTICES(ctx
, 0);
8456 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8457 (target
, internalFormat
, x
, y
, width
));
8460 static void GLAPIENTRY
8461 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8462 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8464 GET_CURRENT_CONTEXT(ctx
);
8465 FLUSH_VERTICES(ctx
, 0);
8466 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8467 (target
, internalFormat
, x
, y
, width
,
8471 static void GLAPIENTRY
8472 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8474 GET_CURRENT_CONTEXT(ctx
);
8475 FLUSH_VERTICES(ctx
, 0);
8476 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8479 static void GLAPIENTRY
8480 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8482 GET_CURRENT_CONTEXT(ctx
);
8483 FLUSH_VERTICES(ctx
, 0);
8484 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8487 static void GLAPIENTRY
8488 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8490 GET_CURRENT_CONTEXT(ctx
);
8491 FLUSH_VERTICES(ctx
, 0);
8492 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8495 static void GLAPIENTRY
8496 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8499 GET_CURRENT_CONTEXT(ctx
);
8500 FLUSH_VERTICES(ctx
, 0);
8501 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8504 static void GLAPIENTRY
8505 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8507 GET_CURRENT_CONTEXT(ctx
);
8508 FLUSH_VERTICES(ctx
, 0);
8509 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8512 static void GLAPIENTRY
8513 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8515 GET_CURRENT_CONTEXT(ctx
);
8516 FLUSH_VERTICES(ctx
, 0);
8517 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8520 static void GLAPIENTRY
8521 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8522 GLenum type
, GLvoid
*values
)
8524 GET_CURRENT_CONTEXT(ctx
);
8525 FLUSH_VERTICES(ctx
, 0);
8526 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8529 static void GLAPIENTRY
8530 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8532 GET_CURRENT_CONTEXT(ctx
);
8533 FLUSH_VERTICES(ctx
, 0);
8534 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8537 static void GLAPIENTRY
8538 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8540 GET_CURRENT_CONTEXT(ctx
);
8541 FLUSH_VERTICES(ctx
, 0);
8542 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8545 static void GLAPIENTRY
8546 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8547 GLenum type
, GLvoid
*values
)
8549 GET_CURRENT_CONTEXT(ctx
);
8550 FLUSH_VERTICES(ctx
, 0);
8551 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8554 static void GLAPIENTRY
8555 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8557 GET_CURRENT_CONTEXT(ctx
);
8558 FLUSH_VERTICES(ctx
, 0);
8559 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8562 static void GLAPIENTRY
8563 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8565 GET_CURRENT_CONTEXT(ctx
);
8566 FLUSH_VERTICES(ctx
, 0);
8567 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8570 static void GLAPIENTRY
8571 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8572 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8574 GET_CURRENT_CONTEXT(ctx
);
8575 FLUSH_VERTICES(ctx
, 0);
8576 CALL_GetSeparableFilter(ctx
->Exec
,
8577 (target
, format
, type
, row
, column
, span
));
8580 static void GLAPIENTRY
8581 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8582 GLsizei width
, GLsizei height
, GLenum format
,
8583 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8585 GET_CURRENT_CONTEXT(ctx
);
8586 FLUSH_VERTICES(ctx
, 0);
8587 CALL_SeparableFilter2D(ctx
->Exec
,
8588 (target
, internalFormat
, width
, height
, format
,
8589 type
, row
, column
));
8592 static void GLAPIENTRY
8593 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8594 GLsizei count
, const GLvoid
*ptr
)
8596 GET_CURRENT_CONTEXT(ctx
);
8597 FLUSH_VERTICES(ctx
, 0);
8598 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8601 static void GLAPIENTRY
8602 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8604 GET_CURRENT_CONTEXT(ctx
);
8605 FLUSH_VERTICES(ctx
, 0);
8606 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8609 static void GLAPIENTRY
8610 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8613 GET_CURRENT_CONTEXT(ctx
);
8614 FLUSH_VERTICES(ctx
, 0);
8615 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8618 static void GLAPIENTRY
8619 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8622 GET_CURRENT_CONTEXT(ctx
);
8623 FLUSH_VERTICES(ctx
, 0);
8624 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8627 static void GLAPIENTRY
8628 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8629 GLsizei count
, const GLvoid
*ptr
)
8631 GET_CURRENT_CONTEXT(ctx
);
8632 FLUSH_VERTICES(ctx
, 0);
8633 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8636 static void GLAPIENTRY
8637 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8638 GLsizei count
, const GLvoid
*ptr
)
8640 GET_CURRENT_CONTEXT(ctx
);
8641 FLUSH_VERTICES(ctx
, 0);
8642 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8645 static void GLAPIENTRY
8646 exec_LockArraysEXT(GLint first
, GLsizei count
)
8648 GET_CURRENT_CONTEXT(ctx
);
8649 FLUSH_VERTICES(ctx
, 0);
8650 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8653 static void GLAPIENTRY
8654 exec_UnlockArraysEXT(void)
8656 GET_CURRENT_CONTEXT(ctx
);
8657 FLUSH_VERTICES(ctx
, 0);
8658 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8661 static void GLAPIENTRY
8662 exec_ClientActiveTextureARB(GLenum target
)
8664 GET_CURRENT_CONTEXT(ctx
);
8665 FLUSH_VERTICES(ctx
, 0);
8666 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8669 static void GLAPIENTRY
8670 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8671 GLsizei stride
, const GLvoid
*ptr
)
8673 GET_CURRENT_CONTEXT(ctx
);
8674 FLUSH_VERTICES(ctx
, 0);
8675 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8678 static void GLAPIENTRY
8679 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8681 GET_CURRENT_CONTEXT(ctx
);
8682 FLUSH_VERTICES(ctx
, 0);
8683 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8686 /* GL_EXT_multi_draw_arrays */
8687 static void GLAPIENTRY
8688 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8689 GLsizei
* count
, GLsizei primcount
)
8691 GET_CURRENT_CONTEXT(ctx
);
8692 FLUSH_VERTICES(ctx
, 0);
8693 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8696 /* GL_IBM_multimode_draw_arrays */
8697 static void GLAPIENTRY
8698 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8699 const GLsizei
* count
, GLsizei primcount
,
8702 GET_CURRENT_CONTEXT(ctx
);
8703 FLUSH_VERTICES(ctx
, 0);
8704 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8705 (mode
, first
, count
, primcount
, modestride
));
8708 /* GL_IBM_multimode_draw_arrays */
8709 static void GLAPIENTRY
8710 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8711 const GLsizei
* count
,
8713 const GLvoid
* const *indices
,
8714 GLsizei primcount
, GLint modestride
)
8716 GET_CURRENT_CONTEXT(ctx
);
8717 FLUSH_VERTICES(ctx
, 0);
8718 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8719 (mode
, count
, type
, indices
, primcount
,
8726 * Setup the given dispatch table to point to Mesa's display list
8727 * building functions.
8729 * This does not include any of the tnl functions - they are
8730 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8734 _mesa_init_save_table(struct _glapi_table
*table
)
8736 _mesa_loopback_init_api_table(table
);
8739 SET_Accum(table
, save_Accum
);
8740 SET_AlphaFunc(table
, save_AlphaFunc
);
8741 SET_Bitmap(table
, save_Bitmap
);
8742 SET_BlendFunc(table
, save_BlendFunc
);
8743 SET_CallList(table
, save_CallList
);
8744 SET_CallLists(table
, save_CallLists
);
8745 SET_Clear(table
, save_Clear
);
8746 SET_ClearAccum(table
, save_ClearAccum
);
8747 SET_ClearColor(table
, save_ClearColor
);
8748 SET_ClearDepth(table
, save_ClearDepth
);
8749 SET_ClearIndex(table
, save_ClearIndex
);
8750 SET_ClearStencil(table
, save_ClearStencil
);
8751 SET_ClipPlane(table
, save_ClipPlane
);
8752 SET_ColorMask(table
, save_ColorMask
);
8753 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
8754 (void) save_ColorMaskIndexed
;
8755 SET_ColorMaterial(table
, save_ColorMaterial
);
8756 SET_CopyPixels(table
, save_CopyPixels
);
8757 SET_CullFace(table
, save_CullFace
);
8758 SET_DeleteLists(table
, _mesa_DeleteLists
);
8759 SET_DepthFunc(table
, save_DepthFunc
);
8760 SET_DepthMask(table
, save_DepthMask
);
8761 SET_DepthRange(table
, save_DepthRange
);
8762 SET_Disable(table
, save_Disable
);
8763 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
8764 SET_DrawBuffer(table
, save_DrawBuffer
);
8765 SET_DrawPixels(table
, save_DrawPixels
);
8766 SET_Enable(table
, save_Enable
);
8767 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
8768 SET_EndList(table
, _mesa_EndList
);
8769 SET_EvalMesh1(table
, save_EvalMesh1
);
8770 SET_EvalMesh2(table
, save_EvalMesh2
);
8771 SET_Finish(table
, exec_Finish
);
8772 SET_Flush(table
, exec_Flush
);
8773 SET_Fogf(table
, save_Fogf
);
8774 SET_Fogfv(table
, save_Fogfv
);
8775 SET_Fogi(table
, save_Fogi
);
8776 SET_Fogiv(table
, save_Fogiv
);
8777 SET_FrontFace(table
, save_FrontFace
);
8778 SET_Frustum(table
, save_Frustum
);
8779 SET_GenLists(table
, _mesa_GenLists
);
8780 SET_GetBooleanv(table
, exec_GetBooleanv
);
8781 SET_GetClipPlane(table
, exec_GetClipPlane
);
8782 SET_GetDoublev(table
, exec_GetDoublev
);
8783 SET_GetError(table
, exec_GetError
);
8784 SET_GetFloatv(table
, exec_GetFloatv
);
8785 SET_GetIntegerv(table
, exec_GetIntegerv
);
8786 SET_GetLightfv(table
, exec_GetLightfv
);
8787 SET_GetLightiv(table
, exec_GetLightiv
);
8788 SET_GetMapdv(table
, exec_GetMapdv
);
8789 SET_GetMapfv(table
, exec_GetMapfv
);
8790 SET_GetMapiv(table
, exec_GetMapiv
);
8791 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8792 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8793 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8794 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8795 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8796 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8797 SET_GetString(table
, exec_GetString
);
8798 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8799 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8800 SET_GetTexGendv(table
, exec_GetTexGendv
);
8801 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8802 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8803 SET_GetTexImage(table
, exec_GetTexImage
);
8804 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8805 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8806 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8807 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8808 SET_Hint(table
, save_Hint
);
8809 SET_IndexMask(table
, save_IndexMask
);
8810 SET_InitNames(table
, save_InitNames
);
8811 SET_IsEnabled(table
, exec_IsEnabled
);
8812 SET_IsList(table
, _mesa_IsList
);
8813 SET_LightModelf(table
, save_LightModelf
);
8814 SET_LightModelfv(table
, save_LightModelfv
);
8815 SET_LightModeli(table
, save_LightModeli
);
8816 SET_LightModeliv(table
, save_LightModeliv
);
8817 SET_Lightf(table
, save_Lightf
);
8818 SET_Lightfv(table
, save_Lightfv
);
8819 SET_Lighti(table
, save_Lighti
);
8820 SET_Lightiv(table
, save_Lightiv
);
8821 SET_LineStipple(table
, save_LineStipple
);
8822 SET_LineWidth(table
, save_LineWidth
);
8823 SET_ListBase(table
, save_ListBase
);
8824 SET_LoadIdentity(table
, save_LoadIdentity
);
8825 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8826 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8827 SET_LoadName(table
, save_LoadName
);
8828 SET_LogicOp(table
, save_LogicOp
);
8829 SET_Map1d(table
, save_Map1d
);
8830 SET_Map1f(table
, save_Map1f
);
8831 SET_Map2d(table
, save_Map2d
);
8832 SET_Map2f(table
, save_Map2f
);
8833 SET_MapGrid1d(table
, save_MapGrid1d
);
8834 SET_MapGrid1f(table
, save_MapGrid1f
);
8835 SET_MapGrid2d(table
, save_MapGrid2d
);
8836 SET_MapGrid2f(table
, save_MapGrid2f
);
8837 SET_MatrixMode(table
, save_MatrixMode
);
8838 SET_MultMatrixd(table
, save_MultMatrixd
);
8839 SET_MultMatrixf(table
, save_MultMatrixf
);
8840 SET_NewList(table
, save_NewList
);
8841 SET_Ortho(table
, save_Ortho
);
8842 SET_PassThrough(table
, save_PassThrough
);
8843 SET_PixelMapfv(table
, save_PixelMapfv
);
8844 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8845 SET_PixelMapusv(table
, save_PixelMapusv
);
8846 SET_PixelStoref(table
, exec_PixelStoref
);
8847 SET_PixelStorei(table
, exec_PixelStorei
);
8848 SET_PixelTransferf(table
, save_PixelTransferf
);
8849 SET_PixelTransferi(table
, save_PixelTransferi
);
8850 SET_PixelZoom(table
, save_PixelZoom
);
8851 SET_PointSize(table
, save_PointSize
);
8852 SET_PolygonMode(table
, save_PolygonMode
);
8853 SET_PolygonOffset(table
, save_PolygonOffset
);
8854 SET_PolygonStipple(table
, save_PolygonStipple
);
8855 SET_PopAttrib(table
, save_PopAttrib
);
8856 SET_PopMatrix(table
, save_PopMatrix
);
8857 SET_PopName(table
, save_PopName
);
8858 SET_PushAttrib(table
, save_PushAttrib
);
8859 SET_PushMatrix(table
, save_PushMatrix
);
8860 SET_PushName(table
, save_PushName
);
8861 SET_RasterPos2d(table
, save_RasterPos2d
);
8862 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8863 SET_RasterPos2f(table
, save_RasterPos2f
);
8864 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8865 SET_RasterPos2i(table
, save_RasterPos2i
);
8866 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8867 SET_RasterPos2s(table
, save_RasterPos2s
);
8868 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8869 SET_RasterPos3d(table
, save_RasterPos3d
);
8870 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8871 SET_RasterPos3f(table
, save_RasterPos3f
);
8872 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8873 SET_RasterPos3i(table
, save_RasterPos3i
);
8874 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8875 SET_RasterPos3s(table
, save_RasterPos3s
);
8876 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8877 SET_RasterPos4d(table
, save_RasterPos4d
);
8878 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8879 SET_RasterPos4f(table
, save_RasterPos4f
);
8880 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8881 SET_RasterPos4i(table
, save_RasterPos4i
);
8882 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8883 SET_RasterPos4s(table
, save_RasterPos4s
);
8884 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8885 SET_ReadBuffer(table
, save_ReadBuffer
);
8886 SET_ReadPixels(table
, exec_ReadPixels
);
8887 SET_RenderMode(table
, exec_RenderMode
);
8888 SET_Rotated(table
, save_Rotated
);
8889 SET_Rotatef(table
, save_Rotatef
);
8890 SET_Scaled(table
, save_Scaled
);
8891 SET_Scalef(table
, save_Scalef
);
8892 SET_Scissor(table
, save_Scissor
);
8893 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8894 SET_SelectBuffer(table
, exec_SelectBuffer
);
8895 SET_ShadeModel(table
, save_ShadeModel
);
8896 SET_StencilFunc(table
, save_StencilFunc
);
8897 SET_StencilMask(table
, save_StencilMask
);
8898 SET_StencilOp(table
, save_StencilOp
);
8899 SET_TexEnvf(table
, save_TexEnvf
);
8900 SET_TexEnvfv(table
, save_TexEnvfv
);
8901 SET_TexEnvi(table
, save_TexEnvi
);
8902 SET_TexEnviv(table
, save_TexEnviv
);
8903 SET_TexGend(table
, save_TexGend
);
8904 SET_TexGendv(table
, save_TexGendv
);
8905 SET_TexGenf(table
, save_TexGenf
);
8906 SET_TexGenfv(table
, save_TexGenfv
);
8907 SET_TexGeni(table
, save_TexGeni
);
8908 SET_TexGeniv(table
, save_TexGeniv
);
8909 SET_TexImage1D(table
, save_TexImage1D
);
8910 SET_TexImage2D(table
, save_TexImage2D
);
8911 SET_TexParameterf(table
, save_TexParameterf
);
8912 SET_TexParameterfv(table
, save_TexParameterfv
);
8913 SET_TexParameteri(table
, save_TexParameteri
);
8914 SET_TexParameteriv(table
, save_TexParameteriv
);
8915 SET_Translated(table
, save_Translated
);
8916 SET_Translatef(table
, save_Translatef
);
8917 SET_Viewport(table
, save_Viewport
);
8920 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8921 SET_BindTexture(table
, save_BindTexture
);
8922 SET_ColorPointer(table
, exec_ColorPointer
);
8923 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8924 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8925 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8926 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8927 SET_DeleteTextures(table
, exec_DeleteTextures
);
8928 SET_DisableClientState(table
, exec_DisableClientState
);
8929 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8930 SET_EnableClientState(table
, exec_EnableClientState
);
8931 SET_GenTextures(table
, exec_GenTextures
);
8932 SET_GetPointerv(table
, exec_GetPointerv
);
8933 SET_IndexPointer(table
, exec_IndexPointer
);
8934 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8935 SET_IsTexture(table
, exec_IsTexture
);
8936 SET_NormalPointer(table
, exec_NormalPointer
);
8937 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8938 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8939 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8940 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8941 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8942 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8943 SET_VertexPointer(table
, exec_VertexPointer
);
8946 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8947 SET_TexImage3D(table
, save_TexImage3D
);
8948 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8951 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8952 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8953 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8955 /* ATI_separate_stencil */
8956 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8958 /* GL_ARB_imaging */
8959 /* Not all are supported */
8960 SET_BlendColor(table
, save_BlendColor
);
8961 SET_BlendEquation(table
, save_BlendEquation
);
8962 SET_ColorSubTable(table
, save_ColorSubTable
);
8963 SET_ColorTable(table
, save_ColorTable
);
8964 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8965 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8966 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8967 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8968 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8969 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8970 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8971 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8972 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8973 SET_CopyColorTable(table
, save_CopyColorTable
);
8974 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8975 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8976 SET_GetColorTable(table
, exec_GetColorTable
);
8977 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8978 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8979 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8980 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8981 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8982 SET_GetHistogram(table
, exec_GetHistogram
);
8983 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8984 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8985 SET_GetMinmax(table
, exec_GetMinmax
);
8986 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8987 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8988 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8989 SET_Histogram(table
, save_Histogram
);
8990 SET_Minmax(table
, save_Minmax
);
8991 SET_ResetHistogram(table
, save_ResetHistogram
);
8992 SET_ResetMinmax(table
, save_ResetMinmax
);
8993 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8995 /* 2. GL_EXT_blend_color */
8997 SET_BlendColorEXT(table
, save_BlendColorEXT
);
9000 /* 3. GL_EXT_polygon_offset */
9001 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
9003 /* 6. GL_EXT_texture3d */
9005 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
9006 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
9007 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
9010 /* 14. GL_SGI_color_table */
9012 SET_ColorTableSGI(table
, save_ColorTable
);
9013 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
9014 SET_GetColorTableSGI(table
, exec_GetColorTable
);
9015 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
9016 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
9019 /* 30. GL_EXT_vertex_array */
9020 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
9021 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9022 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9023 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9024 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9025 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9027 /* 37. GL_EXT_blend_minmax */
9029 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9032 /* 54. GL_EXT_point_parameters */
9033 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9034 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9036 /* 97. GL_EXT_compiled_vertex_array */
9037 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9038 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9040 /* 145. GL_EXT_secondary_color */
9041 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9043 /* 148. GL_EXT_multi_draw_arrays */
9044 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9046 /* 149. GL_EXT_fog_coord */
9047 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9049 /* 173. GL_EXT_blend_func_separate */
9050 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9052 /* 196. GL_MESA_resize_buffers */
9053 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9055 /* 197. GL_MESA_window_pos */
9056 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9057 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9058 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9059 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9060 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9061 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9062 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9063 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9064 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9065 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9066 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9067 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9068 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9069 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9070 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9071 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9072 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9073 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9074 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9075 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9076 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9077 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9078 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9079 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9081 /* 200. GL_IBM_multimode_draw_arrays */
9082 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9083 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9085 #if FEATURE_NV_vertex_program
9086 /* 233. GL_NV_vertex_program */
9087 /* The following commands DO NOT go into display lists:
9088 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9089 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9091 SET_BindProgramNV(table
, save_BindProgramNV
);
9092 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9093 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
9094 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9095 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
9096 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
9097 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
9098 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
9099 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
9100 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
9101 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
9102 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9103 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9104 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9105 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9106 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9107 SET_LoadProgramNV(table
, save_LoadProgramNV
);
9108 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9109 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9110 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9111 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9112 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
9113 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
9114 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
9115 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
9118 /* 244. GL_ATI_envmap_bumpmap */
9119 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9120 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9122 /* 245. GL_ATI_fragment_shader */
9123 #if FEATURE_ATI_fragment_shader
9124 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9125 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9128 /* 282. GL_NV_fragment_program */
9129 #if FEATURE_NV_fragment_program
9130 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
9131 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
9132 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
9133 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
9134 SET_GetProgramNamedParameterfvNV(table
,
9135 _mesa_GetProgramNamedParameterfvNV
);
9136 SET_GetProgramNamedParameterdvNV(table
,
9137 _mesa_GetProgramNamedParameterdvNV
);
9138 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9139 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9140 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9141 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9142 SET_GetProgramLocalParameterdvARB(table
,
9143 _mesa_GetProgramLocalParameterdvARB
);
9144 SET_GetProgramLocalParameterfvARB(table
,
9145 _mesa_GetProgramLocalParameterfvARB
);
9148 /* 262. GL_NV_point_sprite */
9149 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9150 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9152 /* 268. GL_EXT_stencil_two_side */
9153 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9155 /* 273. GL_APPLE_vertex_array_object */
9156 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9157 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9158 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9159 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9161 /* ???. GL_EXT_depth_bounds_test */
9162 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9164 /* ARB 1. GL_ARB_multitexture */
9165 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9166 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9168 /* ARB 3. GL_ARB_transpose_matrix */
9169 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9170 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9171 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9172 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9174 /* ARB 5. GL_ARB_multisample */
9175 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9177 /* ARB 12. GL_ARB_texture_compression */
9178 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9179 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9180 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9181 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9182 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9183 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9184 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9186 /* ARB 14. GL_ARB_point_parameters */
9187 /* aliased with EXT_point_parameters functions */
9189 /* ARB 25. GL_ARB_window_pos */
9190 /* aliased with MESA_window_pos functions */
9192 /* ARB 26. GL_ARB_vertex_program */
9193 /* ARB 27. GL_ARB_fragment_program */
9194 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9195 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9196 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9197 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9198 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9199 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9200 SET_BindProgramNV(table
, save_BindProgramNV
);
9201 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9202 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9203 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9204 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9205 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9206 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9207 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9208 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9209 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9210 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9211 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9212 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9213 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9214 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9215 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9216 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9217 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9218 SET_GetProgramLocalParameterdvARB(table
,
9219 _mesa_GetProgramLocalParameterdvARB
);
9220 SET_GetProgramLocalParameterfvARB(table
,
9221 _mesa_GetProgramLocalParameterfvARB
);
9222 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9223 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9226 /* ARB 28. GL_ARB_vertex_buffer_object */
9227 #if FEATURE_ARB_vertex_buffer_object
9228 /* None of the extension's functions get compiled */
9229 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9230 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9231 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9232 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9233 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9234 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9235 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9236 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9237 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9238 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9239 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9242 #if FEATURE_queryobj
9243 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9244 SET_EndQueryARB(table
, save_EndQueryARB
);
9245 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9246 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9247 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9248 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9249 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9250 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9252 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9254 #if FEATURE_EXT_framebuffer_blit
9255 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9258 /* GL_ARB_shader_objects */
9259 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9260 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9261 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9262 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9263 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9264 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9265 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9266 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9267 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9268 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9269 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9270 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9271 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9272 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9273 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9274 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9275 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9276 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9277 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9278 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9279 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9280 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9281 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9282 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9283 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9284 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9286 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9287 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9288 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9289 /* XXX additional functions need to be implemented here! */
9291 /* 299. GL_EXT_blend_equation_separate */
9292 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9294 /* GL_EXT_gpu_program_parmaeters */
9295 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9296 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9297 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9300 /* ARB 50. GL_ARB_map_buffer_range */
9301 #if FEATURE_ARB_map_buffer_range
9302 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9303 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9306 /* ARB 59. GL_ARB_copy_buffer */
9307 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9309 /* 364. GL_EXT_provoking_vertex */
9310 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9314 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9315 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9316 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9317 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9319 (void) save_ClearBufferiv
;
9320 (void) save_ClearBufferuiv
;
9321 (void) save_ClearBufferfv
;
9322 (void) save_ClearBufferfi
;
9329 enum_string(GLenum k
)
9331 return _mesa_lookup_enum_by_nr(k
);
9336 * Print the commands in a display list. For debugging only.
9337 * TODO: many commands aren't handled yet.
9339 static void GLAPIENTRY
9340 print_list(GLcontext
*ctx
, GLuint list
)
9342 struct gl_display_list
*dlist
;
9346 if (!islist(ctx
, list
)) {
9347 _mesa_printf("%u is not a display list ID\n", list
);
9351 dlist
= lookup_list(ctx
, list
);
9357 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
9359 done
= n
? GL_FALSE
: GL_TRUE
;
9361 const OpCode opcode
= n
[0].opcode
;
9363 if (is_ext_opcode(opcode
)) {
9364 n
+= ext_opcode_print(ctx
, n
);
9369 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9372 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9373 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9375 case OPCODE_CALL_LIST
:
9376 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
9378 case OPCODE_CALL_LIST_OFFSET
:
9379 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9380 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9382 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9383 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9384 enum_string(n
[1].e
), enum_string(n
[2].e
),
9385 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9387 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9388 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9389 enum_string(n
[1].e
), enum_string(n
[2].e
),
9390 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9392 case OPCODE_DISABLE
:
9393 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
9396 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
9398 case OPCODE_FRUSTUM
:
9399 _mesa_printf("Frustum %g %g %g %g %g %g\n",
9400 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9402 case OPCODE_LINE_STIPPLE
:
9403 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9405 case OPCODE_LOAD_IDENTITY
:
9406 _mesa_printf("LoadIdentity\n");
9408 case OPCODE_LOAD_MATRIX
:
9409 _mesa_printf("LoadMatrix\n");
9410 _mesa_printf(" %8f %8f %8f %8f\n",
9411 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9412 _mesa_printf(" %8f %8f %8f %8f\n",
9413 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9414 _mesa_printf(" %8f %8f %8f %8f\n",
9415 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9416 _mesa_printf(" %8f %8f %8f %8f\n",
9417 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9419 case OPCODE_MULT_MATRIX
:
9420 _mesa_printf("MultMatrix (or Rotate)\n");
9421 _mesa_printf(" %8f %8f %8f %8f\n",
9422 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9423 _mesa_printf(" %8f %8f %8f %8f\n",
9424 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9425 _mesa_printf(" %8f %8f %8f %8f\n",
9426 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9427 _mesa_printf(" %8f %8f %8f %8f\n",
9428 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9431 _mesa_printf("Ortho %g %g %g %g %g %g\n",
9432 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9434 case OPCODE_POP_ATTRIB
:
9435 _mesa_printf("PopAttrib\n");
9437 case OPCODE_POP_MATRIX
:
9438 _mesa_printf("PopMatrix\n");
9440 case OPCODE_POP_NAME
:
9441 _mesa_printf("PopName\n");
9443 case OPCODE_PUSH_ATTRIB
:
9444 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
9446 case OPCODE_PUSH_MATRIX
:
9447 _mesa_printf("PushMatrix\n");
9449 case OPCODE_PUSH_NAME
:
9450 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
9452 case OPCODE_RASTER_POS
:
9453 _mesa_printf("RasterPos %g %g %g %g\n",
9454 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9457 _mesa_printf("Rotate %g %g %g %g\n",
9458 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9461 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9463 case OPCODE_TRANSLATE
:
9464 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9466 case OPCODE_BIND_TEXTURE
:
9467 _mesa_printf("BindTexture %s %d\n",
9468 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9470 case OPCODE_SHADE_MODEL
:
9471 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9474 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
9475 _mesa_lookup_enum_by_nr(n
[1].ui
),
9476 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9479 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9480 _mesa_lookup_enum_by_nr(n
[1].ui
),
9481 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9482 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9484 case OPCODE_MAPGRID1
:
9485 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9487 case OPCODE_MAPGRID2
:
9488 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9489 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9491 case OPCODE_EVALMESH1
:
9492 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9494 case OPCODE_EVALMESH2
:
9495 _mesa_printf("EvalMesh2 %d %d %d %d\n",
9496 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9499 case OPCODE_ATTR_1F_NV
:
9500 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9502 case OPCODE_ATTR_2F_NV
:
9503 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
9504 n
[1].i
, n
[2].f
, n
[3].f
);
9506 case OPCODE_ATTR_3F_NV
:
9507 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
9508 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9510 case OPCODE_ATTR_4F_NV
:
9511 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9512 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9514 case OPCODE_ATTR_1F_ARB
:
9515 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9517 case OPCODE_ATTR_2F_ARB
:
9518 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
9519 n
[1].i
, n
[2].f
, n
[3].f
);
9521 case OPCODE_ATTR_3F_ARB
:
9522 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9523 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9525 case OPCODE_ATTR_4F_ARB
:
9526 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9527 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9530 case OPCODE_MATERIAL
:
9531 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
9532 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9535 _mesa_printf("BEGIN %x\n", n
[1].i
);
9538 _mesa_printf("END\n");
9541 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9544 case OPCODE_EVAL_C1
:
9545 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
9547 case OPCODE_EVAL_C2
:
9548 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9550 case OPCODE_EVAL_P1
:
9551 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
9553 case OPCODE_EVAL_P2
:
9554 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9557 case OPCODE_PROVOKING_VERTEX
:
9558 _mesa_printf("ProvokingVertex %s\n",
9559 _mesa_lookup_enum_by_nr(n
[1].ui
));
9563 * meta opcodes/commands
9566 _mesa_printf("Error: %s %s\n",
9567 enum_string(n
[1].e
), (const char *) n
[2].data
);
9569 case OPCODE_CONTINUE
:
9570 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
9571 n
= (Node
*) n
[1].next
;
9573 case OPCODE_END_OF_LIST
:
9574 _mesa_printf("END-LIST %u\n", list
);
9578 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9580 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9581 opcode
, (void *) n
);
9585 _mesa_printf("command %d, %u operands\n", opcode
,
9589 /* increment n to point to next compiled command */
9590 if (opcode
!= OPCODE_CONTINUE
) {
9591 n
+= InstSize
[opcode
];
9600 * Clients may call this function to help debug display list problems.
9601 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9602 * changed, or break in the future without notice.
9605 mesa_print_display_list(GLuint list
)
9607 GET_CURRENT_CONTEXT(ctx
);
9608 print_list(ctx
, list
);
9612 /**********************************************************************/
9613 /***** Initialization *****/
9614 /**********************************************************************/
9617 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9619 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9621 vfmt
->Begin
= save_Begin
;
9623 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9625 vfmt
->Color3f
= save_Color3f
;
9626 vfmt
->Color3fv
= save_Color3fv
;
9627 vfmt
->Color4f
= save_Color4f
;
9628 vfmt
->Color4fv
= save_Color4fv
;
9629 vfmt
->EdgeFlag
= save_EdgeFlag
;
9630 vfmt
->End
= save_End
;
9632 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9634 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9635 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9636 vfmt
->Indexf
= save_Indexf
;
9637 vfmt
->Indexfv
= save_Indexfv
;
9638 vfmt
->Materialfv
= save_Materialfv
;
9639 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9640 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9641 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9642 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9643 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9644 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9645 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9646 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9647 vfmt
->Normal3f
= save_Normal3f
;
9648 vfmt
->Normal3fv
= save_Normal3fv
;
9649 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9650 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9651 vfmt
->TexCoord1f
= save_TexCoord1f
;
9652 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9653 vfmt
->TexCoord2f
= save_TexCoord2f
;
9654 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9655 vfmt
->TexCoord3f
= save_TexCoord3f
;
9656 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9657 vfmt
->TexCoord4f
= save_TexCoord4f
;
9658 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9659 vfmt
->Vertex2f
= save_Vertex2f
;
9660 vfmt
->Vertex2fv
= save_Vertex2fv
;
9661 vfmt
->Vertex3f
= save_Vertex3f
;
9662 vfmt
->Vertex3fv
= save_Vertex3fv
;
9663 vfmt
->Vertex4f
= save_Vertex4f
;
9664 vfmt
->Vertex4fv
= save_Vertex4fv
;
9665 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9666 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9667 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9668 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9669 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9670 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9671 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9672 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9673 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9674 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9675 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9676 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9677 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9678 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9679 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9680 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9682 vfmt
->Rectf
= save_Rectf
;
9684 /* The driver is required to implement these as
9685 * 1) They can probably do a better job.
9686 * 2) A lot of new mechanisms would have to be added to this module
9687 * to support it. That code would probably never get used,
9691 vfmt
->DrawArrays
= 0;
9692 vfmt
->DrawElements
= 0;
9693 vfmt
->DrawRangeElements
= 0;
9694 vfmt
->MultiDrawElemementsEXT
= 0;
9695 vfmt
->DrawElementsBaseVertex
= 0;
9696 vfmt
->DrawRangeElementsBaseVertex
= 0;
9697 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9703 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9704 const GLvertexformat
*vfmt
)
9706 SET_CallList(disp
, vfmt
->CallList
);
9707 SET_CallLists(disp
, vfmt
->CallLists
);
9711 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9713 SET_CallList(disp
, _mesa_CallList
);
9714 SET_CallLists(disp
, _mesa_CallLists
);
9716 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9717 SET_EndList(disp
, _mesa_EndList
);
9718 SET_GenLists(disp
, _mesa_GenLists
);
9719 SET_IsList(disp
, _mesa_IsList
);
9720 SET_ListBase(disp
, _mesa_ListBase
);
9721 SET_NewList(disp
, _mesa_NewList
);
9725 #endif /* FEATURE_dlist */
9729 * Initialize display list state for given context.
9732 _mesa_init_display_list(GLcontext
*ctx
)
9734 static GLboolean tableInitialized
= GL_FALSE
;
9736 /* zero-out the instruction size table, just once */
9737 if (!tableInitialized
) {
9738 _mesa_bzero(InstSize
, sizeof(InstSize
));
9739 tableInitialized
= GL_TRUE
;
9742 /* extension info */
9743 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9746 ctx
->ListState
.CallDepth
= 0;
9747 ctx
->ExecuteFlag
= GL_TRUE
;
9748 ctx
->CompileFlag
= GL_FALSE
;
9749 ctx
->ListState
.CurrentBlock
= NULL
;
9750 ctx
->ListState
.CurrentPos
= 0;
9752 /* Display List group */
9753 ctx
->List
.ListBase
= 0;
9756 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9762 _mesa_free_display_list_data(GLcontext
*ctx
)
9765 ctx
->ListExt
= NULL
;