2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
34 #include "api_arrayelt.h"
35 #include "api_loopback.h"
37 #include "mfeatures.h"
38 #if FEATURE_ARB_vertex_buffer_object
39 #include "bufferobj.h"
46 #include "framebuffer.h"
47 #include "glapi/glapi.h"
57 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
58 #include "shader/arbprogram.h"
59 #include "shader/program.h"
61 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
62 #include "shader/nvprogram.h"
63 #include "shader/program.h"
65 #if FEATURE_ATI_fragment_shader
66 #include "shader/atifragshader.h"
69 #include "math/m_matrix.h"
71 #include "glapi/dispatch.h"
76 * Other parts of Mesa (such as the VBO module) can plug into the display
77 * list system. This structure describes new display list instructions.
79 struct gl_list_instruction
82 void (*Execute
)( GLcontext
*ctx
, void *data
);
83 void (*Destroy
)( GLcontext
*ctx
, void *data
);
84 void (*Print
)( GLcontext
*ctx
, void *data
);
88 #define MAX_DLIST_EXT_OPCODES 16
91 * Used by device drivers to hook new commands into display lists.
93 struct gl_list_extensions
95 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
104 * \param ctx GL context.
106 * Checks if dd_function_table::SaveNeedFlush is marked to flush
107 * stored (save) vertices, and calls
108 * dd_function_table::SaveFlushVertices if so.
110 #define SAVE_FLUSH_VERTICES(ctx) \
112 if (ctx->Driver.SaveNeedFlush) \
113 ctx->Driver.SaveFlushVertices(ctx); \
118 * Macro to assert that the API call was made outside the
119 * glBegin()/glEnd() pair, with return value.
121 * \param ctx GL context.
122 * \param retval value to return value in case the assertion fails.
124 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
126 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
127 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
128 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
134 * Macro to assert that the API call was made outside the
135 * glBegin()/glEnd() pair.
137 * \param ctx GL context.
139 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
141 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
142 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
143 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
149 * Macro to assert that the API call was made outside the
150 * glBegin()/glEnd() pair and flush the vertices.
152 * \param ctx GL context.
154 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
156 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
157 SAVE_FLUSH_VERTICES(ctx); \
161 * Macro to assert that the API call was made outside the
162 * glBegin()/glEnd() pair and flush the vertices, with return value.
164 * \param ctx GL context.
165 * \param retval value to return value in case the assertion fails.
167 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
169 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
170 SAVE_FLUSH_VERTICES(ctx); \
176 * Display list opcodes.
178 * The fact that these identifiers are assigned consecutive
179 * integer values starting at 0 is very important, see InstSize array usage)
183 OPCODE_INVALID
= -1, /* Force signed enum */
189 OPCODE_BLEND_EQUATION
,
190 OPCODE_BLEND_EQUATION_SEPARATE
,
191 OPCODE_BLEND_FUNC_SEPARATE
,
193 OPCODE_CALL_LIST_OFFSET
,
199 OPCODE_CLEAR_STENCIL
,
200 OPCODE_CLEAR_BUFFER_IV
,
201 OPCODE_CLEAR_BUFFER_UIV
,
202 OPCODE_CLEAR_BUFFER_FV
,
203 OPCODE_CLEAR_BUFFER_FI
,
206 OPCODE_COLOR_MASK_INDEXED
,
207 OPCODE_COLOR_MATERIAL
,
209 OPCODE_COLOR_TABLE_PARAMETER_FV
,
210 OPCODE_COLOR_TABLE_PARAMETER_IV
,
211 OPCODE_COLOR_SUB_TABLE
,
212 OPCODE_CONVOLUTION_FILTER_1D
,
213 OPCODE_CONVOLUTION_FILTER_2D
,
214 OPCODE_CONVOLUTION_PARAMETER_I
,
215 OPCODE_CONVOLUTION_PARAMETER_IV
,
216 OPCODE_CONVOLUTION_PARAMETER_F
,
217 OPCODE_CONVOLUTION_PARAMETER_FV
,
218 OPCODE_COPY_COLOR_SUB_TABLE
,
219 OPCODE_COPY_COLOR_TABLE
,
221 OPCODE_COPY_TEX_IMAGE1D
,
222 OPCODE_COPY_TEX_IMAGE2D
,
223 OPCODE_COPY_TEX_SUB_IMAGE1D
,
224 OPCODE_COPY_TEX_SUB_IMAGE2D
,
225 OPCODE_COPY_TEX_SUB_IMAGE3D
,
231 OPCODE_DISABLE_INDEXED
,
235 OPCODE_ENABLE_INDEXED
,
250 OPCODE_LOAD_IDENTITY
,
264 OPCODE_PIXEL_TRANSFER
,
267 OPCODE_POINT_PARAMETERS
,
269 OPCODE_POLYGON_STIPPLE
,
270 OPCODE_POLYGON_OFFSET
,
274 OPCODE_PRIORITIZE_TEXTURE
,
280 OPCODE_RESET_HISTOGRAM
,
281 OPCODE_RESET_MIN_MAX
,
285 OPCODE_SELECT_TEXTURE_SGIS
,
286 OPCODE_SELECT_TEXTURE_COORD_SET
,
297 OPCODE_TEX_SUB_IMAGE1D
,
298 OPCODE_TEX_SUB_IMAGE2D
,
299 OPCODE_TEX_SUB_IMAGE3D
,
303 /* GL_ARB_multitexture */
304 OPCODE_ACTIVE_TEXTURE
,
305 /* GL_ARB_texture_compression */
306 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
307 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
308 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
309 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
310 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
311 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
312 /* GL_ARB_multisample */
313 OPCODE_SAMPLE_COVERAGE
,
314 /* GL_ARB_window_pos */
315 OPCODE_WINDOW_POS_ARB
,
316 /* GL_NV_vertex_program */
317 OPCODE_BIND_PROGRAM_NV
,
318 OPCODE_EXECUTE_PROGRAM_NV
,
319 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
320 OPCODE_LOAD_PROGRAM_NV
,
321 OPCODE_TRACK_MATRIX_NV
,
322 /* GL_NV_fragment_program */
323 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
324 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
325 /* GL_EXT_stencil_two_side */
326 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
327 /* GL_EXT_depth_bounds_test */
328 OPCODE_DEPTH_BOUNDS_EXT
,
329 /* GL_ARB_vertex/fragment_program */
330 OPCODE_PROGRAM_STRING_ARB
,
331 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
332 /* GL_ARB_occlusion_query */
333 OPCODE_BEGIN_QUERY_ARB
,
334 OPCODE_END_QUERY_ARB
,
335 /* GL_ARB_draw_buffers */
336 OPCODE_DRAW_BUFFERS_ARB
,
337 /* GL_ATI_fragment_shader */
338 OPCODE_TEX_BUMP_PARAMETER_ATI
,
339 /* GL_ATI_fragment_shader */
340 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
341 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
343 OPCODE_STENCIL_FUNC_SEPARATE
,
344 OPCODE_STENCIL_OP_SEPARATE
,
345 OPCODE_STENCIL_MASK_SEPARATE
,
347 /* GL_ARB_shader_objects */
365 OPCODE_UNIFORM_MATRIX22
,
366 OPCODE_UNIFORM_MATRIX33
,
367 OPCODE_UNIFORM_MATRIX44
,
368 OPCODE_UNIFORM_MATRIX23
,
369 OPCODE_UNIFORM_MATRIX32
,
370 OPCODE_UNIFORM_MATRIX24
,
371 OPCODE_UNIFORM_MATRIX42
,
372 OPCODE_UNIFORM_MATRIX34
,
373 OPCODE_UNIFORM_MATRIX43
,
375 /* GL_EXT_framebuffer_blit */
376 OPCODE_BLIT_FRAMEBUFFER
,
378 /* Vertex attributes -- fallback for when optimized display
379 * list build isn't active.
398 /* GL_EXT_provoking_vertex */
399 OPCODE_PROVOKING_VERTEX
,
401 /* The following three are meta instructions */
402 OPCODE_ERROR
, /* raise compiled-in error */
413 * Display list instructions are stored as sequences of "nodes". Nodes
414 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
415 * are linked together with a pointer.
417 * Each instruction in the display list is stored as a sequence of
418 * contiguous nodes in memory.
419 * Each node is the union of a variety of data types.
434 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
438 typedef union gl_dlist_node Node
;
442 * How many nodes to allocate at a time.
444 * \note Reduced now that we hold vertices etc. elsewhere.
446 #define BLOCK_SIZE 256
451 * Number of nodes of storage needed for each instruction.
452 * Sizes for dynamically allocated opcodes are stored in the context struct.
454 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
460 void mesa_print_display_list(GLuint list
);
463 /**********************************************************************/
464 /***** Private *****/
465 /**********************************************************************/
469 * Make an empty display list. This is used by glGenLists() to
470 * reserve display list IDs.
472 static struct gl_display_list
*
473 make_list(GLuint name
, GLuint count
)
475 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
477 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
478 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
484 * Lookup function to just encapsulate casting.
486 static INLINE
struct gl_display_list
*
487 lookup_list(GLcontext
*ctx
, GLuint list
)
489 return (struct gl_display_list
*)
490 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
494 /** Is the given opcode an extension code? */
495 static INLINE GLboolean
496 is_ext_opcode(OpCode opcode
)
498 return (opcode
>= OPCODE_EXT_0
);
502 /** Destroy an extended opcode instruction */
504 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
506 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
508 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
509 step
= ctx
->ListExt
->Opcode
[i
].Size
;
514 /** Execute an extended opcode instruction */
516 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
518 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
520 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
521 step
= ctx
->ListExt
->Opcode
[i
].Size
;
526 /** Print an extended opcode instruction */
528 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
530 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
532 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
533 step
= ctx
->ListExt
->Opcode
[i
].Size
;
539 * Delete the named display list, but don't remove from hash table.
540 * \param dlist - display list pointer
543 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
548 n
= block
= dlist
->Head
;
550 done
= block
? GL_FALSE
: GL_TRUE
;
552 const OpCode opcode
= n
[0].opcode
;
554 /* check for extension opcodes first */
555 if (is_ext_opcode(opcode
)) {
556 n
+= ext_opcode_destroy(ctx
, n
);
560 /* for some commands, we need to free malloc'd memory */
562 _mesa_free(n
[6].data
);
563 n
+= InstSize
[n
[0].opcode
];
566 _mesa_free(n
[10].data
);
567 n
+= InstSize
[n
[0].opcode
];
569 case OPCODE_DRAW_PIXELS
:
570 _mesa_free(n
[5].data
);
571 n
+= InstSize
[n
[0].opcode
];
574 _mesa_free(n
[7].data
);
575 n
+= InstSize
[n
[0].opcode
];
577 case OPCODE_COLOR_TABLE
:
578 _mesa_free(n
[6].data
);
579 n
+= InstSize
[n
[0].opcode
];
581 case OPCODE_COLOR_SUB_TABLE
:
582 _mesa_free(n
[6].data
);
583 n
+= InstSize
[n
[0].opcode
];
585 case OPCODE_CONVOLUTION_FILTER_1D
:
586 _mesa_free(n
[6].data
);
587 n
+= InstSize
[n
[0].opcode
];
589 case OPCODE_CONVOLUTION_FILTER_2D
:
590 _mesa_free(n
[7].data
);
591 n
+= InstSize
[n
[0].opcode
];
593 case OPCODE_POLYGON_STIPPLE
:
594 _mesa_free(n
[1].data
);
595 n
+= InstSize
[n
[0].opcode
];
597 case OPCODE_TEX_IMAGE1D
:
598 _mesa_free(n
[8].data
);
599 n
+= InstSize
[n
[0].opcode
];
601 case OPCODE_TEX_IMAGE2D
:
602 _mesa_free(n
[9].data
);
603 n
+= InstSize
[n
[0].opcode
];
605 case OPCODE_TEX_IMAGE3D
:
606 _mesa_free(n
[10].data
);
607 n
+= InstSize
[n
[0].opcode
];
609 case OPCODE_TEX_SUB_IMAGE1D
:
610 _mesa_free(n
[7].data
);
611 n
+= InstSize
[n
[0].opcode
];
613 case OPCODE_TEX_SUB_IMAGE2D
:
614 _mesa_free(n
[9].data
);
615 n
+= InstSize
[n
[0].opcode
];
617 case OPCODE_TEX_SUB_IMAGE3D
:
618 _mesa_free(n
[11].data
);
619 n
+= InstSize
[n
[0].opcode
];
621 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
622 _mesa_free(n
[7].data
);
623 n
+= InstSize
[n
[0].opcode
];
625 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
626 _mesa_free(n
[8].data
);
627 n
+= InstSize
[n
[0].opcode
];
629 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
630 _mesa_free(n
[9].data
);
631 n
+= InstSize
[n
[0].opcode
];
633 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
634 _mesa_free(n
[7].data
);
635 n
+= InstSize
[n
[0].opcode
];
637 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
638 _mesa_free(n
[9].data
);
639 n
+= InstSize
[n
[0].opcode
];
641 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
642 _mesa_free(n
[11].data
);
643 n
+= InstSize
[n
[0].opcode
];
645 #if FEATURE_NV_vertex_program
646 case OPCODE_LOAD_PROGRAM_NV
:
647 _mesa_free(n
[4].data
); /* program string */
648 n
+= InstSize
[n
[0].opcode
];
650 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
651 _mesa_free(n
[2].data
); /* array of program ids */
652 n
+= InstSize
[n
[0].opcode
];
655 #if FEATURE_NV_fragment_program
656 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
657 _mesa_free(n
[3].data
); /* parameter name */
658 n
+= InstSize
[n
[0].opcode
];
661 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
662 case OPCODE_PROGRAM_STRING_ARB
:
663 _mesa_free(n
[4].data
); /* program string */
664 n
+= InstSize
[n
[0].opcode
];
667 case OPCODE_UNIFORM_1FV
:
668 case OPCODE_UNIFORM_2FV
:
669 case OPCODE_UNIFORM_3FV
:
670 case OPCODE_UNIFORM_4FV
:
671 case OPCODE_UNIFORM_1IV
:
672 case OPCODE_UNIFORM_2IV
:
673 case OPCODE_UNIFORM_3IV
:
674 case OPCODE_UNIFORM_4IV
:
675 _mesa_free(n
[3].data
);
676 n
+= InstSize
[n
[0].opcode
];
678 case OPCODE_UNIFORM_MATRIX22
:
679 case OPCODE_UNIFORM_MATRIX33
:
680 case OPCODE_UNIFORM_MATRIX44
:
681 case OPCODE_UNIFORM_MATRIX24
:
682 case OPCODE_UNIFORM_MATRIX42
:
683 case OPCODE_UNIFORM_MATRIX23
:
684 case OPCODE_UNIFORM_MATRIX32
:
685 case OPCODE_UNIFORM_MATRIX34
:
686 case OPCODE_UNIFORM_MATRIX43
:
687 _mesa_free(n
[4].data
);
688 n
+= InstSize
[n
[0].opcode
];
691 case OPCODE_CONTINUE
:
692 n
= (Node
*) n
[1].next
;
696 case OPCODE_END_OF_LIST
:
701 /* Most frequent case */
702 n
+= InstSize
[n
[0].opcode
];
713 * Destroy a display list and remove from hash table.
714 * \param list - display list number
717 destroy_list(GLcontext
*ctx
, GLuint list
)
719 struct gl_display_list
*dlist
;
724 dlist
= lookup_list(ctx
, list
);
728 _mesa_delete_list(ctx
, dlist
);
729 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
734 * Translate the nth element of list from <type> to GLint.
737 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
749 bptr
= (GLbyte
*) list
;
750 return (GLint
) bptr
[n
];
751 case GL_UNSIGNED_BYTE
:
752 ubptr
= (GLubyte
*) list
;
753 return (GLint
) ubptr
[n
];
755 sptr
= (GLshort
*) list
;
756 return (GLint
) sptr
[n
];
757 case GL_UNSIGNED_SHORT
:
758 usptr
= (GLushort
*) list
;
759 return (GLint
) usptr
[n
];
761 iptr
= (GLint
*) list
;
763 case GL_UNSIGNED_INT
:
764 uiptr
= (GLuint
*) list
;
765 return (GLint
) uiptr
[n
];
767 fptr
= (GLfloat
*) list
;
768 return (GLint
) FLOORF(fptr
[n
]);
770 ubptr
= ((GLubyte
*) list
) + 2 * n
;
771 return (GLint
) ubptr
[0] * 256
774 ubptr
= ((GLubyte
*) list
) + 3 * n
;
775 return (GLint
) ubptr
[0] * 65536
776 + (GLint
) ubptr
[1] * 256
779 ubptr
= ((GLubyte
*) list
) + 4 * n
;
780 return (GLint
) ubptr
[0] * 16777216
781 + (GLint
) ubptr
[1] * 65536
782 + (GLint
) ubptr
[2] * 256
792 /**********************************************************************/
794 /**********************************************************************/
797 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
798 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
801 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
802 GLsizei width
, GLsizei height
, GLsizei depth
,
803 GLenum format
, GLenum type
, const GLvoid
* pixels
,
804 const struct gl_pixelstore_attrib
*unpack
)
806 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
808 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
809 format
, type
, pixels
, unpack
);
810 if (pixels
&& !image
) {
811 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
815 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
816 format
, type
, pixels
)) {
817 const GLubyte
*map
, *src
;
821 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
822 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
824 /* unable to map src buffer! */
825 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
829 src
= ADD_POINTERS(map
, pixels
);
830 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
831 format
, type
, src
, unpack
);
833 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
837 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
847 * Allocate space for a display list instruction (opcode + payload space).
848 * \param opcode the instruction opcode (OPCODE_* value)
849 * \param bytes instruction payload size (not counting opcode)
850 * \return pointer to allocated memory (the opcode space)
853 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
855 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
858 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
859 if (InstSize
[opcode
] == 0) {
860 /* save instruction size now */
861 InstSize
[opcode
] = numNodes
;
864 /* make sure instruction size agrees */
865 ASSERT(numNodes
== InstSize
[opcode
]);
869 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
870 /* This block is full. Allocate a new block and chain to it */
872 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
873 n
[0].opcode
= OPCODE_CONTINUE
;
874 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
876 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
879 n
[1].next
= (Node
*) newblock
;
880 ctx
->ListState
.CurrentBlock
= newblock
;
881 ctx
->ListState
.CurrentPos
= 0;
884 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
885 ctx
->ListState
.CurrentPos
+= numNodes
;
887 n
[0].opcode
= opcode
;
895 * Allocate space for a display list instruction. Used by callers outside
896 * this file for things like VBO vertex data.
898 * \param opcode the instruction opcode (OPCODE_* value)
899 * \param bytes instruction size in bytes, not counting opcode.
900 * \return pointer to the usable data area (not including the internal
904 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
906 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
908 return n
+ 1; /* return pointer to payload area, after opcode */
915 * This function allows modules and drivers to get their own opcodes
916 * for extending display list functionality.
917 * \param ctx the rendering context
918 * \param size number of bytes for storing the new display list command
919 * \param execute function to execute the new display list command
920 * \param destroy function to destroy the new display list command
921 * \param print function to print the new display list command
922 * \return the new opcode number or -1 if error
925 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
927 void (*execute
) (GLcontext
*, void *),
928 void (*destroy
) (GLcontext
*, void *),
929 void (*print
) (GLcontext
*, void *))
931 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
932 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
933 ctx
->ListExt
->Opcode
[i
].Size
=
934 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
935 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
936 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
937 ctx
->ListExt
->Opcode
[i
].Print
= print
;
938 return i
+ OPCODE_EXT_0
;
945 * Allocate space for a display list instruction. The space is basically
946 * an array of Nodes where node[0] holds the opcode, node[1] is the first
947 * function parameter, node[2] is the second parameter, etc.
949 * \param opcode one of OPCODE_x
950 * \param nparams number of function parameters
951 * \return pointer to start of instruction space
954 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
956 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
962 * Display List compilation functions
964 static void GLAPIENTRY
965 save_Accum(GLenum op
, GLfloat value
)
967 GET_CURRENT_CONTEXT(ctx
);
969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
970 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
975 if (ctx
->ExecuteFlag
) {
976 CALL_Accum(ctx
->Exec
, (op
, value
));
981 static void GLAPIENTRY
982 save_AlphaFunc(GLenum func
, GLclampf ref
)
984 GET_CURRENT_CONTEXT(ctx
);
986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
987 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
990 n
[2].f
= (GLfloat
) ref
;
992 if (ctx
->ExecuteFlag
) {
993 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
998 static void GLAPIENTRY
999 save_BindTexture(GLenum target
, GLuint texture
)
1001 GET_CURRENT_CONTEXT(ctx
);
1003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1004 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1009 if (ctx
->ExecuteFlag
) {
1010 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1015 static void GLAPIENTRY
1016 save_Bitmap(GLsizei width
, GLsizei height
,
1017 GLfloat xorig
, GLfloat yorig
,
1018 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1020 GET_CURRENT_CONTEXT(ctx
);
1022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1023 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1025 n
[1].i
= (GLint
) width
;
1026 n
[2].i
= (GLint
) height
;
1031 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1033 if (ctx
->ExecuteFlag
) {
1034 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1035 xorig
, yorig
, xmove
, ymove
, pixels
));
1040 static void GLAPIENTRY
1041 save_BlendEquation(GLenum mode
)
1043 GET_CURRENT_CONTEXT(ctx
);
1045 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1046 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1050 if (ctx
->ExecuteFlag
) {
1051 CALL_BlendEquation(ctx
->Exec
, (mode
));
1056 static void GLAPIENTRY
1057 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1059 GET_CURRENT_CONTEXT(ctx
);
1061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1062 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1067 if (ctx
->ExecuteFlag
) {
1068 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1073 static void GLAPIENTRY
1074 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1075 GLenum sfactorA
, GLenum dfactorA
)
1077 GET_CURRENT_CONTEXT(ctx
);
1079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1080 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1082 n
[1].e
= sfactorRGB
;
1083 n
[2].e
= dfactorRGB
;
1087 if (ctx
->ExecuteFlag
) {
1088 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1089 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1094 static void GLAPIENTRY
1095 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1097 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1101 static void GLAPIENTRY
1102 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1104 GET_CURRENT_CONTEXT(ctx
);
1106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1107 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1114 if (ctx
->ExecuteFlag
) {
1115 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1119 static void invalidate_saved_current_state( GLcontext
*ctx
)
1123 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1124 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1126 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1127 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1129 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1131 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1134 static void GLAPIENTRY
1135 save_CallList(GLuint list
)
1137 GET_CURRENT_CONTEXT(ctx
);
1139 SAVE_FLUSH_VERTICES(ctx
);
1141 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1146 /* After this, we don't know what state we're in. Invalidate all
1147 * cached information previously gathered:
1149 invalidate_saved_current_state( ctx
);
1151 if (ctx
->ExecuteFlag
) {
1152 _mesa_CallList(list
);
1157 static void GLAPIENTRY
1158 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1160 GET_CURRENT_CONTEXT(ctx
);
1162 GLboolean typeErrorFlag
;
1164 SAVE_FLUSH_VERTICES(ctx
);
1168 case GL_UNSIGNED_BYTE
:
1170 case GL_UNSIGNED_SHORT
:
1172 case GL_UNSIGNED_INT
:
1177 typeErrorFlag
= GL_FALSE
;
1180 typeErrorFlag
= GL_TRUE
;
1183 for (i
= 0; i
< num
; i
++) {
1184 GLint list
= translate_id(i
, type
, lists
);
1185 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1188 n
[2].b
= typeErrorFlag
;
1192 /* After this, we don't know what state we're in. Invalidate all
1193 * cached information previously gathered:
1195 invalidate_saved_current_state( ctx
);
1197 if (ctx
->ExecuteFlag
) {
1198 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1203 static void GLAPIENTRY
1204 save_Clear(GLbitfield mask
)
1206 GET_CURRENT_CONTEXT(ctx
);
1208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1209 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1213 if (ctx
->ExecuteFlag
) {
1214 CALL_Clear(ctx
->Exec
, (mask
));
1219 static void GLAPIENTRY
1220 save_ClearBufferiv(GLenum buffer
, GLint drawbuffer
, const GLint
*value
)
1222 GET_CURRENT_CONTEXT(ctx
);
1224 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1225 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_IV
, 6);
1228 n
[2].i
= drawbuffer
;
1230 if (buffer
== GL_COLOR
) {
1241 if (ctx
->ExecuteFlag
) {
1242 /*CALL_ClearBufferiv(ctx->Exec, (buffer, drawbuffer, value));*/
1247 static void GLAPIENTRY
1248 save_ClearBufferuiv(GLenum buffer
, GLint drawbuffer
, const GLuint
*value
)
1250 GET_CURRENT_CONTEXT(ctx
);
1252 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1253 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_UIV
, 6);
1256 n
[2].i
= drawbuffer
;
1258 if (buffer
== GL_COLOR
) {
1269 if (ctx
->ExecuteFlag
) {
1270 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1275 static void GLAPIENTRY
1276 save_ClearBufferfv(GLenum buffer
, GLint drawbuffer
, const GLfloat
*value
)
1278 GET_CURRENT_CONTEXT(ctx
);
1280 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1281 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FV
, 6);
1284 n
[2].i
= drawbuffer
;
1286 if (buffer
== GL_COLOR
) {
1297 if (ctx
->ExecuteFlag
) {
1298 /*CALL_ClearBufferuiv(ctx->Exec, (buffer, drawbuffer, value));*/
1303 static void GLAPIENTRY
1304 save_ClearBufferfi(GLenum buffer
, GLint drawbuffer
,
1305 GLfloat depth
, GLint stencil
)
1307 GET_CURRENT_CONTEXT(ctx
);
1309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1310 n
= alloc_instruction(ctx
, OPCODE_CLEAR_BUFFER_FI
, 4);
1313 n
[2].i
= drawbuffer
;
1317 if (ctx
->ExecuteFlag
) {
1318 /*CALL_ClearBufferfi(ctx->Exec, (buffer, drawbuffer, depth, stencil));*/
1323 static void GLAPIENTRY
1324 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1326 GET_CURRENT_CONTEXT(ctx
);
1328 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1329 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1336 if (ctx
->ExecuteFlag
) {
1337 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1342 static void GLAPIENTRY
1343 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1345 GET_CURRENT_CONTEXT(ctx
);
1347 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1348 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1355 if (ctx
->ExecuteFlag
) {
1356 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1361 static void GLAPIENTRY
1362 save_ClearDepth(GLclampd depth
)
1364 GET_CURRENT_CONTEXT(ctx
);
1366 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1367 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1369 n
[1].f
= (GLfloat
) depth
;
1371 if (ctx
->ExecuteFlag
) {
1372 CALL_ClearDepth(ctx
->Exec
, (depth
));
1377 static void GLAPIENTRY
1378 save_ClearIndex(GLfloat c
)
1380 GET_CURRENT_CONTEXT(ctx
);
1382 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1383 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1387 if (ctx
->ExecuteFlag
) {
1388 CALL_ClearIndex(ctx
->Exec
, (c
));
1393 static void GLAPIENTRY
1394 save_ClearStencil(GLint s
)
1396 GET_CURRENT_CONTEXT(ctx
);
1398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1399 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1403 if (ctx
->ExecuteFlag
) {
1404 CALL_ClearStencil(ctx
->Exec
, (s
));
1409 static void GLAPIENTRY
1410 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1412 GET_CURRENT_CONTEXT(ctx
);
1414 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1415 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1418 n
[2].f
= (GLfloat
) equ
[0];
1419 n
[3].f
= (GLfloat
) equ
[1];
1420 n
[4].f
= (GLfloat
) equ
[2];
1421 n
[5].f
= (GLfloat
) equ
[3];
1423 if (ctx
->ExecuteFlag
) {
1424 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1430 static void GLAPIENTRY
1431 save_ColorMask(GLboolean red
, GLboolean green
,
1432 GLboolean blue
, GLboolean alpha
)
1434 GET_CURRENT_CONTEXT(ctx
);
1436 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1437 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1444 if (ctx
->ExecuteFlag
) {
1445 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1450 static void GLAPIENTRY
1451 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1452 GLboolean blue
, GLboolean alpha
)
1454 GET_CURRENT_CONTEXT(ctx
);
1456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1457 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1465 if (ctx
->ExecuteFlag
) {
1466 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1471 static void GLAPIENTRY
1472 save_ColorMaterial(GLenum face
, GLenum mode
)
1474 GET_CURRENT_CONTEXT(ctx
);
1476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1478 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1483 if (ctx
->ExecuteFlag
) {
1484 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1489 static void GLAPIENTRY
1490 save_ColorTable(GLenum target
, GLenum internalFormat
,
1491 GLsizei width
, GLenum format
, GLenum type
,
1492 const GLvoid
* table
)
1494 GET_CURRENT_CONTEXT(ctx
);
1495 if (_mesa_is_proxy_texture(target
)) {
1496 /* execute immediately */
1497 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1498 format
, type
, table
));
1502 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1503 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1506 n
[2].e
= internalFormat
;
1510 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1513 if (ctx
->ExecuteFlag
) {
1514 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1515 format
, type
, table
));
1522 static void GLAPIENTRY
1523 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1524 const GLfloat
*params
)
1526 GET_CURRENT_CONTEXT(ctx
);
1529 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1531 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1536 if (pname
== GL_COLOR_TABLE_SGI
||
1537 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1538 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1539 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1546 if (ctx
->ExecuteFlag
) {
1547 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1552 static void GLAPIENTRY
1553 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1555 GET_CURRENT_CONTEXT(ctx
);
1558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1560 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1565 if (pname
== GL_COLOR_TABLE_SGI
||
1566 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1567 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1568 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1575 if (ctx
->ExecuteFlag
) {
1576 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1582 static void GLAPIENTRY
1583 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1584 GLenum format
, GLenum type
, const GLvoid
* table
)
1586 GET_CURRENT_CONTEXT(ctx
);
1588 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1589 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1596 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1599 if (ctx
->ExecuteFlag
) {
1600 CALL_ColorSubTable(ctx
->Exec
,
1601 (target
, start
, count
, format
, type
, table
));
1606 static void GLAPIENTRY
1607 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1608 GLint x
, GLint y
, GLsizei width
)
1610 GET_CURRENT_CONTEXT(ctx
);
1613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1614 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1622 if (ctx
->ExecuteFlag
) {
1623 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1628 static void GLAPIENTRY
1629 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1630 GLint x
, GLint y
, GLsizei width
)
1632 GET_CURRENT_CONTEXT(ctx
);
1635 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1636 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1639 n
[2].e
= internalformat
;
1644 if (ctx
->ExecuteFlag
) {
1645 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1650 static void GLAPIENTRY
1651 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1652 GLenum format
, GLenum type
, const GLvoid
* filter
)
1654 GET_CURRENT_CONTEXT(ctx
);
1657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1659 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1662 n
[2].e
= internalFormat
;
1666 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1669 if (ctx
->ExecuteFlag
) {
1670 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1671 format
, type
, filter
));
1676 static void GLAPIENTRY
1677 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1678 GLsizei width
, GLsizei height
, GLenum format
,
1679 GLenum type
, const GLvoid
* filter
)
1681 GET_CURRENT_CONTEXT(ctx
);
1684 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1686 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1689 n
[2].e
= internalFormat
;
1694 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1697 if (ctx
->ExecuteFlag
) {
1698 CALL_ConvolutionFilter2D(ctx
->Exec
,
1699 (target
, internalFormat
, width
, height
, format
,
1705 static void GLAPIENTRY
1706 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1708 GET_CURRENT_CONTEXT(ctx
);
1710 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1711 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1717 if (ctx
->ExecuteFlag
) {
1718 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1723 static void GLAPIENTRY
1724 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1726 GET_CURRENT_CONTEXT(ctx
);
1728 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1729 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1734 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1735 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1736 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1742 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1745 if (ctx
->ExecuteFlag
) {
1746 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1751 static void GLAPIENTRY
1752 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1754 GET_CURRENT_CONTEXT(ctx
);
1756 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1757 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1763 if (ctx
->ExecuteFlag
) {
1764 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1769 static void GLAPIENTRY
1770 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1771 const GLfloat
*params
)
1773 GET_CURRENT_CONTEXT(ctx
);
1775 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1776 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1781 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1782 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1783 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1789 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1792 if (ctx
->ExecuteFlag
) {
1793 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1798 static void GLAPIENTRY
1799 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1801 GET_CURRENT_CONTEXT(ctx
);
1803 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1804 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1808 n
[3].i
= (GLint
) width
;
1809 n
[4].i
= (GLint
) height
;
1812 if (ctx
->ExecuteFlag
) {
1813 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1819 static void GLAPIENTRY
1820 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1821 GLint x
, GLint y
, GLsizei width
, GLint border
)
1823 GET_CURRENT_CONTEXT(ctx
);
1825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1826 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1830 n
[3].e
= internalformat
;
1836 if (ctx
->ExecuteFlag
) {
1837 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1838 x
, y
, width
, border
));
1843 static void GLAPIENTRY
1844 save_CopyTexImage2D(GLenum target
, GLint level
,
1845 GLenum internalformat
,
1846 GLint x
, GLint y
, GLsizei width
,
1847 GLsizei height
, GLint border
)
1849 GET_CURRENT_CONTEXT(ctx
);
1851 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1852 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1856 n
[3].e
= internalformat
;
1863 if (ctx
->ExecuteFlag
) {
1864 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1865 x
, y
, width
, height
, border
));
1871 static void GLAPIENTRY
1872 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1873 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1875 GET_CURRENT_CONTEXT(ctx
);
1877 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1878 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1887 if (ctx
->ExecuteFlag
) {
1888 CALL_CopyTexSubImage1D(ctx
->Exec
,
1889 (target
, level
, xoffset
, x
, y
, width
));
1894 static void GLAPIENTRY
1895 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1896 GLint xoffset
, GLint yoffset
,
1897 GLint x
, GLint y
, GLsizei width
, GLint height
)
1899 GET_CURRENT_CONTEXT(ctx
);
1901 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1902 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1913 if (ctx
->ExecuteFlag
) {
1914 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1915 x
, y
, width
, height
));
1920 static void GLAPIENTRY
1921 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1922 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1923 GLint x
, GLint y
, GLsizei width
, GLint height
)
1925 GET_CURRENT_CONTEXT(ctx
);
1927 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1928 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1940 if (ctx
->ExecuteFlag
) {
1941 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1942 xoffset
, yoffset
, zoffset
,
1943 x
, y
, width
, height
));
1948 static void GLAPIENTRY
1949 save_CullFace(GLenum mode
)
1951 GET_CURRENT_CONTEXT(ctx
);
1953 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1954 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1958 if (ctx
->ExecuteFlag
) {
1959 CALL_CullFace(ctx
->Exec
, (mode
));
1964 static void GLAPIENTRY
1965 save_DepthFunc(GLenum func
)
1967 GET_CURRENT_CONTEXT(ctx
);
1969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1970 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1974 if (ctx
->ExecuteFlag
) {
1975 CALL_DepthFunc(ctx
->Exec
, (func
));
1980 static void GLAPIENTRY
1981 save_DepthMask(GLboolean mask
)
1983 GET_CURRENT_CONTEXT(ctx
);
1985 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1986 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
1990 if (ctx
->ExecuteFlag
) {
1991 CALL_DepthMask(ctx
->Exec
, (mask
));
1996 static void GLAPIENTRY
1997 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1999 GET_CURRENT_CONTEXT(ctx
);
2001 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2002 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
2004 n
[1].f
= (GLfloat
) nearval
;
2005 n
[2].f
= (GLfloat
) farval
;
2007 if (ctx
->ExecuteFlag
) {
2008 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
2013 static void GLAPIENTRY
2014 save_Disable(GLenum cap
)
2016 GET_CURRENT_CONTEXT(ctx
);
2018 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2019 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
2023 if (ctx
->ExecuteFlag
) {
2024 CALL_Disable(ctx
->Exec
, (cap
));
2029 static void GLAPIENTRY
2030 save_DisableIndexed(GLuint index
, GLenum cap
)
2032 GET_CURRENT_CONTEXT(ctx
);
2034 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2035 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
2040 if (ctx
->ExecuteFlag
) {
2041 CALL_DisableIndexedEXT(ctx
->Exec
, (index
, cap
));
2046 static void GLAPIENTRY
2047 save_DrawBuffer(GLenum mode
)
2049 GET_CURRENT_CONTEXT(ctx
);
2051 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2052 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
2056 if (ctx
->ExecuteFlag
) {
2057 CALL_DrawBuffer(ctx
->Exec
, (mode
));
2062 static void GLAPIENTRY
2063 save_DrawPixels(GLsizei width
, GLsizei height
,
2064 GLenum format
, GLenum type
, const GLvoid
* pixels
)
2066 GET_CURRENT_CONTEXT(ctx
);
2069 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2071 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
2077 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
2078 pixels
, &ctx
->Unpack
);
2080 if (ctx
->ExecuteFlag
) {
2081 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2087 static void GLAPIENTRY
2088 save_Enable(GLenum cap
)
2090 GET_CURRENT_CONTEXT(ctx
);
2092 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2093 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2097 if (ctx
->ExecuteFlag
) {
2098 CALL_Enable(ctx
->Exec
, (cap
));
2104 static void GLAPIENTRY
2105 save_EnableIndexed(GLuint index
, GLenum cap
)
2107 GET_CURRENT_CONTEXT(ctx
);
2109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2110 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2115 if (ctx
->ExecuteFlag
) {
2116 CALL_EnableIndexedEXT(ctx
->Exec
, (index
, cap
));
2122 static void GLAPIENTRY
2123 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2125 GET_CURRENT_CONTEXT(ctx
);
2127 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2128 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2134 if (ctx
->ExecuteFlag
) {
2135 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2140 static void GLAPIENTRY
2141 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2143 GET_CURRENT_CONTEXT(ctx
);
2145 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2146 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2154 if (ctx
->ExecuteFlag
) {
2155 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2162 static void GLAPIENTRY
2163 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2165 GET_CURRENT_CONTEXT(ctx
);
2167 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2168 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2176 if (ctx
->ExecuteFlag
) {
2177 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2182 static void GLAPIENTRY
2183 save_Fogf(GLenum pname
, GLfloat param
)
2187 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2188 save_Fogfv(pname
, parray
);
2192 static void GLAPIENTRY
2193 save_Fogiv(GLenum pname
, const GLint
*params
)
2198 case GL_FOG_DENSITY
:
2202 p
[0] = (GLfloat
) *params
;
2208 p
[0] = INT_TO_FLOAT(params
[0]);
2209 p
[1] = INT_TO_FLOAT(params
[1]);
2210 p
[2] = INT_TO_FLOAT(params
[2]);
2211 p
[3] = INT_TO_FLOAT(params
[3]);
2214 /* Error will be caught later in gl_Fogfv */
2215 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2217 save_Fogfv(pname
, p
);
2221 static void GLAPIENTRY
2222 save_Fogi(GLenum pname
, GLint param
)
2226 parray
[1] = parray
[2] = parray
[3] = 0;
2227 save_Fogiv(pname
, parray
);
2231 static void GLAPIENTRY
2232 save_FrontFace(GLenum mode
)
2234 GET_CURRENT_CONTEXT(ctx
);
2236 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2237 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2241 if (ctx
->ExecuteFlag
) {
2242 CALL_FrontFace(ctx
->Exec
, (mode
));
2247 static void GLAPIENTRY
2248 save_Frustum(GLdouble left
, GLdouble right
,
2249 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2256 n
[1].f
= (GLfloat
) left
;
2257 n
[2].f
= (GLfloat
) right
;
2258 n
[3].f
= (GLfloat
) bottom
;
2259 n
[4].f
= (GLfloat
) top
;
2260 n
[5].f
= (GLfloat
) nearval
;
2261 n
[6].f
= (GLfloat
) farval
;
2263 if (ctx
->ExecuteFlag
) {
2264 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2269 static void GLAPIENTRY
2270 save_Hint(GLenum target
, GLenum mode
)
2272 GET_CURRENT_CONTEXT(ctx
);
2274 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2275 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2280 if (ctx
->ExecuteFlag
) {
2281 CALL_Hint(ctx
->Exec
, (target
, mode
));
2286 static void GLAPIENTRY
2287 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2290 GET_CURRENT_CONTEXT(ctx
);
2293 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2294 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2298 n
[3].e
= internalFormat
;
2301 if (ctx
->ExecuteFlag
) {
2302 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2307 static void GLAPIENTRY
2308 save_IndexMask(GLuint mask
)
2310 GET_CURRENT_CONTEXT(ctx
);
2312 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2313 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2317 if (ctx
->ExecuteFlag
) {
2318 CALL_IndexMask(ctx
->Exec
, (mask
));
2323 static void GLAPIENTRY
2324 save_InitNames(void)
2326 GET_CURRENT_CONTEXT(ctx
);
2327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2328 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2329 if (ctx
->ExecuteFlag
) {
2330 CALL_InitNames(ctx
->Exec
, ());
2335 static void GLAPIENTRY
2336 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2338 GET_CURRENT_CONTEXT(ctx
);
2340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2341 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2359 case GL_SPOT_DIRECTION
:
2362 case GL_SPOT_EXPONENT
:
2365 case GL_SPOT_CUTOFF
:
2368 case GL_CONSTANT_ATTENUATION
:
2371 case GL_LINEAR_ATTENUATION
:
2374 case GL_QUADRATIC_ATTENUATION
:
2380 for (i
= 0; i
< nParams
; i
++) {
2381 n
[3 + i
].f
= params
[i
];
2384 if (ctx
->ExecuteFlag
) {
2385 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2390 static void GLAPIENTRY
2391 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2395 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2396 save_Lightfv(light
, pname
, parray
);
2400 static void GLAPIENTRY
2401 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2408 fparam
[0] = INT_TO_FLOAT(params
[0]);
2409 fparam
[1] = INT_TO_FLOAT(params
[1]);
2410 fparam
[2] = INT_TO_FLOAT(params
[2]);
2411 fparam
[3] = INT_TO_FLOAT(params
[3]);
2414 fparam
[0] = (GLfloat
) params
[0];
2415 fparam
[1] = (GLfloat
) params
[1];
2416 fparam
[2] = (GLfloat
) params
[2];
2417 fparam
[3] = (GLfloat
) params
[3];
2419 case GL_SPOT_DIRECTION
:
2420 fparam
[0] = (GLfloat
) params
[0];
2421 fparam
[1] = (GLfloat
) params
[1];
2422 fparam
[2] = (GLfloat
) params
[2];
2424 case GL_SPOT_EXPONENT
:
2425 case GL_SPOT_CUTOFF
:
2426 case GL_CONSTANT_ATTENUATION
:
2427 case GL_LINEAR_ATTENUATION
:
2428 case GL_QUADRATIC_ATTENUATION
:
2429 fparam
[0] = (GLfloat
) params
[0];
2432 /* error will be caught later in gl_Lightfv */
2435 save_Lightfv(light
, pname
, fparam
);
2439 static void GLAPIENTRY
2440 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2444 parray
[1] = parray
[2] = parray
[3] = 0;
2445 save_Lightiv(light
, pname
, parray
);
2449 static void GLAPIENTRY
2450 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2452 GET_CURRENT_CONTEXT(ctx
);
2454 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2455 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2463 if (ctx
->ExecuteFlag
) {
2464 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2469 static void GLAPIENTRY
2470 save_LightModelf(GLenum pname
, GLfloat param
)
2474 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2475 save_LightModelfv(pname
, parray
);
2479 static void GLAPIENTRY
2480 save_LightModeliv(GLenum pname
, const GLint
*params
)
2484 case GL_LIGHT_MODEL_AMBIENT
:
2485 fparam
[0] = INT_TO_FLOAT(params
[0]);
2486 fparam
[1] = INT_TO_FLOAT(params
[1]);
2487 fparam
[2] = INT_TO_FLOAT(params
[2]);
2488 fparam
[3] = INT_TO_FLOAT(params
[3]);
2490 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2491 case GL_LIGHT_MODEL_TWO_SIDE
:
2492 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2493 fparam
[0] = (GLfloat
) params
[0];
2499 /* Error will be caught later in gl_LightModelfv */
2500 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2502 save_LightModelfv(pname
, fparam
);
2506 static void GLAPIENTRY
2507 save_LightModeli(GLenum pname
, GLint param
)
2511 parray
[1] = parray
[2] = parray
[3] = 0;
2512 save_LightModeliv(pname
, parray
);
2516 static void GLAPIENTRY
2517 save_LineStipple(GLint factor
, GLushort pattern
)
2519 GET_CURRENT_CONTEXT(ctx
);
2521 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2522 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2527 if (ctx
->ExecuteFlag
) {
2528 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2533 static void GLAPIENTRY
2534 save_LineWidth(GLfloat width
)
2536 GET_CURRENT_CONTEXT(ctx
);
2538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2539 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2543 if (ctx
->ExecuteFlag
) {
2544 CALL_LineWidth(ctx
->Exec
, (width
));
2549 static void GLAPIENTRY
2550 save_ListBase(GLuint base
)
2552 GET_CURRENT_CONTEXT(ctx
);
2554 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2555 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2559 if (ctx
->ExecuteFlag
) {
2560 CALL_ListBase(ctx
->Exec
, (base
));
2565 static void GLAPIENTRY
2566 save_LoadIdentity(void)
2568 GET_CURRENT_CONTEXT(ctx
);
2569 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2570 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2571 if (ctx
->ExecuteFlag
) {
2572 CALL_LoadIdentity(ctx
->Exec
, ());
2577 static void GLAPIENTRY
2578 save_LoadMatrixf(const GLfloat
* m
)
2580 GET_CURRENT_CONTEXT(ctx
);
2582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2583 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2586 for (i
= 0; i
< 16; i
++) {
2590 if (ctx
->ExecuteFlag
) {
2591 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2596 static void GLAPIENTRY
2597 save_LoadMatrixd(const GLdouble
* m
)
2601 for (i
= 0; i
< 16; i
++) {
2602 f
[i
] = (GLfloat
) m
[i
];
2604 save_LoadMatrixf(f
);
2608 static void GLAPIENTRY
2609 save_LoadName(GLuint name
)
2611 GET_CURRENT_CONTEXT(ctx
);
2613 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2614 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2618 if (ctx
->ExecuteFlag
) {
2619 CALL_LoadName(ctx
->Exec
, (name
));
2624 static void GLAPIENTRY
2625 save_LogicOp(GLenum opcode
)
2627 GET_CURRENT_CONTEXT(ctx
);
2629 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2630 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2634 if (ctx
->ExecuteFlag
) {
2635 CALL_LogicOp(ctx
->Exec
, (opcode
));
2640 static void GLAPIENTRY
2641 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2642 GLint order
, const GLdouble
* points
)
2644 GET_CURRENT_CONTEXT(ctx
);
2646 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2647 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2649 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2651 n
[2].f
= (GLfloat
) u1
;
2652 n
[3].f
= (GLfloat
) u2
;
2653 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2655 n
[6].data
= (void *) pnts
;
2657 if (ctx
->ExecuteFlag
) {
2658 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2662 static void GLAPIENTRY
2663 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2664 GLint order
, const GLfloat
* points
)
2666 GET_CURRENT_CONTEXT(ctx
);
2668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2669 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2671 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2675 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2677 n
[6].data
= (void *) pnts
;
2679 if (ctx
->ExecuteFlag
) {
2680 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2685 static void GLAPIENTRY
2686 save_Map2d(GLenum target
,
2687 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2688 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2689 const GLdouble
* points
)
2691 GET_CURRENT_CONTEXT(ctx
);
2693 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2694 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2696 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2697 vstride
, vorder
, points
);
2699 n
[2].f
= (GLfloat
) u1
;
2700 n
[3].f
= (GLfloat
) u2
;
2701 n
[4].f
= (GLfloat
) v1
;
2702 n
[5].f
= (GLfloat
) v2
;
2703 /* XXX verify these strides are correct */
2704 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2705 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2708 n
[10].data
= (void *) pnts
;
2710 if (ctx
->ExecuteFlag
) {
2711 CALL_Map2d(ctx
->Exec
, (target
,
2712 u1
, u2
, ustride
, uorder
,
2713 v1
, v2
, vstride
, vorder
, points
));
2718 static void GLAPIENTRY
2719 save_Map2f(GLenum target
,
2720 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2721 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2722 const GLfloat
* points
)
2724 GET_CURRENT_CONTEXT(ctx
);
2726 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2727 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2729 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2730 vstride
, vorder
, points
);
2736 /* XXX verify these strides are correct */
2737 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2738 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2741 n
[10].data
= (void *) pnts
;
2743 if (ctx
->ExecuteFlag
) {
2744 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2745 v1
, v2
, vstride
, vorder
, points
));
2750 static void GLAPIENTRY
2751 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2753 GET_CURRENT_CONTEXT(ctx
);
2755 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2756 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2762 if (ctx
->ExecuteFlag
) {
2763 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2768 static void GLAPIENTRY
2769 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2771 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2775 static void GLAPIENTRY
2776 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2777 GLint vn
, GLfloat v1
, GLfloat v2
)
2779 GET_CURRENT_CONTEXT(ctx
);
2781 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2782 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2791 if (ctx
->ExecuteFlag
) {
2792 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2798 static void GLAPIENTRY
2799 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2800 GLint vn
, GLdouble v1
, GLdouble v2
)
2802 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2803 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2807 static void GLAPIENTRY
2808 save_MatrixMode(GLenum mode
)
2810 GET_CURRENT_CONTEXT(ctx
);
2812 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2813 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2817 if (ctx
->ExecuteFlag
) {
2818 CALL_MatrixMode(ctx
->Exec
, (mode
));
2823 static void GLAPIENTRY
2824 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2826 GET_CURRENT_CONTEXT(ctx
);
2829 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2830 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2833 n
[2].e
= internalFormat
;
2836 if (ctx
->ExecuteFlag
) {
2837 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2842 static void GLAPIENTRY
2843 save_MultMatrixf(const GLfloat
* m
)
2845 GET_CURRENT_CONTEXT(ctx
);
2847 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2848 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2851 for (i
= 0; i
< 16; i
++) {
2855 if (ctx
->ExecuteFlag
) {
2856 CALL_MultMatrixf(ctx
->Exec
, (m
));
2861 static void GLAPIENTRY
2862 save_MultMatrixd(const GLdouble
* m
)
2866 for (i
= 0; i
< 16; i
++) {
2867 f
[i
] = (GLfloat
) m
[i
];
2869 save_MultMatrixf(f
);
2873 static void GLAPIENTRY
2874 save_NewList(GLuint name
, GLenum mode
)
2876 GET_CURRENT_CONTEXT(ctx
);
2877 /* It's an error to call this function while building a display list */
2878 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2885 static void GLAPIENTRY
2886 save_Ortho(GLdouble left
, GLdouble right
,
2887 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2889 GET_CURRENT_CONTEXT(ctx
);
2891 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2892 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2894 n
[1].f
= (GLfloat
) left
;
2895 n
[2].f
= (GLfloat
) right
;
2896 n
[3].f
= (GLfloat
) bottom
;
2897 n
[4].f
= (GLfloat
) top
;
2898 n
[5].f
= (GLfloat
) nearval
;
2899 n
[6].f
= (GLfloat
) farval
;
2901 if (ctx
->ExecuteFlag
) {
2902 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2907 static void GLAPIENTRY
2908 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2910 GET_CURRENT_CONTEXT(ctx
);
2912 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2913 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2917 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2918 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2920 if (ctx
->ExecuteFlag
) {
2921 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2926 static void GLAPIENTRY
2927 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2929 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2931 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2932 for (i
= 0; i
< mapsize
; i
++) {
2933 fvalues
[i
] = (GLfloat
) values
[i
];
2937 for (i
= 0; i
< mapsize
; i
++) {
2938 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2941 save_PixelMapfv(map
, mapsize
, fvalues
);
2945 static void GLAPIENTRY
2946 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2948 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2950 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2951 for (i
= 0; i
< mapsize
; i
++) {
2952 fvalues
[i
] = (GLfloat
) values
[i
];
2956 for (i
= 0; i
< mapsize
; i
++) {
2957 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2960 save_PixelMapfv(map
, mapsize
, fvalues
);
2964 static void GLAPIENTRY
2965 save_PixelTransferf(GLenum pname
, GLfloat param
)
2967 GET_CURRENT_CONTEXT(ctx
);
2969 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2970 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2975 if (ctx
->ExecuteFlag
) {
2976 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2981 static void GLAPIENTRY
2982 save_PixelTransferi(GLenum pname
, GLint param
)
2984 save_PixelTransferf(pname
, (GLfloat
) param
);
2988 static void GLAPIENTRY
2989 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2991 GET_CURRENT_CONTEXT(ctx
);
2993 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2994 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2999 if (ctx
->ExecuteFlag
) {
3000 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
3005 static void GLAPIENTRY
3006 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
3008 GET_CURRENT_CONTEXT(ctx
);
3010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3011 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
3018 if (ctx
->ExecuteFlag
) {
3019 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
3024 static void GLAPIENTRY
3025 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
3029 parray
[1] = parray
[2] = 0.0F
;
3030 save_PointParameterfvEXT(pname
, parray
);
3033 static void GLAPIENTRY
3034 save_PointParameteriNV(GLenum pname
, GLint param
)
3037 parray
[0] = (GLfloat
) param
;
3038 parray
[1] = parray
[2] = 0.0F
;
3039 save_PointParameterfvEXT(pname
, parray
);
3042 static void GLAPIENTRY
3043 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
3046 parray
[0] = (GLfloat
) param
[0];
3047 parray
[1] = parray
[2] = 0.0F
;
3048 save_PointParameterfvEXT(pname
, parray
);
3052 static void GLAPIENTRY
3053 save_PointSize(GLfloat size
)
3055 GET_CURRENT_CONTEXT(ctx
);
3057 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3058 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
3062 if (ctx
->ExecuteFlag
) {
3063 CALL_PointSize(ctx
->Exec
, (size
));
3068 static void GLAPIENTRY
3069 save_PolygonMode(GLenum face
, GLenum mode
)
3071 GET_CURRENT_CONTEXT(ctx
);
3073 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3074 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
3079 if (ctx
->ExecuteFlag
) {
3080 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
3085 static void GLAPIENTRY
3086 save_PolygonStipple(const GLubyte
* pattern
)
3088 GET_CURRENT_CONTEXT(ctx
);
3091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3093 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3095 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3096 pattern
, &ctx
->Unpack
);
3098 if (ctx
->ExecuteFlag
) {
3099 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3104 static void GLAPIENTRY
3105 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3107 GET_CURRENT_CONTEXT(ctx
);
3109 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3110 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3115 if (ctx
->ExecuteFlag
) {
3116 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3121 static void GLAPIENTRY
3122 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3124 GET_CURRENT_CONTEXT(ctx
);
3125 /* XXX mult by DepthMaxF here??? */
3126 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3130 static void GLAPIENTRY
3131 save_PopAttrib(void)
3133 GET_CURRENT_CONTEXT(ctx
);
3134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3135 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3136 if (ctx
->ExecuteFlag
) {
3137 CALL_PopAttrib(ctx
->Exec
, ());
3142 static void GLAPIENTRY
3143 save_PopMatrix(void)
3145 GET_CURRENT_CONTEXT(ctx
);
3146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3147 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3148 if (ctx
->ExecuteFlag
) {
3149 CALL_PopMatrix(ctx
->Exec
, ());
3154 static void GLAPIENTRY
3157 GET_CURRENT_CONTEXT(ctx
);
3158 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3159 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3160 if (ctx
->ExecuteFlag
) {
3161 CALL_PopName(ctx
->Exec
, ());
3166 static void GLAPIENTRY
3167 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3168 const GLclampf
* priorities
)
3170 GET_CURRENT_CONTEXT(ctx
);
3172 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3174 for (i
= 0; i
< num
; i
++) {
3176 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3178 n
[1].ui
= textures
[i
];
3179 n
[2].f
= priorities
[i
];
3182 if (ctx
->ExecuteFlag
) {
3183 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3188 static void GLAPIENTRY
3189 save_PushAttrib(GLbitfield mask
)
3191 GET_CURRENT_CONTEXT(ctx
);
3193 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3194 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3198 if (ctx
->ExecuteFlag
) {
3199 CALL_PushAttrib(ctx
->Exec
, (mask
));
3204 static void GLAPIENTRY
3205 save_PushMatrix(void)
3207 GET_CURRENT_CONTEXT(ctx
);
3208 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3209 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3210 if (ctx
->ExecuteFlag
) {
3211 CALL_PushMatrix(ctx
->Exec
, ());
3216 static void GLAPIENTRY
3217 save_PushName(GLuint name
)
3219 GET_CURRENT_CONTEXT(ctx
);
3221 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3222 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3226 if (ctx
->ExecuteFlag
) {
3227 CALL_PushName(ctx
->Exec
, (name
));
3232 static void GLAPIENTRY
3233 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3235 GET_CURRENT_CONTEXT(ctx
);
3237 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3238 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3245 if (ctx
->ExecuteFlag
) {
3246 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3250 static void GLAPIENTRY
3251 save_RasterPos2d(GLdouble x
, GLdouble y
)
3253 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3256 static void GLAPIENTRY
3257 save_RasterPos2f(GLfloat x
, GLfloat y
)
3259 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3262 static void GLAPIENTRY
3263 save_RasterPos2i(GLint x
, GLint y
)
3265 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3268 static void GLAPIENTRY
3269 save_RasterPos2s(GLshort x
, GLshort y
)
3271 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3274 static void GLAPIENTRY
3275 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3277 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3280 static void GLAPIENTRY
3281 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3283 save_RasterPos4f(x
, y
, z
, 1.0F
);
3286 static void GLAPIENTRY
3287 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3289 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3292 static void GLAPIENTRY
3293 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3295 save_RasterPos4f(x
, y
, z
, 1.0F
);
3298 static void GLAPIENTRY
3299 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3301 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3304 static void GLAPIENTRY
3305 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3307 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3310 static void GLAPIENTRY
3311 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3313 save_RasterPos4f(x
, y
, z
, w
);
3316 static void GLAPIENTRY
3317 save_RasterPos2dv(const GLdouble
* v
)
3319 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3322 static void GLAPIENTRY
3323 save_RasterPos2fv(const GLfloat
* v
)
3325 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3328 static void GLAPIENTRY
3329 save_RasterPos2iv(const GLint
* v
)
3331 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3334 static void GLAPIENTRY
3335 save_RasterPos2sv(const GLshort
* v
)
3337 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3340 static void GLAPIENTRY
3341 save_RasterPos3dv(const GLdouble
* v
)
3343 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3346 static void GLAPIENTRY
3347 save_RasterPos3fv(const GLfloat
* v
)
3349 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3352 static void GLAPIENTRY
3353 save_RasterPos3iv(const GLint
* v
)
3355 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3358 static void GLAPIENTRY
3359 save_RasterPos3sv(const GLshort
* v
)
3361 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3364 static void GLAPIENTRY
3365 save_RasterPos4dv(const GLdouble
* v
)
3367 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3368 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3371 static void GLAPIENTRY
3372 save_RasterPos4fv(const GLfloat
* v
)
3374 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3377 static void GLAPIENTRY
3378 save_RasterPos4iv(const GLint
* v
)
3380 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3381 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3384 static void GLAPIENTRY
3385 save_RasterPos4sv(const GLshort
* v
)
3387 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3391 static void GLAPIENTRY
3392 save_PassThrough(GLfloat token
)
3394 GET_CURRENT_CONTEXT(ctx
);
3396 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3397 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3401 if (ctx
->ExecuteFlag
) {
3402 CALL_PassThrough(ctx
->Exec
, (token
));
3407 static void GLAPIENTRY
3408 save_ReadBuffer(GLenum mode
)
3410 GET_CURRENT_CONTEXT(ctx
);
3412 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3413 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3417 if (ctx
->ExecuteFlag
) {
3418 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3423 static void GLAPIENTRY
3424 save_ResetHistogram(GLenum target
)
3426 GET_CURRENT_CONTEXT(ctx
);
3428 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3429 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3433 if (ctx
->ExecuteFlag
) {
3434 CALL_ResetHistogram(ctx
->Exec
, (target
));
3439 static void GLAPIENTRY
3440 save_ResetMinmax(GLenum target
)
3442 GET_CURRENT_CONTEXT(ctx
);
3444 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3445 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3449 if (ctx
->ExecuteFlag
) {
3450 CALL_ResetMinmax(ctx
->Exec
, (target
));
3455 static void GLAPIENTRY
3456 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3458 GET_CURRENT_CONTEXT(ctx
);
3460 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3461 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3468 if (ctx
->ExecuteFlag
) {
3469 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3474 static void GLAPIENTRY
3475 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3477 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3481 static void GLAPIENTRY
3482 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3484 GET_CURRENT_CONTEXT(ctx
);
3486 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3487 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3493 if (ctx
->ExecuteFlag
) {
3494 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3499 static void GLAPIENTRY
3500 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3502 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3506 static void GLAPIENTRY
3507 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3509 GET_CURRENT_CONTEXT(ctx
);
3511 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3512 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3519 if (ctx
->ExecuteFlag
) {
3520 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3525 static void GLAPIENTRY
3526 save_ShadeModel(GLenum mode
)
3528 GET_CURRENT_CONTEXT(ctx
);
3530 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3532 if (ctx
->ExecuteFlag
) {
3533 CALL_ShadeModel(ctx
->Exec
, (mode
));
3536 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3539 SAVE_FLUSH_VERTICES(ctx
);
3541 /* Only save the value if we know the statechange will take effect:
3543 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3544 ctx
->ListState
.Current
.ShadeModel
= mode
;
3546 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3553 static void GLAPIENTRY
3554 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3556 GET_CURRENT_CONTEXT(ctx
);
3558 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3559 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3565 if (ctx
->ExecuteFlag
) {
3566 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3571 static void GLAPIENTRY
3572 save_StencilMask(GLuint mask
)
3574 GET_CURRENT_CONTEXT(ctx
);
3576 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3577 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3581 if (ctx
->ExecuteFlag
) {
3582 CALL_StencilMask(ctx
->Exec
, (mask
));
3587 static void GLAPIENTRY
3588 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3590 GET_CURRENT_CONTEXT(ctx
);
3592 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3593 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3599 if (ctx
->ExecuteFlag
) {
3600 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3605 static void GLAPIENTRY
3606 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3608 GET_CURRENT_CONTEXT(ctx
);
3610 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3611 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3618 if (ctx
->ExecuteFlag
) {
3619 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3624 static void GLAPIENTRY
3625 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3628 GET_CURRENT_CONTEXT(ctx
);
3630 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3632 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3640 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3647 if (ctx
->ExecuteFlag
) {
3648 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3649 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3654 static void GLAPIENTRY
3655 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3657 GET_CURRENT_CONTEXT(ctx
);
3659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3660 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3665 if (ctx
->ExecuteFlag
) {
3666 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3671 static void GLAPIENTRY
3672 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3674 GET_CURRENT_CONTEXT(ctx
);
3676 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3677 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3684 if (ctx
->ExecuteFlag
) {
3685 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3690 static void GLAPIENTRY
3691 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3693 GET_CURRENT_CONTEXT(ctx
);
3695 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3696 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3700 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3708 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3711 if (ctx
->ExecuteFlag
) {
3712 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3717 static void GLAPIENTRY
3718 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3721 parray
[0] = (GLfloat
) param
;
3722 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3723 save_TexEnvfv(target
, pname
, parray
);
3727 static void GLAPIENTRY
3728 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3731 p
[0] = (GLfloat
) param
;
3732 p
[1] = p
[2] = p
[3] = 0.0;
3733 save_TexEnvfv(target
, pname
, p
);
3737 static void GLAPIENTRY
3738 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3741 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3742 p
[0] = INT_TO_FLOAT(param
[0]);
3743 p
[1] = INT_TO_FLOAT(param
[1]);
3744 p
[2] = INT_TO_FLOAT(param
[2]);
3745 p
[3] = INT_TO_FLOAT(param
[3]);
3748 p
[0] = (GLfloat
) param
[0];
3749 p
[1] = p
[2] = p
[3] = 0.0F
;
3751 save_TexEnvfv(target
, pname
, p
);
3755 static void GLAPIENTRY
3756 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3758 GET_CURRENT_CONTEXT(ctx
);
3760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3761 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3770 if (ctx
->ExecuteFlag
) {
3771 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3776 static void GLAPIENTRY
3777 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3780 p
[0] = (GLfloat
) params
[0];
3781 p
[1] = (GLfloat
) params
[1];
3782 p
[2] = (GLfloat
) params
[2];
3783 p
[3] = (GLfloat
) params
[3];
3784 save_TexGenfv(coord
, pname
, p
);
3788 static void GLAPIENTRY
3789 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3792 parray
[0] = (GLfloat
) param
;
3793 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3794 save_TexGenfv(coord
, pname
, parray
);
3798 static void GLAPIENTRY
3799 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3802 p
[0] = (GLfloat
) params
[0];
3803 p
[1] = (GLfloat
) params
[1];
3804 p
[2] = (GLfloat
) params
[2];
3805 p
[3] = (GLfloat
) params
[3];
3806 save_TexGenfv(coord
, pname
, p
);
3810 static void GLAPIENTRY
3811 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3815 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3816 save_TexGenfv(coord
, pname
, parray
);
3820 static void GLAPIENTRY
3821 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3825 parray
[1] = parray
[2] = parray
[3] = 0;
3826 save_TexGeniv(coord
, pname
, parray
);
3830 static void GLAPIENTRY
3831 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3833 GET_CURRENT_CONTEXT(ctx
);
3835 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3836 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3845 if (ctx
->ExecuteFlag
) {
3846 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3851 static void GLAPIENTRY
3852 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3856 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3857 save_TexParameterfv(target
, pname
, parray
);
3861 static void GLAPIENTRY
3862 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3865 fparam
[0] = (GLfloat
) param
;
3866 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3867 save_TexParameterfv(target
, pname
, fparam
);
3871 static void GLAPIENTRY
3872 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3875 fparam
[0] = (GLfloat
) params
[0];
3876 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3877 save_TexParameterfv(target
, pname
, fparam
);
3881 static void GLAPIENTRY
3882 save_TexImage1D(GLenum target
,
3883 GLint level
, GLint components
,
3884 GLsizei width
, GLint border
,
3885 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3887 GET_CURRENT_CONTEXT(ctx
);
3888 if (target
== GL_PROXY_TEXTURE_1D
) {
3889 /* don't compile, execute immediately */
3890 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3891 border
, format
, type
, pixels
));
3895 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3896 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3900 n
[3].i
= components
;
3901 n
[4].i
= (GLint
) width
;
3905 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3906 pixels
, &ctx
->Unpack
);
3908 if (ctx
->ExecuteFlag
) {
3909 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3910 border
, format
, type
, pixels
));
3916 static void GLAPIENTRY
3917 save_TexImage2D(GLenum target
,
3918 GLint level
, GLint components
,
3919 GLsizei width
, GLsizei height
, GLint border
,
3920 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3922 GET_CURRENT_CONTEXT(ctx
);
3923 if (target
== GL_PROXY_TEXTURE_2D
) {
3924 /* don't compile, execute immediately */
3925 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3926 height
, border
, format
, type
, pixels
));
3930 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3931 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3935 n
[3].i
= components
;
3936 n
[4].i
= (GLint
) width
;
3937 n
[5].i
= (GLint
) height
;
3941 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3942 pixels
, &ctx
->Unpack
);
3944 if (ctx
->ExecuteFlag
) {
3945 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3946 height
, border
, format
, type
, pixels
));
3952 static void GLAPIENTRY
3953 save_TexImage3D(GLenum target
,
3954 GLint level
, GLint internalFormat
,
3955 GLsizei width
, GLsizei height
, GLsizei depth
,
3957 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3959 GET_CURRENT_CONTEXT(ctx
);
3960 if (target
== GL_PROXY_TEXTURE_3D
) {
3961 /* don't compile, execute immediately */
3962 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3963 height
, depth
, border
, format
, type
,
3968 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3969 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3973 n
[3].i
= (GLint
) internalFormat
;
3974 n
[4].i
= (GLint
) width
;
3975 n
[5].i
= (GLint
) height
;
3976 n
[6].i
= (GLint
) depth
;
3980 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3981 pixels
, &ctx
->Unpack
);
3983 if (ctx
->ExecuteFlag
) {
3984 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3985 height
, depth
, border
, format
, type
,
3992 static void GLAPIENTRY
3993 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3994 GLsizei width
, GLenum format
, GLenum type
,
3995 const GLvoid
* pixels
)
3997 GET_CURRENT_CONTEXT(ctx
);
4000 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4002 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
4007 n
[4].i
= (GLint
) width
;
4010 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
4011 pixels
, &ctx
->Unpack
);
4013 if (ctx
->ExecuteFlag
) {
4014 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
4015 format
, type
, pixels
));
4020 static void GLAPIENTRY
4021 save_TexSubImage2D(GLenum target
, GLint level
,
4022 GLint xoffset
, GLint yoffset
,
4023 GLsizei width
, GLsizei height
,
4024 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4026 GET_CURRENT_CONTEXT(ctx
);
4029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4031 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
4037 n
[5].i
= (GLint
) width
;
4038 n
[6].i
= (GLint
) height
;
4041 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
4042 pixels
, &ctx
->Unpack
);
4044 if (ctx
->ExecuteFlag
) {
4045 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
4046 width
, height
, format
, type
, pixels
));
4051 static void GLAPIENTRY
4052 save_TexSubImage3D(GLenum target
, GLint level
,
4053 GLint xoffset
, GLint yoffset
, GLint zoffset
,
4054 GLsizei width
, GLsizei height
, GLsizei depth
,
4055 GLenum format
, GLenum type
, const GLvoid
* pixels
)
4057 GET_CURRENT_CONTEXT(ctx
);
4060 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4062 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
4069 n
[6].i
= (GLint
) width
;
4070 n
[7].i
= (GLint
) height
;
4071 n
[8].i
= (GLint
) depth
;
4074 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
4075 pixels
, &ctx
->Unpack
);
4077 if (ctx
->ExecuteFlag
) {
4078 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
4079 xoffset
, yoffset
, zoffset
,
4080 width
, height
, depth
, format
, type
,
4086 static void GLAPIENTRY
4087 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4089 GET_CURRENT_CONTEXT(ctx
);
4091 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4092 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4098 if (ctx
->ExecuteFlag
) {
4099 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4104 static void GLAPIENTRY
4105 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4107 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4112 static void GLAPIENTRY
4113 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4115 GET_CURRENT_CONTEXT(ctx
);
4117 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4118 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4122 n
[3].i
= (GLint
) width
;
4123 n
[4].i
= (GLint
) height
;
4125 if (ctx
->ExecuteFlag
) {
4126 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4131 static void GLAPIENTRY
4132 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4134 GET_CURRENT_CONTEXT(ctx
);
4136 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4137 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4144 if (ctx
->ExecuteFlag
) {
4145 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4149 static void GLAPIENTRY
4150 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4152 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4155 static void GLAPIENTRY
4156 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4158 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4161 static void GLAPIENTRY
4162 save_WindowPos2iMESA(GLint x
, GLint y
)
4164 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4167 static void GLAPIENTRY
4168 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4170 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4173 static void GLAPIENTRY
4174 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4176 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4179 static void GLAPIENTRY
4180 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4182 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4185 static void GLAPIENTRY
4186 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4188 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4191 static void GLAPIENTRY
4192 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4194 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4197 static void GLAPIENTRY
4198 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4200 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4203 static void GLAPIENTRY
4204 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4206 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4209 static void GLAPIENTRY
4210 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4212 save_WindowPos4fMESA(x
, y
, z
, w
);
4215 static void GLAPIENTRY
4216 save_WindowPos2dvMESA(const GLdouble
* v
)
4218 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4221 static void GLAPIENTRY
4222 save_WindowPos2fvMESA(const GLfloat
* v
)
4224 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4227 static void GLAPIENTRY
4228 save_WindowPos2ivMESA(const GLint
* v
)
4230 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4233 static void GLAPIENTRY
4234 save_WindowPos2svMESA(const GLshort
* v
)
4236 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4239 static void GLAPIENTRY
4240 save_WindowPos3dvMESA(const GLdouble
* v
)
4242 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4245 static void GLAPIENTRY
4246 save_WindowPos3fvMESA(const GLfloat
* v
)
4248 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4251 static void GLAPIENTRY
4252 save_WindowPos3ivMESA(const GLint
* v
)
4254 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4257 static void GLAPIENTRY
4258 save_WindowPos3svMESA(const GLshort
* v
)
4260 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4263 static void GLAPIENTRY
4264 save_WindowPos4dvMESA(const GLdouble
* v
)
4266 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4267 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4270 static void GLAPIENTRY
4271 save_WindowPos4fvMESA(const GLfloat
* v
)
4273 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4276 static void GLAPIENTRY
4277 save_WindowPos4ivMESA(const GLint
* v
)
4279 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4280 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4283 static void GLAPIENTRY
4284 save_WindowPos4svMESA(const GLshort
* v
)
4286 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4291 /* GL_ARB_multitexture */
4292 static void GLAPIENTRY
4293 save_ActiveTextureARB(GLenum target
)
4295 GET_CURRENT_CONTEXT(ctx
);
4297 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4298 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4302 if (ctx
->ExecuteFlag
) {
4303 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4308 /* GL_ARB_transpose_matrix */
4310 static void GLAPIENTRY
4311 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4314 _math_transposefd(tm
, m
);
4315 save_LoadMatrixf(tm
);
4319 static void GLAPIENTRY
4320 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4323 _math_transposef(tm
, m
);
4324 save_LoadMatrixf(tm
);
4328 static void GLAPIENTRY
4329 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4332 _math_transposefd(tm
, m
);
4333 save_MultMatrixf(tm
);
4337 static void GLAPIENTRY
4338 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4341 _math_transposef(tm
, m
);
4342 save_MultMatrixf(tm
);
4346 /* GL_ARB_texture_compression */
4347 static void GLAPIENTRY
4348 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4349 GLenum internalFormat
, GLsizei width
,
4350 GLint border
, GLsizei imageSize
,
4351 const GLvoid
* data
)
4353 GET_CURRENT_CONTEXT(ctx
);
4354 if (target
== GL_PROXY_TEXTURE_1D
) {
4355 /* don't compile, execute immediately */
4356 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4357 width
, border
, imageSize
,
4363 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4364 /* make copy of image */
4365 image
= _mesa_malloc(imageSize
);
4367 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4370 MEMCPY(image
, data
, imageSize
);
4371 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4375 n
[3].e
= internalFormat
;
4376 n
[4].i
= (GLint
) width
;
4384 if (ctx
->ExecuteFlag
) {
4385 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4386 (target
, level
, internalFormat
, width
,
4387 border
, imageSize
, data
));
4393 static void GLAPIENTRY
4394 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4395 GLenum internalFormat
, GLsizei width
,
4396 GLsizei height
, GLint border
, GLsizei imageSize
,
4397 const GLvoid
* data
)
4399 GET_CURRENT_CONTEXT(ctx
);
4400 if (target
== GL_PROXY_TEXTURE_2D
) {
4401 /* don't compile, execute immediately */
4402 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4403 width
, height
, border
,
4409 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4410 /* make copy of image */
4411 image
= _mesa_malloc(imageSize
);
4413 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4416 MEMCPY(image
, data
, imageSize
);
4417 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4421 n
[3].e
= internalFormat
;
4422 n
[4].i
= (GLint
) width
;
4423 n
[5].i
= (GLint
) height
;
4431 if (ctx
->ExecuteFlag
) {
4432 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4433 (target
, level
, internalFormat
, width
,
4434 height
, border
, imageSize
, data
));
4440 static void GLAPIENTRY
4441 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4442 GLenum internalFormat
, GLsizei width
,
4443 GLsizei height
, GLsizei depth
, GLint border
,
4444 GLsizei imageSize
, const GLvoid
* data
)
4446 GET_CURRENT_CONTEXT(ctx
);
4447 if (target
== GL_PROXY_TEXTURE_3D
) {
4448 /* don't compile, execute immediately */
4449 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4450 width
, height
, depth
, border
,
4456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4457 /* make copy of image */
4458 image
= _mesa_malloc(imageSize
);
4460 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4463 MEMCPY(image
, data
, imageSize
);
4464 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4468 n
[3].e
= internalFormat
;
4469 n
[4].i
= (GLint
) width
;
4470 n
[5].i
= (GLint
) height
;
4471 n
[6].i
= (GLint
) depth
;
4479 if (ctx
->ExecuteFlag
) {
4480 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4481 (target
, level
, internalFormat
, width
,
4482 height
, depth
, border
, imageSize
,
4489 static void GLAPIENTRY
4490 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4491 GLsizei width
, GLenum format
,
4492 GLsizei imageSize
, const GLvoid
* data
)
4497 GET_CURRENT_CONTEXT(ctx
);
4498 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4500 /* make copy of image */
4501 image
= _mesa_malloc(imageSize
);
4503 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4506 MEMCPY(image
, data
, imageSize
);
4507 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4512 n
[4].i
= (GLint
) width
;
4520 if (ctx
->ExecuteFlag
) {
4521 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4522 width
, format
, imageSize
,
4528 static void GLAPIENTRY
4529 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4530 GLint yoffset
, GLsizei width
, GLsizei height
,
4531 GLenum format
, GLsizei imageSize
,
4532 const GLvoid
* data
)
4537 GET_CURRENT_CONTEXT(ctx
);
4538 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4540 /* make copy of image */
4541 image
= _mesa_malloc(imageSize
);
4543 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4546 MEMCPY(image
, data
, imageSize
);
4547 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4553 n
[5].i
= (GLint
) width
;
4554 n
[6].i
= (GLint
) height
;
4562 if (ctx
->ExecuteFlag
) {
4563 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4564 (target
, level
, xoffset
, yoffset
, width
,
4565 height
, format
, imageSize
, data
));
4570 static void GLAPIENTRY
4571 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4572 GLint yoffset
, GLint zoffset
, GLsizei width
,
4573 GLsizei height
, GLsizei depth
, GLenum format
,
4574 GLsizei imageSize
, const GLvoid
* data
)
4579 GET_CURRENT_CONTEXT(ctx
);
4580 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4582 /* make copy of image */
4583 image
= _mesa_malloc(imageSize
);
4585 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4588 MEMCPY(image
, data
, imageSize
);
4589 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4596 n
[6].i
= (GLint
) width
;
4597 n
[7].i
= (GLint
) height
;
4598 n
[8].i
= (GLint
) depth
;
4600 n
[10].i
= imageSize
;
4606 if (ctx
->ExecuteFlag
) {
4607 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4608 (target
, level
, xoffset
, yoffset
,
4609 zoffset
, width
, height
, depth
, format
,
4615 /* GL_ARB_multisample */
4616 static void GLAPIENTRY
4617 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4619 GET_CURRENT_CONTEXT(ctx
);
4621 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4622 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4627 if (ctx
->ExecuteFlag
) {
4628 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4634 * GL_NV_vertex_program
4636 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4637 static void GLAPIENTRY
4638 save_BindProgramNV(GLenum target
, GLuint id
)
4640 GET_CURRENT_CONTEXT(ctx
);
4642 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4643 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4648 if (ctx
->ExecuteFlag
) {
4649 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4653 static void GLAPIENTRY
4654 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4655 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4657 GET_CURRENT_CONTEXT(ctx
);
4659 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4660 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4669 if (ctx
->ExecuteFlag
) {
4670 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4675 static void GLAPIENTRY
4676 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4677 const GLfloat
*params
)
4679 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4680 params
[2], params
[3]);
4684 static void GLAPIENTRY
4685 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4686 const GLfloat
* params
)
4688 GET_CURRENT_CONTEXT(ctx
);
4690 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4694 const GLfloat
* p
= params
;
4696 for (i
= 0 ; i
< count
; i
++) {
4697 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4710 if (ctx
->ExecuteFlag
) {
4711 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4716 static void GLAPIENTRY
4717 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4718 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4720 save_ProgramEnvParameter4fARB(target
, index
,
4722 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4726 static void GLAPIENTRY
4727 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4728 const GLdouble
*params
)
4730 save_ProgramEnvParameter4fARB(target
, index
,
4731 (GLfloat
) params
[0],
4732 (GLfloat
) params
[1],
4733 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4736 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4738 #if FEATURE_NV_vertex_program
4739 static void GLAPIENTRY
4740 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4742 GET_CURRENT_CONTEXT(ctx
);
4744 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4745 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4754 if (ctx
->ExecuteFlag
) {
4755 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4760 static void GLAPIENTRY
4761 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4762 GLuint num
, const GLdouble
*params
)
4765 for (i
= 0; i
< num
; i
++) {
4766 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4771 static void GLAPIENTRY
4772 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4773 GLuint num
, const GLfloat
*params
)
4776 for (i
= 0; i
< num
; i
++) {
4777 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4782 static void GLAPIENTRY
4783 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4784 const GLubyte
* program
)
4786 GET_CURRENT_CONTEXT(ctx
);
4789 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4791 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4793 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4795 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4798 _mesa_memcpy(programCopy
, program
, len
);
4802 n
[4].data
= programCopy
;
4804 if (ctx
->ExecuteFlag
) {
4805 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4810 static void GLAPIENTRY
4811 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4813 GET_CURRENT_CONTEXT(ctx
);
4816 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4818 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4820 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4822 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4825 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4829 if (ctx
->ExecuteFlag
) {
4830 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4835 static void GLAPIENTRY
4836 save_TrackMatrixNV(GLenum target
, GLuint address
,
4837 GLenum matrix
, GLenum transform
)
4839 GET_CURRENT_CONTEXT(ctx
);
4841 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4842 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4849 if (ctx
->ExecuteFlag
) {
4850 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4853 #endif /* FEATURE_NV_vertex_program */
4857 * GL_NV_fragment_program
4859 #if FEATURE_NV_fragment_program
4860 static void GLAPIENTRY
4861 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4862 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4864 GET_CURRENT_CONTEXT(ctx
);
4866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4867 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4876 if (ctx
->ExecuteFlag
) {
4877 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4882 static void GLAPIENTRY
4883 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4884 const GLfloat
*params
)
4886 GET_CURRENT_CONTEXT(ctx
);
4888 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4889 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4898 if (ctx
->ExecuteFlag
) {
4899 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4904 static void GLAPIENTRY
4905 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4906 const GLfloat
*params
)
4908 GET_CURRENT_CONTEXT(ctx
);
4910 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4914 const GLfloat
* p
= params
;
4916 for (i
= 0 ; i
< count
; i
++) {
4917 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4930 if (ctx
->ExecuteFlag
) {
4931 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4936 static void GLAPIENTRY
4937 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4938 GLdouble x
, GLdouble y
,
4939 GLdouble z
, GLdouble w
)
4941 GET_CURRENT_CONTEXT(ctx
);
4943 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4944 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4948 n
[3].f
= (GLfloat
) x
;
4949 n
[4].f
= (GLfloat
) y
;
4950 n
[5].f
= (GLfloat
) z
;
4951 n
[6].f
= (GLfloat
) w
;
4953 if (ctx
->ExecuteFlag
) {
4954 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4959 static void GLAPIENTRY
4960 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4961 const GLdouble
*params
)
4963 GET_CURRENT_CONTEXT(ctx
);
4965 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4966 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4970 n
[3].f
= (GLfloat
) params
[0];
4971 n
[4].f
= (GLfloat
) params
[1];
4972 n
[5].f
= (GLfloat
) params
[2];
4973 n
[6].f
= (GLfloat
) params
[3];
4975 if (ctx
->ExecuteFlag
) {
4976 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4980 static void GLAPIENTRY
4981 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4982 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4984 GET_CURRENT_CONTEXT(ctx
);
4987 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4989 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4991 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4993 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4996 _mesa_memcpy(nameCopy
, name
, len
);
4999 n
[3].data
= nameCopy
;
5005 if (ctx
->ExecuteFlag
) {
5006 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
5011 static void GLAPIENTRY
5012 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5015 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
5019 static void GLAPIENTRY
5020 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5021 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
5023 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
5024 (GLfloat
) z
, (GLfloat
) w
);
5028 static void GLAPIENTRY
5029 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
5032 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
5033 (GLfloat
) v
[1], (GLfloat
) v
[2],
5037 #endif /* FEATURE_NV_fragment_program */
5041 /* GL_EXT_stencil_two_side */
5042 static void GLAPIENTRY
5043 save_ActiveStencilFaceEXT(GLenum face
)
5045 GET_CURRENT_CONTEXT(ctx
);
5047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5048 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
5052 if (ctx
->ExecuteFlag
) {
5053 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
5058 /* GL_EXT_depth_bounds_test */
5059 static void GLAPIENTRY
5060 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
5062 GET_CURRENT_CONTEXT(ctx
);
5064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5065 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
5067 n
[1].f
= (GLfloat
) zmin
;
5068 n
[2].f
= (GLfloat
) zmax
;
5070 if (ctx
->ExecuteFlag
) {
5071 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
5077 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
5079 static void GLAPIENTRY
5080 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
5081 const GLvoid
* string
)
5083 GET_CURRENT_CONTEXT(ctx
);
5086 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5088 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5090 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
5092 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5095 _mesa_memcpy(programCopy
, string
, len
);
5099 n
[4].data
= programCopy
;
5101 if (ctx
->ExecuteFlag
) {
5102 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5106 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5109 #if FEATURE_queryobj
5111 static void GLAPIENTRY
5112 save_BeginQueryARB(GLenum target
, GLuint id
)
5114 GET_CURRENT_CONTEXT(ctx
);
5116 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5117 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5122 if (ctx
->ExecuteFlag
) {
5123 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5128 static void GLAPIENTRY
5129 save_EndQueryARB(GLenum target
)
5131 GET_CURRENT_CONTEXT(ctx
);
5133 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5134 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5138 if (ctx
->ExecuteFlag
) {
5139 CALL_EndQueryARB(ctx
->Exec
, (target
));
5143 #endif /* FEATURE_queryobj */
5146 static void GLAPIENTRY
5147 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5149 GET_CURRENT_CONTEXT(ctx
);
5151 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5152 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5156 if (count
> MAX_DRAW_BUFFERS
)
5157 count
= MAX_DRAW_BUFFERS
;
5158 for (i
= 0; i
< count
; i
++) {
5159 n
[2 + i
].e
= buffers
[i
];
5162 if (ctx
->ExecuteFlag
) {
5163 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5167 static void GLAPIENTRY
5168 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5170 GET_CURRENT_CONTEXT(ctx
);
5173 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5181 if (ctx
->ExecuteFlag
) {
5182 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5186 static void GLAPIENTRY
5187 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5190 p
[0] = INT_TO_FLOAT(param
[0]);
5191 p
[1] = INT_TO_FLOAT(param
[1]);
5192 p
[2] = INT_TO_FLOAT(param
[2]);
5193 p
[3] = INT_TO_FLOAT(param
[3]);
5194 save_TexBumpParameterfvATI(pname
, p
);
5197 #if FEATURE_ATI_fragment_shader
5198 static void GLAPIENTRY
5199 save_BindFragmentShaderATI(GLuint id
)
5201 GET_CURRENT_CONTEXT(ctx
);
5204 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5208 if (ctx
->ExecuteFlag
) {
5209 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5213 static void GLAPIENTRY
5214 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5216 GET_CURRENT_CONTEXT(ctx
);
5219 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5227 if (ctx
->ExecuteFlag
) {
5228 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5234 save_Attr1fNV(GLenum attr
, GLfloat x
)
5236 GET_CURRENT_CONTEXT(ctx
);
5238 SAVE_FLUSH_VERTICES(ctx
);
5239 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5245 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5246 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5247 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5249 if (ctx
->ExecuteFlag
) {
5250 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5255 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5257 GET_CURRENT_CONTEXT(ctx
);
5259 SAVE_FLUSH_VERTICES(ctx
);
5260 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5267 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5268 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5269 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5271 if (ctx
->ExecuteFlag
) {
5272 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5277 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5279 GET_CURRENT_CONTEXT(ctx
);
5281 SAVE_FLUSH_VERTICES(ctx
);
5282 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5290 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5291 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5292 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5294 if (ctx
->ExecuteFlag
) {
5295 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5300 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5302 GET_CURRENT_CONTEXT(ctx
);
5304 SAVE_FLUSH_VERTICES(ctx
);
5305 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5314 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5315 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5316 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5318 if (ctx
->ExecuteFlag
) {
5319 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5325 save_Attr1fARB(GLenum attr
, GLfloat x
)
5327 GET_CURRENT_CONTEXT(ctx
);
5329 SAVE_FLUSH_VERTICES(ctx
);
5330 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5336 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5337 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5338 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5340 if (ctx
->ExecuteFlag
) {
5341 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5346 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5348 GET_CURRENT_CONTEXT(ctx
);
5350 SAVE_FLUSH_VERTICES(ctx
);
5351 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5358 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5359 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5360 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5362 if (ctx
->ExecuteFlag
) {
5363 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5368 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5370 GET_CURRENT_CONTEXT(ctx
);
5372 SAVE_FLUSH_VERTICES(ctx
);
5373 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5381 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5382 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5383 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5385 if (ctx
->ExecuteFlag
) {
5386 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5391 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5393 GET_CURRENT_CONTEXT(ctx
);
5395 SAVE_FLUSH_VERTICES(ctx
);
5396 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5405 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5406 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5407 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5409 if (ctx
->ExecuteFlag
) {
5410 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5415 static void GLAPIENTRY
5416 save_EvalCoord1f(GLfloat x
)
5418 GET_CURRENT_CONTEXT(ctx
);
5420 SAVE_FLUSH_VERTICES(ctx
);
5421 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5425 if (ctx
->ExecuteFlag
) {
5426 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5430 static void GLAPIENTRY
5431 save_EvalCoord1fv(const GLfloat
* v
)
5433 save_EvalCoord1f(v
[0]);
5436 static void GLAPIENTRY
5437 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5439 GET_CURRENT_CONTEXT(ctx
);
5441 SAVE_FLUSH_VERTICES(ctx
);
5442 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5447 if (ctx
->ExecuteFlag
) {
5448 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5452 static void GLAPIENTRY
5453 save_EvalCoord2fv(const GLfloat
* v
)
5455 save_EvalCoord2f(v
[0], v
[1]);
5459 static void GLAPIENTRY
5460 save_EvalPoint1(GLint x
)
5462 GET_CURRENT_CONTEXT(ctx
);
5464 SAVE_FLUSH_VERTICES(ctx
);
5465 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5469 if (ctx
->ExecuteFlag
) {
5470 CALL_EvalPoint1(ctx
->Exec
, (x
));
5474 static void GLAPIENTRY
5475 save_EvalPoint2(GLint x
, GLint y
)
5477 GET_CURRENT_CONTEXT(ctx
);
5479 SAVE_FLUSH_VERTICES(ctx
);
5480 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5485 if (ctx
->ExecuteFlag
) {
5486 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5490 static void GLAPIENTRY
5491 save_Indexf(GLfloat x
)
5493 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5496 static void GLAPIENTRY
5497 save_Indexfv(const GLfloat
* v
)
5499 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5502 static void GLAPIENTRY
5503 save_EdgeFlag(GLboolean x
)
5505 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5508 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5512 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5516 static void GLAPIENTRY
5517 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5519 GET_CURRENT_CONTEXT(ctx
);
5527 case GL_FRONT_AND_BACK
:
5530 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5539 case GL_AMBIENT_AND_DIFFUSE
:
5545 case GL_COLOR_INDEXES
:
5549 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5553 if (ctx
->ExecuteFlag
) {
5554 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5557 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5559 /* Try to eliminate redundant statechanges. Because it is legal to
5560 * call glMaterial even inside begin/end calls, don't need to worry
5561 * about ctx->Driver.CurrentSavePrimitive here.
5563 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5564 if (bitmask
& (1 << i
)) {
5565 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5566 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5567 bitmask
&= ~(1 << i
);
5570 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5571 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5576 /* If this call has effect, return early:
5581 SAVE_FLUSH_VERTICES(ctx
);
5583 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5587 for (i
= 0; i
< args
; i
++)
5588 n
[3 + i
].f
= param
[i
];
5592 static void GLAPIENTRY
5593 save_Begin(GLenum mode
)
5595 GET_CURRENT_CONTEXT(ctx
);
5597 GLboolean error
= GL_FALSE
;
5599 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5600 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5603 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5604 /* Typically the first begin. This may raise an error on
5605 * playback, depending on whether CallList is issued from inside
5606 * a begin/end or not.
5608 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5610 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5611 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5614 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5619 /* Give the driver an opportunity to hook in an optimized
5620 * display list compiler.
5622 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5625 SAVE_FLUSH_VERTICES(ctx
);
5626 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5632 if (ctx
->ExecuteFlag
) {
5633 CALL_Begin(ctx
->Exec
, (mode
));
5637 static void GLAPIENTRY
5640 GET_CURRENT_CONTEXT(ctx
);
5641 SAVE_FLUSH_VERTICES(ctx
);
5642 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5643 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5644 if (ctx
->ExecuteFlag
) {
5645 CALL_End(ctx
->Exec
, ());
5649 static void GLAPIENTRY
5650 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5652 GET_CURRENT_CONTEXT(ctx
);
5654 SAVE_FLUSH_VERTICES(ctx
);
5655 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5662 if (ctx
->ExecuteFlag
) {
5663 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5668 static void GLAPIENTRY
5669 save_Vertex2f(GLfloat x
, GLfloat y
)
5671 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5674 static void GLAPIENTRY
5675 save_Vertex2fv(const GLfloat
* v
)
5677 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5680 static void GLAPIENTRY
5681 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5683 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5686 static void GLAPIENTRY
5687 save_Vertex3fv(const GLfloat
* v
)
5689 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5692 static void GLAPIENTRY
5693 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5695 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5698 static void GLAPIENTRY
5699 save_Vertex4fv(const GLfloat
* v
)
5701 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5704 static void GLAPIENTRY
5705 save_TexCoord1f(GLfloat x
)
5707 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5710 static void GLAPIENTRY
5711 save_TexCoord1fv(const GLfloat
* v
)
5713 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5716 static void GLAPIENTRY
5717 save_TexCoord2f(GLfloat x
, GLfloat y
)
5719 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5722 static void GLAPIENTRY
5723 save_TexCoord2fv(const GLfloat
* v
)
5725 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5728 static void GLAPIENTRY
5729 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5731 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5734 static void GLAPIENTRY
5735 save_TexCoord3fv(const GLfloat
* v
)
5737 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5740 static void GLAPIENTRY
5741 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5743 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5746 static void GLAPIENTRY
5747 save_TexCoord4fv(const GLfloat
* v
)
5749 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5752 static void GLAPIENTRY
5753 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5755 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5758 static void GLAPIENTRY
5759 save_Normal3fv(const GLfloat
* v
)
5761 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5764 static void GLAPIENTRY
5765 save_FogCoordfEXT(GLfloat x
)
5767 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5770 static void GLAPIENTRY
5771 save_FogCoordfvEXT(const GLfloat
* v
)
5773 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5776 static void GLAPIENTRY
5777 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5779 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5782 static void GLAPIENTRY
5783 save_Color3fv(const GLfloat
* v
)
5785 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5788 static void GLAPIENTRY
5789 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5791 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5794 static void GLAPIENTRY
5795 save_Color4fv(const GLfloat
* v
)
5797 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5800 static void GLAPIENTRY
5801 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5803 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5806 static void GLAPIENTRY
5807 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5809 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5813 /* Just call the respective ATTR for texcoord
5815 static void GLAPIENTRY
5816 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5818 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5819 save_Attr1fNV(attr
, x
);
5822 static void GLAPIENTRY
5823 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5825 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5826 save_Attr1fNV(attr
, v
[0]);
5829 static void GLAPIENTRY
5830 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5832 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5833 save_Attr2fNV(attr
, x
, y
);
5836 static void GLAPIENTRY
5837 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5839 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5840 save_Attr2fNV(attr
, v
[0], v
[1]);
5843 static void GLAPIENTRY
5844 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5846 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5847 save_Attr3fNV(attr
, x
, y
, z
);
5850 static void GLAPIENTRY
5851 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5853 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5854 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5857 static void GLAPIENTRY
5858 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5859 GLfloat z
, GLfloat w
)
5861 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5862 save_Attr4fNV(attr
, x
, y
, z
, w
);
5865 static void GLAPIENTRY
5866 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5868 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5869 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5874 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5880 GET_CURRENT_CONTEXT(ctx
);
5881 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5885 /* First level for NV_vertex_program:
5887 * Check for errors at compile time?.
5889 static void GLAPIENTRY
5890 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5892 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5893 save_Attr1fNV(index
, x
);
5898 static void GLAPIENTRY
5899 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5901 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5902 save_Attr1fNV(index
, v
[0]);
5907 static void GLAPIENTRY
5908 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5910 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5911 save_Attr2fNV(index
, x
, y
);
5916 static void GLAPIENTRY
5917 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5919 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5920 save_Attr2fNV(index
, v
[0], v
[1]);
5925 static void GLAPIENTRY
5926 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5928 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5929 save_Attr3fNV(index
, x
, y
, z
);
5934 static void GLAPIENTRY
5935 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5937 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5938 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5943 static void GLAPIENTRY
5944 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5945 GLfloat z
, GLfloat w
)
5947 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5948 save_Attr4fNV(index
, x
, y
, z
, w
);
5953 static void GLAPIENTRY
5954 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5956 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5957 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5965 static void GLAPIENTRY
5966 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5968 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5969 save_Attr1fARB(index
, x
);
5974 static void GLAPIENTRY
5975 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5977 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5978 save_Attr1fARB(index
, v
[0]);
5983 static void GLAPIENTRY
5984 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5986 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5987 save_Attr2fARB(index
, x
, y
);
5992 static void GLAPIENTRY
5993 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5995 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5996 save_Attr2fARB(index
, v
[0], v
[1]);
6001 static void GLAPIENTRY
6002 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
6004 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6005 save_Attr3fARB(index
, x
, y
, z
);
6010 static void GLAPIENTRY
6011 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
6013 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6014 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
6019 static void GLAPIENTRY
6020 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
6023 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6024 save_Attr4fARB(index
, x
, y
, z
, w
);
6029 static void GLAPIENTRY
6030 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
6032 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
6033 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
6039 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
6041 static void GLAPIENTRY
6042 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
6044 GET_CURRENT_CONTEXT(ctx
);
6045 FLUSH_VERTICES(ctx
, 0);
6046 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
6049 static GLint GLAPIENTRY
6050 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
6052 GET_CURRENT_CONTEXT(ctx
);
6053 FLUSH_VERTICES(ctx
, 0);
6054 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
6056 /* XXX more shader functions needed here */
6060 #if FEATURE_EXT_framebuffer_blit
6061 static void GLAPIENTRY
6062 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
6063 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
6064 GLbitfield mask
, GLenum filter
)
6066 GET_CURRENT_CONTEXT(ctx
);
6068 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6069 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
6082 if (ctx
->ExecuteFlag
) {
6083 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
6084 dstX0
, dstY0
, dstX1
, dstY1
,
6091 /** GL_EXT_provoking_vertex */
6092 static void GLAPIENTRY
6093 save_ProvokingVertexEXT(GLenum mode
)
6095 GET_CURRENT_CONTEXT(ctx
);
6097 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6098 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6102 if (ctx
->ExecuteFlag
) {
6103 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6104 _mesa_ProvokingVertexEXT(mode
);
6109 /* aka UseProgram() */
6110 static void GLAPIENTRY
6111 save_UseProgramObjectARB(GLhandleARB program
)
6113 GET_CURRENT_CONTEXT(ctx
);
6115 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6116 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6120 if (ctx
->ExecuteFlag
) {
6121 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6126 static void GLAPIENTRY
6127 save_Uniform1fARB(GLint location
, GLfloat x
)
6129 GET_CURRENT_CONTEXT(ctx
);
6131 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6132 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6137 if (ctx
->ExecuteFlag
) {
6138 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6143 static void GLAPIENTRY
6144 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6146 GET_CURRENT_CONTEXT(ctx
);
6148 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6149 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6155 if (ctx
->ExecuteFlag
) {
6156 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6161 static void GLAPIENTRY
6162 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6164 GET_CURRENT_CONTEXT(ctx
);
6166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6167 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6174 if (ctx
->ExecuteFlag
) {
6175 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6180 static void GLAPIENTRY
6181 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6183 GET_CURRENT_CONTEXT(ctx
);
6185 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6186 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6194 if (ctx
->ExecuteFlag
) {
6195 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6200 /** Return copy of memory */
6202 memdup(const void *src
, GLsizei bytes
)
6204 void *b
= bytes
>= 0 ? _mesa_malloc(bytes
) : NULL
;
6206 _mesa_memcpy(b
, src
, bytes
);
6211 static void GLAPIENTRY
6212 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6214 GET_CURRENT_CONTEXT(ctx
);
6216 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6217 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6221 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6223 if (ctx
->ExecuteFlag
) {
6224 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6228 static void GLAPIENTRY
6229 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6231 GET_CURRENT_CONTEXT(ctx
);
6233 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6234 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6238 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6240 if (ctx
->ExecuteFlag
) {
6241 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6245 static void GLAPIENTRY
6246 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6248 GET_CURRENT_CONTEXT(ctx
);
6250 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6251 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6255 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6257 if (ctx
->ExecuteFlag
) {
6258 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6262 static void GLAPIENTRY
6263 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6265 GET_CURRENT_CONTEXT(ctx
);
6267 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6268 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6272 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6274 if (ctx
->ExecuteFlag
) {
6275 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6280 static void GLAPIENTRY
6281 save_Uniform1iARB(GLint location
, GLint x
)
6283 GET_CURRENT_CONTEXT(ctx
);
6285 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6286 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6291 if (ctx
->ExecuteFlag
) {
6292 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6296 static void GLAPIENTRY
6297 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6299 GET_CURRENT_CONTEXT(ctx
);
6301 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6302 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6308 if (ctx
->ExecuteFlag
) {
6309 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6313 static void GLAPIENTRY
6314 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6316 GET_CURRENT_CONTEXT(ctx
);
6318 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6319 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6326 if (ctx
->ExecuteFlag
) {
6327 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6331 static void GLAPIENTRY
6332 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6334 GET_CURRENT_CONTEXT(ctx
);
6336 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6337 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6345 if (ctx
->ExecuteFlag
) {
6346 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6352 static void GLAPIENTRY
6353 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6355 GET_CURRENT_CONTEXT(ctx
);
6357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6358 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6362 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6364 if (ctx
->ExecuteFlag
) {
6365 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6369 static void GLAPIENTRY
6370 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6372 GET_CURRENT_CONTEXT(ctx
);
6374 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6375 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6379 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6381 if (ctx
->ExecuteFlag
) {
6382 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6386 static void GLAPIENTRY
6387 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6389 GET_CURRENT_CONTEXT(ctx
);
6391 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6392 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6396 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6398 if (ctx
->ExecuteFlag
) {
6399 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6403 static void GLAPIENTRY
6404 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6406 GET_CURRENT_CONTEXT(ctx
);
6408 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6409 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6413 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6415 if (ctx
->ExecuteFlag
) {
6416 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6421 static void GLAPIENTRY
6422 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6425 GET_CURRENT_CONTEXT(ctx
);
6427 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6428 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6433 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6435 if (ctx
->ExecuteFlag
) {
6436 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6440 static void GLAPIENTRY
6441 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6444 GET_CURRENT_CONTEXT(ctx
);
6446 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6447 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6452 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6454 if (ctx
->ExecuteFlag
) {
6455 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6459 static void GLAPIENTRY
6460 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6463 GET_CURRENT_CONTEXT(ctx
);
6465 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6466 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6471 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6473 if (ctx
->ExecuteFlag
) {
6474 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6479 static void GLAPIENTRY
6480 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6483 GET_CURRENT_CONTEXT(ctx
);
6485 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6486 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6491 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6493 if (ctx
->ExecuteFlag
) {
6494 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6498 static void GLAPIENTRY
6499 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6502 GET_CURRENT_CONTEXT(ctx
);
6504 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6505 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6510 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6512 if (ctx
->ExecuteFlag
) {
6513 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6518 static void GLAPIENTRY
6519 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6522 GET_CURRENT_CONTEXT(ctx
);
6524 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6525 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6530 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6532 if (ctx
->ExecuteFlag
) {
6533 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6537 static void GLAPIENTRY
6538 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6541 GET_CURRENT_CONTEXT(ctx
);
6543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6544 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6549 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6551 if (ctx
->ExecuteFlag
) {
6552 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6557 static void GLAPIENTRY
6558 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6561 GET_CURRENT_CONTEXT(ctx
);
6563 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6564 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6569 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6571 if (ctx
->ExecuteFlag
) {
6572 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6576 static void GLAPIENTRY
6577 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6580 GET_CURRENT_CONTEXT(ctx
);
6582 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6583 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6588 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6590 if (ctx
->ExecuteFlag
) {
6591 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6598 * Save an error-generating command into display list.
6600 * KW: Will appear in the list before the vertex buffer containing the
6601 * command that provoked the error. I don't see this as a problem.
6604 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6607 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6610 n
[2].data
= (void *) s
;
6616 * Compile an error into current display list.
6619 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6621 if (ctx
->CompileFlag
)
6622 save_error(ctx
, error
, s
);
6623 if (ctx
->ExecuteFlag
)
6624 _mesa_error(ctx
, error
, s
);
6629 * Test if ID names a display list.
6632 islist(GLcontext
*ctx
, GLuint list
)
6634 if (list
> 0 && lookup_list(ctx
, list
)) {
6644 /**********************************************************************/
6645 /* Display list execution */
6646 /**********************************************************************/
6650 * Execute a display list. Note that the ListBase offset must have already
6651 * been added before calling this function. I.e. the list argument is
6652 * the absolute list number, not relative to ListBase.
6653 * \param list - display list number
6656 execute_list(GLcontext
*ctx
, GLuint list
)
6658 struct gl_display_list
*dlist
;
6662 if (list
== 0 || !islist(ctx
, list
))
6665 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6666 /* raise an error? */
6670 dlist
= lookup_list(ctx
, list
);
6674 ctx
->ListState
.CallDepth
++;
6676 if (ctx
->Driver
.BeginCallList
)
6677 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6683 const OpCode opcode
= n
[0].opcode
;
6685 if (is_ext_opcode(opcode
)) {
6686 n
+= ext_opcode_execute(ctx
, n
);
6691 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6694 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6696 case OPCODE_ALPHA_FUNC
:
6697 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6699 case OPCODE_BIND_TEXTURE
:
6700 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6704 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6705 ctx
->Unpack
= ctx
->DefaultPacking
;
6706 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6707 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6708 (const GLubyte
*) n
[7].data
));
6709 ctx
->Unpack
= save
; /* restore */
6712 case OPCODE_BLEND_COLOR
:
6713 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6715 case OPCODE_BLEND_EQUATION
:
6716 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6718 case OPCODE_BLEND_EQUATION_SEPARATE
:
6719 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6721 case OPCODE_BLEND_FUNC_SEPARATE
:
6722 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6723 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6725 case OPCODE_CALL_LIST
:
6726 /* Generated by glCallList(), don't add ListBase */
6727 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6728 execute_list(ctx
, n
[1].ui
);
6731 case OPCODE_CALL_LIST_OFFSET
:
6732 /* Generated by glCallLists() so we must add ListBase */
6734 /* user specified a bad data type at compile time */
6735 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6737 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6738 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6739 execute_list(ctx
, list
);
6743 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6745 case OPCODE_CLEAR_BUFFER_IV
:
6752 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6755 case OPCODE_CLEAR_BUFFER_UIV
:
6762 /*CALL_ClearBufferiv(ctx->Exec, (n[1].e, n[2].i, value));*/
6765 case OPCODE_CLEAR_BUFFER_FV
:
6772 /*CALL_ClearBufferfv(ctx->Exec, (n[1].e, n[2].i, value));*/
6775 case OPCODE_CLEAR_BUFFER_FI
:
6776 /*CALL_ClearBufferfi(ctx->Exec, (n[1].e, n[2].i, n[3].f, n[4].i));*/
6778 case OPCODE_CLEAR_COLOR
:
6779 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6781 case OPCODE_CLEAR_ACCUM
:
6782 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6784 case OPCODE_CLEAR_DEPTH
:
6785 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6787 case OPCODE_CLEAR_INDEX
:
6788 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6790 case OPCODE_CLEAR_STENCIL
:
6791 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6793 case OPCODE_CLIP_PLANE
:
6800 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6803 case OPCODE_COLOR_MASK
:
6804 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6806 case OPCODE_COLOR_MASK_INDEXED
:
6807 CALL_ColorMaskIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].b
, n
[3].b
,
6810 case OPCODE_COLOR_MATERIAL
:
6811 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6813 case OPCODE_COLOR_TABLE
:
6815 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6816 ctx
->Unpack
= ctx
->DefaultPacking
;
6817 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6818 n
[5].e
, n
[6].data
));
6819 ctx
->Unpack
= save
; /* restore */
6822 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6829 CALL_ColorTableParameterfv(ctx
->Exec
,
6830 (n
[1].e
, n
[2].e
, params
));
6833 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6840 CALL_ColorTableParameteriv(ctx
->Exec
,
6841 (n
[1].e
, n
[2].e
, params
));
6844 case OPCODE_COLOR_SUB_TABLE
:
6846 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6847 ctx
->Unpack
= ctx
->DefaultPacking
;
6848 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6849 n
[4].e
, n
[5].e
, n
[6].data
));
6850 ctx
->Unpack
= save
; /* restore */
6853 case OPCODE_CONVOLUTION_FILTER_1D
:
6855 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6856 ctx
->Unpack
= ctx
->DefaultPacking
;
6857 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6860 ctx
->Unpack
= save
; /* restore */
6863 case OPCODE_CONVOLUTION_FILTER_2D
:
6865 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6866 ctx
->Unpack
= ctx
->DefaultPacking
;
6867 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6868 n
[4].i
, n
[5].e
, n
[6].e
,
6870 ctx
->Unpack
= save
; /* restore */
6873 case OPCODE_CONVOLUTION_PARAMETER_I
:
6874 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6876 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6883 CALL_ConvolutionParameteriv(ctx
->Exec
,
6884 (n
[1].e
, n
[2].e
, params
));
6887 case OPCODE_CONVOLUTION_PARAMETER_F
:
6888 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6890 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6897 CALL_ConvolutionParameterfv(ctx
->Exec
,
6898 (n
[1].e
, n
[2].e
, params
));
6901 case OPCODE_COPY_COLOR_SUB_TABLE
:
6902 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6903 n
[3].i
, n
[4].i
, n
[5].i
));
6905 case OPCODE_COPY_COLOR_TABLE
:
6906 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6907 n
[3].i
, n
[4].i
, n
[5].i
));
6909 case OPCODE_COPY_PIXELS
:
6910 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6911 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6914 case OPCODE_COPY_TEX_IMAGE1D
:
6915 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6916 n
[5].i
, n
[6].i
, n
[7].i
));
6918 case OPCODE_COPY_TEX_IMAGE2D
:
6919 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6920 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6922 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6923 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6924 n
[4].i
, n
[5].i
, n
[6].i
));
6926 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6927 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6928 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6931 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6932 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6933 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6936 case OPCODE_CULL_FACE
:
6937 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6939 case OPCODE_DEPTH_FUNC
:
6940 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6942 case OPCODE_DEPTH_MASK
:
6943 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6945 case OPCODE_DEPTH_RANGE
:
6946 CALL_DepthRange(ctx
->Exec
,
6947 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6949 case OPCODE_DISABLE
:
6950 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6952 case OPCODE_DISABLE_INDEXED
:
6953 CALL_DisableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6955 case OPCODE_DRAW_BUFFER
:
6956 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6958 case OPCODE_DRAW_PIXELS
:
6960 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6961 ctx
->Unpack
= ctx
->DefaultPacking
;
6962 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6964 ctx
->Unpack
= save
; /* restore */
6968 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6970 case OPCODE_ENABLE_INDEXED
:
6971 CALL_EnableIndexedEXT(ctx
->Exec
, (n
[1].ui
, n
[2].e
));
6973 case OPCODE_EVALMESH1
:
6974 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6976 case OPCODE_EVALMESH2
:
6977 CALL_EvalMesh2(ctx
->Exec
,
6978 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6987 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6990 case OPCODE_FRONT_FACE
:
6991 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6993 case OPCODE_FRUSTUM
:
6994 CALL_Frustum(ctx
->Exec
,
6995 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6998 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7000 case OPCODE_HISTOGRAM
:
7001 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
7003 case OPCODE_INDEX_MASK
:
7004 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
7006 case OPCODE_INIT_NAMES
:
7007 CALL_InitNames(ctx
->Exec
, ());
7016 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
7019 case OPCODE_LIGHT_MODEL
:
7026 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
7029 case OPCODE_LINE_STIPPLE
:
7030 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
7032 case OPCODE_LINE_WIDTH
:
7033 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
7035 case OPCODE_LIST_BASE
:
7036 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
7038 case OPCODE_LOAD_IDENTITY
:
7039 CALL_LoadIdentity(ctx
->Exec
, ());
7041 case OPCODE_LOAD_MATRIX
:
7042 if (sizeof(Node
) == sizeof(GLfloat
)) {
7043 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
7048 for (i
= 0; i
< 16; i
++) {
7051 CALL_LoadMatrixf(ctx
->Exec
, (m
));
7054 case OPCODE_LOAD_NAME
:
7055 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
7057 case OPCODE_LOGIC_OP
:
7058 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
7062 GLenum target
= n
[1].e
;
7063 GLint ustride
= _mesa_evaluator_components(target
);
7064 GLint uorder
= n
[5].i
;
7065 GLfloat u1
= n
[2].f
;
7066 GLfloat u2
= n
[3].f
;
7067 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7068 (GLfloat
*) n
[6].data
));
7073 GLenum target
= n
[1].e
;
7074 GLfloat u1
= n
[2].f
;
7075 GLfloat u2
= n
[3].f
;
7076 GLfloat v1
= n
[4].f
;
7077 GLfloat v2
= n
[5].f
;
7078 GLint ustride
= n
[6].i
;
7079 GLint vstride
= n
[7].i
;
7080 GLint uorder
= n
[8].i
;
7081 GLint vorder
= n
[9].i
;
7082 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
7083 v1
, v2
, vstride
, vorder
,
7084 (GLfloat
*) n
[10].data
));
7087 case OPCODE_MAPGRID1
:
7088 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7090 case OPCODE_MAPGRID2
:
7091 CALL_MapGrid2f(ctx
->Exec
,
7092 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
7094 case OPCODE_MATRIX_MODE
:
7095 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
7097 case OPCODE_MIN_MAX
:
7098 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
7100 case OPCODE_MULT_MATRIX
:
7101 if (sizeof(Node
) == sizeof(GLfloat
)) {
7102 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
7107 for (i
= 0; i
< 16; i
++) {
7110 CALL_MultMatrixf(ctx
->Exec
, (m
));
7114 CALL_Ortho(ctx
->Exec
,
7115 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
7117 case OPCODE_PASSTHROUGH
:
7118 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7120 case OPCODE_PIXEL_MAP
:
7121 CALL_PixelMapfv(ctx
->Exec
,
7122 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7124 case OPCODE_PIXEL_TRANSFER
:
7125 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7127 case OPCODE_PIXEL_ZOOM
:
7128 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7130 case OPCODE_POINT_SIZE
:
7131 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7133 case OPCODE_POINT_PARAMETERS
:
7139 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7142 case OPCODE_POLYGON_MODE
:
7143 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7145 case OPCODE_POLYGON_STIPPLE
:
7147 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7148 ctx
->Unpack
= ctx
->DefaultPacking
;
7149 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7150 ctx
->Unpack
= save
; /* restore */
7153 case OPCODE_POLYGON_OFFSET
:
7154 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7156 case OPCODE_POP_ATTRIB
:
7157 CALL_PopAttrib(ctx
->Exec
, ());
7159 case OPCODE_POP_MATRIX
:
7160 CALL_PopMatrix(ctx
->Exec
, ());
7162 case OPCODE_POP_NAME
:
7163 CALL_PopName(ctx
->Exec
, ());
7165 case OPCODE_PRIORITIZE_TEXTURE
:
7166 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7168 case OPCODE_PUSH_ATTRIB
:
7169 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7171 case OPCODE_PUSH_MATRIX
:
7172 CALL_PushMatrix(ctx
->Exec
, ());
7174 case OPCODE_PUSH_NAME
:
7175 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7177 case OPCODE_RASTER_POS
:
7178 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7180 case OPCODE_READ_BUFFER
:
7181 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7183 case OPCODE_RESET_HISTOGRAM
:
7184 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7186 case OPCODE_RESET_MIN_MAX
:
7187 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7190 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7193 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7195 case OPCODE_SCISSOR
:
7196 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7198 case OPCODE_SHADE_MODEL
:
7199 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7201 case OPCODE_PROVOKING_VERTEX
:
7202 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7204 case OPCODE_STENCIL_FUNC
:
7205 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7207 case OPCODE_STENCIL_MASK
:
7208 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7210 case OPCODE_STENCIL_OP
:
7211 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7213 case OPCODE_STENCIL_FUNC_SEPARATE
:
7214 CALL_StencilFuncSeparate(ctx
->Exec
,
7215 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7217 case OPCODE_STENCIL_MASK_SEPARATE
:
7218 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7220 case OPCODE_STENCIL_OP_SEPARATE
:
7221 CALL_StencilOpSeparate(ctx
->Exec
,
7222 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7231 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7241 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7244 case OPCODE_TEXPARAMETER
:
7251 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7254 case OPCODE_TEX_IMAGE1D
:
7256 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7257 ctx
->Unpack
= ctx
->DefaultPacking
;
7258 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7260 n
[3].i
, /* components */
7262 n
[5].e
, /* border */
7263 n
[6].e
, /* format */
7266 ctx
->Unpack
= save
; /* restore */
7269 case OPCODE_TEX_IMAGE2D
:
7271 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7272 ctx
->Unpack
= ctx
->DefaultPacking
;
7273 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7275 n
[3].i
, /* components */
7277 n
[5].i
, /* height */
7278 n
[6].e
, /* border */
7279 n
[7].e
, /* format */
7282 ctx
->Unpack
= save
; /* restore */
7285 case OPCODE_TEX_IMAGE3D
:
7287 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7288 ctx
->Unpack
= ctx
->DefaultPacking
;
7289 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7291 n
[3].i
, /* components */
7293 n
[5].i
, /* height */
7295 n
[7].e
, /* border */
7296 n
[8].e
, /* format */
7299 ctx
->Unpack
= save
; /* restore */
7302 case OPCODE_TEX_SUB_IMAGE1D
:
7304 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7305 ctx
->Unpack
= ctx
->DefaultPacking
;
7306 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7308 n
[6].e
, n
[7].data
));
7309 ctx
->Unpack
= save
; /* restore */
7312 case OPCODE_TEX_SUB_IMAGE2D
:
7314 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7315 ctx
->Unpack
= ctx
->DefaultPacking
;
7316 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7318 n
[6].i
, n
[7].e
, n
[8].e
,
7320 ctx
->Unpack
= save
; /* restore */
7323 case OPCODE_TEX_SUB_IMAGE3D
:
7325 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7326 ctx
->Unpack
= ctx
->DefaultPacking
;
7327 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7328 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7329 n
[8].i
, n
[9].e
, n
[10].e
,
7331 ctx
->Unpack
= save
; /* restore */
7334 case OPCODE_TRANSLATE
:
7335 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7337 case OPCODE_VIEWPORT
:
7338 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7339 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7341 case OPCODE_WINDOW_POS
:
7342 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7344 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7345 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7347 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7348 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7349 n
[4].i
, n
[5].i
, n
[6].i
,
7352 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7353 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7354 n
[4].i
, n
[5].i
, n
[6].i
,
7355 n
[7].i
, n
[8].data
));
7357 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7358 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7359 n
[4].i
, n
[5].i
, n
[6].i
,
7363 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7364 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7365 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7366 n
[5].e
, n
[6].i
, n
[7].data
));
7368 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7369 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7370 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7371 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7374 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7375 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7376 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7377 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7378 n
[9].e
, n
[10].i
, n
[11].data
));
7380 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7381 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7383 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7384 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7386 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7387 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7388 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7391 #if FEATURE_NV_vertex_program
7392 case OPCODE_EXECUTE_PROGRAM_NV
:
7399 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7402 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7403 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7404 (GLuint
*) n
[2].data
));
7406 case OPCODE_LOAD_PROGRAM_NV
:
7407 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7408 (const GLubyte
*) n
[4].data
));
7410 case OPCODE_TRACK_MATRIX_NV
:
7411 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7415 #if FEATURE_NV_fragment_program
7416 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7417 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7418 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7421 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7422 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7423 (const GLubyte
*) n
[3].
7424 data
, n
[4].f
, n
[5].f
,
7429 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7430 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7432 case OPCODE_DEPTH_BOUNDS_EXT
:
7433 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7435 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7436 case OPCODE_PROGRAM_STRING_ARB
:
7437 CALL_ProgramStringARB(ctx
->Exec
,
7438 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7441 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7442 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7443 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7448 #if FEATURE_queryobj
7449 case OPCODE_BEGIN_QUERY_ARB
:
7450 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7452 case OPCODE_END_QUERY_ARB
:
7453 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7456 case OPCODE_DRAW_BUFFERS_ARB
:
7458 GLenum buffers
[MAX_DRAW_BUFFERS
];
7459 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7460 for (i
= 0; i
< count
; i
++)
7461 buffers
[i
] = n
[2 + i
].e
;
7462 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7465 #if FEATURE_EXT_framebuffer_blit
7466 case OPCODE_BLIT_FRAMEBUFFER
:
7467 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7468 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7473 case OPCODE_USE_PROGRAM
:
7474 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7476 case OPCODE_UNIFORM_1F
:
7477 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7479 case OPCODE_UNIFORM_2F
:
7480 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7482 case OPCODE_UNIFORM_3F
:
7483 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7485 case OPCODE_UNIFORM_4F
:
7486 CALL_Uniform4fARB(ctx
->Exec
,
7487 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7489 case OPCODE_UNIFORM_1FV
:
7490 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7492 case OPCODE_UNIFORM_2FV
:
7493 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7495 case OPCODE_UNIFORM_3FV
:
7496 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7498 case OPCODE_UNIFORM_4FV
:
7499 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7501 case OPCODE_UNIFORM_1I
:
7502 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7504 case OPCODE_UNIFORM_2I
:
7505 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7507 case OPCODE_UNIFORM_3I
:
7508 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7510 case OPCODE_UNIFORM_4I
:
7511 CALL_Uniform4iARB(ctx
->Exec
,
7512 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7514 case OPCODE_UNIFORM_1IV
:
7515 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7517 case OPCODE_UNIFORM_2IV
:
7518 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7520 case OPCODE_UNIFORM_3IV
:
7521 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7523 case OPCODE_UNIFORM_4IV
:
7524 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7527 case OPCODE_UNIFORM_MATRIX22
:
7528 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7529 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7531 case OPCODE_UNIFORM_MATRIX33
:
7532 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7533 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7535 case OPCODE_UNIFORM_MATRIX44
:
7536 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7537 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7539 case OPCODE_UNIFORM_MATRIX23
:
7540 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7541 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7543 case OPCODE_UNIFORM_MATRIX32
:
7544 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7545 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7547 case OPCODE_UNIFORM_MATRIX24
:
7548 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7549 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7551 case OPCODE_UNIFORM_MATRIX42
:
7552 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7553 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7555 case OPCODE_UNIFORM_MATRIX34
:
7556 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7557 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7559 case OPCODE_UNIFORM_MATRIX43
:
7560 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7561 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7564 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7567 GLuint i
, pname
= n
[1].ui
;
7569 for (i
= 0; i
< 4; i
++)
7570 values
[i
] = n
[1 + i
].f
;
7571 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7574 #if FEATURE_ATI_fragment_shader
7575 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7576 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7578 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7581 GLuint i
, dst
= n
[1].ui
;
7583 for (i
= 0; i
< 4; i
++)
7584 values
[i
] = n
[1 + i
].f
;
7585 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7589 case OPCODE_ATTR_1F_NV
:
7590 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7592 case OPCODE_ATTR_2F_NV
:
7593 /* Really shouldn't have to do this - the Node structure
7594 * is convenient, but it would be better to store the data
7595 * packed appropriately so that it can be sent directly
7596 * on. With x86_64 becoming common, this will start to
7599 if (sizeof(Node
) == sizeof(GLfloat
))
7600 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7602 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7604 case OPCODE_ATTR_3F_NV
:
7605 if (sizeof(Node
) == sizeof(GLfloat
))
7606 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7608 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7611 case OPCODE_ATTR_4F_NV
:
7612 if (sizeof(Node
) == sizeof(GLfloat
))
7613 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7615 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7618 case OPCODE_ATTR_1F_ARB
:
7619 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7621 case OPCODE_ATTR_2F_ARB
:
7622 /* Really shouldn't have to do this - the Node structure
7623 * is convenient, but it would be better to store the data
7624 * packed appropriately so that it can be sent directly
7625 * on. With x86_64 becoming common, this will start to
7628 if (sizeof(Node
) == sizeof(GLfloat
))
7629 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7631 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7633 case OPCODE_ATTR_3F_ARB
:
7634 if (sizeof(Node
) == sizeof(GLfloat
))
7635 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7637 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7640 case OPCODE_ATTR_4F_ARB
:
7641 if (sizeof(Node
) == sizeof(GLfloat
))
7642 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7644 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7647 case OPCODE_MATERIAL
:
7648 if (sizeof(Node
) == sizeof(GLfloat
))
7649 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7656 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7660 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7663 CALL_End(ctx
->Exec
, ());
7666 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7668 case OPCODE_EVAL_C1
:
7669 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7671 case OPCODE_EVAL_C2
:
7672 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7674 case OPCODE_EVAL_P1
:
7675 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7677 case OPCODE_EVAL_P2
:
7678 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7681 case OPCODE_CONTINUE
:
7682 n
= (Node
*) n
[1].next
;
7684 case OPCODE_END_OF_LIST
:
7690 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
7692 _mesa_problem(ctx
, msg
);
7697 /* increment n to point to next compiled command */
7698 if (opcode
!= OPCODE_CONTINUE
) {
7699 n
+= InstSize
[opcode
];
7704 if (ctx
->Driver
.EndCallList
)
7705 ctx
->Driver
.EndCallList(ctx
);
7707 ctx
->ListState
.CallDepth
--;
7712 /**********************************************************************/
7714 /**********************************************************************/
7717 * Test if a display list number is valid.
7719 static GLboolean GLAPIENTRY
7720 _mesa_IsList(GLuint list
)
7722 GET_CURRENT_CONTEXT(ctx
);
7723 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7724 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7725 return islist(ctx
, list
);
7730 * Delete a sequence of consecutive display lists.
7732 static void GLAPIENTRY
7733 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7735 GET_CURRENT_CONTEXT(ctx
);
7737 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7738 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7741 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7744 for (i
= list
; i
< list
+ range
; i
++) {
7745 destroy_list(ctx
, i
);
7751 * Return a display list number, n, such that lists n through n+range-1
7754 static GLuint GLAPIENTRY
7755 _mesa_GenLists(GLsizei range
)
7757 GET_CURRENT_CONTEXT(ctx
);
7759 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7760 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7763 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7771 * Make this an atomic operation
7773 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7775 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7777 /* reserve the list IDs by with empty/dummy lists */
7779 for (i
= 0; i
< range
; i
++) {
7780 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7781 make_list(base
+ i
, 1));
7785 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7792 * Begin a new display list.
7794 static void GLAPIENTRY
7795 _mesa_NewList(GLuint name
, GLenum mode
)
7797 GET_CURRENT_CONTEXT(ctx
);
7799 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7800 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7802 if (MESA_VERBOSE
& VERBOSE_API
)
7803 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7804 _mesa_lookup_enum_by_nr(mode
));
7807 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7811 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7812 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7816 if (ctx
->ListState
.CurrentList
) {
7817 /* already compiling a display list */
7818 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7822 ctx
->CompileFlag
= GL_TRUE
;
7823 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7825 /* Reset acumulated list state:
7827 invalidate_saved_current_state( ctx
);
7829 /* Allocate new display list */
7830 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7831 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7832 ctx
->ListState
.CurrentPos
= 0;
7834 ctx
->Driver
.NewList(ctx
, name
, mode
);
7836 ctx
->CurrentDispatch
= ctx
->Save
;
7837 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7842 * End definition of current display list.
7844 static void GLAPIENTRY
7847 GET_CURRENT_CONTEXT(ctx
);
7848 SAVE_FLUSH_VERTICES(ctx
);
7849 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7851 if (MESA_VERBOSE
& VERBOSE_API
)
7852 _mesa_debug(ctx
, "glEndList\n");
7854 /* Check that a list is under construction */
7855 if (!ctx
->ListState
.CurrentList
) {
7856 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7860 /* Call before emitting END_OF_LIST, in case the driver wants to
7861 * emit opcodes itself.
7863 ctx
->Driver
.EndList(ctx
);
7865 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
7867 /* Destroy old list, if any */
7868 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7870 /* Install the new list */
7871 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7872 ctx
->ListState
.CurrentList
->Name
,
7873 ctx
->ListState
.CurrentList
);
7876 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7877 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7879 ctx
->ListState
.CurrentList
= NULL
;
7880 ctx
->ExecuteFlag
= GL_TRUE
;
7881 ctx
->CompileFlag
= GL_FALSE
;
7883 ctx
->CurrentDispatch
= ctx
->Exec
;
7884 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7889 _mesa_CallList(GLuint list
)
7891 GLboolean save_compile_flag
;
7892 GET_CURRENT_CONTEXT(ctx
);
7893 FLUSH_CURRENT(ctx
, 0);
7894 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7895 /* execute the display list, and restore the CompileFlag. */
7897 if (MESA_VERBOSE
& VERBOSE_API
)
7898 _mesa_debug(ctx
, "glCallList %d\n", list
);
7901 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7905 /* mesa_print_display_list( list ); */
7907 save_compile_flag
= ctx
->CompileFlag
;
7908 if (save_compile_flag
) {
7909 ctx
->CompileFlag
= GL_FALSE
;
7912 execute_list(ctx
, list
);
7913 ctx
->CompileFlag
= save_compile_flag
;
7915 /* also restore API function pointers to point to "save" versions */
7916 if (save_compile_flag
) {
7917 ctx
->CurrentDispatch
= ctx
->Save
;
7918 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7924 * Execute glCallLists: call multiple display lists.
7927 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7929 GET_CURRENT_CONTEXT(ctx
);
7931 GLboolean save_compile_flag
;
7933 if (MESA_VERBOSE
& VERBOSE_API
)
7934 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7938 case GL_UNSIGNED_BYTE
:
7940 case GL_UNSIGNED_SHORT
:
7942 case GL_UNSIGNED_INT
:
7950 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7954 /* Save the CompileFlag status, turn it off, execute display list,
7955 * and restore the CompileFlag.
7957 save_compile_flag
= ctx
->CompileFlag
;
7958 ctx
->CompileFlag
= GL_FALSE
;
7960 for (i
= 0; i
< n
; i
++) {
7961 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7962 execute_list(ctx
, list
);
7965 ctx
->CompileFlag
= save_compile_flag
;
7967 /* also restore API function pointers to point to "save" versions */
7968 if (save_compile_flag
) {
7969 ctx
->CurrentDispatch
= ctx
->Save
;
7970 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7976 * Set the offset added to list numbers in glCallLists.
7978 static void GLAPIENTRY
7979 _mesa_ListBase(GLuint base
)
7981 GET_CURRENT_CONTEXT(ctx
);
7982 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7983 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7984 ctx
->List
.ListBase
= base
;
7988 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7990 static void GLAPIENTRY
7993 GET_CURRENT_CONTEXT(ctx
);
7994 FLUSH_VERTICES(ctx
, 0);
7995 CALL_Finish(ctx
->Exec
, ());
7998 static void GLAPIENTRY
8001 GET_CURRENT_CONTEXT(ctx
);
8002 FLUSH_VERTICES(ctx
, 0);
8003 CALL_Flush(ctx
->Exec
, ());
8006 static void GLAPIENTRY
8007 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
8009 GET_CURRENT_CONTEXT(ctx
);
8010 FLUSH_VERTICES(ctx
, 0);
8011 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
8014 static void GLAPIENTRY
8015 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
8017 GET_CURRENT_CONTEXT(ctx
);
8018 FLUSH_VERTICES(ctx
, 0);
8019 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
8022 static void GLAPIENTRY
8023 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
8025 GET_CURRENT_CONTEXT(ctx
);
8026 FLUSH_VERTICES(ctx
, 0);
8027 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
8030 static GLenum GLAPIENTRY
8033 GET_CURRENT_CONTEXT(ctx
);
8034 FLUSH_VERTICES(ctx
, 0);
8035 return CALL_GetError(ctx
->Exec
, ());
8038 static void GLAPIENTRY
8039 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
8041 GET_CURRENT_CONTEXT(ctx
);
8042 FLUSH_VERTICES(ctx
, 0);
8043 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
8046 static void GLAPIENTRY
8047 exec_GetIntegerv(GLenum pname
, GLint
*params
)
8049 GET_CURRENT_CONTEXT(ctx
);
8050 FLUSH_VERTICES(ctx
, 0);
8051 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
8054 static void GLAPIENTRY
8055 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
8057 GET_CURRENT_CONTEXT(ctx
);
8058 FLUSH_VERTICES(ctx
, 0);
8059 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
8062 static void GLAPIENTRY
8063 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
8065 GET_CURRENT_CONTEXT(ctx
);
8066 FLUSH_VERTICES(ctx
, 0);
8067 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
8070 static void GLAPIENTRY
8071 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
8073 GET_CURRENT_CONTEXT(ctx
);
8074 FLUSH_VERTICES(ctx
, 0);
8075 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
8078 static void GLAPIENTRY
8079 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
8081 GET_CURRENT_CONTEXT(ctx
);
8082 FLUSH_VERTICES(ctx
, 0);
8083 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
8086 static void GLAPIENTRY
8087 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
8089 GET_CURRENT_CONTEXT(ctx
);
8090 FLUSH_VERTICES(ctx
, 0);
8091 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
8094 static void GLAPIENTRY
8095 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
8097 GET_CURRENT_CONTEXT(ctx
);
8098 FLUSH_VERTICES(ctx
, 0);
8099 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
8102 static void GLAPIENTRY
8103 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
8105 GET_CURRENT_CONTEXT(ctx
);
8106 FLUSH_VERTICES(ctx
, 0);
8107 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
8110 static void GLAPIENTRY
8111 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
8113 GET_CURRENT_CONTEXT(ctx
);
8114 FLUSH_VERTICES(ctx
, 0);
8115 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8118 static void GLAPIENTRY
8119 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8121 GET_CURRENT_CONTEXT(ctx
);
8122 FLUSH_VERTICES(ctx
, 0);
8123 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8126 static void GLAPIENTRY
8127 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8129 GET_CURRENT_CONTEXT(ctx
);
8130 FLUSH_VERTICES(ctx
, 0);
8131 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8134 static void GLAPIENTRY
8135 exec_GetPolygonStipple(GLubyte
* dest
)
8137 GET_CURRENT_CONTEXT(ctx
);
8138 FLUSH_VERTICES(ctx
, 0);
8139 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8142 static const GLubyte
*GLAPIENTRY
8143 exec_GetString(GLenum name
)
8145 GET_CURRENT_CONTEXT(ctx
);
8146 FLUSH_VERTICES(ctx
, 0);
8147 return CALL_GetString(ctx
->Exec
, (name
));
8150 static void GLAPIENTRY
8151 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8153 GET_CURRENT_CONTEXT(ctx
);
8154 FLUSH_VERTICES(ctx
, 0);
8155 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8158 static void GLAPIENTRY
8159 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8161 GET_CURRENT_CONTEXT(ctx
);
8162 FLUSH_VERTICES(ctx
, 0);
8163 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8166 static void GLAPIENTRY
8167 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8169 GET_CURRENT_CONTEXT(ctx
);
8170 FLUSH_VERTICES(ctx
, 0);
8171 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8174 static void GLAPIENTRY
8175 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8177 GET_CURRENT_CONTEXT(ctx
);
8178 FLUSH_VERTICES(ctx
, 0);
8179 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8182 static void GLAPIENTRY
8183 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8185 GET_CURRENT_CONTEXT(ctx
);
8186 FLUSH_VERTICES(ctx
, 0);
8187 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8190 static void GLAPIENTRY
8191 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8192 GLenum type
, GLvoid
* pixels
)
8194 GET_CURRENT_CONTEXT(ctx
);
8195 FLUSH_VERTICES(ctx
, 0);
8196 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8199 static void GLAPIENTRY
8200 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8201 GLenum pname
, GLfloat
*params
)
8203 GET_CURRENT_CONTEXT(ctx
);
8204 FLUSH_VERTICES(ctx
, 0);
8205 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8208 static void GLAPIENTRY
8209 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8210 GLenum pname
, GLint
*params
)
8212 GET_CURRENT_CONTEXT(ctx
);
8213 FLUSH_VERTICES(ctx
, 0);
8214 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8217 static void GLAPIENTRY
8218 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8220 GET_CURRENT_CONTEXT(ctx
);
8221 FLUSH_VERTICES(ctx
, 0);
8222 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8225 static void GLAPIENTRY
8226 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8228 GET_CURRENT_CONTEXT(ctx
);
8229 FLUSH_VERTICES(ctx
, 0);
8230 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8233 static GLboolean GLAPIENTRY
8234 exec_IsEnabled(GLenum cap
)
8236 GET_CURRENT_CONTEXT(ctx
);
8237 FLUSH_VERTICES(ctx
, 0);
8238 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8241 static void GLAPIENTRY
8242 exec_PixelStoref(GLenum pname
, GLfloat param
)
8244 GET_CURRENT_CONTEXT(ctx
);
8245 FLUSH_VERTICES(ctx
, 0);
8246 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8249 static void GLAPIENTRY
8250 exec_PixelStorei(GLenum pname
, GLint param
)
8252 GET_CURRENT_CONTEXT(ctx
);
8253 FLUSH_VERTICES(ctx
, 0);
8254 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8257 static void GLAPIENTRY
8258 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8259 GLenum format
, GLenum type
, GLvoid
* pixels
)
8261 GET_CURRENT_CONTEXT(ctx
);
8262 FLUSH_VERTICES(ctx
, 0);
8263 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8266 static GLint GLAPIENTRY
8267 exec_RenderMode(GLenum mode
)
8269 GET_CURRENT_CONTEXT(ctx
);
8270 FLUSH_VERTICES(ctx
, 0);
8271 return CALL_RenderMode(ctx
->Exec
, (mode
));
8274 static void GLAPIENTRY
8275 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8277 GET_CURRENT_CONTEXT(ctx
);
8278 FLUSH_VERTICES(ctx
, 0);
8279 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8282 static void GLAPIENTRY
8283 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8285 GET_CURRENT_CONTEXT(ctx
);
8286 FLUSH_VERTICES(ctx
, 0);
8287 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8290 static GLboolean GLAPIENTRY
8291 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8292 GLboolean
* residences
)
8294 GET_CURRENT_CONTEXT(ctx
);
8295 FLUSH_VERTICES(ctx
, 0);
8296 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8299 static void GLAPIENTRY
8300 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8302 GET_CURRENT_CONTEXT(ctx
);
8303 FLUSH_VERTICES(ctx
, 0);
8304 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8307 static void GLAPIENTRY
8308 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8310 GET_CURRENT_CONTEXT(ctx
);
8311 FLUSH_VERTICES(ctx
, 0);
8312 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8315 static void GLAPIENTRY
8316 exec_DisableClientState(GLenum cap
)
8318 GET_CURRENT_CONTEXT(ctx
);
8319 FLUSH_VERTICES(ctx
, 0);
8320 CALL_DisableClientState(ctx
->Exec
, (cap
));
8323 static void GLAPIENTRY
8324 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8326 GET_CURRENT_CONTEXT(ctx
);
8327 FLUSH_VERTICES(ctx
, 0);
8328 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8331 static void GLAPIENTRY
8332 exec_EnableClientState(GLenum cap
)
8334 GET_CURRENT_CONTEXT(ctx
);
8335 FLUSH_VERTICES(ctx
, 0);
8336 CALL_EnableClientState(ctx
->Exec
, (cap
));
8339 static void GLAPIENTRY
8340 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8342 GET_CURRENT_CONTEXT(ctx
);
8343 FLUSH_VERTICES(ctx
, 0);
8344 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8347 static void GLAPIENTRY
8348 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8350 GET_CURRENT_CONTEXT(ctx
);
8351 FLUSH_VERTICES(ctx
, 0);
8352 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8355 static void GLAPIENTRY
8356 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8358 GET_CURRENT_CONTEXT(ctx
);
8359 FLUSH_VERTICES(ctx
, 0);
8360 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8363 static void GLAPIENTRY
8364 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8366 GET_CURRENT_CONTEXT(ctx
);
8367 FLUSH_VERTICES(ctx
, 0);
8368 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8371 static GLboolean GLAPIENTRY
8372 exec_IsTexture(GLuint texture
)
8374 GET_CURRENT_CONTEXT(ctx
);
8375 FLUSH_VERTICES(ctx
, 0);
8376 return CALL_IsTexture(ctx
->Exec
, (texture
));
8379 static void GLAPIENTRY
8380 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8382 GET_CURRENT_CONTEXT(ctx
);
8383 FLUSH_VERTICES(ctx
, 0);
8384 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8387 static void GLAPIENTRY
8388 exec_PopClientAttrib(void)
8390 GET_CURRENT_CONTEXT(ctx
);
8391 FLUSH_VERTICES(ctx
, 0);
8392 CALL_PopClientAttrib(ctx
->Exec
, ());
8395 static void GLAPIENTRY
8396 exec_PushClientAttrib(GLbitfield mask
)
8398 GET_CURRENT_CONTEXT(ctx
);
8399 FLUSH_VERTICES(ctx
, 0);
8400 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8403 static void GLAPIENTRY
8404 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8407 GET_CURRENT_CONTEXT(ctx
);
8408 FLUSH_VERTICES(ctx
, 0);
8409 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8412 static void GLAPIENTRY
8413 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8415 GET_CURRENT_CONTEXT(ctx
);
8416 FLUSH_VERTICES(ctx
, 0);
8417 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8420 static void GLAPIENTRY
8421 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8424 GET_CURRENT_CONTEXT(ctx
);
8425 FLUSH_VERTICES(ctx
, 0);
8426 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8429 static void GLAPIENTRY
8430 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8431 GLint x
, GLint y
, GLsizei width
)
8433 GET_CURRENT_CONTEXT(ctx
);
8434 FLUSH_VERTICES(ctx
, 0);
8435 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8436 (target
, internalFormat
, x
, y
, width
));
8439 static void GLAPIENTRY
8440 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8441 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8443 GET_CURRENT_CONTEXT(ctx
);
8444 FLUSH_VERTICES(ctx
, 0);
8445 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8446 (target
, internalFormat
, x
, y
, width
,
8450 static void GLAPIENTRY
8451 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8453 GET_CURRENT_CONTEXT(ctx
);
8454 FLUSH_VERTICES(ctx
, 0);
8455 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8458 static void GLAPIENTRY
8459 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8461 GET_CURRENT_CONTEXT(ctx
);
8462 FLUSH_VERTICES(ctx
, 0);
8463 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8466 static void GLAPIENTRY
8467 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8469 GET_CURRENT_CONTEXT(ctx
);
8470 FLUSH_VERTICES(ctx
, 0);
8471 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8474 static void GLAPIENTRY
8475 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8478 GET_CURRENT_CONTEXT(ctx
);
8479 FLUSH_VERTICES(ctx
, 0);
8480 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8483 static void GLAPIENTRY
8484 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8486 GET_CURRENT_CONTEXT(ctx
);
8487 FLUSH_VERTICES(ctx
, 0);
8488 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8491 static void GLAPIENTRY
8492 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8494 GET_CURRENT_CONTEXT(ctx
);
8495 FLUSH_VERTICES(ctx
, 0);
8496 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8499 static void GLAPIENTRY
8500 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8501 GLenum type
, GLvoid
*values
)
8503 GET_CURRENT_CONTEXT(ctx
);
8504 FLUSH_VERTICES(ctx
, 0);
8505 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8508 static void GLAPIENTRY
8509 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8511 GET_CURRENT_CONTEXT(ctx
);
8512 FLUSH_VERTICES(ctx
, 0);
8513 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8516 static void GLAPIENTRY
8517 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8519 GET_CURRENT_CONTEXT(ctx
);
8520 FLUSH_VERTICES(ctx
, 0);
8521 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8524 static void GLAPIENTRY
8525 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8526 GLenum type
, GLvoid
*values
)
8528 GET_CURRENT_CONTEXT(ctx
);
8529 FLUSH_VERTICES(ctx
, 0);
8530 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8533 static void GLAPIENTRY
8534 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8536 GET_CURRENT_CONTEXT(ctx
);
8537 FLUSH_VERTICES(ctx
, 0);
8538 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8541 static void GLAPIENTRY
8542 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8544 GET_CURRENT_CONTEXT(ctx
);
8545 FLUSH_VERTICES(ctx
, 0);
8546 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8549 static void GLAPIENTRY
8550 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8551 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8553 GET_CURRENT_CONTEXT(ctx
);
8554 FLUSH_VERTICES(ctx
, 0);
8555 CALL_GetSeparableFilter(ctx
->Exec
,
8556 (target
, format
, type
, row
, column
, span
));
8559 static void GLAPIENTRY
8560 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8561 GLsizei width
, GLsizei height
, GLenum format
,
8562 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8564 GET_CURRENT_CONTEXT(ctx
);
8565 FLUSH_VERTICES(ctx
, 0);
8566 CALL_SeparableFilter2D(ctx
->Exec
,
8567 (target
, internalFormat
, width
, height
, format
,
8568 type
, row
, column
));
8571 static void GLAPIENTRY
8572 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8573 GLsizei count
, const GLvoid
*ptr
)
8575 GET_CURRENT_CONTEXT(ctx
);
8576 FLUSH_VERTICES(ctx
, 0);
8577 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8580 static void GLAPIENTRY
8581 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8583 GET_CURRENT_CONTEXT(ctx
);
8584 FLUSH_VERTICES(ctx
, 0);
8585 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8588 static void GLAPIENTRY
8589 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8592 GET_CURRENT_CONTEXT(ctx
);
8593 FLUSH_VERTICES(ctx
, 0);
8594 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8597 static void GLAPIENTRY
8598 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8601 GET_CURRENT_CONTEXT(ctx
);
8602 FLUSH_VERTICES(ctx
, 0);
8603 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8606 static void GLAPIENTRY
8607 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8608 GLsizei count
, const GLvoid
*ptr
)
8610 GET_CURRENT_CONTEXT(ctx
);
8611 FLUSH_VERTICES(ctx
, 0);
8612 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8615 static void GLAPIENTRY
8616 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8617 GLsizei count
, const GLvoid
*ptr
)
8619 GET_CURRENT_CONTEXT(ctx
);
8620 FLUSH_VERTICES(ctx
, 0);
8621 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8624 static void GLAPIENTRY
8625 exec_LockArraysEXT(GLint first
, GLsizei count
)
8627 GET_CURRENT_CONTEXT(ctx
);
8628 FLUSH_VERTICES(ctx
, 0);
8629 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8632 static void GLAPIENTRY
8633 exec_UnlockArraysEXT(void)
8635 GET_CURRENT_CONTEXT(ctx
);
8636 FLUSH_VERTICES(ctx
, 0);
8637 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8640 static void GLAPIENTRY
8641 exec_ClientActiveTextureARB(GLenum target
)
8643 GET_CURRENT_CONTEXT(ctx
);
8644 FLUSH_VERTICES(ctx
, 0);
8645 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8648 static void GLAPIENTRY
8649 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8650 GLsizei stride
, const GLvoid
*ptr
)
8652 GET_CURRENT_CONTEXT(ctx
);
8653 FLUSH_VERTICES(ctx
, 0);
8654 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8657 static void GLAPIENTRY
8658 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8660 GET_CURRENT_CONTEXT(ctx
);
8661 FLUSH_VERTICES(ctx
, 0);
8662 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8665 /* GL_EXT_multi_draw_arrays */
8666 static void GLAPIENTRY
8667 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8668 GLsizei
* count
, GLsizei primcount
)
8670 GET_CURRENT_CONTEXT(ctx
);
8671 FLUSH_VERTICES(ctx
, 0);
8672 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8675 /* GL_IBM_multimode_draw_arrays */
8676 static void GLAPIENTRY
8677 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8678 const GLsizei
* count
, GLsizei primcount
,
8681 GET_CURRENT_CONTEXT(ctx
);
8682 FLUSH_VERTICES(ctx
, 0);
8683 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8684 (mode
, first
, count
, primcount
, modestride
));
8687 /* GL_IBM_multimode_draw_arrays */
8688 static void GLAPIENTRY
8689 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8690 const GLsizei
* count
,
8692 const GLvoid
* const *indices
,
8693 GLsizei primcount
, GLint modestride
)
8695 GET_CURRENT_CONTEXT(ctx
);
8696 FLUSH_VERTICES(ctx
, 0);
8697 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8698 (mode
, count
, type
, indices
, primcount
,
8705 * Setup the given dispatch table to point to Mesa's display list
8706 * building functions.
8708 * This does not include any of the tnl functions - they are
8709 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8713 _mesa_init_save_table(struct _glapi_table
*table
)
8715 _mesa_loopback_init_api_table(table
);
8718 SET_Accum(table
, save_Accum
);
8719 SET_AlphaFunc(table
, save_AlphaFunc
);
8720 SET_Bitmap(table
, save_Bitmap
);
8721 SET_BlendFunc(table
, save_BlendFunc
);
8722 SET_CallList(table
, save_CallList
);
8723 SET_CallLists(table
, save_CallLists
);
8724 SET_Clear(table
, save_Clear
);
8725 SET_ClearAccum(table
, save_ClearAccum
);
8726 SET_ClearColor(table
, save_ClearColor
);
8727 SET_ClearDepth(table
, save_ClearDepth
);
8728 SET_ClearIndex(table
, save_ClearIndex
);
8729 SET_ClearStencil(table
, save_ClearStencil
);
8730 SET_ClipPlane(table
, save_ClipPlane
);
8731 SET_ColorMask(table
, save_ColorMask
);
8732 SET_ColorMaskIndexedEXT(table
, save_ColorMaskIndexed
);
8733 SET_ColorMaterial(table
, save_ColorMaterial
);
8734 SET_CopyPixels(table
, save_CopyPixels
);
8735 SET_CullFace(table
, save_CullFace
);
8736 SET_DeleteLists(table
, _mesa_DeleteLists
);
8737 SET_DepthFunc(table
, save_DepthFunc
);
8738 SET_DepthMask(table
, save_DepthMask
);
8739 SET_DepthRange(table
, save_DepthRange
);
8740 SET_Disable(table
, save_Disable
);
8741 SET_DisableIndexedEXT(table
, save_DisableIndexed
);
8742 SET_DrawBuffer(table
, save_DrawBuffer
);
8743 SET_DrawPixels(table
, save_DrawPixels
);
8744 SET_Enable(table
, save_Enable
);
8745 SET_EnableIndexedEXT(table
, save_EnableIndexed
);
8746 SET_EndList(table
, _mesa_EndList
);
8747 SET_EvalMesh1(table
, save_EvalMesh1
);
8748 SET_EvalMesh2(table
, save_EvalMesh2
);
8749 SET_Finish(table
, exec_Finish
);
8750 SET_Flush(table
, exec_Flush
);
8751 SET_Fogf(table
, save_Fogf
);
8752 SET_Fogfv(table
, save_Fogfv
);
8753 SET_Fogi(table
, save_Fogi
);
8754 SET_Fogiv(table
, save_Fogiv
);
8755 SET_FrontFace(table
, save_FrontFace
);
8756 SET_Frustum(table
, save_Frustum
);
8757 SET_GenLists(table
, _mesa_GenLists
);
8758 SET_GetBooleanv(table
, exec_GetBooleanv
);
8759 SET_GetClipPlane(table
, exec_GetClipPlane
);
8760 SET_GetDoublev(table
, exec_GetDoublev
);
8761 SET_GetError(table
, exec_GetError
);
8762 SET_GetFloatv(table
, exec_GetFloatv
);
8763 SET_GetIntegerv(table
, exec_GetIntegerv
);
8764 SET_GetLightfv(table
, exec_GetLightfv
);
8765 SET_GetLightiv(table
, exec_GetLightiv
);
8766 SET_GetMapdv(table
, exec_GetMapdv
);
8767 SET_GetMapfv(table
, exec_GetMapfv
);
8768 SET_GetMapiv(table
, exec_GetMapiv
);
8769 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8770 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8771 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8772 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8773 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8774 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8775 SET_GetString(table
, exec_GetString
);
8776 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8777 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8778 SET_GetTexGendv(table
, exec_GetTexGendv
);
8779 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8780 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8781 SET_GetTexImage(table
, exec_GetTexImage
);
8782 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8783 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8784 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8785 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8786 SET_Hint(table
, save_Hint
);
8787 SET_IndexMask(table
, save_IndexMask
);
8788 SET_InitNames(table
, save_InitNames
);
8789 SET_IsEnabled(table
, exec_IsEnabled
);
8790 SET_IsList(table
, _mesa_IsList
);
8791 SET_LightModelf(table
, save_LightModelf
);
8792 SET_LightModelfv(table
, save_LightModelfv
);
8793 SET_LightModeli(table
, save_LightModeli
);
8794 SET_LightModeliv(table
, save_LightModeliv
);
8795 SET_Lightf(table
, save_Lightf
);
8796 SET_Lightfv(table
, save_Lightfv
);
8797 SET_Lighti(table
, save_Lighti
);
8798 SET_Lightiv(table
, save_Lightiv
);
8799 SET_LineStipple(table
, save_LineStipple
);
8800 SET_LineWidth(table
, save_LineWidth
);
8801 SET_ListBase(table
, save_ListBase
);
8802 SET_LoadIdentity(table
, save_LoadIdentity
);
8803 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8804 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8805 SET_LoadName(table
, save_LoadName
);
8806 SET_LogicOp(table
, save_LogicOp
);
8807 SET_Map1d(table
, save_Map1d
);
8808 SET_Map1f(table
, save_Map1f
);
8809 SET_Map2d(table
, save_Map2d
);
8810 SET_Map2f(table
, save_Map2f
);
8811 SET_MapGrid1d(table
, save_MapGrid1d
);
8812 SET_MapGrid1f(table
, save_MapGrid1f
);
8813 SET_MapGrid2d(table
, save_MapGrid2d
);
8814 SET_MapGrid2f(table
, save_MapGrid2f
);
8815 SET_MatrixMode(table
, save_MatrixMode
);
8816 SET_MultMatrixd(table
, save_MultMatrixd
);
8817 SET_MultMatrixf(table
, save_MultMatrixf
);
8818 SET_NewList(table
, save_NewList
);
8819 SET_Ortho(table
, save_Ortho
);
8820 SET_PassThrough(table
, save_PassThrough
);
8821 SET_PixelMapfv(table
, save_PixelMapfv
);
8822 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8823 SET_PixelMapusv(table
, save_PixelMapusv
);
8824 SET_PixelStoref(table
, exec_PixelStoref
);
8825 SET_PixelStorei(table
, exec_PixelStorei
);
8826 SET_PixelTransferf(table
, save_PixelTransferf
);
8827 SET_PixelTransferi(table
, save_PixelTransferi
);
8828 SET_PixelZoom(table
, save_PixelZoom
);
8829 SET_PointSize(table
, save_PointSize
);
8830 SET_PolygonMode(table
, save_PolygonMode
);
8831 SET_PolygonOffset(table
, save_PolygonOffset
);
8832 SET_PolygonStipple(table
, save_PolygonStipple
);
8833 SET_PopAttrib(table
, save_PopAttrib
);
8834 SET_PopMatrix(table
, save_PopMatrix
);
8835 SET_PopName(table
, save_PopName
);
8836 SET_PushAttrib(table
, save_PushAttrib
);
8837 SET_PushMatrix(table
, save_PushMatrix
);
8838 SET_PushName(table
, save_PushName
);
8839 SET_RasterPos2d(table
, save_RasterPos2d
);
8840 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8841 SET_RasterPos2f(table
, save_RasterPos2f
);
8842 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8843 SET_RasterPos2i(table
, save_RasterPos2i
);
8844 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8845 SET_RasterPos2s(table
, save_RasterPos2s
);
8846 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8847 SET_RasterPos3d(table
, save_RasterPos3d
);
8848 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8849 SET_RasterPos3f(table
, save_RasterPos3f
);
8850 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8851 SET_RasterPos3i(table
, save_RasterPos3i
);
8852 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8853 SET_RasterPos3s(table
, save_RasterPos3s
);
8854 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8855 SET_RasterPos4d(table
, save_RasterPos4d
);
8856 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8857 SET_RasterPos4f(table
, save_RasterPos4f
);
8858 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8859 SET_RasterPos4i(table
, save_RasterPos4i
);
8860 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8861 SET_RasterPos4s(table
, save_RasterPos4s
);
8862 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8863 SET_ReadBuffer(table
, save_ReadBuffer
);
8864 SET_ReadPixels(table
, exec_ReadPixels
);
8865 SET_RenderMode(table
, exec_RenderMode
);
8866 SET_Rotated(table
, save_Rotated
);
8867 SET_Rotatef(table
, save_Rotatef
);
8868 SET_Scaled(table
, save_Scaled
);
8869 SET_Scalef(table
, save_Scalef
);
8870 SET_Scissor(table
, save_Scissor
);
8871 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8872 SET_SelectBuffer(table
, exec_SelectBuffer
);
8873 SET_ShadeModel(table
, save_ShadeModel
);
8874 SET_StencilFunc(table
, save_StencilFunc
);
8875 SET_StencilMask(table
, save_StencilMask
);
8876 SET_StencilOp(table
, save_StencilOp
);
8877 SET_TexEnvf(table
, save_TexEnvf
);
8878 SET_TexEnvfv(table
, save_TexEnvfv
);
8879 SET_TexEnvi(table
, save_TexEnvi
);
8880 SET_TexEnviv(table
, save_TexEnviv
);
8881 SET_TexGend(table
, save_TexGend
);
8882 SET_TexGendv(table
, save_TexGendv
);
8883 SET_TexGenf(table
, save_TexGenf
);
8884 SET_TexGenfv(table
, save_TexGenfv
);
8885 SET_TexGeni(table
, save_TexGeni
);
8886 SET_TexGeniv(table
, save_TexGeniv
);
8887 SET_TexImage1D(table
, save_TexImage1D
);
8888 SET_TexImage2D(table
, save_TexImage2D
);
8889 SET_TexParameterf(table
, save_TexParameterf
);
8890 SET_TexParameterfv(table
, save_TexParameterfv
);
8891 SET_TexParameteri(table
, save_TexParameteri
);
8892 SET_TexParameteriv(table
, save_TexParameteriv
);
8893 SET_Translated(table
, save_Translated
);
8894 SET_Translatef(table
, save_Translatef
);
8895 SET_Viewport(table
, save_Viewport
);
8898 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8899 SET_BindTexture(table
, save_BindTexture
);
8900 SET_ColorPointer(table
, exec_ColorPointer
);
8901 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8902 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8903 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8904 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8905 SET_DeleteTextures(table
, exec_DeleteTextures
);
8906 SET_DisableClientState(table
, exec_DisableClientState
);
8907 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8908 SET_EnableClientState(table
, exec_EnableClientState
);
8909 SET_GenTextures(table
, exec_GenTextures
);
8910 SET_GetPointerv(table
, exec_GetPointerv
);
8911 SET_IndexPointer(table
, exec_IndexPointer
);
8912 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8913 SET_IsTexture(table
, exec_IsTexture
);
8914 SET_NormalPointer(table
, exec_NormalPointer
);
8915 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8916 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8917 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8918 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8919 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8920 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8921 SET_VertexPointer(table
, exec_VertexPointer
);
8924 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8925 SET_TexImage3D(table
, save_TexImage3D
);
8926 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8929 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8930 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8931 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8933 /* ATI_separate_stencil */
8934 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8936 /* GL_ARB_imaging */
8937 /* Not all are supported */
8938 SET_BlendColor(table
, save_BlendColor
);
8939 SET_BlendEquation(table
, save_BlendEquation
);
8940 SET_ColorSubTable(table
, save_ColorSubTable
);
8941 SET_ColorTable(table
, save_ColorTable
);
8942 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8943 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8944 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8945 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8946 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8947 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8948 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8949 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8950 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8951 SET_CopyColorTable(table
, save_CopyColorTable
);
8952 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8953 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8954 SET_GetColorTable(table
, exec_GetColorTable
);
8955 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8956 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8957 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8958 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8959 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8960 SET_GetHistogram(table
, exec_GetHistogram
);
8961 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8962 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8963 SET_GetMinmax(table
, exec_GetMinmax
);
8964 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8965 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8966 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8967 SET_Histogram(table
, save_Histogram
);
8968 SET_Minmax(table
, save_Minmax
);
8969 SET_ResetHistogram(table
, save_ResetHistogram
);
8970 SET_ResetMinmax(table
, save_ResetMinmax
);
8971 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8973 /* 2. GL_EXT_blend_color */
8975 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8978 /* 3. GL_EXT_polygon_offset */
8979 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8981 /* 6. GL_EXT_texture3d */
8983 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8984 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8985 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8988 /* 14. GL_SGI_color_table */
8990 SET_ColorTableSGI(table
, save_ColorTable
);
8991 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8992 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8993 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8994 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8997 /* 30. GL_EXT_vertex_array */
8998 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8999 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
9000 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
9001 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
9002 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
9003 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
9005 /* 37. GL_EXT_blend_minmax */
9007 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
9010 /* 54. GL_EXT_point_parameters */
9011 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
9012 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
9014 /* 97. GL_EXT_compiled_vertex_array */
9015 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
9016 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
9018 /* 145. GL_EXT_secondary_color */
9019 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
9021 /* 148. GL_EXT_multi_draw_arrays */
9022 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
9024 /* 149. GL_EXT_fog_coord */
9025 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
9027 /* 173. GL_EXT_blend_func_separate */
9028 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
9030 /* 196. GL_MESA_resize_buffers */
9031 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
9033 /* 197. GL_MESA_window_pos */
9034 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
9035 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
9036 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
9037 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
9038 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
9039 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
9040 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
9041 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
9042 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
9043 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
9044 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
9045 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
9046 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
9047 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
9048 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
9049 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
9050 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
9051 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
9052 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
9053 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
9054 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
9055 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
9056 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
9057 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
9059 /* 200. GL_IBM_multimode_draw_arrays */
9060 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
9061 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
9063 #if FEATURE_NV_vertex_program
9064 /* 233. GL_NV_vertex_program */
9065 /* The following commands DO NOT go into display lists:
9066 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
9067 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
9069 SET_BindProgramNV(table
, save_BindProgramNV
);
9070 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9071 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
9072 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9073 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
9074 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
9075 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
9076 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
9077 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
9078 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
9079 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
9080 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9081 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9082 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9083 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9084 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9085 SET_LoadProgramNV(table
, save_LoadProgramNV
);
9086 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9087 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9088 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9089 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9090 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
9091 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
9092 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
9093 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
9096 /* 244. GL_ATI_envmap_bumpmap */
9097 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
9098 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
9100 /* 245. GL_ATI_fragment_shader */
9101 #if FEATURE_ATI_fragment_shader
9102 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
9103 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
9106 /* 282. GL_NV_fragment_program */
9107 #if FEATURE_NV_fragment_program
9108 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
9109 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
9110 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
9111 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
9112 SET_GetProgramNamedParameterfvNV(table
,
9113 _mesa_GetProgramNamedParameterfvNV
);
9114 SET_GetProgramNamedParameterdvNV(table
,
9115 _mesa_GetProgramNamedParameterdvNV
);
9116 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9117 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9118 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9119 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9120 SET_GetProgramLocalParameterdvARB(table
,
9121 _mesa_GetProgramLocalParameterdvARB
);
9122 SET_GetProgramLocalParameterfvARB(table
,
9123 _mesa_GetProgramLocalParameterfvARB
);
9126 /* 262. GL_NV_point_sprite */
9127 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9128 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9130 /* 268. GL_EXT_stencil_two_side */
9131 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9133 /* 273. GL_APPLE_vertex_array_object */
9134 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9135 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9136 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9137 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9139 /* ???. GL_EXT_depth_bounds_test */
9140 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9142 /* ARB 1. GL_ARB_multitexture */
9143 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9144 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9146 /* ARB 3. GL_ARB_transpose_matrix */
9147 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9148 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9149 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9150 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9152 /* ARB 5. GL_ARB_multisample */
9153 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9155 /* ARB 12. GL_ARB_texture_compression */
9156 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9157 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9158 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9159 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9160 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9161 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9162 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9164 /* ARB 14. GL_ARB_point_parameters */
9165 /* aliased with EXT_point_parameters functions */
9167 /* ARB 25. GL_ARB_window_pos */
9168 /* aliased with MESA_window_pos functions */
9170 /* ARB 26. GL_ARB_vertex_program */
9171 /* ARB 27. GL_ARB_fragment_program */
9172 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9173 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9174 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9175 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9176 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9177 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9178 SET_BindProgramNV(table
, save_BindProgramNV
);
9179 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9180 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9181 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9182 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9183 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9184 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9185 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9186 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9187 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9188 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9189 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9190 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9191 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9192 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9193 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9194 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9195 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9196 SET_GetProgramLocalParameterdvARB(table
,
9197 _mesa_GetProgramLocalParameterdvARB
);
9198 SET_GetProgramLocalParameterfvARB(table
,
9199 _mesa_GetProgramLocalParameterfvARB
);
9200 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9201 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9204 /* ARB 28. GL_ARB_vertex_buffer_object */
9205 #if FEATURE_ARB_vertex_buffer_object
9206 /* None of the extension's functions get compiled */
9207 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9208 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9209 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9210 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9211 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9212 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9213 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9214 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9215 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9216 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9217 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9220 #if FEATURE_queryobj
9221 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9222 SET_EndQueryARB(table
, save_EndQueryARB
);
9223 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9224 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9225 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9226 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9227 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9228 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9230 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9232 #if FEATURE_EXT_framebuffer_blit
9233 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9236 /* GL_ARB_shader_objects */
9237 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9238 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9239 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9240 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9241 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9242 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9243 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9244 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9245 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9246 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9247 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9248 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9249 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9250 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9251 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9252 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9253 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9254 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9255 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9256 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9257 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9258 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9259 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9260 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9261 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9262 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9264 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9265 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9266 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9267 /* XXX additional functions need to be implemented here! */
9269 /* 299. GL_EXT_blend_equation_separate */
9270 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9272 /* GL_EXT_gpu_program_parmaeters */
9273 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9274 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9275 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9278 /* ARB 50. GL_ARB_map_buffer_range */
9279 #if FEATURE_ARB_map_buffer_range
9280 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9281 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9284 /* ARB 59. GL_ARB_copy_buffer */
9285 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9287 /* 364. GL_EXT_provoking_vertex */
9288 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9292 SET_ClearBufferiv(table
, save_ClearBufferiv
);
9293 SET_ClearBufferuiv(table
, save_ClearBufferuiv
);
9294 SET_ClearBufferfv(table
, save_ClearBufferfv
);
9295 SET_ClearBufferfi(table
, save_ClearBufferfi
);
9297 (void) save_ClearBufferiv
;
9298 (void) save_ClearBufferuiv
;
9299 (void) save_ClearBufferfv
;
9300 (void) save_ClearBufferfi
;
9307 enum_string(GLenum k
)
9309 return _mesa_lookup_enum_by_nr(k
);
9314 * Print the commands in a display list. For debugging only.
9315 * TODO: many commands aren't handled yet.
9317 static void GLAPIENTRY
9318 print_list(GLcontext
*ctx
, GLuint list
)
9320 struct gl_display_list
*dlist
;
9324 if (!islist(ctx
, list
)) {
9325 _mesa_printf("%u is not a display list ID\n", list
);
9329 dlist
= lookup_list(ctx
, list
);
9335 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
9337 done
= n
? GL_FALSE
: GL_TRUE
;
9339 const OpCode opcode
= n
[0].opcode
;
9341 if (is_ext_opcode(opcode
)) {
9342 n
+= ext_opcode_print(ctx
, n
);
9347 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9350 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9351 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9353 case OPCODE_CALL_LIST
:
9354 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
9356 case OPCODE_CALL_LIST_OFFSET
:
9357 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9358 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9360 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9361 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9362 enum_string(n
[1].e
), enum_string(n
[2].e
),
9363 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9365 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9366 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9367 enum_string(n
[1].e
), enum_string(n
[2].e
),
9368 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9370 case OPCODE_DISABLE
:
9371 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
9374 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
9376 case OPCODE_FRUSTUM
:
9377 _mesa_printf("Frustum %g %g %g %g %g %g\n",
9378 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9380 case OPCODE_LINE_STIPPLE
:
9381 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9383 case OPCODE_LOAD_IDENTITY
:
9384 _mesa_printf("LoadIdentity\n");
9386 case OPCODE_LOAD_MATRIX
:
9387 _mesa_printf("LoadMatrix\n");
9388 _mesa_printf(" %8f %8f %8f %8f\n",
9389 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9390 _mesa_printf(" %8f %8f %8f %8f\n",
9391 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9392 _mesa_printf(" %8f %8f %8f %8f\n",
9393 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9394 _mesa_printf(" %8f %8f %8f %8f\n",
9395 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9397 case OPCODE_MULT_MATRIX
:
9398 _mesa_printf("MultMatrix (or Rotate)\n");
9399 _mesa_printf(" %8f %8f %8f %8f\n",
9400 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9401 _mesa_printf(" %8f %8f %8f %8f\n",
9402 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9403 _mesa_printf(" %8f %8f %8f %8f\n",
9404 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9405 _mesa_printf(" %8f %8f %8f %8f\n",
9406 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9409 _mesa_printf("Ortho %g %g %g %g %g %g\n",
9410 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9412 case OPCODE_POP_ATTRIB
:
9413 _mesa_printf("PopAttrib\n");
9415 case OPCODE_POP_MATRIX
:
9416 _mesa_printf("PopMatrix\n");
9418 case OPCODE_POP_NAME
:
9419 _mesa_printf("PopName\n");
9421 case OPCODE_PUSH_ATTRIB
:
9422 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
9424 case OPCODE_PUSH_MATRIX
:
9425 _mesa_printf("PushMatrix\n");
9427 case OPCODE_PUSH_NAME
:
9428 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
9430 case OPCODE_RASTER_POS
:
9431 _mesa_printf("RasterPos %g %g %g %g\n",
9432 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9435 _mesa_printf("Rotate %g %g %g %g\n",
9436 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9439 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9441 case OPCODE_TRANSLATE
:
9442 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9444 case OPCODE_BIND_TEXTURE
:
9445 _mesa_printf("BindTexture %s %d\n",
9446 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9448 case OPCODE_SHADE_MODEL
:
9449 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9452 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
9453 _mesa_lookup_enum_by_nr(n
[1].ui
),
9454 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9457 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9458 _mesa_lookup_enum_by_nr(n
[1].ui
),
9459 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9460 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9462 case OPCODE_MAPGRID1
:
9463 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9465 case OPCODE_MAPGRID2
:
9466 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9467 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9469 case OPCODE_EVALMESH1
:
9470 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9472 case OPCODE_EVALMESH2
:
9473 _mesa_printf("EvalMesh2 %d %d %d %d\n",
9474 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9477 case OPCODE_ATTR_1F_NV
:
9478 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9480 case OPCODE_ATTR_2F_NV
:
9481 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
9482 n
[1].i
, n
[2].f
, n
[3].f
);
9484 case OPCODE_ATTR_3F_NV
:
9485 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
9486 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9488 case OPCODE_ATTR_4F_NV
:
9489 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9490 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9492 case OPCODE_ATTR_1F_ARB
:
9493 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9495 case OPCODE_ATTR_2F_ARB
:
9496 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
9497 n
[1].i
, n
[2].f
, n
[3].f
);
9499 case OPCODE_ATTR_3F_ARB
:
9500 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9501 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9503 case OPCODE_ATTR_4F_ARB
:
9504 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9505 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9508 case OPCODE_MATERIAL
:
9509 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
9510 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9513 _mesa_printf("BEGIN %x\n", n
[1].i
);
9516 _mesa_printf("END\n");
9519 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9522 case OPCODE_EVAL_C1
:
9523 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
9525 case OPCODE_EVAL_C2
:
9526 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9528 case OPCODE_EVAL_P1
:
9529 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
9531 case OPCODE_EVAL_P2
:
9532 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9535 case OPCODE_PROVOKING_VERTEX
:
9536 _mesa_printf("ProvokingVertex %s\n",
9537 _mesa_lookup_enum_by_nr(n
[1].ui
));
9541 * meta opcodes/commands
9544 _mesa_printf("Error: %s %s\n",
9545 enum_string(n
[1].e
), (const char *) n
[2].data
);
9547 case OPCODE_CONTINUE
:
9548 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
9549 n
= (Node
*) n
[1].next
;
9551 case OPCODE_END_OF_LIST
:
9552 _mesa_printf("END-LIST %u\n", list
);
9556 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9558 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9559 opcode
, (void *) n
);
9563 _mesa_printf("command %d, %u operands\n", opcode
,
9567 /* increment n to point to next compiled command */
9568 if (opcode
!= OPCODE_CONTINUE
) {
9569 n
+= InstSize
[opcode
];
9578 * Clients may call this function to help debug display list problems.
9579 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9580 * changed, or break in the future without notice.
9583 mesa_print_display_list(GLuint list
)
9585 GET_CURRENT_CONTEXT(ctx
);
9586 print_list(ctx
, list
);
9590 /**********************************************************************/
9591 /***** Initialization *****/
9592 /**********************************************************************/
9595 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9597 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9599 vfmt
->Begin
= save_Begin
;
9601 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9603 vfmt
->Color3f
= save_Color3f
;
9604 vfmt
->Color3fv
= save_Color3fv
;
9605 vfmt
->Color4f
= save_Color4f
;
9606 vfmt
->Color4fv
= save_Color4fv
;
9607 vfmt
->EdgeFlag
= save_EdgeFlag
;
9608 vfmt
->End
= save_End
;
9610 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9612 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9613 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9614 vfmt
->Indexf
= save_Indexf
;
9615 vfmt
->Indexfv
= save_Indexfv
;
9616 vfmt
->Materialfv
= save_Materialfv
;
9617 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9618 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9619 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9620 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9621 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9622 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9623 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9624 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9625 vfmt
->Normal3f
= save_Normal3f
;
9626 vfmt
->Normal3fv
= save_Normal3fv
;
9627 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9628 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9629 vfmt
->TexCoord1f
= save_TexCoord1f
;
9630 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9631 vfmt
->TexCoord2f
= save_TexCoord2f
;
9632 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9633 vfmt
->TexCoord3f
= save_TexCoord3f
;
9634 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9635 vfmt
->TexCoord4f
= save_TexCoord4f
;
9636 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9637 vfmt
->Vertex2f
= save_Vertex2f
;
9638 vfmt
->Vertex2fv
= save_Vertex2fv
;
9639 vfmt
->Vertex3f
= save_Vertex3f
;
9640 vfmt
->Vertex3fv
= save_Vertex3fv
;
9641 vfmt
->Vertex4f
= save_Vertex4f
;
9642 vfmt
->Vertex4fv
= save_Vertex4fv
;
9643 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9644 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9645 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9646 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9647 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9648 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9649 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9650 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9651 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9652 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9653 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9654 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9655 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9656 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9657 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9658 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9660 vfmt
->Rectf
= save_Rectf
;
9662 /* The driver is required to implement these as
9663 * 1) They can probably do a better job.
9664 * 2) A lot of new mechanisms would have to be added to this module
9665 * to support it. That code would probably never get used,
9669 vfmt
->DrawArrays
= 0;
9670 vfmt
->DrawElements
= 0;
9671 vfmt
->DrawRangeElements
= 0;
9672 vfmt
->MultiDrawElemementsEXT
= 0;
9673 vfmt
->DrawElementsBaseVertex
= 0;
9674 vfmt
->DrawRangeElementsBaseVertex
= 0;
9675 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9681 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9682 const GLvertexformat
*vfmt
)
9684 SET_CallList(disp
, vfmt
->CallList
);
9685 SET_CallLists(disp
, vfmt
->CallLists
);
9689 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9691 SET_CallList(disp
, _mesa_CallList
);
9692 SET_CallLists(disp
, _mesa_CallLists
);
9694 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9695 SET_EndList(disp
, _mesa_EndList
);
9696 SET_GenLists(disp
, _mesa_GenLists
);
9697 SET_IsList(disp
, _mesa_IsList
);
9698 SET_ListBase(disp
, _mesa_ListBase
);
9699 SET_NewList(disp
, _mesa_NewList
);
9703 #endif /* FEATURE_dlist */
9707 * Initialize display list state for given context.
9710 _mesa_init_display_list(GLcontext
*ctx
)
9712 static GLboolean tableInitialized
= GL_FALSE
;
9714 /* zero-out the instruction size table, just once */
9715 if (!tableInitialized
) {
9716 _mesa_bzero(InstSize
, sizeof(InstSize
));
9717 tableInitialized
= GL_TRUE
;
9720 /* extension info */
9721 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9724 ctx
->ListState
.CallDepth
= 0;
9725 ctx
->ExecuteFlag
= GL_TRUE
;
9726 ctx
->CompileFlag
= GL_FALSE
;
9727 ctx
->ListState
.CurrentBlock
= NULL
;
9728 ctx
->ListState
.CurrentPos
= 0;
9730 /* Display List group */
9731 ctx
->List
.ListBase
= 0;
9734 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9740 _mesa_free_display_list_data(GLcontext
*ctx
)
9743 ctx
->ListExt
= NULL
;