2 * Mesa 3-D graphics library
5 * Copyright (C) 1999-2008 Brian Paul All Rights Reserved.
6 * Copyright (C) 2009 VMware, Inc. All Rights Reserved.
8 * Permission is hereby granted, free of charge, to any person obtaining a
9 * copy of this software and associated documentation files (the "Software"),
10 * to deal in the Software without restriction, including without limitation
11 * the rights to use, copy, modify, merge, publish, distribute, sublicense,
12 * and/or sell copies of the Software, and to permit persons to whom the
13 * Software is furnished to do so, subject to the following conditions:
15 * The above copyright notice and this permission notice shall be included
16 * in all copies or substantial portions of the Software.
18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
19 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
21 * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
22 * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
23 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 * Display lists management functions.
34 #include "api_arrayelt.h"
35 #include "api_loopback.h"
37 #include "mfeatures.h"
41 #if FEATURE_ARB_vertex_buffer_object
42 #include "bufferobj.h"
54 #include "extensions.h"
56 #include "framebuffer.h"
58 #include "glapi/glapi.h"
60 #include "histogram.h"
78 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
79 #include "shader/arbprogram.h"
80 #include "shader/program.h"
82 #if FEATURE_NV_vertex_program || FEATURE_NV_fragment_program
83 #include "shader/nvprogram.h"
84 #include "shader/program.h"
86 #if FEATURE_ATI_fragment_shader
87 #include "shader/atifragshader.h"
90 #include "math/m_matrix.h"
92 #include "glapi/dispatch.h"
97 * Other parts of Mesa (such as the VBO module) can plug into the display
98 * list system. This structure describes new display list instructions.
100 struct gl_list_instruction
103 void (*Execute
)( GLcontext
*ctx
, void *data
);
104 void (*Destroy
)( GLcontext
*ctx
, void *data
);
105 void (*Print
)( GLcontext
*ctx
, void *data
);
109 #define MAX_DLIST_EXT_OPCODES 16
112 * Used by device drivers to hook new commands into display lists.
114 struct gl_list_extensions
116 struct gl_list_instruction Opcode
[MAX_DLIST_EXT_OPCODES
];
125 * \param ctx GL context.
127 * Checks if dd_function_table::SaveNeedFlush is marked to flush
128 * stored (save) vertices, and calls
129 * dd_function_table::SaveFlushVertices if so.
131 #define SAVE_FLUSH_VERTICES(ctx) \
133 if (ctx->Driver.SaveNeedFlush) \
134 ctx->Driver.SaveFlushVertices(ctx); \
139 * Macro to assert that the API call was made outside the
140 * glBegin()/glEnd() pair, with return value.
142 * \param ctx GL context.
143 * \param retval value to return value in case the assertion fails.
145 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval) \
147 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
148 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
149 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
155 * Macro to assert that the API call was made outside the
156 * glBegin()/glEnd() pair.
158 * \param ctx GL context.
160 #define ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx) \
162 if (ctx->Driver.CurrentSavePrimitive <= GL_POLYGON || \
163 ctx->Driver.CurrentSavePrimitive == PRIM_INSIDE_UNKNOWN_PRIM) { \
164 _mesa_compile_error( ctx, GL_INVALID_OPERATION, "begin/end" ); \
170 * Macro to assert that the API call was made outside the
171 * glBegin()/glEnd() pair and flush the vertices.
173 * \param ctx GL context.
175 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx) \
177 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx); \
178 SAVE_FLUSH_VERTICES(ctx); \
182 * Macro to assert that the API call was made outside the
183 * glBegin()/glEnd() pair and flush the vertices, with return value.
185 * \param ctx GL context.
186 * \param retval value to return value in case the assertion fails.
188 #define ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH_WITH_RETVAL(ctx, retval)\
190 ASSERT_OUTSIDE_SAVE_BEGIN_END_WITH_RETVAL(ctx, retval); \
191 SAVE_FLUSH_VERTICES(ctx); \
197 * Display list opcodes.
199 * The fact that these identifiers are assigned consecutive
200 * integer values starting at 0 is very important, see InstSize array usage)
204 OPCODE_INVALID
= -1, /* Force signed enum */
210 OPCODE_BLEND_EQUATION
,
211 OPCODE_BLEND_EQUATION_SEPARATE
,
212 OPCODE_BLEND_FUNC_SEPARATE
,
214 OPCODE_CALL_LIST_OFFSET
,
220 OPCODE_CLEAR_STENCIL
,
223 OPCODE_COLOR_MASK_INDEXED
,
224 OPCODE_COLOR_MATERIAL
,
226 OPCODE_COLOR_TABLE_PARAMETER_FV
,
227 OPCODE_COLOR_TABLE_PARAMETER_IV
,
228 OPCODE_COLOR_SUB_TABLE
,
229 OPCODE_CONVOLUTION_FILTER_1D
,
230 OPCODE_CONVOLUTION_FILTER_2D
,
231 OPCODE_CONVOLUTION_PARAMETER_I
,
232 OPCODE_CONVOLUTION_PARAMETER_IV
,
233 OPCODE_CONVOLUTION_PARAMETER_F
,
234 OPCODE_CONVOLUTION_PARAMETER_FV
,
235 OPCODE_COPY_COLOR_SUB_TABLE
,
236 OPCODE_COPY_COLOR_TABLE
,
238 OPCODE_COPY_TEX_IMAGE1D
,
239 OPCODE_COPY_TEX_IMAGE2D
,
240 OPCODE_COPY_TEX_SUB_IMAGE1D
,
241 OPCODE_COPY_TEX_SUB_IMAGE2D
,
242 OPCODE_COPY_TEX_SUB_IMAGE3D
,
248 OPCODE_DISABLE_INDEXED
,
252 OPCODE_ENABLE_INDEXED
,
267 OPCODE_LOAD_IDENTITY
,
281 OPCODE_PIXEL_TRANSFER
,
284 OPCODE_POINT_PARAMETERS
,
286 OPCODE_POLYGON_STIPPLE
,
287 OPCODE_POLYGON_OFFSET
,
291 OPCODE_PRIORITIZE_TEXTURE
,
297 OPCODE_RESET_HISTOGRAM
,
298 OPCODE_RESET_MIN_MAX
,
302 OPCODE_SELECT_TEXTURE_SGIS
,
303 OPCODE_SELECT_TEXTURE_COORD_SET
,
314 OPCODE_TEX_SUB_IMAGE1D
,
315 OPCODE_TEX_SUB_IMAGE2D
,
316 OPCODE_TEX_SUB_IMAGE3D
,
320 /* GL_ARB_multitexture */
321 OPCODE_ACTIVE_TEXTURE
,
322 /* GL_ARB_texture_compression */
323 OPCODE_COMPRESSED_TEX_IMAGE_1D
,
324 OPCODE_COMPRESSED_TEX_IMAGE_2D
,
325 OPCODE_COMPRESSED_TEX_IMAGE_3D
,
326 OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
,
327 OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
,
328 OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
,
329 /* GL_ARB_multisample */
330 OPCODE_SAMPLE_COVERAGE
,
331 /* GL_ARB_window_pos */
332 OPCODE_WINDOW_POS_ARB
,
333 /* GL_NV_vertex_program */
334 OPCODE_BIND_PROGRAM_NV
,
335 OPCODE_EXECUTE_PROGRAM_NV
,
336 OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
,
337 OPCODE_LOAD_PROGRAM_NV
,
338 OPCODE_TRACK_MATRIX_NV
,
339 /* GL_NV_fragment_program */
340 OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
,
341 OPCODE_PROGRAM_NAMED_PARAMETER_NV
,
342 /* GL_EXT_stencil_two_side */
343 OPCODE_ACTIVE_STENCIL_FACE_EXT
,
344 /* GL_EXT_depth_bounds_test */
345 OPCODE_DEPTH_BOUNDS_EXT
,
346 /* GL_ARB_vertex/fragment_program */
347 OPCODE_PROGRAM_STRING_ARB
,
348 OPCODE_PROGRAM_ENV_PARAMETER_ARB
,
349 /* GL_ARB_occlusion_query */
350 OPCODE_BEGIN_QUERY_ARB
,
351 OPCODE_END_QUERY_ARB
,
352 /* GL_ARB_draw_buffers */
353 OPCODE_DRAW_BUFFERS_ARB
,
354 /* GL_ATI_fragment_shader */
355 OPCODE_TEX_BUMP_PARAMETER_ATI
,
356 /* GL_ATI_fragment_shader */
357 OPCODE_BIND_FRAGMENT_SHADER_ATI
,
358 OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
,
360 OPCODE_STENCIL_FUNC_SEPARATE
,
361 OPCODE_STENCIL_OP_SEPARATE
,
362 OPCODE_STENCIL_MASK_SEPARATE
,
364 /* GL_ARB_shader_objects */
382 OPCODE_UNIFORM_MATRIX22
,
383 OPCODE_UNIFORM_MATRIX33
,
384 OPCODE_UNIFORM_MATRIX44
,
385 OPCODE_UNIFORM_MATRIX23
,
386 OPCODE_UNIFORM_MATRIX32
,
387 OPCODE_UNIFORM_MATRIX24
,
388 OPCODE_UNIFORM_MATRIX42
,
389 OPCODE_UNIFORM_MATRIX34
,
390 OPCODE_UNIFORM_MATRIX43
,
392 /* GL_EXT_framebuffer_blit */
393 OPCODE_BLIT_FRAMEBUFFER
,
395 /* Vertex attributes -- fallback for when optimized display
396 * list build isn't active.
415 /* GL_EXT_provoking_vertex */
416 OPCODE_PROVOKING_VERTEX
,
418 /* The following three are meta instructions */
419 OPCODE_ERROR
, /* raise compiled-in error */
430 * Display list instructions are stored as sequences of "nodes". Nodes
431 * are allocated in blocks. Each block has BLOCK_SIZE nodes. Blocks
432 * are linked together with a pointer.
434 * Each instruction in the display list is stored as a sequence of
435 * contiguous nodes in memory.
436 * Each node is the union of a variety of data types.
451 void *next
; /* If prev node's opcode==OPCODE_CONTINUE */
455 typedef union gl_dlist_node Node
;
459 * How many nodes to allocate at a time.
461 * \note Reduced now that we hold vertices etc. elsewhere.
463 #define BLOCK_SIZE 256
468 * Number of nodes of storage needed for each instruction.
469 * Sizes for dynamically allocated opcodes are stored in the context struct.
471 static GLuint InstSize
[OPCODE_END_OF_LIST
+ 1];
477 void mesa_print_display_list(GLuint list
);
480 /**********************************************************************/
481 /***** Private *****/
482 /**********************************************************************/
486 * Make an empty display list. This is used by glGenLists() to
487 * reserve display list IDs.
489 static struct gl_display_list
*
490 make_list(GLuint name
, GLuint count
)
492 struct gl_display_list
*dlist
= CALLOC_STRUCT(gl_display_list
);
494 dlist
->Head
= (Node
*) _mesa_malloc(sizeof(Node
) * count
);
495 dlist
->Head
[0].opcode
= OPCODE_END_OF_LIST
;
501 * Lookup function to just encapsulate casting.
503 static INLINE
struct gl_display_list
*
504 lookup_list(GLcontext
*ctx
, GLuint list
)
506 return (struct gl_display_list
*)
507 _mesa_HashLookup(ctx
->Shared
->DisplayList
, list
);
511 /** Is the given opcode an extension code? */
512 static INLINE GLboolean
513 is_ext_opcode(OpCode opcode
)
515 return (opcode
>= OPCODE_EXT_0
);
519 /** Destroy an extended opcode instruction */
521 ext_opcode_destroy(GLcontext
*ctx
, Node
*node
)
523 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
525 ctx
->ListExt
->Opcode
[i
].Destroy(ctx
, &node
[1]);
526 step
= ctx
->ListExt
->Opcode
[i
].Size
;
531 /** Execute an extended opcode instruction */
533 ext_opcode_execute(GLcontext
*ctx
, Node
*node
)
535 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
537 ctx
->ListExt
->Opcode
[i
].Execute(ctx
, &node
[1]);
538 step
= ctx
->ListExt
->Opcode
[i
].Size
;
543 /** Print an extended opcode instruction */
545 ext_opcode_print(GLcontext
*ctx
, Node
*node
)
547 const GLint i
= node
[0].opcode
- OPCODE_EXT_0
;
549 ctx
->ListExt
->Opcode
[i
].Print(ctx
, &node
[1]);
550 step
= ctx
->ListExt
->Opcode
[i
].Size
;
556 * Delete the named display list, but don't remove from hash table.
557 * \param dlist - display list pointer
560 _mesa_delete_list(GLcontext
*ctx
, struct gl_display_list
*dlist
)
565 n
= block
= dlist
->Head
;
567 done
= block
? GL_FALSE
: GL_TRUE
;
569 const OpCode opcode
= n
[0].opcode
;
571 /* check for extension opcodes first */
572 if (is_ext_opcode(opcode
)) {
573 n
+= ext_opcode_destroy(ctx
, n
);
577 /* for some commands, we need to free malloc'd memory */
579 _mesa_free(n
[6].data
);
580 n
+= InstSize
[n
[0].opcode
];
583 _mesa_free(n
[10].data
);
584 n
+= InstSize
[n
[0].opcode
];
586 case OPCODE_DRAW_PIXELS
:
587 _mesa_free(n
[5].data
);
588 n
+= InstSize
[n
[0].opcode
];
591 _mesa_free(n
[7].data
);
592 n
+= InstSize
[n
[0].opcode
];
594 case OPCODE_COLOR_TABLE
:
595 _mesa_free(n
[6].data
);
596 n
+= InstSize
[n
[0].opcode
];
598 case OPCODE_COLOR_SUB_TABLE
:
599 _mesa_free(n
[6].data
);
600 n
+= InstSize
[n
[0].opcode
];
602 case OPCODE_CONVOLUTION_FILTER_1D
:
603 _mesa_free(n
[6].data
);
604 n
+= InstSize
[n
[0].opcode
];
606 case OPCODE_CONVOLUTION_FILTER_2D
:
607 _mesa_free(n
[7].data
);
608 n
+= InstSize
[n
[0].opcode
];
610 case OPCODE_POLYGON_STIPPLE
:
611 _mesa_free(n
[1].data
);
612 n
+= InstSize
[n
[0].opcode
];
614 case OPCODE_TEX_IMAGE1D
:
615 _mesa_free(n
[8].data
);
616 n
+= InstSize
[n
[0].opcode
];
618 case OPCODE_TEX_IMAGE2D
:
619 _mesa_free(n
[9].data
);
620 n
+= InstSize
[n
[0].opcode
];
622 case OPCODE_TEX_IMAGE3D
:
623 _mesa_free(n
[10].data
);
624 n
+= InstSize
[n
[0].opcode
];
626 case OPCODE_TEX_SUB_IMAGE1D
:
627 _mesa_free(n
[7].data
);
628 n
+= InstSize
[n
[0].opcode
];
630 case OPCODE_TEX_SUB_IMAGE2D
:
631 _mesa_free(n
[9].data
);
632 n
+= InstSize
[n
[0].opcode
];
634 case OPCODE_TEX_SUB_IMAGE3D
:
635 _mesa_free(n
[11].data
);
636 n
+= InstSize
[n
[0].opcode
];
638 case OPCODE_COMPRESSED_TEX_IMAGE_1D
:
639 _mesa_free(n
[7].data
);
640 n
+= InstSize
[n
[0].opcode
];
642 case OPCODE_COMPRESSED_TEX_IMAGE_2D
:
643 _mesa_free(n
[8].data
);
644 n
+= InstSize
[n
[0].opcode
];
646 case OPCODE_COMPRESSED_TEX_IMAGE_3D
:
647 _mesa_free(n
[9].data
);
648 n
+= InstSize
[n
[0].opcode
];
650 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
:
651 _mesa_free(n
[7].data
);
652 n
+= InstSize
[n
[0].opcode
];
654 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
:
655 _mesa_free(n
[9].data
);
656 n
+= InstSize
[n
[0].opcode
];
658 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
:
659 _mesa_free(n
[11].data
);
660 n
+= InstSize
[n
[0].opcode
];
662 #if FEATURE_NV_vertex_program
663 case OPCODE_LOAD_PROGRAM_NV
:
664 _mesa_free(n
[4].data
); /* program string */
665 n
+= InstSize
[n
[0].opcode
];
667 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
668 _mesa_free(n
[2].data
); /* array of program ids */
669 n
+= InstSize
[n
[0].opcode
];
672 #if FEATURE_NV_fragment_program
673 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
674 _mesa_free(n
[3].data
); /* parameter name */
675 n
+= InstSize
[n
[0].opcode
];
678 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
679 case OPCODE_PROGRAM_STRING_ARB
:
680 _mesa_free(n
[4].data
); /* program string */
681 n
+= InstSize
[n
[0].opcode
];
684 case OPCODE_UNIFORM_1FV
:
685 case OPCODE_UNIFORM_2FV
:
686 case OPCODE_UNIFORM_3FV
:
687 case OPCODE_UNIFORM_4FV
:
688 case OPCODE_UNIFORM_1IV
:
689 case OPCODE_UNIFORM_2IV
:
690 case OPCODE_UNIFORM_3IV
:
691 case OPCODE_UNIFORM_4IV
:
692 _mesa_free(n
[3].data
);
693 n
+= InstSize
[n
[0].opcode
];
695 case OPCODE_UNIFORM_MATRIX22
:
696 case OPCODE_UNIFORM_MATRIX33
:
697 case OPCODE_UNIFORM_MATRIX44
:
698 case OPCODE_UNIFORM_MATRIX24
:
699 case OPCODE_UNIFORM_MATRIX42
:
700 case OPCODE_UNIFORM_MATRIX23
:
701 case OPCODE_UNIFORM_MATRIX32
:
702 case OPCODE_UNIFORM_MATRIX34
:
703 case OPCODE_UNIFORM_MATRIX43
:
704 _mesa_free(n
[4].data
);
705 n
+= InstSize
[n
[0].opcode
];
708 case OPCODE_CONTINUE
:
709 n
= (Node
*) n
[1].next
;
713 case OPCODE_END_OF_LIST
:
718 /* Most frequent case */
719 n
+= InstSize
[n
[0].opcode
];
730 * Destroy a display list and remove from hash table.
731 * \param list - display list number
734 destroy_list(GLcontext
*ctx
, GLuint list
)
736 struct gl_display_list
*dlist
;
741 dlist
= lookup_list(ctx
, list
);
745 _mesa_delete_list(ctx
, dlist
);
746 _mesa_HashRemove(ctx
->Shared
->DisplayList
, list
);
751 * Translate the nth element of list from <type> to GLint.
754 translate_id(GLsizei n
, GLenum type
, const GLvoid
* list
)
766 bptr
= (GLbyte
*) list
;
767 return (GLint
) bptr
[n
];
768 case GL_UNSIGNED_BYTE
:
769 ubptr
= (GLubyte
*) list
;
770 return (GLint
) ubptr
[n
];
772 sptr
= (GLshort
*) list
;
773 return (GLint
) sptr
[n
];
774 case GL_UNSIGNED_SHORT
:
775 usptr
= (GLushort
*) list
;
776 return (GLint
) usptr
[n
];
778 iptr
= (GLint
*) list
;
780 case GL_UNSIGNED_INT
:
781 uiptr
= (GLuint
*) list
;
782 return (GLint
) uiptr
[n
];
784 fptr
= (GLfloat
*) list
;
785 return (GLint
) FLOORF(fptr
[n
]);
787 ubptr
= ((GLubyte
*) list
) + 2 * n
;
788 return (GLint
) ubptr
[0] * 256
791 ubptr
= ((GLubyte
*) list
) + 3 * n
;
792 return (GLint
) ubptr
[0] * 65536
793 + (GLint
) ubptr
[1] * 256
796 ubptr
= ((GLubyte
*) list
) + 4 * n
;
797 return (GLint
) ubptr
[0] * 16777216
798 + (GLint
) ubptr
[1] * 65536
799 + (GLint
) ubptr
[2] * 256
809 /**********************************************************************/
811 /**********************************************************************/
814 * Wrapper for _mesa_unpack_image() that handles pixel buffer objects.
815 * If we run out of memory, GL_OUT_OF_MEMORY will be recorded.
818 unpack_image(GLcontext
*ctx
, GLuint dimensions
,
819 GLsizei width
, GLsizei height
, GLsizei depth
,
820 GLenum format
, GLenum type
, const GLvoid
* pixels
,
821 const struct gl_pixelstore_attrib
*unpack
)
823 if (!_mesa_is_bufferobj(unpack
->BufferObj
)) {
825 GLvoid
*image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
826 format
, type
, pixels
, unpack
);
827 if (pixels
&& !image
) {
828 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
832 else if (_mesa_validate_pbo_access(dimensions
, unpack
, width
, height
, depth
,
833 format
, type
, pixels
)) {
834 const GLubyte
*map
, *src
;
838 ctx
->Driver
.MapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
839 GL_READ_ONLY_ARB
, unpack
->BufferObj
);
841 /* unable to map src buffer! */
842 _mesa_error(ctx
, GL_INVALID_OPERATION
, "unable to map PBO");
846 src
= ADD_POINTERS(map
, pixels
);
847 image
= _mesa_unpack_image(dimensions
, width
, height
, depth
,
848 format
, type
, src
, unpack
);
850 ctx
->Driver
.UnmapBuffer(ctx
, GL_PIXEL_UNPACK_BUFFER_EXT
,
854 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "display list construction");
864 * Allocate space for a display list instruction (opcode + payload space).
865 * \param opcode the instruction opcode (OPCODE_* value)
866 * \param bytes instruction payload size (not counting opcode)
867 * \return pointer to allocated memory (the opcode space)
870 dlist_alloc(GLcontext
*ctx
, OpCode opcode
, GLuint bytes
)
872 const GLuint numNodes
= 1 + (bytes
+ sizeof(Node
) - 1) / sizeof(Node
);
875 if (opcode
< (GLuint
) OPCODE_EXT_0
) {
876 if (InstSize
[opcode
] == 0) {
877 /* save instruction size now */
878 InstSize
[opcode
] = numNodes
;
881 /* make sure instruction size agrees */
882 ASSERT(numNodes
== InstSize
[opcode
]);
886 if (ctx
->ListState
.CurrentPos
+ numNodes
+ 2 > BLOCK_SIZE
) {
887 /* This block is full. Allocate a new block and chain to it */
889 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
890 n
[0].opcode
= OPCODE_CONTINUE
;
891 newblock
= (Node
*) _mesa_malloc(sizeof(Node
) * BLOCK_SIZE
);
893 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "Building display list");
896 n
[1].next
= (Node
*) newblock
;
897 ctx
->ListState
.CurrentBlock
= newblock
;
898 ctx
->ListState
.CurrentPos
= 0;
901 n
= ctx
->ListState
.CurrentBlock
+ ctx
->ListState
.CurrentPos
;
902 ctx
->ListState
.CurrentPos
+= numNodes
;
904 n
[0].opcode
= opcode
;
912 * Allocate space for a display list instruction. Used by callers outside
913 * this file for things like VBO vertex data.
915 * \param opcode the instruction opcode (OPCODE_* value)
916 * \param bytes instruction size in bytes, not counting opcode.
917 * \return pointer to the usable data area (not including the internal
921 _mesa_dlist_alloc(GLcontext
*ctx
, GLuint opcode
, GLuint bytes
)
923 Node
*n
= dlist_alloc(ctx
, (OpCode
) opcode
, bytes
);
925 return n
+ 1; /* return pointer to payload area, after opcode */
932 * This function allows modules and drivers to get their own opcodes
933 * for extending display list functionality.
934 * \param ctx the rendering context
935 * \param size number of bytes for storing the new display list command
936 * \param execute function to execute the new display list command
937 * \param destroy function to destroy the new display list command
938 * \param print function to print the new display list command
939 * \return the new opcode number or -1 if error
942 _mesa_dlist_alloc_opcode(GLcontext
*ctx
,
944 void (*execute
) (GLcontext
*, void *),
945 void (*destroy
) (GLcontext
*, void *),
946 void (*print
) (GLcontext
*, void *))
948 if (ctx
->ListExt
->NumOpcodes
< MAX_DLIST_EXT_OPCODES
) {
949 const GLuint i
= ctx
->ListExt
->NumOpcodes
++;
950 ctx
->ListExt
->Opcode
[i
].Size
=
951 1 + (size
+ sizeof(Node
) - 1) / sizeof(Node
);
952 ctx
->ListExt
->Opcode
[i
].Execute
= execute
;
953 ctx
->ListExt
->Opcode
[i
].Destroy
= destroy
;
954 ctx
->ListExt
->Opcode
[i
].Print
= print
;
955 return i
+ OPCODE_EXT_0
;
962 * Allocate space for a display list instruction. The space is basically
963 * an array of Nodes where node[0] holds the opcode, node[1] is the first
964 * function parameter, node[2] is the second parameter, etc.
966 * \param opcode one of OPCODE_x
967 * \param nparams number of function parameters
968 * \return pointer to start of instruction space
971 alloc_instruction(GLcontext
*ctx
, OpCode opcode
, GLuint nparams
)
973 return dlist_alloc(ctx
, opcode
, nparams
* sizeof(Node
));
979 * Display List compilation functions
981 static void GLAPIENTRY
982 save_Accum(GLenum op
, GLfloat value
)
984 GET_CURRENT_CONTEXT(ctx
);
986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
987 n
= alloc_instruction(ctx
, OPCODE_ACCUM
, 2);
992 if (ctx
->ExecuteFlag
) {
993 CALL_Accum(ctx
->Exec
, (op
, value
));
998 static void GLAPIENTRY
999 save_AlphaFunc(GLenum func
, GLclampf ref
)
1001 GET_CURRENT_CONTEXT(ctx
);
1003 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1004 n
= alloc_instruction(ctx
, OPCODE_ALPHA_FUNC
, 2);
1007 n
[2].f
= (GLfloat
) ref
;
1009 if (ctx
->ExecuteFlag
) {
1010 CALL_AlphaFunc(ctx
->Exec
, (func
, ref
));
1015 static void GLAPIENTRY
1016 save_BindTexture(GLenum target
, GLuint texture
)
1018 GET_CURRENT_CONTEXT(ctx
);
1020 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1021 n
= alloc_instruction(ctx
, OPCODE_BIND_TEXTURE
, 2);
1026 if (ctx
->ExecuteFlag
) {
1027 CALL_BindTexture(ctx
->Exec
, (target
, texture
));
1032 static void GLAPIENTRY
1033 save_Bitmap(GLsizei width
, GLsizei height
,
1034 GLfloat xorig
, GLfloat yorig
,
1035 GLfloat xmove
, GLfloat ymove
, const GLubyte
* pixels
)
1037 GET_CURRENT_CONTEXT(ctx
);
1039 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1040 n
= alloc_instruction(ctx
, OPCODE_BITMAP
, 7);
1042 n
[1].i
= (GLint
) width
;
1043 n
[2].i
= (GLint
) height
;
1048 n
[7].data
= _mesa_unpack_bitmap(width
, height
, pixels
, &ctx
->Unpack
);
1050 if (ctx
->ExecuteFlag
) {
1051 CALL_Bitmap(ctx
->Exec
, (width
, height
,
1052 xorig
, yorig
, xmove
, ymove
, pixels
));
1057 static void GLAPIENTRY
1058 save_BlendEquation(GLenum mode
)
1060 GET_CURRENT_CONTEXT(ctx
);
1062 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1063 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION
, 1);
1067 if (ctx
->ExecuteFlag
) {
1068 CALL_BlendEquation(ctx
->Exec
, (mode
));
1073 static void GLAPIENTRY
1074 save_BlendEquationSeparateEXT(GLenum modeRGB
, GLenum modeA
)
1076 GET_CURRENT_CONTEXT(ctx
);
1078 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1079 n
= alloc_instruction(ctx
, OPCODE_BLEND_EQUATION_SEPARATE
, 2);
1084 if (ctx
->ExecuteFlag
) {
1085 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (modeRGB
, modeA
));
1090 static void GLAPIENTRY
1091 save_BlendFuncSeparateEXT(GLenum sfactorRGB
, GLenum dfactorRGB
,
1092 GLenum sfactorA
, GLenum dfactorA
)
1094 GET_CURRENT_CONTEXT(ctx
);
1096 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1097 n
= alloc_instruction(ctx
, OPCODE_BLEND_FUNC_SEPARATE
, 4);
1099 n
[1].e
= sfactorRGB
;
1100 n
[2].e
= dfactorRGB
;
1104 if (ctx
->ExecuteFlag
) {
1105 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
1106 (sfactorRGB
, dfactorRGB
, sfactorA
, dfactorA
));
1111 static void GLAPIENTRY
1112 save_BlendFunc(GLenum srcfactor
, GLenum dstfactor
)
1114 save_BlendFuncSeparateEXT(srcfactor
, dstfactor
, srcfactor
, dstfactor
);
1118 static void GLAPIENTRY
1119 save_BlendColor(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1121 GET_CURRENT_CONTEXT(ctx
);
1123 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1124 n
= alloc_instruction(ctx
, OPCODE_BLEND_COLOR
, 4);
1131 if (ctx
->ExecuteFlag
) {
1132 CALL_BlendColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1136 static void invalidate_saved_current_state( GLcontext
*ctx
)
1140 for (i
= 0; i
< VERT_ATTRIB_MAX
; i
++)
1141 ctx
->ListState
.ActiveAttribSize
[i
] = 0;
1143 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++)
1144 ctx
->ListState
.ActiveMaterialSize
[i
] = 0;
1146 memset(&ctx
->ListState
.Current
, 0, sizeof ctx
->ListState
.Current
);
1148 ctx
->Driver
.CurrentSavePrimitive
= PRIM_UNKNOWN
;
1151 static void GLAPIENTRY
1152 save_CallList(GLuint list
)
1154 GET_CURRENT_CONTEXT(ctx
);
1156 SAVE_FLUSH_VERTICES(ctx
);
1158 n
= alloc_instruction(ctx
, OPCODE_CALL_LIST
, 1);
1163 /* After this, we don't know what state we're in. Invalidate all
1164 * cached information previously gathered:
1166 invalidate_saved_current_state( ctx
);
1168 if (ctx
->ExecuteFlag
) {
1169 _mesa_CallList(list
);
1174 static void GLAPIENTRY
1175 save_CallLists(GLsizei num
, GLenum type
, const GLvoid
* lists
)
1177 GET_CURRENT_CONTEXT(ctx
);
1179 GLboolean typeErrorFlag
;
1181 SAVE_FLUSH_VERTICES(ctx
);
1185 case GL_UNSIGNED_BYTE
:
1187 case GL_UNSIGNED_SHORT
:
1189 case GL_UNSIGNED_INT
:
1194 typeErrorFlag
= GL_FALSE
;
1197 typeErrorFlag
= GL_TRUE
;
1200 for (i
= 0; i
< num
; i
++) {
1201 GLint list
= translate_id(i
, type
, lists
);
1202 Node
*n
= alloc_instruction(ctx
, OPCODE_CALL_LIST_OFFSET
, 2);
1205 n
[2].b
= typeErrorFlag
;
1209 /* After this, we don't know what state we're in. Invalidate all
1210 * cached information previously gathered:
1212 invalidate_saved_current_state( ctx
);
1214 if (ctx
->ExecuteFlag
) {
1215 CALL_CallLists(ctx
->Exec
, (num
, type
, lists
));
1220 static void GLAPIENTRY
1221 save_Clear(GLbitfield mask
)
1223 GET_CURRENT_CONTEXT(ctx
);
1225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1226 n
= alloc_instruction(ctx
, OPCODE_CLEAR
, 1);
1230 if (ctx
->ExecuteFlag
) {
1231 CALL_Clear(ctx
->Exec
, (mask
));
1236 static void GLAPIENTRY
1237 save_ClearAccum(GLfloat red
, GLfloat green
, GLfloat blue
, GLfloat alpha
)
1239 GET_CURRENT_CONTEXT(ctx
);
1241 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1242 n
= alloc_instruction(ctx
, OPCODE_CLEAR_ACCUM
, 4);
1249 if (ctx
->ExecuteFlag
) {
1250 CALL_ClearAccum(ctx
->Exec
, (red
, green
, blue
, alpha
));
1255 static void GLAPIENTRY
1256 save_ClearColor(GLclampf red
, GLclampf green
, GLclampf blue
, GLclampf alpha
)
1258 GET_CURRENT_CONTEXT(ctx
);
1260 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1261 n
= alloc_instruction(ctx
, OPCODE_CLEAR_COLOR
, 4);
1268 if (ctx
->ExecuteFlag
) {
1269 CALL_ClearColor(ctx
->Exec
, (red
, green
, blue
, alpha
));
1274 static void GLAPIENTRY
1275 save_ClearDepth(GLclampd depth
)
1277 GET_CURRENT_CONTEXT(ctx
);
1279 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1280 n
= alloc_instruction(ctx
, OPCODE_CLEAR_DEPTH
, 1);
1282 n
[1].f
= (GLfloat
) depth
;
1284 if (ctx
->ExecuteFlag
) {
1285 CALL_ClearDepth(ctx
->Exec
, (depth
));
1290 static void GLAPIENTRY
1291 save_ClearIndex(GLfloat c
)
1293 GET_CURRENT_CONTEXT(ctx
);
1295 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1296 n
= alloc_instruction(ctx
, OPCODE_CLEAR_INDEX
, 1);
1300 if (ctx
->ExecuteFlag
) {
1301 CALL_ClearIndex(ctx
->Exec
, (c
));
1306 static void GLAPIENTRY
1307 save_ClearStencil(GLint s
)
1309 GET_CURRENT_CONTEXT(ctx
);
1311 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1312 n
= alloc_instruction(ctx
, OPCODE_CLEAR_STENCIL
, 1);
1316 if (ctx
->ExecuteFlag
) {
1317 CALL_ClearStencil(ctx
->Exec
, (s
));
1322 static void GLAPIENTRY
1323 save_ClipPlane(GLenum plane
, const GLdouble
* equ
)
1325 GET_CURRENT_CONTEXT(ctx
);
1327 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1328 n
= alloc_instruction(ctx
, OPCODE_CLIP_PLANE
, 5);
1331 n
[2].f
= (GLfloat
) equ
[0];
1332 n
[3].f
= (GLfloat
) equ
[1];
1333 n
[4].f
= (GLfloat
) equ
[2];
1334 n
[5].f
= (GLfloat
) equ
[3];
1336 if (ctx
->ExecuteFlag
) {
1337 CALL_ClipPlane(ctx
->Exec
, (plane
, equ
));
1343 static void GLAPIENTRY
1344 save_ColorMask(GLboolean red
, GLboolean green
,
1345 GLboolean blue
, GLboolean alpha
)
1347 GET_CURRENT_CONTEXT(ctx
);
1349 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1350 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK
, 4);
1357 if (ctx
->ExecuteFlag
) {
1358 CALL_ColorMask(ctx
->Exec
, (red
, green
, blue
, alpha
));
1363 static void GLAPIENTRY
1364 save_ColorMaskIndexed(GLuint buf
, GLboolean red
, GLboolean green
,
1365 GLboolean blue
, GLboolean alpha
)
1367 GET_CURRENT_CONTEXT(ctx
);
1369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1370 n
= alloc_instruction(ctx
, OPCODE_COLOR_MASK_INDEXED
, 5);
1378 if (ctx
->ExecuteFlag
) {
1379 /*CALL_ColorMaskIndexedEXT(ctx->Exec, (buf, red, green, blue, alpha));*/
1384 static void GLAPIENTRY
1385 save_ColorMaterial(GLenum face
, GLenum mode
)
1387 GET_CURRENT_CONTEXT(ctx
);
1389 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1391 n
= alloc_instruction(ctx
, OPCODE_COLOR_MATERIAL
, 2);
1396 if (ctx
->ExecuteFlag
) {
1397 CALL_ColorMaterial(ctx
->Exec
, (face
, mode
));
1402 static void GLAPIENTRY
1403 save_ColorTable(GLenum target
, GLenum internalFormat
,
1404 GLsizei width
, GLenum format
, GLenum type
,
1405 const GLvoid
* table
)
1407 GET_CURRENT_CONTEXT(ctx
);
1408 if (_mesa_is_proxy_texture(target
)) {
1409 /* execute immediately */
1410 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1411 format
, type
, table
));
1415 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1416 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE
, 6);
1419 n
[2].e
= internalFormat
;
1423 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, table
,
1426 if (ctx
->ExecuteFlag
) {
1427 CALL_ColorTable(ctx
->Exec
, (target
, internalFormat
, width
,
1428 format
, type
, table
));
1435 static void GLAPIENTRY
1436 save_ColorTableParameterfv(GLenum target
, GLenum pname
,
1437 const GLfloat
*params
)
1439 GET_CURRENT_CONTEXT(ctx
);
1442 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1444 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_FV
, 6);
1449 if (pname
== GL_COLOR_TABLE_SGI
||
1450 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1451 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1452 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1459 if (ctx
->ExecuteFlag
) {
1460 CALL_ColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
1465 static void GLAPIENTRY
1466 save_ColorTableParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1468 GET_CURRENT_CONTEXT(ctx
);
1471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1473 n
= alloc_instruction(ctx
, OPCODE_COLOR_TABLE_PARAMETER_IV
, 6);
1478 if (pname
== GL_COLOR_TABLE_SGI
||
1479 pname
== GL_POST_CONVOLUTION_COLOR_TABLE_SGI
||
1480 pname
== GL_POST_COLOR_MATRIX_COLOR_TABLE_SGI
||
1481 pname
== GL_TEXTURE_COLOR_TABLE_SGI
) {
1488 if (ctx
->ExecuteFlag
) {
1489 CALL_ColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
1495 static void GLAPIENTRY
1496 save_ColorSubTable(GLenum target
, GLsizei start
, GLsizei count
,
1497 GLenum format
, GLenum type
, const GLvoid
* table
)
1499 GET_CURRENT_CONTEXT(ctx
);
1501 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1502 n
= alloc_instruction(ctx
, OPCODE_COLOR_SUB_TABLE
, 6);
1509 n
[6].data
= unpack_image(ctx
, 1, count
, 1, 1, format
, type
, table
,
1512 if (ctx
->ExecuteFlag
) {
1513 CALL_ColorSubTable(ctx
->Exec
,
1514 (target
, start
, count
, format
, type
, table
));
1519 static void GLAPIENTRY
1520 save_CopyColorSubTable(GLenum target
, GLsizei start
,
1521 GLint x
, GLint y
, GLsizei width
)
1523 GET_CURRENT_CONTEXT(ctx
);
1526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1527 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_SUB_TABLE
, 5);
1535 if (ctx
->ExecuteFlag
) {
1536 CALL_CopyColorSubTable(ctx
->Exec
, (target
, start
, x
, y
, width
));
1541 static void GLAPIENTRY
1542 save_CopyColorTable(GLenum target
, GLenum internalformat
,
1543 GLint x
, GLint y
, GLsizei width
)
1545 GET_CURRENT_CONTEXT(ctx
);
1548 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1549 n
= alloc_instruction(ctx
, OPCODE_COPY_COLOR_TABLE
, 5);
1552 n
[2].e
= internalformat
;
1557 if (ctx
->ExecuteFlag
) {
1558 CALL_CopyColorTable(ctx
->Exec
, (target
, internalformat
, x
, y
, width
));
1563 static void GLAPIENTRY
1564 save_ConvolutionFilter1D(GLenum target
, GLenum internalFormat
, GLsizei width
,
1565 GLenum format
, GLenum type
, const GLvoid
* filter
)
1567 GET_CURRENT_CONTEXT(ctx
);
1570 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1572 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_1D
, 6);
1575 n
[2].e
= internalFormat
;
1579 n
[6].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
, filter
,
1582 if (ctx
->ExecuteFlag
) {
1583 CALL_ConvolutionFilter1D(ctx
->Exec
, (target
, internalFormat
, width
,
1584 format
, type
, filter
));
1589 static void GLAPIENTRY
1590 save_ConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
1591 GLsizei width
, GLsizei height
, GLenum format
,
1592 GLenum type
, const GLvoid
* filter
)
1594 GET_CURRENT_CONTEXT(ctx
);
1597 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1599 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_FILTER_2D
, 7);
1602 n
[2].e
= internalFormat
;
1607 n
[7].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
, filter
,
1610 if (ctx
->ExecuteFlag
) {
1611 CALL_ConvolutionFilter2D(ctx
->Exec
,
1612 (target
, internalFormat
, width
, height
, format
,
1618 static void GLAPIENTRY
1619 save_ConvolutionParameteri(GLenum target
, GLenum pname
, GLint param
)
1621 GET_CURRENT_CONTEXT(ctx
);
1623 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1624 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_I
, 3);
1630 if (ctx
->ExecuteFlag
) {
1631 CALL_ConvolutionParameteri(ctx
->Exec
, (target
, pname
, param
));
1636 static void GLAPIENTRY
1637 save_ConvolutionParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
1639 GET_CURRENT_CONTEXT(ctx
);
1641 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1642 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_IV
, 6);
1647 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1648 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1649 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1655 n
[4].i
= n
[5].i
= n
[6].i
= 0;
1658 if (ctx
->ExecuteFlag
) {
1659 CALL_ConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
1664 static void GLAPIENTRY
1665 save_ConvolutionParameterf(GLenum target
, GLenum pname
, GLfloat param
)
1667 GET_CURRENT_CONTEXT(ctx
);
1669 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1670 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_F
, 3);
1676 if (ctx
->ExecuteFlag
) {
1677 CALL_ConvolutionParameterf(ctx
->Exec
, (target
, pname
, param
));
1682 static void GLAPIENTRY
1683 save_ConvolutionParameterfv(GLenum target
, GLenum pname
,
1684 const GLfloat
*params
)
1686 GET_CURRENT_CONTEXT(ctx
);
1688 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1689 n
= alloc_instruction(ctx
, OPCODE_CONVOLUTION_PARAMETER_FV
, 6);
1694 if (pname
== GL_CONVOLUTION_BORDER_COLOR
||
1695 pname
== GL_CONVOLUTION_FILTER_SCALE
||
1696 pname
== GL_CONVOLUTION_FILTER_BIAS
) {
1702 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
1705 if (ctx
->ExecuteFlag
) {
1706 CALL_ConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
1711 static void GLAPIENTRY
1712 save_CopyPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
, GLenum type
)
1714 GET_CURRENT_CONTEXT(ctx
);
1716 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1717 n
= alloc_instruction(ctx
, OPCODE_COPY_PIXELS
, 5);
1721 n
[3].i
= (GLint
) width
;
1722 n
[4].i
= (GLint
) height
;
1725 if (ctx
->ExecuteFlag
) {
1726 CALL_CopyPixels(ctx
->Exec
, (x
, y
, width
, height
, type
));
1732 static void GLAPIENTRY
1733 save_CopyTexImage1D(GLenum target
, GLint level
, GLenum internalformat
,
1734 GLint x
, GLint y
, GLsizei width
, GLint border
)
1736 GET_CURRENT_CONTEXT(ctx
);
1738 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1739 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE1D
, 7);
1743 n
[3].e
= internalformat
;
1749 if (ctx
->ExecuteFlag
) {
1750 CALL_CopyTexImage1D(ctx
->Exec
, (target
, level
, internalformat
,
1751 x
, y
, width
, border
));
1756 static void GLAPIENTRY
1757 save_CopyTexImage2D(GLenum target
, GLint level
,
1758 GLenum internalformat
,
1759 GLint x
, GLint y
, GLsizei width
,
1760 GLsizei height
, GLint border
)
1762 GET_CURRENT_CONTEXT(ctx
);
1764 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1765 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_IMAGE2D
, 8);
1769 n
[3].e
= internalformat
;
1776 if (ctx
->ExecuteFlag
) {
1777 CALL_CopyTexImage2D(ctx
->Exec
, (target
, level
, internalformat
,
1778 x
, y
, width
, height
, border
));
1784 static void GLAPIENTRY
1785 save_CopyTexSubImage1D(GLenum target
, GLint level
,
1786 GLint xoffset
, GLint x
, GLint y
, GLsizei width
)
1788 GET_CURRENT_CONTEXT(ctx
);
1790 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1791 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE1D
, 6);
1800 if (ctx
->ExecuteFlag
) {
1801 CALL_CopyTexSubImage1D(ctx
->Exec
,
1802 (target
, level
, xoffset
, x
, y
, width
));
1807 static void GLAPIENTRY
1808 save_CopyTexSubImage2D(GLenum target
, GLint level
,
1809 GLint xoffset
, GLint yoffset
,
1810 GLint x
, GLint y
, GLsizei width
, GLint height
)
1812 GET_CURRENT_CONTEXT(ctx
);
1814 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1815 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE2D
, 8);
1826 if (ctx
->ExecuteFlag
) {
1827 CALL_CopyTexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
1828 x
, y
, width
, height
));
1833 static void GLAPIENTRY
1834 save_CopyTexSubImage3D(GLenum target
, GLint level
,
1835 GLint xoffset
, GLint yoffset
, GLint zoffset
,
1836 GLint x
, GLint y
, GLsizei width
, GLint height
)
1838 GET_CURRENT_CONTEXT(ctx
);
1840 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1841 n
= alloc_instruction(ctx
, OPCODE_COPY_TEX_SUB_IMAGE3D
, 9);
1853 if (ctx
->ExecuteFlag
) {
1854 CALL_CopyTexSubImage3D(ctx
->Exec
, (target
, level
,
1855 xoffset
, yoffset
, zoffset
,
1856 x
, y
, width
, height
));
1861 static void GLAPIENTRY
1862 save_CullFace(GLenum mode
)
1864 GET_CURRENT_CONTEXT(ctx
);
1866 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1867 n
= alloc_instruction(ctx
, OPCODE_CULL_FACE
, 1);
1871 if (ctx
->ExecuteFlag
) {
1872 CALL_CullFace(ctx
->Exec
, (mode
));
1877 static void GLAPIENTRY
1878 save_DepthFunc(GLenum func
)
1880 GET_CURRENT_CONTEXT(ctx
);
1882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1883 n
= alloc_instruction(ctx
, OPCODE_DEPTH_FUNC
, 1);
1887 if (ctx
->ExecuteFlag
) {
1888 CALL_DepthFunc(ctx
->Exec
, (func
));
1893 static void GLAPIENTRY
1894 save_DepthMask(GLboolean mask
)
1896 GET_CURRENT_CONTEXT(ctx
);
1898 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1899 n
= alloc_instruction(ctx
, OPCODE_DEPTH_MASK
, 1);
1903 if (ctx
->ExecuteFlag
) {
1904 CALL_DepthMask(ctx
->Exec
, (mask
));
1909 static void GLAPIENTRY
1910 save_DepthRange(GLclampd nearval
, GLclampd farval
)
1912 GET_CURRENT_CONTEXT(ctx
);
1914 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1915 n
= alloc_instruction(ctx
, OPCODE_DEPTH_RANGE
, 2);
1917 n
[1].f
= (GLfloat
) nearval
;
1918 n
[2].f
= (GLfloat
) farval
;
1920 if (ctx
->ExecuteFlag
) {
1921 CALL_DepthRange(ctx
->Exec
, (nearval
, farval
));
1926 static void GLAPIENTRY
1927 save_Disable(GLenum cap
)
1929 GET_CURRENT_CONTEXT(ctx
);
1931 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1932 n
= alloc_instruction(ctx
, OPCODE_DISABLE
, 1);
1936 if (ctx
->ExecuteFlag
) {
1937 CALL_Disable(ctx
->Exec
, (cap
));
1942 static void GLAPIENTRY
1943 save_DisableIndexed(GLuint index
, GLenum cap
)
1945 GET_CURRENT_CONTEXT(ctx
);
1947 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1948 n
= alloc_instruction(ctx
, OPCODE_DISABLE_INDEXED
, 2);
1953 if (ctx
->ExecuteFlag
) {
1954 /*CALL_DisableIndexedEXT(ctx->Exec, (index, cap));*/
1959 static void GLAPIENTRY
1960 save_DrawBuffer(GLenum mode
)
1962 GET_CURRENT_CONTEXT(ctx
);
1964 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1965 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFER
, 1);
1969 if (ctx
->ExecuteFlag
) {
1970 CALL_DrawBuffer(ctx
->Exec
, (mode
));
1975 static void GLAPIENTRY
1976 save_DrawPixels(GLsizei width
, GLsizei height
,
1977 GLenum format
, GLenum type
, const GLvoid
* pixels
)
1979 GET_CURRENT_CONTEXT(ctx
);
1982 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
1984 n
= alloc_instruction(ctx
, OPCODE_DRAW_PIXELS
, 5);
1990 n
[5].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
1991 pixels
, &ctx
->Unpack
);
1993 if (ctx
->ExecuteFlag
) {
1994 CALL_DrawPixels(ctx
->Exec
, (width
, height
, format
, type
, pixels
));
2000 static void GLAPIENTRY
2001 save_Enable(GLenum cap
)
2003 GET_CURRENT_CONTEXT(ctx
);
2005 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2006 n
= alloc_instruction(ctx
, OPCODE_ENABLE
, 1);
2010 if (ctx
->ExecuteFlag
) {
2011 CALL_Enable(ctx
->Exec
, (cap
));
2017 static void GLAPIENTRY
2018 save_EnableIndexed(GLuint index
, GLenum cap
)
2020 GET_CURRENT_CONTEXT(ctx
);
2022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2023 n
= alloc_instruction(ctx
, OPCODE_ENABLE_INDEXED
, 2);
2028 if (ctx
->ExecuteFlag
) {
2029 /*CALL_EnableIndexed(ctx->Exec, (index, cap));*/
2035 static void GLAPIENTRY
2036 save_EvalMesh1(GLenum mode
, GLint i1
, GLint i2
)
2038 GET_CURRENT_CONTEXT(ctx
);
2040 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2041 n
= alloc_instruction(ctx
, OPCODE_EVALMESH1
, 3);
2047 if (ctx
->ExecuteFlag
) {
2048 CALL_EvalMesh1(ctx
->Exec
, (mode
, i1
, i2
));
2053 static void GLAPIENTRY
2054 save_EvalMesh2(GLenum mode
, GLint i1
, GLint i2
, GLint j1
, GLint j2
)
2056 GET_CURRENT_CONTEXT(ctx
);
2058 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2059 n
= alloc_instruction(ctx
, OPCODE_EVALMESH2
, 5);
2067 if (ctx
->ExecuteFlag
) {
2068 CALL_EvalMesh2(ctx
->Exec
, (mode
, i1
, i2
, j1
, j2
));
2075 static void GLAPIENTRY
2076 save_Fogfv(GLenum pname
, const GLfloat
*params
)
2078 GET_CURRENT_CONTEXT(ctx
);
2080 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2081 n
= alloc_instruction(ctx
, OPCODE_FOG
, 5);
2089 if (ctx
->ExecuteFlag
) {
2090 CALL_Fogfv(ctx
->Exec
, (pname
, params
));
2095 static void GLAPIENTRY
2096 save_Fogf(GLenum pname
, GLfloat param
)
2100 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2101 save_Fogfv(pname
, parray
);
2105 static void GLAPIENTRY
2106 save_Fogiv(GLenum pname
, const GLint
*params
)
2111 case GL_FOG_DENSITY
:
2115 p
[0] = (GLfloat
) *params
;
2121 p
[0] = INT_TO_FLOAT(params
[0]);
2122 p
[1] = INT_TO_FLOAT(params
[1]);
2123 p
[2] = INT_TO_FLOAT(params
[2]);
2124 p
[3] = INT_TO_FLOAT(params
[3]);
2127 /* Error will be caught later in gl_Fogfv */
2128 ASSIGN_4V(p
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2130 save_Fogfv(pname
, p
);
2134 static void GLAPIENTRY
2135 save_Fogi(GLenum pname
, GLint param
)
2139 parray
[1] = parray
[2] = parray
[3] = 0;
2140 save_Fogiv(pname
, parray
);
2144 static void GLAPIENTRY
2145 save_FrontFace(GLenum mode
)
2147 GET_CURRENT_CONTEXT(ctx
);
2149 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2150 n
= alloc_instruction(ctx
, OPCODE_FRONT_FACE
, 1);
2154 if (ctx
->ExecuteFlag
) {
2155 CALL_FrontFace(ctx
->Exec
, (mode
));
2160 static void GLAPIENTRY
2161 save_Frustum(GLdouble left
, GLdouble right
,
2162 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2164 GET_CURRENT_CONTEXT(ctx
);
2166 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2167 n
= alloc_instruction(ctx
, OPCODE_FRUSTUM
, 6);
2169 n
[1].f
= (GLfloat
) left
;
2170 n
[2].f
= (GLfloat
) right
;
2171 n
[3].f
= (GLfloat
) bottom
;
2172 n
[4].f
= (GLfloat
) top
;
2173 n
[5].f
= (GLfloat
) nearval
;
2174 n
[6].f
= (GLfloat
) farval
;
2176 if (ctx
->ExecuteFlag
) {
2177 CALL_Frustum(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2182 static void GLAPIENTRY
2183 save_Hint(GLenum target
, GLenum mode
)
2185 GET_CURRENT_CONTEXT(ctx
);
2187 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2188 n
= alloc_instruction(ctx
, OPCODE_HINT
, 2);
2193 if (ctx
->ExecuteFlag
) {
2194 CALL_Hint(ctx
->Exec
, (target
, mode
));
2199 static void GLAPIENTRY
2200 save_Histogram(GLenum target
, GLsizei width
, GLenum internalFormat
,
2203 GET_CURRENT_CONTEXT(ctx
);
2206 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2207 n
= alloc_instruction(ctx
, OPCODE_HISTOGRAM
, 4);
2211 n
[3].e
= internalFormat
;
2214 if (ctx
->ExecuteFlag
) {
2215 CALL_Histogram(ctx
->Exec
, (target
, width
, internalFormat
, sink
));
2220 static void GLAPIENTRY
2221 save_IndexMask(GLuint mask
)
2223 GET_CURRENT_CONTEXT(ctx
);
2225 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2226 n
= alloc_instruction(ctx
, OPCODE_INDEX_MASK
, 1);
2230 if (ctx
->ExecuteFlag
) {
2231 CALL_IndexMask(ctx
->Exec
, (mask
));
2236 static void GLAPIENTRY
2237 save_InitNames(void)
2239 GET_CURRENT_CONTEXT(ctx
);
2240 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2241 (void) alloc_instruction(ctx
, OPCODE_INIT_NAMES
, 0);
2242 if (ctx
->ExecuteFlag
) {
2243 CALL_InitNames(ctx
->Exec
, ());
2248 static void GLAPIENTRY
2249 save_Lightfv(GLenum light
, GLenum pname
, const GLfloat
*params
)
2251 GET_CURRENT_CONTEXT(ctx
);
2253 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2254 n
= alloc_instruction(ctx
, OPCODE_LIGHT
, 6);
2272 case GL_SPOT_DIRECTION
:
2275 case GL_SPOT_EXPONENT
:
2278 case GL_SPOT_CUTOFF
:
2281 case GL_CONSTANT_ATTENUATION
:
2284 case GL_LINEAR_ATTENUATION
:
2287 case GL_QUADRATIC_ATTENUATION
:
2293 for (i
= 0; i
< nParams
; i
++) {
2294 n
[3 + i
].f
= params
[i
];
2297 if (ctx
->ExecuteFlag
) {
2298 CALL_Lightfv(ctx
->Exec
, (light
, pname
, params
));
2303 static void GLAPIENTRY
2304 save_Lightf(GLenum light
, GLenum pname
, GLfloat param
)
2308 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2309 save_Lightfv(light
, pname
, parray
);
2313 static void GLAPIENTRY
2314 save_Lightiv(GLenum light
, GLenum pname
, const GLint
*params
)
2321 fparam
[0] = INT_TO_FLOAT(params
[0]);
2322 fparam
[1] = INT_TO_FLOAT(params
[1]);
2323 fparam
[2] = INT_TO_FLOAT(params
[2]);
2324 fparam
[3] = INT_TO_FLOAT(params
[3]);
2327 fparam
[0] = (GLfloat
) params
[0];
2328 fparam
[1] = (GLfloat
) params
[1];
2329 fparam
[2] = (GLfloat
) params
[2];
2330 fparam
[3] = (GLfloat
) params
[3];
2332 case GL_SPOT_DIRECTION
:
2333 fparam
[0] = (GLfloat
) params
[0];
2334 fparam
[1] = (GLfloat
) params
[1];
2335 fparam
[2] = (GLfloat
) params
[2];
2337 case GL_SPOT_EXPONENT
:
2338 case GL_SPOT_CUTOFF
:
2339 case GL_CONSTANT_ATTENUATION
:
2340 case GL_LINEAR_ATTENUATION
:
2341 case GL_QUADRATIC_ATTENUATION
:
2342 fparam
[0] = (GLfloat
) params
[0];
2345 /* error will be caught later in gl_Lightfv */
2348 save_Lightfv(light
, pname
, fparam
);
2352 static void GLAPIENTRY
2353 save_Lighti(GLenum light
, GLenum pname
, GLint param
)
2357 parray
[1] = parray
[2] = parray
[3] = 0;
2358 save_Lightiv(light
, pname
, parray
);
2362 static void GLAPIENTRY
2363 save_LightModelfv(GLenum pname
, const GLfloat
*params
)
2365 GET_CURRENT_CONTEXT(ctx
);
2367 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2368 n
= alloc_instruction(ctx
, OPCODE_LIGHT_MODEL
, 5);
2376 if (ctx
->ExecuteFlag
) {
2377 CALL_LightModelfv(ctx
->Exec
, (pname
, params
));
2382 static void GLAPIENTRY
2383 save_LightModelf(GLenum pname
, GLfloat param
)
2387 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
2388 save_LightModelfv(pname
, parray
);
2392 static void GLAPIENTRY
2393 save_LightModeliv(GLenum pname
, const GLint
*params
)
2397 case GL_LIGHT_MODEL_AMBIENT
:
2398 fparam
[0] = INT_TO_FLOAT(params
[0]);
2399 fparam
[1] = INT_TO_FLOAT(params
[1]);
2400 fparam
[2] = INT_TO_FLOAT(params
[2]);
2401 fparam
[3] = INT_TO_FLOAT(params
[3]);
2403 case GL_LIGHT_MODEL_LOCAL_VIEWER
:
2404 case GL_LIGHT_MODEL_TWO_SIDE
:
2405 case GL_LIGHT_MODEL_COLOR_CONTROL
:
2406 fparam
[0] = (GLfloat
) params
[0];
2412 /* Error will be caught later in gl_LightModelfv */
2413 ASSIGN_4V(fparam
, 0.0F
, 0.0F
, 0.0F
, 0.0F
);
2415 save_LightModelfv(pname
, fparam
);
2419 static void GLAPIENTRY
2420 save_LightModeli(GLenum pname
, GLint param
)
2424 parray
[1] = parray
[2] = parray
[3] = 0;
2425 save_LightModeliv(pname
, parray
);
2429 static void GLAPIENTRY
2430 save_LineStipple(GLint factor
, GLushort pattern
)
2432 GET_CURRENT_CONTEXT(ctx
);
2434 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2435 n
= alloc_instruction(ctx
, OPCODE_LINE_STIPPLE
, 2);
2440 if (ctx
->ExecuteFlag
) {
2441 CALL_LineStipple(ctx
->Exec
, (factor
, pattern
));
2446 static void GLAPIENTRY
2447 save_LineWidth(GLfloat width
)
2449 GET_CURRENT_CONTEXT(ctx
);
2451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2452 n
= alloc_instruction(ctx
, OPCODE_LINE_WIDTH
, 1);
2456 if (ctx
->ExecuteFlag
) {
2457 CALL_LineWidth(ctx
->Exec
, (width
));
2462 static void GLAPIENTRY
2463 save_ListBase(GLuint base
)
2465 GET_CURRENT_CONTEXT(ctx
);
2467 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2468 n
= alloc_instruction(ctx
, OPCODE_LIST_BASE
, 1);
2472 if (ctx
->ExecuteFlag
) {
2473 CALL_ListBase(ctx
->Exec
, (base
));
2478 static void GLAPIENTRY
2479 save_LoadIdentity(void)
2481 GET_CURRENT_CONTEXT(ctx
);
2482 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2483 (void) alloc_instruction(ctx
, OPCODE_LOAD_IDENTITY
, 0);
2484 if (ctx
->ExecuteFlag
) {
2485 CALL_LoadIdentity(ctx
->Exec
, ());
2490 static void GLAPIENTRY
2491 save_LoadMatrixf(const GLfloat
* m
)
2493 GET_CURRENT_CONTEXT(ctx
);
2495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2496 n
= alloc_instruction(ctx
, OPCODE_LOAD_MATRIX
, 16);
2499 for (i
= 0; i
< 16; i
++) {
2503 if (ctx
->ExecuteFlag
) {
2504 CALL_LoadMatrixf(ctx
->Exec
, (m
));
2509 static void GLAPIENTRY
2510 save_LoadMatrixd(const GLdouble
* m
)
2514 for (i
= 0; i
< 16; i
++) {
2515 f
[i
] = (GLfloat
) m
[i
];
2517 save_LoadMatrixf(f
);
2521 static void GLAPIENTRY
2522 save_LoadName(GLuint name
)
2524 GET_CURRENT_CONTEXT(ctx
);
2526 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2527 n
= alloc_instruction(ctx
, OPCODE_LOAD_NAME
, 1);
2531 if (ctx
->ExecuteFlag
) {
2532 CALL_LoadName(ctx
->Exec
, (name
));
2537 static void GLAPIENTRY
2538 save_LogicOp(GLenum opcode
)
2540 GET_CURRENT_CONTEXT(ctx
);
2542 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2543 n
= alloc_instruction(ctx
, OPCODE_LOGIC_OP
, 1);
2547 if (ctx
->ExecuteFlag
) {
2548 CALL_LogicOp(ctx
->Exec
, (opcode
));
2553 static void GLAPIENTRY
2554 save_Map1d(GLenum target
, GLdouble u1
, GLdouble u2
, GLint stride
,
2555 GLint order
, const GLdouble
* points
)
2557 GET_CURRENT_CONTEXT(ctx
);
2559 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2560 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2562 GLfloat
*pnts
= _mesa_copy_map_points1d(target
, stride
, order
, points
);
2564 n
[2].f
= (GLfloat
) u1
;
2565 n
[3].f
= (GLfloat
) u2
;
2566 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2568 n
[6].data
= (void *) pnts
;
2570 if (ctx
->ExecuteFlag
) {
2571 CALL_Map1d(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2575 static void GLAPIENTRY
2576 save_Map1f(GLenum target
, GLfloat u1
, GLfloat u2
, GLint stride
,
2577 GLint order
, const GLfloat
* points
)
2579 GET_CURRENT_CONTEXT(ctx
);
2581 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2582 n
= alloc_instruction(ctx
, OPCODE_MAP1
, 6);
2584 GLfloat
*pnts
= _mesa_copy_map_points1f(target
, stride
, order
, points
);
2588 n
[4].i
= _mesa_evaluator_components(target
); /* stride */
2590 n
[6].data
= (void *) pnts
;
2592 if (ctx
->ExecuteFlag
) {
2593 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, stride
, order
, points
));
2598 static void GLAPIENTRY
2599 save_Map2d(GLenum target
,
2600 GLdouble u1
, GLdouble u2
, GLint ustride
, GLint uorder
,
2601 GLdouble v1
, GLdouble v2
, GLint vstride
, GLint vorder
,
2602 const GLdouble
* points
)
2604 GET_CURRENT_CONTEXT(ctx
);
2606 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2607 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2609 GLfloat
*pnts
= _mesa_copy_map_points2d(target
, ustride
, uorder
,
2610 vstride
, vorder
, points
);
2612 n
[2].f
= (GLfloat
) u1
;
2613 n
[3].f
= (GLfloat
) u2
;
2614 n
[4].f
= (GLfloat
) v1
;
2615 n
[5].f
= (GLfloat
) v2
;
2616 /* XXX verify these strides are correct */
2617 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2618 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2621 n
[10].data
= (void *) pnts
;
2623 if (ctx
->ExecuteFlag
) {
2624 CALL_Map2d(ctx
->Exec
, (target
,
2625 u1
, u2
, ustride
, uorder
,
2626 v1
, v2
, vstride
, vorder
, points
));
2631 static void GLAPIENTRY
2632 save_Map2f(GLenum target
,
2633 GLfloat u1
, GLfloat u2
, GLint ustride
, GLint uorder
,
2634 GLfloat v1
, GLfloat v2
, GLint vstride
, GLint vorder
,
2635 const GLfloat
* points
)
2637 GET_CURRENT_CONTEXT(ctx
);
2639 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2640 n
= alloc_instruction(ctx
, OPCODE_MAP2
, 10);
2642 GLfloat
*pnts
= _mesa_copy_map_points2f(target
, ustride
, uorder
,
2643 vstride
, vorder
, points
);
2649 /* XXX verify these strides are correct */
2650 n
[6].i
= _mesa_evaluator_components(target
) * vorder
; /*ustride */
2651 n
[7].i
= _mesa_evaluator_components(target
); /*vstride */
2654 n
[10].data
= (void *) pnts
;
2656 if (ctx
->ExecuteFlag
) {
2657 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
2658 v1
, v2
, vstride
, vorder
, points
));
2663 static void GLAPIENTRY
2664 save_MapGrid1f(GLint un
, GLfloat u1
, GLfloat u2
)
2666 GET_CURRENT_CONTEXT(ctx
);
2668 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2669 n
= alloc_instruction(ctx
, OPCODE_MAPGRID1
, 3);
2675 if (ctx
->ExecuteFlag
) {
2676 CALL_MapGrid1f(ctx
->Exec
, (un
, u1
, u2
));
2681 static void GLAPIENTRY
2682 save_MapGrid1d(GLint un
, GLdouble u1
, GLdouble u2
)
2684 save_MapGrid1f(un
, (GLfloat
) u1
, (GLfloat
) u2
);
2688 static void GLAPIENTRY
2689 save_MapGrid2f(GLint un
, GLfloat u1
, GLfloat u2
,
2690 GLint vn
, GLfloat v1
, GLfloat v2
)
2692 GET_CURRENT_CONTEXT(ctx
);
2694 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2695 n
= alloc_instruction(ctx
, OPCODE_MAPGRID2
, 6);
2704 if (ctx
->ExecuteFlag
) {
2705 CALL_MapGrid2f(ctx
->Exec
, (un
, u1
, u2
, vn
, v1
, v2
));
2711 static void GLAPIENTRY
2712 save_MapGrid2d(GLint un
, GLdouble u1
, GLdouble u2
,
2713 GLint vn
, GLdouble v1
, GLdouble v2
)
2715 save_MapGrid2f(un
, (GLfloat
) u1
, (GLfloat
) u2
,
2716 vn
, (GLfloat
) v1
, (GLfloat
) v2
);
2720 static void GLAPIENTRY
2721 save_MatrixMode(GLenum mode
)
2723 GET_CURRENT_CONTEXT(ctx
);
2725 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2726 n
= alloc_instruction(ctx
, OPCODE_MATRIX_MODE
, 1);
2730 if (ctx
->ExecuteFlag
) {
2731 CALL_MatrixMode(ctx
->Exec
, (mode
));
2736 static void GLAPIENTRY
2737 save_Minmax(GLenum target
, GLenum internalFormat
, GLboolean sink
)
2739 GET_CURRENT_CONTEXT(ctx
);
2742 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2743 n
= alloc_instruction(ctx
, OPCODE_MIN_MAX
, 3);
2746 n
[2].e
= internalFormat
;
2749 if (ctx
->ExecuteFlag
) {
2750 CALL_Minmax(ctx
->Exec
, (target
, internalFormat
, sink
));
2755 static void GLAPIENTRY
2756 save_MultMatrixf(const GLfloat
* m
)
2758 GET_CURRENT_CONTEXT(ctx
);
2760 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2761 n
= alloc_instruction(ctx
, OPCODE_MULT_MATRIX
, 16);
2764 for (i
= 0; i
< 16; i
++) {
2768 if (ctx
->ExecuteFlag
) {
2769 CALL_MultMatrixf(ctx
->Exec
, (m
));
2774 static void GLAPIENTRY
2775 save_MultMatrixd(const GLdouble
* m
)
2779 for (i
= 0; i
< 16; i
++) {
2780 f
[i
] = (GLfloat
) m
[i
];
2782 save_MultMatrixf(f
);
2786 static void GLAPIENTRY
2787 save_NewList(GLuint name
, GLenum mode
)
2789 GET_CURRENT_CONTEXT(ctx
);
2790 /* It's an error to call this function while building a display list */
2791 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
2798 static void GLAPIENTRY
2799 save_Ortho(GLdouble left
, GLdouble right
,
2800 GLdouble bottom
, GLdouble top
, GLdouble nearval
, GLdouble farval
)
2802 GET_CURRENT_CONTEXT(ctx
);
2804 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2805 n
= alloc_instruction(ctx
, OPCODE_ORTHO
, 6);
2807 n
[1].f
= (GLfloat
) left
;
2808 n
[2].f
= (GLfloat
) right
;
2809 n
[3].f
= (GLfloat
) bottom
;
2810 n
[4].f
= (GLfloat
) top
;
2811 n
[5].f
= (GLfloat
) nearval
;
2812 n
[6].f
= (GLfloat
) farval
;
2814 if (ctx
->ExecuteFlag
) {
2815 CALL_Ortho(ctx
->Exec
, (left
, right
, bottom
, top
, nearval
, farval
));
2820 static void GLAPIENTRY
2821 save_PixelMapfv(GLenum map
, GLint mapsize
, const GLfloat
*values
)
2823 GET_CURRENT_CONTEXT(ctx
);
2825 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2826 n
= alloc_instruction(ctx
, OPCODE_PIXEL_MAP
, 3);
2830 n
[3].data
= (void *) _mesa_malloc(mapsize
* sizeof(GLfloat
));
2831 MEMCPY(n
[3].data
, (void *) values
, mapsize
* sizeof(GLfloat
));
2833 if (ctx
->ExecuteFlag
) {
2834 CALL_PixelMapfv(ctx
->Exec
, (map
, mapsize
, values
));
2839 static void GLAPIENTRY
2840 save_PixelMapuiv(GLenum map
, GLint mapsize
, const GLuint
*values
)
2842 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2844 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2845 for (i
= 0; i
< mapsize
; i
++) {
2846 fvalues
[i
] = (GLfloat
) values
[i
];
2850 for (i
= 0; i
< mapsize
; i
++) {
2851 fvalues
[i
] = UINT_TO_FLOAT(values
[i
]);
2854 save_PixelMapfv(map
, mapsize
, fvalues
);
2858 static void GLAPIENTRY
2859 save_PixelMapusv(GLenum map
, GLint mapsize
, const GLushort
*values
)
2861 GLfloat fvalues
[MAX_PIXEL_MAP_TABLE
];
2863 if (map
== GL_PIXEL_MAP_I_TO_I
|| map
== GL_PIXEL_MAP_S_TO_S
) {
2864 for (i
= 0; i
< mapsize
; i
++) {
2865 fvalues
[i
] = (GLfloat
) values
[i
];
2869 for (i
= 0; i
< mapsize
; i
++) {
2870 fvalues
[i
] = USHORT_TO_FLOAT(values
[i
]);
2873 save_PixelMapfv(map
, mapsize
, fvalues
);
2877 static void GLAPIENTRY
2878 save_PixelTransferf(GLenum pname
, GLfloat param
)
2880 GET_CURRENT_CONTEXT(ctx
);
2882 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2883 n
= alloc_instruction(ctx
, OPCODE_PIXEL_TRANSFER
, 2);
2888 if (ctx
->ExecuteFlag
) {
2889 CALL_PixelTransferf(ctx
->Exec
, (pname
, param
));
2894 static void GLAPIENTRY
2895 save_PixelTransferi(GLenum pname
, GLint param
)
2897 save_PixelTransferf(pname
, (GLfloat
) param
);
2901 static void GLAPIENTRY
2902 save_PixelZoom(GLfloat xfactor
, GLfloat yfactor
)
2904 GET_CURRENT_CONTEXT(ctx
);
2906 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2907 n
= alloc_instruction(ctx
, OPCODE_PIXEL_ZOOM
, 2);
2912 if (ctx
->ExecuteFlag
) {
2913 CALL_PixelZoom(ctx
->Exec
, (xfactor
, yfactor
));
2918 static void GLAPIENTRY
2919 save_PointParameterfvEXT(GLenum pname
, const GLfloat
*params
)
2921 GET_CURRENT_CONTEXT(ctx
);
2923 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2924 n
= alloc_instruction(ctx
, OPCODE_POINT_PARAMETERS
, 4);
2931 if (ctx
->ExecuteFlag
) {
2932 CALL_PointParameterfvEXT(ctx
->Exec
, (pname
, params
));
2937 static void GLAPIENTRY
2938 save_PointParameterfEXT(GLenum pname
, GLfloat param
)
2942 parray
[1] = parray
[2] = 0.0F
;
2943 save_PointParameterfvEXT(pname
, parray
);
2946 static void GLAPIENTRY
2947 save_PointParameteriNV(GLenum pname
, GLint param
)
2950 parray
[0] = (GLfloat
) param
;
2951 parray
[1] = parray
[2] = 0.0F
;
2952 save_PointParameterfvEXT(pname
, parray
);
2955 static void GLAPIENTRY
2956 save_PointParameterivNV(GLenum pname
, const GLint
* param
)
2959 parray
[0] = (GLfloat
) param
[0];
2960 parray
[1] = parray
[2] = 0.0F
;
2961 save_PointParameterfvEXT(pname
, parray
);
2965 static void GLAPIENTRY
2966 save_PointSize(GLfloat size
)
2968 GET_CURRENT_CONTEXT(ctx
);
2970 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2971 n
= alloc_instruction(ctx
, OPCODE_POINT_SIZE
, 1);
2975 if (ctx
->ExecuteFlag
) {
2976 CALL_PointSize(ctx
->Exec
, (size
));
2981 static void GLAPIENTRY
2982 save_PolygonMode(GLenum face
, GLenum mode
)
2984 GET_CURRENT_CONTEXT(ctx
);
2986 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
2987 n
= alloc_instruction(ctx
, OPCODE_POLYGON_MODE
, 2);
2992 if (ctx
->ExecuteFlag
) {
2993 CALL_PolygonMode(ctx
->Exec
, (face
, mode
));
2998 static void GLAPIENTRY
2999 save_PolygonStipple(const GLubyte
* pattern
)
3001 GET_CURRENT_CONTEXT(ctx
);
3004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3006 n
= alloc_instruction(ctx
, OPCODE_POLYGON_STIPPLE
, 1);
3008 n
[1].data
= unpack_image(ctx
, 2, 32, 32, 1, GL_COLOR_INDEX
, GL_BITMAP
,
3009 pattern
, &ctx
->Unpack
);
3011 if (ctx
->ExecuteFlag
) {
3012 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) pattern
));
3017 static void GLAPIENTRY
3018 save_PolygonOffset(GLfloat factor
, GLfloat units
)
3020 GET_CURRENT_CONTEXT(ctx
);
3022 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3023 n
= alloc_instruction(ctx
, OPCODE_POLYGON_OFFSET
, 2);
3028 if (ctx
->ExecuteFlag
) {
3029 CALL_PolygonOffset(ctx
->Exec
, (factor
, units
));
3034 static void GLAPIENTRY
3035 save_PolygonOffsetEXT(GLfloat factor
, GLfloat bias
)
3037 GET_CURRENT_CONTEXT(ctx
);
3038 /* XXX mult by DepthMaxF here??? */
3039 save_PolygonOffset(factor
, ctx
->DrawBuffer
->_DepthMaxF
* bias
);
3043 static void GLAPIENTRY
3044 save_PopAttrib(void)
3046 GET_CURRENT_CONTEXT(ctx
);
3047 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3048 (void) alloc_instruction(ctx
, OPCODE_POP_ATTRIB
, 0);
3049 if (ctx
->ExecuteFlag
) {
3050 CALL_PopAttrib(ctx
->Exec
, ());
3055 static void GLAPIENTRY
3056 save_PopMatrix(void)
3058 GET_CURRENT_CONTEXT(ctx
);
3059 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3060 (void) alloc_instruction(ctx
, OPCODE_POP_MATRIX
, 0);
3061 if (ctx
->ExecuteFlag
) {
3062 CALL_PopMatrix(ctx
->Exec
, ());
3067 static void GLAPIENTRY
3070 GET_CURRENT_CONTEXT(ctx
);
3071 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3072 (void) alloc_instruction(ctx
, OPCODE_POP_NAME
, 0);
3073 if (ctx
->ExecuteFlag
) {
3074 CALL_PopName(ctx
->Exec
, ());
3079 static void GLAPIENTRY
3080 save_PrioritizeTextures(GLsizei num
, const GLuint
* textures
,
3081 const GLclampf
* priorities
)
3083 GET_CURRENT_CONTEXT(ctx
);
3085 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3087 for (i
= 0; i
< num
; i
++) {
3089 n
= alloc_instruction(ctx
, OPCODE_PRIORITIZE_TEXTURE
, 2);
3091 n
[1].ui
= textures
[i
];
3092 n
[2].f
= priorities
[i
];
3095 if (ctx
->ExecuteFlag
) {
3096 CALL_PrioritizeTextures(ctx
->Exec
, (num
, textures
, priorities
));
3101 static void GLAPIENTRY
3102 save_PushAttrib(GLbitfield mask
)
3104 GET_CURRENT_CONTEXT(ctx
);
3106 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3107 n
= alloc_instruction(ctx
, OPCODE_PUSH_ATTRIB
, 1);
3111 if (ctx
->ExecuteFlag
) {
3112 CALL_PushAttrib(ctx
->Exec
, (mask
));
3117 static void GLAPIENTRY
3118 save_PushMatrix(void)
3120 GET_CURRENT_CONTEXT(ctx
);
3121 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3122 (void) alloc_instruction(ctx
, OPCODE_PUSH_MATRIX
, 0);
3123 if (ctx
->ExecuteFlag
) {
3124 CALL_PushMatrix(ctx
->Exec
, ());
3129 static void GLAPIENTRY
3130 save_PushName(GLuint name
)
3132 GET_CURRENT_CONTEXT(ctx
);
3134 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3135 n
= alloc_instruction(ctx
, OPCODE_PUSH_NAME
, 1);
3139 if (ctx
->ExecuteFlag
) {
3140 CALL_PushName(ctx
->Exec
, (name
));
3145 static void GLAPIENTRY
3146 save_RasterPos4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
3148 GET_CURRENT_CONTEXT(ctx
);
3150 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3151 n
= alloc_instruction(ctx
, OPCODE_RASTER_POS
, 4);
3158 if (ctx
->ExecuteFlag
) {
3159 CALL_RasterPos4f(ctx
->Exec
, (x
, y
, z
, w
));
3163 static void GLAPIENTRY
3164 save_RasterPos2d(GLdouble x
, GLdouble y
)
3166 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3169 static void GLAPIENTRY
3170 save_RasterPos2f(GLfloat x
, GLfloat y
)
3172 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3175 static void GLAPIENTRY
3176 save_RasterPos2i(GLint x
, GLint y
)
3178 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
3181 static void GLAPIENTRY
3182 save_RasterPos2s(GLshort x
, GLshort y
)
3184 save_RasterPos4f(x
, y
, 0.0F
, 1.0F
);
3187 static void GLAPIENTRY
3188 save_RasterPos3d(GLdouble x
, GLdouble y
, GLdouble z
)
3190 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3193 static void GLAPIENTRY
3194 save_RasterPos3f(GLfloat x
, GLfloat y
, GLfloat z
)
3196 save_RasterPos4f(x
, y
, z
, 1.0F
);
3199 static void GLAPIENTRY
3200 save_RasterPos3i(GLint x
, GLint y
, GLint z
)
3202 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
3205 static void GLAPIENTRY
3206 save_RasterPos3s(GLshort x
, GLshort y
, GLshort z
)
3208 save_RasterPos4f(x
, y
, z
, 1.0F
);
3211 static void GLAPIENTRY
3212 save_RasterPos4d(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
3214 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3217 static void GLAPIENTRY
3218 save_RasterPos4i(GLint x
, GLint y
, GLint z
, GLint w
)
3220 save_RasterPos4f((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
3223 static void GLAPIENTRY
3224 save_RasterPos4s(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
3226 save_RasterPos4f(x
, y
, z
, w
);
3229 static void GLAPIENTRY
3230 save_RasterPos2dv(const GLdouble
* v
)
3232 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3235 static void GLAPIENTRY
3236 save_RasterPos2fv(const GLfloat
* v
)
3238 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3241 static void GLAPIENTRY
3242 save_RasterPos2iv(const GLint
* v
)
3244 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
3247 static void GLAPIENTRY
3248 save_RasterPos2sv(const GLshort
* v
)
3250 save_RasterPos4f(v
[0], v
[1], 0.0F
, 1.0F
);
3253 static void GLAPIENTRY
3254 save_RasterPos3dv(const GLdouble
* v
)
3256 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3259 static void GLAPIENTRY
3260 save_RasterPos3fv(const GLfloat
* v
)
3262 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3265 static void GLAPIENTRY
3266 save_RasterPos3iv(const GLint
* v
)
3268 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
3271 static void GLAPIENTRY
3272 save_RasterPos3sv(const GLshort
* v
)
3274 save_RasterPos4f(v
[0], v
[1], v
[2], 1.0F
);
3277 static void GLAPIENTRY
3278 save_RasterPos4dv(const GLdouble
* v
)
3280 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3281 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3284 static void GLAPIENTRY
3285 save_RasterPos4fv(const GLfloat
* v
)
3287 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3290 static void GLAPIENTRY
3291 save_RasterPos4iv(const GLint
* v
)
3293 save_RasterPos4f((GLfloat
) v
[0], (GLfloat
) v
[1],
3294 (GLfloat
) v
[2], (GLfloat
) v
[3]);
3297 static void GLAPIENTRY
3298 save_RasterPos4sv(const GLshort
* v
)
3300 save_RasterPos4f(v
[0], v
[1], v
[2], v
[3]);
3304 static void GLAPIENTRY
3305 save_PassThrough(GLfloat token
)
3307 GET_CURRENT_CONTEXT(ctx
);
3309 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3310 n
= alloc_instruction(ctx
, OPCODE_PASSTHROUGH
, 1);
3314 if (ctx
->ExecuteFlag
) {
3315 CALL_PassThrough(ctx
->Exec
, (token
));
3320 static void GLAPIENTRY
3321 save_ReadBuffer(GLenum mode
)
3323 GET_CURRENT_CONTEXT(ctx
);
3325 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3326 n
= alloc_instruction(ctx
, OPCODE_READ_BUFFER
, 1);
3330 if (ctx
->ExecuteFlag
) {
3331 CALL_ReadBuffer(ctx
->Exec
, (mode
));
3336 static void GLAPIENTRY
3337 save_ResetHistogram(GLenum target
)
3339 GET_CURRENT_CONTEXT(ctx
);
3341 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3342 n
= alloc_instruction(ctx
, OPCODE_RESET_HISTOGRAM
, 1);
3346 if (ctx
->ExecuteFlag
) {
3347 CALL_ResetHistogram(ctx
->Exec
, (target
));
3352 static void GLAPIENTRY
3353 save_ResetMinmax(GLenum target
)
3355 GET_CURRENT_CONTEXT(ctx
);
3357 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3358 n
= alloc_instruction(ctx
, OPCODE_RESET_MIN_MAX
, 1);
3362 if (ctx
->ExecuteFlag
) {
3363 CALL_ResetMinmax(ctx
->Exec
, (target
));
3368 static void GLAPIENTRY
3369 save_Rotatef(GLfloat angle
, GLfloat x
, GLfloat y
, GLfloat z
)
3371 GET_CURRENT_CONTEXT(ctx
);
3373 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3374 n
= alloc_instruction(ctx
, OPCODE_ROTATE
, 4);
3381 if (ctx
->ExecuteFlag
) {
3382 CALL_Rotatef(ctx
->Exec
, (angle
, x
, y
, z
));
3387 static void GLAPIENTRY
3388 save_Rotated(GLdouble angle
, GLdouble x
, GLdouble y
, GLdouble z
)
3390 save_Rotatef((GLfloat
) angle
, (GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3394 static void GLAPIENTRY
3395 save_Scalef(GLfloat x
, GLfloat y
, GLfloat z
)
3397 GET_CURRENT_CONTEXT(ctx
);
3399 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3400 n
= alloc_instruction(ctx
, OPCODE_SCALE
, 3);
3406 if (ctx
->ExecuteFlag
) {
3407 CALL_Scalef(ctx
->Exec
, (x
, y
, z
));
3412 static void GLAPIENTRY
3413 save_Scaled(GLdouble x
, GLdouble y
, GLdouble z
)
3415 save_Scalef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
3419 static void GLAPIENTRY
3420 save_Scissor(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
3422 GET_CURRENT_CONTEXT(ctx
);
3424 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3425 n
= alloc_instruction(ctx
, OPCODE_SCISSOR
, 4);
3432 if (ctx
->ExecuteFlag
) {
3433 CALL_Scissor(ctx
->Exec
, (x
, y
, width
, height
));
3438 static void GLAPIENTRY
3439 save_ShadeModel(GLenum mode
)
3441 GET_CURRENT_CONTEXT(ctx
);
3443 ASSERT_OUTSIDE_SAVE_BEGIN_END(ctx
);
3445 if (ctx
->ExecuteFlag
) {
3446 CALL_ShadeModel(ctx
->Exec
, (mode
));
3449 if (ctx
->ListState
.Current
.ShadeModel
== mode
)
3452 SAVE_FLUSH_VERTICES(ctx
);
3454 /* Only save the value if we know the statechange will take effect:
3456 if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
)
3457 ctx
->ListState
.Current
.ShadeModel
= mode
;
3459 n
= alloc_instruction(ctx
, OPCODE_SHADE_MODEL
, 1);
3466 static void GLAPIENTRY
3467 save_StencilFunc(GLenum func
, GLint ref
, GLuint mask
)
3469 GET_CURRENT_CONTEXT(ctx
);
3471 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3472 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC
, 3);
3478 if (ctx
->ExecuteFlag
) {
3479 CALL_StencilFunc(ctx
->Exec
, (func
, ref
, mask
));
3484 static void GLAPIENTRY
3485 save_StencilMask(GLuint mask
)
3487 GET_CURRENT_CONTEXT(ctx
);
3489 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3490 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK
, 1);
3494 if (ctx
->ExecuteFlag
) {
3495 CALL_StencilMask(ctx
->Exec
, (mask
));
3500 static void GLAPIENTRY
3501 save_StencilOp(GLenum fail
, GLenum zfail
, GLenum zpass
)
3503 GET_CURRENT_CONTEXT(ctx
);
3505 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3506 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP
, 3);
3512 if (ctx
->ExecuteFlag
) {
3513 CALL_StencilOp(ctx
->Exec
, (fail
, zfail
, zpass
));
3518 static void GLAPIENTRY
3519 save_StencilFuncSeparate(GLenum face
, GLenum func
, GLint ref
, GLuint mask
)
3521 GET_CURRENT_CONTEXT(ctx
);
3523 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3524 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3531 if (ctx
->ExecuteFlag
) {
3532 CALL_StencilFuncSeparate(ctx
->Exec
, (face
, func
, ref
, mask
));
3537 static void GLAPIENTRY
3538 save_StencilFuncSeparateATI(GLenum frontfunc
, GLenum backfunc
, GLint ref
,
3541 GET_CURRENT_CONTEXT(ctx
);
3543 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3545 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3553 n
= alloc_instruction(ctx
, OPCODE_STENCIL_FUNC_SEPARATE
, 4);
3560 if (ctx
->ExecuteFlag
) {
3561 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_FRONT
, frontfunc
, ref
, mask
));
3562 CALL_StencilFuncSeparate(ctx
->Exec
, (GL_BACK
, backfunc
, ref
, mask
));
3567 static void GLAPIENTRY
3568 save_StencilMaskSeparate(GLenum face
, GLuint mask
)
3570 GET_CURRENT_CONTEXT(ctx
);
3572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3573 n
= alloc_instruction(ctx
, OPCODE_STENCIL_MASK_SEPARATE
, 2);
3578 if (ctx
->ExecuteFlag
) {
3579 CALL_StencilMaskSeparate(ctx
->Exec
, (face
, mask
));
3584 static void GLAPIENTRY
3585 save_StencilOpSeparate(GLenum face
, GLenum fail
, GLenum zfail
, GLenum zpass
)
3587 GET_CURRENT_CONTEXT(ctx
);
3589 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3590 n
= alloc_instruction(ctx
, OPCODE_STENCIL_OP_SEPARATE
, 4);
3597 if (ctx
->ExecuteFlag
) {
3598 CALL_StencilOpSeparate(ctx
->Exec
, (face
, fail
, zfail
, zpass
));
3603 static void GLAPIENTRY
3604 save_TexEnvfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3606 GET_CURRENT_CONTEXT(ctx
);
3608 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3609 n
= alloc_instruction(ctx
, OPCODE_TEXENV
, 6);
3613 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3621 n
[4].f
= n
[5].f
= n
[6].f
= 0.0F
;
3624 if (ctx
->ExecuteFlag
) {
3625 CALL_TexEnvfv(ctx
->Exec
, (target
, pname
, params
));
3630 static void GLAPIENTRY
3631 save_TexEnvf(GLenum target
, GLenum pname
, GLfloat param
)
3634 parray
[0] = (GLfloat
) param
;
3635 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3636 save_TexEnvfv(target
, pname
, parray
);
3640 static void GLAPIENTRY
3641 save_TexEnvi(GLenum target
, GLenum pname
, GLint param
)
3644 p
[0] = (GLfloat
) param
;
3645 p
[1] = p
[2] = p
[3] = 0.0;
3646 save_TexEnvfv(target
, pname
, p
);
3650 static void GLAPIENTRY
3651 save_TexEnviv(GLenum target
, GLenum pname
, const GLint
* param
)
3654 if (pname
== GL_TEXTURE_ENV_COLOR
) {
3655 p
[0] = INT_TO_FLOAT(param
[0]);
3656 p
[1] = INT_TO_FLOAT(param
[1]);
3657 p
[2] = INT_TO_FLOAT(param
[2]);
3658 p
[3] = INT_TO_FLOAT(param
[3]);
3661 p
[0] = (GLfloat
) param
[0];
3662 p
[1] = p
[2] = p
[3] = 0.0F
;
3664 save_TexEnvfv(target
, pname
, p
);
3668 static void GLAPIENTRY
3669 save_TexGenfv(GLenum coord
, GLenum pname
, const GLfloat
*params
)
3671 GET_CURRENT_CONTEXT(ctx
);
3673 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3674 n
= alloc_instruction(ctx
, OPCODE_TEXGEN
, 6);
3683 if (ctx
->ExecuteFlag
) {
3684 CALL_TexGenfv(ctx
->Exec
, (coord
, pname
, params
));
3689 static void GLAPIENTRY
3690 save_TexGeniv(GLenum coord
, GLenum pname
, const GLint
*params
)
3693 p
[0] = (GLfloat
) params
[0];
3694 p
[1] = (GLfloat
) params
[1];
3695 p
[2] = (GLfloat
) params
[2];
3696 p
[3] = (GLfloat
) params
[3];
3697 save_TexGenfv(coord
, pname
, p
);
3701 static void GLAPIENTRY
3702 save_TexGend(GLenum coord
, GLenum pname
, GLdouble param
)
3705 parray
[0] = (GLfloat
) param
;
3706 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3707 save_TexGenfv(coord
, pname
, parray
);
3711 static void GLAPIENTRY
3712 save_TexGendv(GLenum coord
, GLenum pname
, const GLdouble
*params
)
3715 p
[0] = (GLfloat
) params
[0];
3716 p
[1] = (GLfloat
) params
[1];
3717 p
[2] = (GLfloat
) params
[2];
3718 p
[3] = (GLfloat
) params
[3];
3719 save_TexGenfv(coord
, pname
, p
);
3723 static void GLAPIENTRY
3724 save_TexGenf(GLenum coord
, GLenum pname
, GLfloat param
)
3728 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3729 save_TexGenfv(coord
, pname
, parray
);
3733 static void GLAPIENTRY
3734 save_TexGeni(GLenum coord
, GLenum pname
, GLint param
)
3738 parray
[1] = parray
[2] = parray
[3] = 0;
3739 save_TexGeniv(coord
, pname
, parray
);
3743 static void GLAPIENTRY
3744 save_TexParameterfv(GLenum target
, GLenum pname
, const GLfloat
*params
)
3746 GET_CURRENT_CONTEXT(ctx
);
3748 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3749 n
= alloc_instruction(ctx
, OPCODE_TEXPARAMETER
, 6);
3758 if (ctx
->ExecuteFlag
) {
3759 CALL_TexParameterfv(ctx
->Exec
, (target
, pname
, params
));
3764 static void GLAPIENTRY
3765 save_TexParameterf(GLenum target
, GLenum pname
, GLfloat param
)
3769 parray
[1] = parray
[2] = parray
[3] = 0.0F
;
3770 save_TexParameterfv(target
, pname
, parray
);
3774 static void GLAPIENTRY
3775 save_TexParameteri(GLenum target
, GLenum pname
, GLint param
)
3778 fparam
[0] = (GLfloat
) param
;
3779 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3780 save_TexParameterfv(target
, pname
, fparam
);
3784 static void GLAPIENTRY
3785 save_TexParameteriv(GLenum target
, GLenum pname
, const GLint
*params
)
3788 fparam
[0] = (GLfloat
) params
[0];
3789 fparam
[1] = fparam
[2] = fparam
[3] = 0.0;
3790 save_TexParameterfv(target
, pname
, fparam
);
3794 static void GLAPIENTRY
3795 save_TexImage1D(GLenum target
,
3796 GLint level
, GLint components
,
3797 GLsizei width
, GLint border
,
3798 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3800 GET_CURRENT_CONTEXT(ctx
);
3801 if (target
== GL_PROXY_TEXTURE_1D
) {
3802 /* don't compile, execute immediately */
3803 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3804 border
, format
, type
, pixels
));
3808 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3809 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE1D
, 8);
3813 n
[3].i
= components
;
3814 n
[4].i
= (GLint
) width
;
3818 n
[8].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3819 pixels
, &ctx
->Unpack
);
3821 if (ctx
->ExecuteFlag
) {
3822 CALL_TexImage1D(ctx
->Exec
, (target
, level
, components
, width
,
3823 border
, format
, type
, pixels
));
3829 static void GLAPIENTRY
3830 save_TexImage2D(GLenum target
,
3831 GLint level
, GLint components
,
3832 GLsizei width
, GLsizei height
, GLint border
,
3833 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3835 GET_CURRENT_CONTEXT(ctx
);
3836 if (target
== GL_PROXY_TEXTURE_2D
) {
3837 /* don't compile, execute immediately */
3838 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3839 height
, border
, format
, type
, pixels
));
3843 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3844 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE2D
, 9);
3848 n
[3].i
= components
;
3849 n
[4].i
= (GLint
) width
;
3850 n
[5].i
= (GLint
) height
;
3854 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3855 pixels
, &ctx
->Unpack
);
3857 if (ctx
->ExecuteFlag
) {
3858 CALL_TexImage2D(ctx
->Exec
, (target
, level
, components
, width
,
3859 height
, border
, format
, type
, pixels
));
3865 static void GLAPIENTRY
3866 save_TexImage3D(GLenum target
,
3867 GLint level
, GLint internalFormat
,
3868 GLsizei width
, GLsizei height
, GLsizei depth
,
3870 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3872 GET_CURRENT_CONTEXT(ctx
);
3873 if (target
== GL_PROXY_TEXTURE_3D
) {
3874 /* don't compile, execute immediately */
3875 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3876 height
, depth
, border
, format
, type
,
3881 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3882 n
= alloc_instruction(ctx
, OPCODE_TEX_IMAGE3D
, 10);
3886 n
[3].i
= (GLint
) internalFormat
;
3887 n
[4].i
= (GLint
) width
;
3888 n
[5].i
= (GLint
) height
;
3889 n
[6].i
= (GLint
) depth
;
3893 n
[10].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3894 pixels
, &ctx
->Unpack
);
3896 if (ctx
->ExecuteFlag
) {
3897 CALL_TexImage3D(ctx
->Exec
, (target
, level
, internalFormat
, width
,
3898 height
, depth
, border
, format
, type
,
3905 static void GLAPIENTRY
3906 save_TexSubImage1D(GLenum target
, GLint level
, GLint xoffset
,
3907 GLsizei width
, GLenum format
, GLenum type
,
3908 const GLvoid
* pixels
)
3910 GET_CURRENT_CONTEXT(ctx
);
3913 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3915 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE1D
, 7);
3920 n
[4].i
= (GLint
) width
;
3923 n
[7].data
= unpack_image(ctx
, 1, width
, 1, 1, format
, type
,
3924 pixels
, &ctx
->Unpack
);
3926 if (ctx
->ExecuteFlag
) {
3927 CALL_TexSubImage1D(ctx
->Exec
, (target
, level
, xoffset
, width
,
3928 format
, type
, pixels
));
3933 static void GLAPIENTRY
3934 save_TexSubImage2D(GLenum target
, GLint level
,
3935 GLint xoffset
, GLint yoffset
,
3936 GLsizei width
, GLsizei height
,
3937 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3939 GET_CURRENT_CONTEXT(ctx
);
3942 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3944 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE2D
, 9);
3950 n
[5].i
= (GLint
) width
;
3951 n
[6].i
= (GLint
) height
;
3954 n
[9].data
= unpack_image(ctx
, 2, width
, height
, 1, format
, type
,
3955 pixels
, &ctx
->Unpack
);
3957 if (ctx
->ExecuteFlag
) {
3958 CALL_TexSubImage2D(ctx
->Exec
, (target
, level
, xoffset
, yoffset
,
3959 width
, height
, format
, type
, pixels
));
3964 static void GLAPIENTRY
3965 save_TexSubImage3D(GLenum target
, GLint level
,
3966 GLint xoffset
, GLint yoffset
, GLint zoffset
,
3967 GLsizei width
, GLsizei height
, GLsizei depth
,
3968 GLenum format
, GLenum type
, const GLvoid
* pixels
)
3970 GET_CURRENT_CONTEXT(ctx
);
3973 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
3975 n
= alloc_instruction(ctx
, OPCODE_TEX_SUB_IMAGE3D
, 11);
3982 n
[6].i
= (GLint
) width
;
3983 n
[7].i
= (GLint
) height
;
3984 n
[8].i
= (GLint
) depth
;
3987 n
[11].data
= unpack_image(ctx
, 3, width
, height
, depth
, format
, type
,
3988 pixels
, &ctx
->Unpack
);
3990 if (ctx
->ExecuteFlag
) {
3991 CALL_TexSubImage3D(ctx
->Exec
, (target
, level
,
3992 xoffset
, yoffset
, zoffset
,
3993 width
, height
, depth
, format
, type
,
3999 static void GLAPIENTRY
4000 save_Translatef(GLfloat x
, GLfloat y
, GLfloat z
)
4002 GET_CURRENT_CONTEXT(ctx
);
4004 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4005 n
= alloc_instruction(ctx
, OPCODE_TRANSLATE
, 3);
4011 if (ctx
->ExecuteFlag
) {
4012 CALL_Translatef(ctx
->Exec
, (x
, y
, z
));
4017 static void GLAPIENTRY
4018 save_Translated(GLdouble x
, GLdouble y
, GLdouble z
)
4020 save_Translatef((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
);
4025 static void GLAPIENTRY
4026 save_Viewport(GLint x
, GLint y
, GLsizei width
, GLsizei height
)
4028 GET_CURRENT_CONTEXT(ctx
);
4030 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4031 n
= alloc_instruction(ctx
, OPCODE_VIEWPORT
, 4);
4035 n
[3].i
= (GLint
) width
;
4036 n
[4].i
= (GLint
) height
;
4038 if (ctx
->ExecuteFlag
) {
4039 CALL_Viewport(ctx
->Exec
, (x
, y
, width
, height
));
4044 static void GLAPIENTRY
4045 save_WindowPos4fMESA(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4047 GET_CURRENT_CONTEXT(ctx
);
4049 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4050 n
= alloc_instruction(ctx
, OPCODE_WINDOW_POS
, 4);
4057 if (ctx
->ExecuteFlag
) {
4058 CALL_WindowPos4fMESA(ctx
->Exec
, (x
, y
, z
, w
));
4062 static void GLAPIENTRY
4063 save_WindowPos2dMESA(GLdouble x
, GLdouble y
)
4065 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4068 static void GLAPIENTRY
4069 save_WindowPos2fMESA(GLfloat x
, GLfloat y
)
4071 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4074 static void GLAPIENTRY
4075 save_WindowPos2iMESA(GLint x
, GLint y
)
4077 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, 0.0F
, 1.0F
);
4080 static void GLAPIENTRY
4081 save_WindowPos2sMESA(GLshort x
, GLshort y
)
4083 save_WindowPos4fMESA(x
, y
, 0.0F
, 1.0F
);
4086 static void GLAPIENTRY
4087 save_WindowPos3dMESA(GLdouble x
, GLdouble y
, GLdouble z
)
4089 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4092 static void GLAPIENTRY
4093 save_WindowPos3fMESA(GLfloat x
, GLfloat y
, GLfloat z
)
4095 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4098 static void GLAPIENTRY
4099 save_WindowPos3iMESA(GLint x
, GLint y
, GLint z
)
4101 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, 1.0F
);
4104 static void GLAPIENTRY
4105 save_WindowPos3sMESA(GLshort x
, GLshort y
, GLshort z
)
4107 save_WindowPos4fMESA(x
, y
, z
, 1.0F
);
4110 static void GLAPIENTRY
4111 save_WindowPos4dMESA(GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4113 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4116 static void GLAPIENTRY
4117 save_WindowPos4iMESA(GLint x
, GLint y
, GLint z
, GLint w
)
4119 save_WindowPos4fMESA((GLfloat
) x
, (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4122 static void GLAPIENTRY
4123 save_WindowPos4sMESA(GLshort x
, GLshort y
, GLshort z
, GLshort w
)
4125 save_WindowPos4fMESA(x
, y
, z
, w
);
4128 static void GLAPIENTRY
4129 save_WindowPos2dvMESA(const GLdouble
* v
)
4131 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4134 static void GLAPIENTRY
4135 save_WindowPos2fvMESA(const GLfloat
* v
)
4137 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4140 static void GLAPIENTRY
4141 save_WindowPos2ivMESA(const GLint
* v
)
4143 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], 0.0F
, 1.0F
);
4146 static void GLAPIENTRY
4147 save_WindowPos2svMESA(const GLshort
* v
)
4149 save_WindowPos4fMESA(v
[0], v
[1], 0.0F
, 1.0F
);
4152 static void GLAPIENTRY
4153 save_WindowPos3dvMESA(const GLdouble
* v
)
4155 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4158 static void GLAPIENTRY
4159 save_WindowPos3fvMESA(const GLfloat
* v
)
4161 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4164 static void GLAPIENTRY
4165 save_WindowPos3ivMESA(const GLint
* v
)
4167 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1], (GLfloat
) v
[2], 1.0F
);
4170 static void GLAPIENTRY
4171 save_WindowPos3svMESA(const GLshort
* v
)
4173 save_WindowPos4fMESA(v
[0], v
[1], v
[2], 1.0F
);
4176 static void GLAPIENTRY
4177 save_WindowPos4dvMESA(const GLdouble
* v
)
4179 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4180 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4183 static void GLAPIENTRY
4184 save_WindowPos4fvMESA(const GLfloat
* v
)
4186 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4189 static void GLAPIENTRY
4190 save_WindowPos4ivMESA(const GLint
* v
)
4192 save_WindowPos4fMESA((GLfloat
) v
[0], (GLfloat
) v
[1],
4193 (GLfloat
) v
[2], (GLfloat
) v
[3]);
4196 static void GLAPIENTRY
4197 save_WindowPos4svMESA(const GLshort
* v
)
4199 save_WindowPos4fMESA(v
[0], v
[1], v
[2], v
[3]);
4204 /* GL_ARB_multitexture */
4205 static void GLAPIENTRY
4206 save_ActiveTextureARB(GLenum target
)
4208 GET_CURRENT_CONTEXT(ctx
);
4210 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4211 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_TEXTURE
, 1);
4215 if (ctx
->ExecuteFlag
) {
4216 CALL_ActiveTextureARB(ctx
->Exec
, (target
));
4221 /* GL_ARB_transpose_matrix */
4223 static void GLAPIENTRY
4224 save_LoadTransposeMatrixdARB(const GLdouble m
[16])
4227 _math_transposefd(tm
, m
);
4228 save_LoadMatrixf(tm
);
4232 static void GLAPIENTRY
4233 save_LoadTransposeMatrixfARB(const GLfloat m
[16])
4236 _math_transposef(tm
, m
);
4237 save_LoadMatrixf(tm
);
4241 static void GLAPIENTRY
4242 save_MultTransposeMatrixdARB(const GLdouble m
[16])
4245 _math_transposefd(tm
, m
);
4246 save_MultMatrixf(tm
);
4250 static void GLAPIENTRY
4251 save_MultTransposeMatrixfARB(const GLfloat m
[16])
4254 _math_transposef(tm
, m
);
4255 save_MultMatrixf(tm
);
4259 /* GL_ARB_texture_compression */
4260 static void GLAPIENTRY
4261 save_CompressedTexImage1DARB(GLenum target
, GLint level
,
4262 GLenum internalFormat
, GLsizei width
,
4263 GLint border
, GLsizei imageSize
,
4264 const GLvoid
* data
)
4266 GET_CURRENT_CONTEXT(ctx
);
4267 if (target
== GL_PROXY_TEXTURE_1D
) {
4268 /* don't compile, execute immediately */
4269 CALL_CompressedTexImage1DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4270 width
, border
, imageSize
,
4276 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4277 /* make copy of image */
4278 image
= _mesa_malloc(imageSize
);
4280 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage1DARB");
4283 MEMCPY(image
, data
, imageSize
);
4284 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_1D
, 7);
4288 n
[3].e
= internalFormat
;
4289 n
[4].i
= (GLint
) width
;
4297 if (ctx
->ExecuteFlag
) {
4298 CALL_CompressedTexImage1DARB(ctx
->Exec
,
4299 (target
, level
, internalFormat
, width
,
4300 border
, imageSize
, data
));
4306 static void GLAPIENTRY
4307 save_CompressedTexImage2DARB(GLenum target
, GLint level
,
4308 GLenum internalFormat
, GLsizei width
,
4309 GLsizei height
, GLint border
, GLsizei imageSize
,
4310 const GLvoid
* data
)
4312 GET_CURRENT_CONTEXT(ctx
);
4313 if (target
== GL_PROXY_TEXTURE_2D
) {
4314 /* don't compile, execute immediately */
4315 CALL_CompressedTexImage2DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4316 width
, height
, border
,
4322 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4323 /* make copy of image */
4324 image
= _mesa_malloc(imageSize
);
4326 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage2DARB");
4329 MEMCPY(image
, data
, imageSize
);
4330 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_2D
, 8);
4334 n
[3].e
= internalFormat
;
4335 n
[4].i
= (GLint
) width
;
4336 n
[5].i
= (GLint
) height
;
4344 if (ctx
->ExecuteFlag
) {
4345 CALL_CompressedTexImage2DARB(ctx
->Exec
,
4346 (target
, level
, internalFormat
, width
,
4347 height
, border
, imageSize
, data
));
4353 static void GLAPIENTRY
4354 save_CompressedTexImage3DARB(GLenum target
, GLint level
,
4355 GLenum internalFormat
, GLsizei width
,
4356 GLsizei height
, GLsizei depth
, GLint border
,
4357 GLsizei imageSize
, const GLvoid
* data
)
4359 GET_CURRENT_CONTEXT(ctx
);
4360 if (target
== GL_PROXY_TEXTURE_3D
) {
4361 /* don't compile, execute immediately */
4362 CALL_CompressedTexImage3DARB(ctx
->Exec
, (target
, level
, internalFormat
,
4363 width
, height
, depth
, border
,
4369 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4370 /* make copy of image */
4371 image
= _mesa_malloc(imageSize
);
4373 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexImage3DARB");
4376 MEMCPY(image
, data
, imageSize
);
4377 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_IMAGE_3D
, 9);
4381 n
[3].e
= internalFormat
;
4382 n
[4].i
= (GLint
) width
;
4383 n
[5].i
= (GLint
) height
;
4384 n
[6].i
= (GLint
) depth
;
4392 if (ctx
->ExecuteFlag
) {
4393 CALL_CompressedTexImage3DARB(ctx
->Exec
,
4394 (target
, level
, internalFormat
, width
,
4395 height
, depth
, border
, imageSize
,
4402 static void GLAPIENTRY
4403 save_CompressedTexSubImage1DARB(GLenum target
, GLint level
, GLint xoffset
,
4404 GLsizei width
, GLenum format
,
4405 GLsizei imageSize
, const GLvoid
* data
)
4410 GET_CURRENT_CONTEXT(ctx
);
4411 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4413 /* make copy of image */
4414 image
= _mesa_malloc(imageSize
);
4416 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage1DARB");
4419 MEMCPY(image
, data
, imageSize
);
4420 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
, 7);
4425 n
[4].i
= (GLint
) width
;
4433 if (ctx
->ExecuteFlag
) {
4434 CALL_CompressedTexSubImage1DARB(ctx
->Exec
, (target
, level
, xoffset
,
4435 width
, format
, imageSize
,
4441 static void GLAPIENTRY
4442 save_CompressedTexSubImage2DARB(GLenum target
, GLint level
, GLint xoffset
,
4443 GLint yoffset
, GLsizei width
, GLsizei height
,
4444 GLenum format
, GLsizei imageSize
,
4445 const GLvoid
* data
)
4450 GET_CURRENT_CONTEXT(ctx
);
4451 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4453 /* make copy of image */
4454 image
= _mesa_malloc(imageSize
);
4456 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage2DARB");
4459 MEMCPY(image
, data
, imageSize
);
4460 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
, 9);
4466 n
[5].i
= (GLint
) width
;
4467 n
[6].i
= (GLint
) height
;
4475 if (ctx
->ExecuteFlag
) {
4476 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
4477 (target
, level
, xoffset
, yoffset
, width
,
4478 height
, format
, imageSize
, data
));
4483 static void GLAPIENTRY
4484 save_CompressedTexSubImage3DARB(GLenum target
, GLint level
, GLint xoffset
,
4485 GLint yoffset
, GLint zoffset
, GLsizei width
,
4486 GLsizei height
, GLsizei depth
, GLenum format
,
4487 GLsizei imageSize
, const GLvoid
* data
)
4492 GET_CURRENT_CONTEXT(ctx
);
4493 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4495 /* make copy of image */
4496 image
= _mesa_malloc(imageSize
);
4498 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glCompressedTexSubImage3DARB");
4501 MEMCPY(image
, data
, imageSize
);
4502 n
= alloc_instruction(ctx
, OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
, 11);
4509 n
[6].i
= (GLint
) width
;
4510 n
[7].i
= (GLint
) height
;
4511 n
[8].i
= (GLint
) depth
;
4513 n
[10].i
= imageSize
;
4519 if (ctx
->ExecuteFlag
) {
4520 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
4521 (target
, level
, xoffset
, yoffset
,
4522 zoffset
, width
, height
, depth
, format
,
4528 /* GL_ARB_multisample */
4529 static void GLAPIENTRY
4530 save_SampleCoverageARB(GLclampf value
, GLboolean invert
)
4532 GET_CURRENT_CONTEXT(ctx
);
4534 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4535 n
= alloc_instruction(ctx
, OPCODE_SAMPLE_COVERAGE
, 2);
4540 if (ctx
->ExecuteFlag
) {
4541 CALL_SampleCoverageARB(ctx
->Exec
, (value
, invert
));
4547 * GL_NV_vertex_program
4549 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4550 static void GLAPIENTRY
4551 save_BindProgramNV(GLenum target
, GLuint id
)
4553 GET_CURRENT_CONTEXT(ctx
);
4555 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4556 n
= alloc_instruction(ctx
, OPCODE_BIND_PROGRAM_NV
, 2);
4561 if (ctx
->ExecuteFlag
) {
4562 CALL_BindProgramNV(ctx
->Exec
, (target
, id
));
4566 static void GLAPIENTRY
4567 save_ProgramEnvParameter4fARB(GLenum target
, GLuint index
,
4568 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4570 GET_CURRENT_CONTEXT(ctx
);
4572 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4573 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4582 if (ctx
->ExecuteFlag
) {
4583 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4588 static void GLAPIENTRY
4589 save_ProgramEnvParameter4fvARB(GLenum target
, GLuint index
,
4590 const GLfloat
*params
)
4592 save_ProgramEnvParameter4fARB(target
, index
, params
[0], params
[1],
4593 params
[2], params
[3]);
4597 static void GLAPIENTRY
4598 save_ProgramEnvParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4599 const GLfloat
* params
)
4601 GET_CURRENT_CONTEXT(ctx
);
4603 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4607 const GLfloat
* p
= params
;
4609 for (i
= 0 ; i
< count
; i
++) {
4610 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_ENV_PARAMETER_ARB
, 6);
4623 if (ctx
->ExecuteFlag
) {
4624 CALL_ProgramEnvParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4629 static void GLAPIENTRY
4630 save_ProgramEnvParameter4dARB(GLenum target
, GLuint index
,
4631 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4633 save_ProgramEnvParameter4fARB(target
, index
,
4635 (GLfloat
) y
, (GLfloat
) z
, (GLfloat
) w
);
4639 static void GLAPIENTRY
4640 save_ProgramEnvParameter4dvARB(GLenum target
, GLuint index
,
4641 const GLdouble
*params
)
4643 save_ProgramEnvParameter4fARB(target
, index
,
4644 (GLfloat
) params
[0],
4645 (GLfloat
) params
[1],
4646 (GLfloat
) params
[2], (GLfloat
) params
[3]);
4649 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program */
4651 #if FEATURE_NV_vertex_program
4652 static void GLAPIENTRY
4653 save_ExecuteProgramNV(GLenum target
, GLuint id
, const GLfloat
*params
)
4655 GET_CURRENT_CONTEXT(ctx
);
4657 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4658 n
= alloc_instruction(ctx
, OPCODE_EXECUTE_PROGRAM_NV
, 6);
4667 if (ctx
->ExecuteFlag
) {
4668 CALL_ExecuteProgramNV(ctx
->Exec
, (target
, id
, params
));
4673 static void GLAPIENTRY
4674 save_ProgramParameters4dvNV(GLenum target
, GLuint index
,
4675 GLuint num
, const GLdouble
*params
)
4678 for (i
= 0; i
< num
; i
++) {
4679 save_ProgramEnvParameter4dvARB(target
, index
+ i
, params
+ 4 * i
);
4684 static void GLAPIENTRY
4685 save_ProgramParameters4fvNV(GLenum target
, GLuint index
,
4686 GLuint num
, const GLfloat
*params
)
4689 for (i
= 0; i
< num
; i
++) {
4690 save_ProgramEnvParameter4fvARB(target
, index
+ i
, params
+ 4 * i
);
4695 static void GLAPIENTRY
4696 save_LoadProgramNV(GLenum target
, GLuint id
, GLsizei len
,
4697 const GLubyte
* program
)
4699 GET_CURRENT_CONTEXT(ctx
);
4702 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4704 n
= alloc_instruction(ctx
, OPCODE_LOAD_PROGRAM_NV
, 4);
4706 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
4708 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glLoadProgramNV");
4711 _mesa_memcpy(programCopy
, program
, len
);
4715 n
[4].data
= programCopy
;
4717 if (ctx
->ExecuteFlag
) {
4718 CALL_LoadProgramNV(ctx
->Exec
, (target
, id
, len
, program
));
4723 static void GLAPIENTRY
4724 save_RequestResidentProgramsNV(GLsizei num
, const GLuint
* ids
)
4726 GET_CURRENT_CONTEXT(ctx
);
4729 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4731 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 2);
4733 GLuint
*idCopy
= (GLuint
*) _mesa_malloc(num
* sizeof(GLuint
));
4735 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glRequestResidentProgramsNV");
4738 _mesa_memcpy(idCopy
, ids
, num
* sizeof(GLuint
));
4742 if (ctx
->ExecuteFlag
) {
4743 CALL_RequestResidentProgramsNV(ctx
->Exec
, (num
, ids
));
4748 static void GLAPIENTRY
4749 save_TrackMatrixNV(GLenum target
, GLuint address
,
4750 GLenum matrix
, GLenum transform
)
4752 GET_CURRENT_CONTEXT(ctx
);
4754 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4755 n
= alloc_instruction(ctx
, OPCODE_TRACK_MATRIX_NV
, 4);
4762 if (ctx
->ExecuteFlag
) {
4763 CALL_TrackMatrixNV(ctx
->Exec
, (target
, address
, matrix
, transform
));
4766 #endif /* FEATURE_NV_vertex_program */
4770 * GL_NV_fragment_program
4772 #if FEATURE_NV_fragment_program
4773 static void GLAPIENTRY
4774 save_ProgramLocalParameter4fARB(GLenum target
, GLuint index
,
4775 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4777 GET_CURRENT_CONTEXT(ctx
);
4779 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4780 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4789 if (ctx
->ExecuteFlag
) {
4790 CALL_ProgramLocalParameter4fARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4795 static void GLAPIENTRY
4796 save_ProgramLocalParameter4fvARB(GLenum target
, GLuint index
,
4797 const GLfloat
*params
)
4799 GET_CURRENT_CONTEXT(ctx
);
4801 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4802 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4811 if (ctx
->ExecuteFlag
) {
4812 CALL_ProgramLocalParameter4fvARB(ctx
->Exec
, (target
, index
, params
));
4817 static void GLAPIENTRY
4818 save_ProgramLocalParameters4fvEXT(GLenum target
, GLuint index
, GLsizei count
,
4819 const GLfloat
*params
)
4821 GET_CURRENT_CONTEXT(ctx
);
4823 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4827 const GLfloat
* p
= params
;
4829 for (i
= 0 ; i
< count
; i
++) {
4830 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4843 if (ctx
->ExecuteFlag
) {
4844 CALL_ProgramLocalParameters4fvEXT(ctx
->Exec
, (target
, index
, count
, params
));
4849 static void GLAPIENTRY
4850 save_ProgramLocalParameter4dARB(GLenum target
, GLuint index
,
4851 GLdouble x
, GLdouble y
,
4852 GLdouble z
, GLdouble w
)
4854 GET_CURRENT_CONTEXT(ctx
);
4856 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4857 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4861 n
[3].f
= (GLfloat
) x
;
4862 n
[4].f
= (GLfloat
) y
;
4863 n
[5].f
= (GLfloat
) z
;
4864 n
[6].f
= (GLfloat
) w
;
4866 if (ctx
->ExecuteFlag
) {
4867 CALL_ProgramLocalParameter4dARB(ctx
->Exec
, (target
, index
, x
, y
, z
, w
));
4872 static void GLAPIENTRY
4873 save_ProgramLocalParameter4dvARB(GLenum target
, GLuint index
,
4874 const GLdouble
*params
)
4876 GET_CURRENT_CONTEXT(ctx
);
4878 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4879 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
, 6);
4883 n
[3].f
= (GLfloat
) params
[0];
4884 n
[4].f
= (GLfloat
) params
[1];
4885 n
[5].f
= (GLfloat
) params
[2];
4886 n
[6].f
= (GLfloat
) params
[3];
4888 if (ctx
->ExecuteFlag
) {
4889 CALL_ProgramLocalParameter4dvARB(ctx
->Exec
, (target
, index
, params
));
4893 static void GLAPIENTRY
4894 save_ProgramNamedParameter4fNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4895 GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
4897 GET_CURRENT_CONTEXT(ctx
);
4900 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4902 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_NAMED_PARAMETER_NV
, 6);
4904 GLubyte
*nameCopy
= (GLubyte
*) _mesa_malloc(len
);
4906 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramNamedParameter4fNV");
4909 _mesa_memcpy(nameCopy
, name
, len
);
4912 n
[3].data
= nameCopy
;
4918 if (ctx
->ExecuteFlag
) {
4919 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (id
, len
, name
, x
, y
, z
, w
));
4924 static void GLAPIENTRY
4925 save_ProgramNamedParameter4fvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4928 save_ProgramNamedParameter4fNV(id
, len
, name
, v
[0], v
[1], v
[2], v
[3]);
4932 static void GLAPIENTRY
4933 save_ProgramNamedParameter4dNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4934 GLdouble x
, GLdouble y
, GLdouble z
, GLdouble w
)
4936 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) x
, (GLfloat
) y
,
4937 (GLfloat
) z
, (GLfloat
) w
);
4941 static void GLAPIENTRY
4942 save_ProgramNamedParameter4dvNV(GLuint id
, GLsizei len
, const GLubyte
* name
,
4945 save_ProgramNamedParameter4fNV(id
, len
, name
, (GLfloat
) v
[0],
4946 (GLfloat
) v
[1], (GLfloat
) v
[2],
4950 #endif /* FEATURE_NV_fragment_program */
4954 /* GL_EXT_stencil_two_side */
4955 static void GLAPIENTRY
4956 save_ActiveStencilFaceEXT(GLenum face
)
4958 GET_CURRENT_CONTEXT(ctx
);
4960 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4961 n
= alloc_instruction(ctx
, OPCODE_ACTIVE_STENCIL_FACE_EXT
, 1);
4965 if (ctx
->ExecuteFlag
) {
4966 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (face
));
4971 /* GL_EXT_depth_bounds_test */
4972 static void GLAPIENTRY
4973 save_DepthBoundsEXT(GLclampd zmin
, GLclampd zmax
)
4975 GET_CURRENT_CONTEXT(ctx
);
4977 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
4978 n
= alloc_instruction(ctx
, OPCODE_DEPTH_BOUNDS_EXT
, 2);
4980 n
[1].f
= (GLfloat
) zmin
;
4981 n
[2].f
= (GLfloat
) zmax
;
4983 if (ctx
->ExecuteFlag
) {
4984 CALL_DepthBoundsEXT(ctx
->Exec
, (zmin
, zmax
));
4990 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
4992 static void GLAPIENTRY
4993 save_ProgramStringARB(GLenum target
, GLenum format
, GLsizei len
,
4994 const GLvoid
* string
)
4996 GET_CURRENT_CONTEXT(ctx
);
4999 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5001 n
= alloc_instruction(ctx
, OPCODE_PROGRAM_STRING_ARB
, 4);
5003 GLubyte
*programCopy
= (GLubyte
*) _mesa_malloc(len
);
5005 _mesa_error(ctx
, GL_OUT_OF_MEMORY
, "glProgramStringARB");
5008 _mesa_memcpy(programCopy
, string
, len
);
5012 n
[4].data
= programCopy
;
5014 if (ctx
->ExecuteFlag
) {
5015 CALL_ProgramStringARB(ctx
->Exec
, (target
, format
, len
, string
));
5019 #endif /* FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program */
5022 #if FEATURE_queryobj
5024 static void GLAPIENTRY
5025 save_BeginQueryARB(GLenum target
, GLuint id
)
5027 GET_CURRENT_CONTEXT(ctx
);
5029 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5030 n
= alloc_instruction(ctx
, OPCODE_BEGIN_QUERY_ARB
, 2);
5035 if (ctx
->ExecuteFlag
) {
5036 CALL_BeginQueryARB(ctx
->Exec
, (target
, id
));
5041 static void GLAPIENTRY
5042 save_EndQueryARB(GLenum target
)
5044 GET_CURRENT_CONTEXT(ctx
);
5046 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5047 n
= alloc_instruction(ctx
, OPCODE_END_QUERY_ARB
, 1);
5051 if (ctx
->ExecuteFlag
) {
5052 CALL_EndQueryARB(ctx
->Exec
, (target
));
5056 #endif /* FEATURE_queryobj */
5059 static void GLAPIENTRY
5060 save_DrawBuffersARB(GLsizei count
, const GLenum
* buffers
)
5062 GET_CURRENT_CONTEXT(ctx
);
5064 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5065 n
= alloc_instruction(ctx
, OPCODE_DRAW_BUFFERS_ARB
, 1 + MAX_DRAW_BUFFERS
);
5069 if (count
> MAX_DRAW_BUFFERS
)
5070 count
= MAX_DRAW_BUFFERS
;
5071 for (i
= 0; i
< count
; i
++) {
5072 n
[2 + i
].e
= buffers
[i
];
5075 if (ctx
->ExecuteFlag
) {
5076 CALL_DrawBuffersARB(ctx
->Exec
, (count
, buffers
));
5080 static void GLAPIENTRY
5081 save_TexBumpParameterfvATI(GLenum pname
, const GLfloat
*param
)
5083 GET_CURRENT_CONTEXT(ctx
);
5086 n
= alloc_instruction(ctx
, OPCODE_TEX_BUMP_PARAMETER_ATI
, 5);
5094 if (ctx
->ExecuteFlag
) {
5095 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, param
));
5099 static void GLAPIENTRY
5100 save_TexBumpParameterivATI(GLenum pname
, const GLint
*param
)
5103 p
[0] = INT_TO_FLOAT(param
[0]);
5104 p
[1] = INT_TO_FLOAT(param
[1]);
5105 p
[2] = INT_TO_FLOAT(param
[2]);
5106 p
[3] = INT_TO_FLOAT(param
[3]);
5107 save_TexBumpParameterfvATI(pname
, p
);
5110 #if FEATURE_ATI_fragment_shader
5111 static void GLAPIENTRY
5112 save_BindFragmentShaderATI(GLuint id
)
5114 GET_CURRENT_CONTEXT(ctx
);
5117 n
= alloc_instruction(ctx
, OPCODE_BIND_FRAGMENT_SHADER_ATI
, 1);
5121 if (ctx
->ExecuteFlag
) {
5122 CALL_BindFragmentShaderATI(ctx
->Exec
, (id
));
5126 static void GLAPIENTRY
5127 save_SetFragmentShaderConstantATI(GLuint dst
, const GLfloat
*value
)
5129 GET_CURRENT_CONTEXT(ctx
);
5132 n
= alloc_instruction(ctx
, OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
, 5);
5140 if (ctx
->ExecuteFlag
) {
5141 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, value
));
5147 save_Attr1fNV(GLenum attr
, GLfloat x
)
5149 GET_CURRENT_CONTEXT(ctx
);
5151 SAVE_FLUSH_VERTICES(ctx
);
5152 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_NV
, 2);
5158 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5159 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5160 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5162 if (ctx
->ExecuteFlag
) {
5163 CALL_VertexAttrib1fNV(ctx
->Exec
, (attr
, x
));
5168 save_Attr2fNV(GLenum attr
, GLfloat x
, GLfloat y
)
5170 GET_CURRENT_CONTEXT(ctx
);
5172 SAVE_FLUSH_VERTICES(ctx
);
5173 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_NV
, 3);
5180 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5181 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5182 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5184 if (ctx
->ExecuteFlag
) {
5185 CALL_VertexAttrib2fNV(ctx
->Exec
, (attr
, x
, y
));
5190 save_Attr3fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5192 GET_CURRENT_CONTEXT(ctx
);
5194 SAVE_FLUSH_VERTICES(ctx
);
5195 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_NV
, 4);
5203 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5204 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5205 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5207 if (ctx
->ExecuteFlag
) {
5208 CALL_VertexAttrib3fNV(ctx
->Exec
, (attr
, x
, y
, z
));
5213 save_Attr4fNV(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5215 GET_CURRENT_CONTEXT(ctx
);
5217 SAVE_FLUSH_VERTICES(ctx
);
5218 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_NV
, 5);
5227 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5228 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5229 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5231 if (ctx
->ExecuteFlag
) {
5232 CALL_VertexAttrib4fNV(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5238 save_Attr1fARB(GLenum attr
, GLfloat x
)
5240 GET_CURRENT_CONTEXT(ctx
);
5242 SAVE_FLUSH_VERTICES(ctx
);
5243 n
= alloc_instruction(ctx
, OPCODE_ATTR_1F_ARB
, 2);
5249 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5250 ctx
->ListState
.ActiveAttribSize
[attr
] = 1;
5251 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, 0, 0, 1);
5253 if (ctx
->ExecuteFlag
) {
5254 CALL_VertexAttrib1fARB(ctx
->Exec
, (attr
, x
));
5259 save_Attr2fARB(GLenum attr
, GLfloat x
, GLfloat y
)
5261 GET_CURRENT_CONTEXT(ctx
);
5263 SAVE_FLUSH_VERTICES(ctx
);
5264 n
= alloc_instruction(ctx
, OPCODE_ATTR_2F_ARB
, 3);
5271 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5272 ctx
->ListState
.ActiveAttribSize
[attr
] = 2;
5273 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, 0, 1);
5275 if (ctx
->ExecuteFlag
) {
5276 CALL_VertexAttrib2fARB(ctx
->Exec
, (attr
, x
, y
));
5281 save_Attr3fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
)
5283 GET_CURRENT_CONTEXT(ctx
);
5285 SAVE_FLUSH_VERTICES(ctx
);
5286 n
= alloc_instruction(ctx
, OPCODE_ATTR_3F_ARB
, 4);
5294 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5295 ctx
->ListState
.ActiveAttribSize
[attr
] = 3;
5296 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, 1);
5298 if (ctx
->ExecuteFlag
) {
5299 CALL_VertexAttrib3fARB(ctx
->Exec
, (attr
, x
, y
, z
));
5304 save_Attr4fARB(GLenum attr
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5306 GET_CURRENT_CONTEXT(ctx
);
5308 SAVE_FLUSH_VERTICES(ctx
);
5309 n
= alloc_instruction(ctx
, OPCODE_ATTR_4F_ARB
, 5);
5318 ASSERT(attr
< MAX_VERTEX_GENERIC_ATTRIBS
);
5319 ctx
->ListState
.ActiveAttribSize
[attr
] = 4;
5320 ASSIGN_4V(ctx
->ListState
.CurrentAttrib
[attr
], x
, y
, z
, w
);
5322 if (ctx
->ExecuteFlag
) {
5323 CALL_VertexAttrib4fARB(ctx
->Exec
, (attr
, x
, y
, z
, w
));
5328 static void GLAPIENTRY
5329 save_EvalCoord1f(GLfloat x
)
5331 GET_CURRENT_CONTEXT(ctx
);
5333 SAVE_FLUSH_VERTICES(ctx
);
5334 n
= alloc_instruction(ctx
, OPCODE_EVAL_C1
, 1);
5338 if (ctx
->ExecuteFlag
) {
5339 CALL_EvalCoord1f(ctx
->Exec
, (x
));
5343 static void GLAPIENTRY
5344 save_EvalCoord1fv(const GLfloat
* v
)
5346 save_EvalCoord1f(v
[0]);
5349 static void GLAPIENTRY
5350 save_EvalCoord2f(GLfloat x
, GLfloat y
)
5352 GET_CURRENT_CONTEXT(ctx
);
5354 SAVE_FLUSH_VERTICES(ctx
);
5355 n
= alloc_instruction(ctx
, OPCODE_EVAL_C2
, 2);
5360 if (ctx
->ExecuteFlag
) {
5361 CALL_EvalCoord2f(ctx
->Exec
, (x
, y
));
5365 static void GLAPIENTRY
5366 save_EvalCoord2fv(const GLfloat
* v
)
5368 save_EvalCoord2f(v
[0], v
[1]);
5372 static void GLAPIENTRY
5373 save_EvalPoint1(GLint x
)
5375 GET_CURRENT_CONTEXT(ctx
);
5377 SAVE_FLUSH_VERTICES(ctx
);
5378 n
= alloc_instruction(ctx
, OPCODE_EVAL_P1
, 1);
5382 if (ctx
->ExecuteFlag
) {
5383 CALL_EvalPoint1(ctx
->Exec
, (x
));
5387 static void GLAPIENTRY
5388 save_EvalPoint2(GLint x
, GLint y
)
5390 GET_CURRENT_CONTEXT(ctx
);
5392 SAVE_FLUSH_VERTICES(ctx
);
5393 n
= alloc_instruction(ctx
, OPCODE_EVAL_P2
, 2);
5398 if (ctx
->ExecuteFlag
) {
5399 CALL_EvalPoint2(ctx
->Exec
, (x
, y
));
5403 static void GLAPIENTRY
5404 save_Indexf(GLfloat x
)
5406 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, x
);
5409 static void GLAPIENTRY
5410 save_Indexfv(const GLfloat
* v
)
5412 save_Attr1fNV(VERT_ATTRIB_COLOR_INDEX
, v
[0]);
5415 static void GLAPIENTRY
5416 save_EdgeFlag(GLboolean x
)
5418 save_Attr1fNV(VERT_ATTRIB_EDGEFLAG
, x
? (GLfloat
)1.0 : (GLfloat
)0.0);
5421 static INLINE GLboolean
compare4fv( const GLfloat
*a
,
5425 return memcmp( a
, b
, count
* sizeof(GLfloat
) ) == 0;
5429 static void GLAPIENTRY
5430 save_Materialfv(GLenum face
, GLenum pname
, const GLfloat
* param
)
5432 GET_CURRENT_CONTEXT(ctx
);
5440 case GL_FRONT_AND_BACK
:
5443 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(face)");
5452 case GL_AMBIENT_AND_DIFFUSE
:
5458 case GL_COLOR_INDEXES
:
5462 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "material(pname)");
5466 if (ctx
->ExecuteFlag
) {
5467 CALL_Materialfv(ctx
->Exec
, (face
, pname
, param
));
5470 bitmask
= _mesa_material_bitmask(ctx
, face
, pname
, ~0, NULL
);
5472 /* Try to eliminate redundant statechanges. Because it is legal to
5473 * call glMaterial even inside begin/end calls, don't need to worry
5474 * about ctx->Driver.CurrentSavePrimitive here.
5476 for (i
= 0; i
< MAT_ATTRIB_MAX
; i
++) {
5477 if (bitmask
& (1 << i
)) {
5478 if (ctx
->ListState
.ActiveMaterialSize
[i
] == args
&&
5479 compare4fv(ctx
->ListState
.CurrentMaterial
[i
], param
, args
)) {
5480 bitmask
&= ~(1 << i
);
5483 ctx
->ListState
.ActiveMaterialSize
[i
] = args
;
5484 COPY_SZ_4V(ctx
->ListState
.CurrentMaterial
[i
], args
, param
);
5489 /* If this call has effect, return early:
5494 SAVE_FLUSH_VERTICES(ctx
);
5496 n
= alloc_instruction(ctx
, OPCODE_MATERIAL
, 6);
5500 for (i
= 0; i
< args
; i
++)
5501 n
[3 + i
].f
= param
[i
];
5505 static void GLAPIENTRY
5506 save_Begin(GLenum mode
)
5508 GET_CURRENT_CONTEXT(ctx
);
5510 GLboolean error
= GL_FALSE
;
5512 if ( /*mode < GL_POINTS || */ mode
> GL_POLYGON
) {
5513 _mesa_compile_error(ctx
, GL_INVALID_ENUM
, "Begin (mode)");
5516 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_UNKNOWN
) {
5517 /* Typically the first begin. This may raise an error on
5518 * playback, depending on whether CallList is issued from inside
5519 * a begin/end or not.
5521 ctx
->Driver
.CurrentSavePrimitive
= PRIM_INSIDE_UNKNOWN_PRIM
;
5523 else if (ctx
->Driver
.CurrentSavePrimitive
== PRIM_OUTSIDE_BEGIN_END
) {
5524 ctx
->Driver
.CurrentSavePrimitive
= mode
;
5527 _mesa_compile_error(ctx
, GL_INVALID_OPERATION
, "recursive begin");
5532 /* Give the driver an opportunity to hook in an optimized
5533 * display list compiler.
5535 if (ctx
->Driver
.NotifySaveBegin(ctx
, mode
))
5538 SAVE_FLUSH_VERTICES(ctx
);
5539 n
= alloc_instruction(ctx
, OPCODE_BEGIN
, 1);
5545 if (ctx
->ExecuteFlag
) {
5546 CALL_Begin(ctx
->Exec
, (mode
));
5550 static void GLAPIENTRY
5553 GET_CURRENT_CONTEXT(ctx
);
5554 SAVE_FLUSH_VERTICES(ctx
);
5555 (void) alloc_instruction(ctx
, OPCODE_END
, 0);
5556 ctx
->Driver
.CurrentSavePrimitive
= PRIM_OUTSIDE_BEGIN_END
;
5557 if (ctx
->ExecuteFlag
) {
5558 CALL_End(ctx
->Exec
, ());
5562 static void GLAPIENTRY
5563 save_Rectf(GLfloat a
, GLfloat b
, GLfloat c
, GLfloat d
)
5565 GET_CURRENT_CONTEXT(ctx
);
5567 SAVE_FLUSH_VERTICES(ctx
);
5568 n
= alloc_instruction(ctx
, OPCODE_RECTF
, 4);
5575 if (ctx
->ExecuteFlag
) {
5576 CALL_Rectf(ctx
->Exec
, (a
, b
, c
, d
));
5581 static void GLAPIENTRY
5582 save_Vertex2f(GLfloat x
, GLfloat y
)
5584 save_Attr2fNV(VERT_ATTRIB_POS
, x
, y
);
5587 static void GLAPIENTRY
5588 save_Vertex2fv(const GLfloat
* v
)
5590 save_Attr2fNV(VERT_ATTRIB_POS
, v
[0], v
[1]);
5593 static void GLAPIENTRY
5594 save_Vertex3f(GLfloat x
, GLfloat y
, GLfloat z
)
5596 save_Attr3fNV(VERT_ATTRIB_POS
, x
, y
, z
);
5599 static void GLAPIENTRY
5600 save_Vertex3fv(const GLfloat
* v
)
5602 save_Attr3fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2]);
5605 static void GLAPIENTRY
5606 save_Vertex4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5608 save_Attr4fNV(VERT_ATTRIB_POS
, x
, y
, z
, w
);
5611 static void GLAPIENTRY
5612 save_Vertex4fv(const GLfloat
* v
)
5614 save_Attr4fNV(VERT_ATTRIB_POS
, v
[0], v
[1], v
[2], v
[3]);
5617 static void GLAPIENTRY
5618 save_TexCoord1f(GLfloat x
)
5620 save_Attr1fNV(VERT_ATTRIB_TEX0
, x
);
5623 static void GLAPIENTRY
5624 save_TexCoord1fv(const GLfloat
* v
)
5626 save_Attr1fNV(VERT_ATTRIB_TEX0
, v
[0]);
5629 static void GLAPIENTRY
5630 save_TexCoord2f(GLfloat x
, GLfloat y
)
5632 save_Attr2fNV(VERT_ATTRIB_TEX0
, x
, y
);
5635 static void GLAPIENTRY
5636 save_TexCoord2fv(const GLfloat
* v
)
5638 save_Attr2fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1]);
5641 static void GLAPIENTRY
5642 save_TexCoord3f(GLfloat x
, GLfloat y
, GLfloat z
)
5644 save_Attr3fNV(VERT_ATTRIB_TEX0
, x
, y
, z
);
5647 static void GLAPIENTRY
5648 save_TexCoord3fv(const GLfloat
* v
)
5650 save_Attr3fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2]);
5653 static void GLAPIENTRY
5654 save_TexCoord4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5656 save_Attr4fNV(VERT_ATTRIB_TEX0
, x
, y
, z
, w
);
5659 static void GLAPIENTRY
5660 save_TexCoord4fv(const GLfloat
* v
)
5662 save_Attr4fNV(VERT_ATTRIB_TEX0
, v
[0], v
[1], v
[2], v
[3]);
5665 static void GLAPIENTRY
5666 save_Normal3f(GLfloat x
, GLfloat y
, GLfloat z
)
5668 save_Attr3fNV(VERT_ATTRIB_NORMAL
, x
, y
, z
);
5671 static void GLAPIENTRY
5672 save_Normal3fv(const GLfloat
* v
)
5674 save_Attr3fNV(VERT_ATTRIB_NORMAL
, v
[0], v
[1], v
[2]);
5677 static void GLAPIENTRY
5678 save_FogCoordfEXT(GLfloat x
)
5680 save_Attr1fNV(VERT_ATTRIB_FOG
, x
);
5683 static void GLAPIENTRY
5684 save_FogCoordfvEXT(const GLfloat
* v
)
5686 save_Attr1fNV(VERT_ATTRIB_FOG
, v
[0]);
5689 static void GLAPIENTRY
5690 save_Color3f(GLfloat x
, GLfloat y
, GLfloat z
)
5692 save_Attr3fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
);
5695 static void GLAPIENTRY
5696 save_Color3fv(const GLfloat
* v
)
5698 save_Attr3fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2]);
5701 static void GLAPIENTRY
5702 save_Color4f(GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
5704 save_Attr4fNV(VERT_ATTRIB_COLOR0
, x
, y
, z
, w
);
5707 static void GLAPIENTRY
5708 save_Color4fv(const GLfloat
* v
)
5710 save_Attr4fNV(VERT_ATTRIB_COLOR0
, v
[0], v
[1], v
[2], v
[3]);
5713 static void GLAPIENTRY
5714 save_SecondaryColor3fEXT(GLfloat x
, GLfloat y
, GLfloat z
)
5716 save_Attr3fNV(VERT_ATTRIB_COLOR1
, x
, y
, z
);
5719 static void GLAPIENTRY
5720 save_SecondaryColor3fvEXT(const GLfloat
* v
)
5722 save_Attr3fNV(VERT_ATTRIB_COLOR1
, v
[0], v
[1], v
[2]);
5726 /* Just call the respective ATTR for texcoord
5728 static void GLAPIENTRY
5729 save_MultiTexCoord1f(GLenum target
, GLfloat x
)
5731 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5732 save_Attr1fNV(attr
, x
);
5735 static void GLAPIENTRY
5736 save_MultiTexCoord1fv(GLenum target
, const GLfloat
* v
)
5738 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5739 save_Attr1fNV(attr
, v
[0]);
5742 static void GLAPIENTRY
5743 save_MultiTexCoord2f(GLenum target
, GLfloat x
, GLfloat y
)
5745 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5746 save_Attr2fNV(attr
, x
, y
);
5749 static void GLAPIENTRY
5750 save_MultiTexCoord2fv(GLenum target
, const GLfloat
* v
)
5752 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5753 save_Attr2fNV(attr
, v
[0], v
[1]);
5756 static void GLAPIENTRY
5757 save_MultiTexCoord3f(GLenum target
, GLfloat x
, GLfloat y
, GLfloat z
)
5759 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5760 save_Attr3fNV(attr
, x
, y
, z
);
5763 static void GLAPIENTRY
5764 save_MultiTexCoord3fv(GLenum target
, const GLfloat
* v
)
5766 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5767 save_Attr3fNV(attr
, v
[0], v
[1], v
[2]);
5770 static void GLAPIENTRY
5771 save_MultiTexCoord4f(GLenum target
, GLfloat x
, GLfloat y
,
5772 GLfloat z
, GLfloat w
)
5774 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5775 save_Attr4fNV(attr
, x
, y
, z
, w
);
5778 static void GLAPIENTRY
5779 save_MultiTexCoord4fv(GLenum target
, const GLfloat
* v
)
5781 GLuint attr
= (target
& 0x7) + VERT_ATTRIB_TEX0
;
5782 save_Attr4fNV(attr
, v
[0], v
[1], v
[2], v
[3]);
5787 * Record a GL_INVALID_VALUE error when a invalid vertex attribute
5793 GET_CURRENT_CONTEXT(ctx
);
5794 _mesa_error(ctx
, GL_INVALID_VALUE
, "VertexAttribf(index)");
5798 /* First level for NV_vertex_program:
5800 * Check for errors at compile time?.
5802 static void GLAPIENTRY
5803 save_VertexAttrib1fNV(GLuint index
, GLfloat x
)
5805 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5806 save_Attr1fNV(index
, x
);
5811 static void GLAPIENTRY
5812 save_VertexAttrib1fvNV(GLuint index
, const GLfloat
* v
)
5814 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5815 save_Attr1fNV(index
, v
[0]);
5820 static void GLAPIENTRY
5821 save_VertexAttrib2fNV(GLuint index
, GLfloat x
, GLfloat y
)
5823 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5824 save_Attr2fNV(index
, x
, y
);
5829 static void GLAPIENTRY
5830 save_VertexAttrib2fvNV(GLuint index
, const GLfloat
* v
)
5832 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5833 save_Attr2fNV(index
, v
[0], v
[1]);
5838 static void GLAPIENTRY
5839 save_VertexAttrib3fNV(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5841 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5842 save_Attr3fNV(index
, x
, y
, z
);
5847 static void GLAPIENTRY
5848 save_VertexAttrib3fvNV(GLuint index
, const GLfloat
* v
)
5850 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5851 save_Attr3fNV(index
, v
[0], v
[1], v
[2]);
5856 static void GLAPIENTRY
5857 save_VertexAttrib4fNV(GLuint index
, GLfloat x
, GLfloat y
,
5858 GLfloat z
, GLfloat w
)
5860 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5861 save_Attr4fNV(index
, x
, y
, z
, w
);
5866 static void GLAPIENTRY
5867 save_VertexAttrib4fvNV(GLuint index
, const GLfloat
* v
)
5869 if (index
< MAX_NV_VERTEX_PROGRAM_INPUTS
)
5870 save_Attr4fNV(index
, v
[0], v
[1], v
[2], v
[3]);
5878 static void GLAPIENTRY
5879 save_VertexAttrib1fARB(GLuint index
, GLfloat x
)
5881 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5882 save_Attr1fARB(index
, x
);
5887 static void GLAPIENTRY
5888 save_VertexAttrib1fvARB(GLuint index
, const GLfloat
* v
)
5890 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5891 save_Attr1fARB(index
, v
[0]);
5896 static void GLAPIENTRY
5897 save_VertexAttrib2fARB(GLuint index
, GLfloat x
, GLfloat y
)
5899 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5900 save_Attr2fARB(index
, x
, y
);
5905 static void GLAPIENTRY
5906 save_VertexAttrib2fvARB(GLuint index
, const GLfloat
* v
)
5908 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5909 save_Attr2fARB(index
, v
[0], v
[1]);
5914 static void GLAPIENTRY
5915 save_VertexAttrib3fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
)
5917 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5918 save_Attr3fARB(index
, x
, y
, z
);
5923 static void GLAPIENTRY
5924 save_VertexAttrib3fvARB(GLuint index
, const GLfloat
* v
)
5926 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5927 save_Attr3fARB(index
, v
[0], v
[1], v
[2]);
5932 static void GLAPIENTRY
5933 save_VertexAttrib4fARB(GLuint index
, GLfloat x
, GLfloat y
, GLfloat z
,
5936 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5937 save_Attr4fARB(index
, x
, y
, z
, w
);
5942 static void GLAPIENTRY
5943 save_VertexAttrib4fvARB(GLuint index
, const GLfloat
* v
)
5945 if (index
< MAX_VERTEX_GENERIC_ATTRIBS
)
5946 save_Attr4fARB(index
, v
[0], v
[1], v
[2], v
[3]);
5952 /* GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
5954 static void GLAPIENTRY
5955 exec_BindAttribLocationARB(GLuint program
, GLuint index
, const GLchar
*name
)
5957 GET_CURRENT_CONTEXT(ctx
);
5958 FLUSH_VERTICES(ctx
, 0);
5959 CALL_BindAttribLocationARB(ctx
->Exec
, (program
, index
, name
));
5962 static GLint GLAPIENTRY
5963 exec_GetAttribLocationARB(GLuint program
, const GLchar
*name
)
5965 GET_CURRENT_CONTEXT(ctx
);
5966 FLUSH_VERTICES(ctx
, 0);
5967 return CALL_GetAttribLocationARB(ctx
->Exec
, (program
, name
));
5969 /* XXX more shader functions needed here */
5973 #if FEATURE_EXT_framebuffer_blit
5974 static void GLAPIENTRY
5975 save_BlitFramebufferEXT(GLint srcX0
, GLint srcY0
, GLint srcX1
, GLint srcY1
,
5976 GLint dstX0
, GLint dstY0
, GLint dstX1
, GLint dstY1
,
5977 GLbitfield mask
, GLenum filter
)
5979 GET_CURRENT_CONTEXT(ctx
);
5981 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
5982 n
= alloc_instruction(ctx
, OPCODE_BLIT_FRAMEBUFFER
, 10);
5995 if (ctx
->ExecuteFlag
) {
5996 CALL_BlitFramebufferEXT(ctx
->Exec
, (srcX0
, srcY0
, srcX1
, srcY1
,
5997 dstX0
, dstY0
, dstX1
, dstY1
,
6004 /** GL_EXT_provoking_vertex */
6005 static void GLAPIENTRY
6006 save_ProvokingVertexEXT(GLenum mode
)
6008 GET_CURRENT_CONTEXT(ctx
);
6010 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6011 n
= alloc_instruction(ctx
, OPCODE_PROVOKING_VERTEX
, 1);
6015 if (ctx
->ExecuteFlag
) {
6016 /*CALL_ProvokingVertexEXT(ctx->Exec, (mode));*/
6017 _mesa_ProvokingVertexEXT(mode
);
6022 /* aka UseProgram() */
6023 static void GLAPIENTRY
6024 save_UseProgramObjectARB(GLhandleARB program
)
6026 GET_CURRENT_CONTEXT(ctx
);
6028 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6029 n
= alloc_instruction(ctx
, OPCODE_USE_PROGRAM
, 1);
6033 if (ctx
->ExecuteFlag
) {
6034 CALL_UseProgramObjectARB(ctx
->Exec
, (program
));
6039 static void GLAPIENTRY
6040 save_Uniform1fARB(GLint location
, GLfloat x
)
6042 GET_CURRENT_CONTEXT(ctx
);
6044 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6045 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1F
, 2);
6050 if (ctx
->ExecuteFlag
) {
6051 CALL_Uniform1fARB(ctx
->Exec
, (location
, x
));
6056 static void GLAPIENTRY
6057 save_Uniform2fARB(GLint location
, GLfloat x
, GLfloat y
)
6059 GET_CURRENT_CONTEXT(ctx
);
6061 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6062 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2F
, 3);
6068 if (ctx
->ExecuteFlag
) {
6069 CALL_Uniform2fARB(ctx
->Exec
, (location
, x
, y
));
6074 static void GLAPIENTRY
6075 save_Uniform3fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
)
6077 GET_CURRENT_CONTEXT(ctx
);
6079 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6080 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3F
, 4);
6087 if (ctx
->ExecuteFlag
) {
6088 CALL_Uniform3fARB(ctx
->Exec
, (location
, x
, y
, z
));
6093 static void GLAPIENTRY
6094 save_Uniform4fARB(GLint location
, GLfloat x
, GLfloat y
, GLfloat z
, GLfloat w
)
6096 GET_CURRENT_CONTEXT(ctx
);
6098 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6099 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4F
, 5);
6107 if (ctx
->ExecuteFlag
) {
6108 CALL_Uniform4fARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6113 /** Return copy of memory */
6115 memdup(const void *src
, GLsizei bytes
)
6117 void *b
= bytes
>= 0 ? _mesa_malloc(bytes
) : NULL
;
6119 _mesa_memcpy(b
, src
, bytes
);
6124 static void GLAPIENTRY
6125 save_Uniform1fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6127 GET_CURRENT_CONTEXT(ctx
);
6129 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6130 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1FV
, 3);
6134 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLfloat
));
6136 if (ctx
->ExecuteFlag
) {
6137 CALL_Uniform1fvARB(ctx
->Exec
, (location
, count
, v
));
6141 static void GLAPIENTRY
6142 save_Uniform2fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6144 GET_CURRENT_CONTEXT(ctx
);
6146 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6147 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2FV
, 3);
6151 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLfloat
));
6153 if (ctx
->ExecuteFlag
) {
6154 CALL_Uniform2fvARB(ctx
->Exec
, (location
, count
, v
));
6158 static void GLAPIENTRY
6159 save_Uniform3fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6161 GET_CURRENT_CONTEXT(ctx
);
6163 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6164 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3FV
, 3);
6168 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLfloat
));
6170 if (ctx
->ExecuteFlag
) {
6171 CALL_Uniform3fvARB(ctx
->Exec
, (location
, count
, v
));
6175 static void GLAPIENTRY
6176 save_Uniform4fvARB(GLint location
, GLsizei count
, const GLfloat
*v
)
6178 GET_CURRENT_CONTEXT(ctx
);
6180 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6181 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4FV
, 3);
6185 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6187 if (ctx
->ExecuteFlag
) {
6188 CALL_Uniform4fvARB(ctx
->Exec
, (location
, count
, v
));
6193 static void GLAPIENTRY
6194 save_Uniform1iARB(GLint location
, GLint x
)
6196 GET_CURRENT_CONTEXT(ctx
);
6198 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6199 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1I
, 2);
6204 if (ctx
->ExecuteFlag
) {
6205 CALL_Uniform1iARB(ctx
->Exec
, (location
, x
));
6209 static void GLAPIENTRY
6210 save_Uniform2iARB(GLint location
, GLint x
, GLint y
)
6212 GET_CURRENT_CONTEXT(ctx
);
6214 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6215 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2I
, 3);
6221 if (ctx
->ExecuteFlag
) {
6222 CALL_Uniform2iARB(ctx
->Exec
, (location
, x
, y
));
6226 static void GLAPIENTRY
6227 save_Uniform3iARB(GLint location
, GLint x
, GLint y
, GLint z
)
6229 GET_CURRENT_CONTEXT(ctx
);
6231 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6232 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3I
, 4);
6239 if (ctx
->ExecuteFlag
) {
6240 CALL_Uniform3iARB(ctx
->Exec
, (location
, x
, y
, z
));
6244 static void GLAPIENTRY
6245 save_Uniform4iARB(GLint location
, GLint x
, GLint y
, GLint z
, GLint w
)
6247 GET_CURRENT_CONTEXT(ctx
);
6249 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6250 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4I
, 5);
6258 if (ctx
->ExecuteFlag
) {
6259 CALL_Uniform4iARB(ctx
->Exec
, (location
, x
, y
, z
, w
));
6265 static void GLAPIENTRY
6266 save_Uniform1ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6268 GET_CURRENT_CONTEXT(ctx
);
6270 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6271 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_1IV
, 3);
6275 n
[3].data
= memdup(v
, count
* 1 * sizeof(GLint
));
6277 if (ctx
->ExecuteFlag
) {
6278 CALL_Uniform1ivARB(ctx
->Exec
, (location
, count
, v
));
6282 static void GLAPIENTRY
6283 save_Uniform2ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6285 GET_CURRENT_CONTEXT(ctx
);
6287 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6288 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_2IV
, 3);
6292 n
[3].data
= memdup(v
, count
* 2 * sizeof(GLint
));
6294 if (ctx
->ExecuteFlag
) {
6295 CALL_Uniform2ivARB(ctx
->Exec
, (location
, count
, v
));
6299 static void GLAPIENTRY
6300 save_Uniform3ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6302 GET_CURRENT_CONTEXT(ctx
);
6304 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6305 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_3IV
, 3);
6309 n
[3].data
= memdup(v
, count
* 3 * sizeof(GLint
));
6311 if (ctx
->ExecuteFlag
) {
6312 CALL_Uniform3ivARB(ctx
->Exec
, (location
, count
, v
));
6316 static void GLAPIENTRY
6317 save_Uniform4ivARB(GLint location
, GLsizei count
, const GLint
*v
)
6319 GET_CURRENT_CONTEXT(ctx
);
6321 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6322 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_4IV
, 3);
6326 n
[3].data
= memdup(v
, count
* 4 * sizeof(GLfloat
));
6328 if (ctx
->ExecuteFlag
) {
6329 CALL_Uniform4ivARB(ctx
->Exec
, (location
, count
, v
));
6334 static void GLAPIENTRY
6335 save_UniformMatrix2fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6338 GET_CURRENT_CONTEXT(ctx
);
6340 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6341 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX22
, 4);
6346 n
[4].data
= memdup(m
, count
* 2 * 2 * sizeof(GLfloat
));
6348 if (ctx
->ExecuteFlag
) {
6349 CALL_UniformMatrix2fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6353 static void GLAPIENTRY
6354 save_UniformMatrix3fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6357 GET_CURRENT_CONTEXT(ctx
);
6359 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6360 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX33
, 4);
6365 n
[4].data
= memdup(m
, count
* 3 * 3 * sizeof(GLfloat
));
6367 if (ctx
->ExecuteFlag
) {
6368 CALL_UniformMatrix3fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6372 static void GLAPIENTRY
6373 save_UniformMatrix4fvARB(GLint location
, GLsizei count
, GLboolean transpose
,
6376 GET_CURRENT_CONTEXT(ctx
);
6378 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6379 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX44
, 4);
6384 n
[4].data
= memdup(m
, count
* 4 * 4 * sizeof(GLfloat
));
6386 if (ctx
->ExecuteFlag
) {
6387 CALL_UniformMatrix4fvARB(ctx
->Exec
, (location
, count
, transpose
, m
));
6392 static void GLAPIENTRY
6393 save_UniformMatrix2x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6396 GET_CURRENT_CONTEXT(ctx
);
6398 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6399 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX23
, 4);
6404 n
[4].data
= memdup(m
, count
* 2 * 3 * sizeof(GLfloat
));
6406 if (ctx
->ExecuteFlag
) {
6407 CALL_UniformMatrix2x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6411 static void GLAPIENTRY
6412 save_UniformMatrix3x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6415 GET_CURRENT_CONTEXT(ctx
);
6417 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6418 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX32
, 4);
6423 n
[4].data
= memdup(m
, count
* 3 * 2 * sizeof(GLfloat
));
6425 if (ctx
->ExecuteFlag
) {
6426 CALL_UniformMatrix3x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6431 static void GLAPIENTRY
6432 save_UniformMatrix2x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6435 GET_CURRENT_CONTEXT(ctx
);
6437 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6438 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX24
, 4);
6443 n
[4].data
= memdup(m
, count
* 2 * 4 * sizeof(GLfloat
));
6445 if (ctx
->ExecuteFlag
) {
6446 CALL_UniformMatrix2x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6450 static void GLAPIENTRY
6451 save_UniformMatrix4x2fv(GLint location
, GLsizei count
, GLboolean transpose
,
6454 GET_CURRENT_CONTEXT(ctx
);
6456 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6457 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX42
, 4);
6462 n
[4].data
= memdup(m
, count
* 4 * 2 * sizeof(GLfloat
));
6464 if (ctx
->ExecuteFlag
) {
6465 CALL_UniformMatrix4x2fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6470 static void GLAPIENTRY
6471 save_UniformMatrix3x4fv(GLint location
, GLsizei count
, GLboolean transpose
,
6474 GET_CURRENT_CONTEXT(ctx
);
6476 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6477 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX34
, 4);
6482 n
[4].data
= memdup(m
, count
* 3 * 4 * sizeof(GLfloat
));
6484 if (ctx
->ExecuteFlag
) {
6485 CALL_UniformMatrix3x4fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6489 static void GLAPIENTRY
6490 save_UniformMatrix4x3fv(GLint location
, GLsizei count
, GLboolean transpose
,
6493 GET_CURRENT_CONTEXT(ctx
);
6495 ASSERT_OUTSIDE_SAVE_BEGIN_END_AND_FLUSH(ctx
);
6496 n
= alloc_instruction(ctx
, OPCODE_UNIFORM_MATRIX43
, 4);
6501 n
[4].data
= memdup(m
, count
* 4 * 3 * sizeof(GLfloat
));
6503 if (ctx
->ExecuteFlag
) {
6504 CALL_UniformMatrix4x3fv(ctx
->Exec
, (location
, count
, transpose
, m
));
6511 * Save an error-generating command into display list.
6513 * KW: Will appear in the list before the vertex buffer containing the
6514 * command that provoked the error. I don't see this as a problem.
6517 save_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6520 n
= alloc_instruction(ctx
, OPCODE_ERROR
, 2);
6523 n
[2].data
= (void *) s
;
6529 * Compile an error into current display list.
6532 _mesa_compile_error(GLcontext
*ctx
, GLenum error
, const char *s
)
6534 if (ctx
->CompileFlag
)
6535 save_error(ctx
, error
, s
);
6536 if (ctx
->ExecuteFlag
)
6537 _mesa_error(ctx
, error
, s
);
6542 * Test if ID names a display list.
6545 islist(GLcontext
*ctx
, GLuint list
)
6547 if (list
> 0 && lookup_list(ctx
, list
)) {
6557 /**********************************************************************/
6558 /* Display list execution */
6559 /**********************************************************************/
6563 * Execute a display list. Note that the ListBase offset must have already
6564 * been added before calling this function. I.e. the list argument is
6565 * the absolute list number, not relative to ListBase.
6566 * \param list - display list number
6569 execute_list(GLcontext
*ctx
, GLuint list
)
6571 struct gl_display_list
*dlist
;
6575 if (list
== 0 || !islist(ctx
, list
))
6578 if (ctx
->ListState
.CallDepth
== MAX_LIST_NESTING
) {
6579 /* raise an error? */
6583 dlist
= lookup_list(ctx
, list
);
6587 ctx
->ListState
.CallDepth
++;
6589 if (ctx
->Driver
.BeginCallList
)
6590 ctx
->Driver
.BeginCallList(ctx
, dlist
);
6596 const OpCode opcode
= n
[0].opcode
;
6598 if (is_ext_opcode(opcode
)) {
6599 n
+= ext_opcode_execute(ctx
, n
);
6604 _mesa_error(ctx
, n
[1].e
, (const char *) n
[2].data
);
6607 CALL_Accum(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6609 case OPCODE_ALPHA_FUNC
:
6610 CALL_AlphaFunc(ctx
->Exec
, (n
[1].e
, n
[2].f
));
6612 case OPCODE_BIND_TEXTURE
:
6613 CALL_BindTexture(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
6617 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6618 ctx
->Unpack
= ctx
->DefaultPacking
;
6619 CALL_Bitmap(ctx
->Exec
, ((GLsizei
) n
[1].i
, (GLsizei
) n
[2].i
,
6620 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
,
6621 (const GLubyte
*) n
[7].data
));
6622 ctx
->Unpack
= save
; /* restore */
6625 case OPCODE_BLEND_COLOR
:
6626 CALL_BlendColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6628 case OPCODE_BLEND_EQUATION
:
6629 CALL_BlendEquation(ctx
->Exec
, (n
[1].e
));
6631 case OPCODE_BLEND_EQUATION_SEPARATE
:
6632 CALL_BlendEquationSeparateEXT(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6634 case OPCODE_BLEND_FUNC_SEPARATE
:
6635 CALL_BlendFuncSeparateEXT(ctx
->Exec
,
6636 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
6638 case OPCODE_CALL_LIST
:
6639 /* Generated by glCallList(), don't add ListBase */
6640 if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6641 execute_list(ctx
, n
[1].ui
);
6644 case OPCODE_CALL_LIST_OFFSET
:
6645 /* Generated by glCallLists() so we must add ListBase */
6647 /* user specified a bad data type at compile time */
6648 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
6650 else if (ctx
->ListState
.CallDepth
< MAX_LIST_NESTING
) {
6651 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ n
[1].i
);
6652 execute_list(ctx
, list
);
6656 CALL_Clear(ctx
->Exec
, (n
[1].bf
));
6658 case OPCODE_CLEAR_COLOR
:
6659 CALL_ClearColor(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6661 case OPCODE_CLEAR_ACCUM
:
6662 CALL_ClearAccum(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
6664 case OPCODE_CLEAR_DEPTH
:
6665 CALL_ClearDepth(ctx
->Exec
, ((GLclampd
) n
[1].f
));
6667 case OPCODE_CLEAR_INDEX
:
6668 CALL_ClearIndex(ctx
->Exec
, ((GLfloat
) n
[1].ui
));
6670 case OPCODE_CLEAR_STENCIL
:
6671 CALL_ClearStencil(ctx
->Exec
, (n
[1].i
));
6673 case OPCODE_CLIP_PLANE
:
6680 CALL_ClipPlane(ctx
->Exec
, (n
[1].e
, eq
));
6683 case OPCODE_COLOR_MASK
:
6684 CALL_ColorMask(ctx
->Exec
, (n
[1].b
, n
[2].b
, n
[3].b
, n
[4].b
));
6686 case OPCODE_COLOR_MASK_INDEXED
:
6688 CALL_ColorMaskIndexedEXT(ctx->Exec, (n[1].ui, n[2].b, n[3].b,
6692 case OPCODE_COLOR_MATERIAL
:
6693 CALL_ColorMaterial(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6695 case OPCODE_COLOR_TABLE
:
6697 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6698 ctx
->Unpack
= ctx
->DefaultPacking
;
6699 CALL_ColorTable(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].e
,
6700 n
[5].e
, n
[6].data
));
6701 ctx
->Unpack
= save
; /* restore */
6704 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
6711 CALL_ColorTableParameterfv(ctx
->Exec
,
6712 (n
[1].e
, n
[2].e
, params
));
6715 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
6722 CALL_ColorTableParameteriv(ctx
->Exec
,
6723 (n
[1].e
, n
[2].e
, params
));
6726 case OPCODE_COLOR_SUB_TABLE
:
6728 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6729 ctx
->Unpack
= ctx
->DefaultPacking
;
6730 CALL_ColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6731 n
[4].e
, n
[5].e
, n
[6].data
));
6732 ctx
->Unpack
= save
; /* restore */
6735 case OPCODE_CONVOLUTION_FILTER_1D
:
6737 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6738 ctx
->Unpack
= ctx
->DefaultPacking
;
6739 CALL_ConvolutionFilter1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6742 ctx
->Unpack
= save
; /* restore */
6745 case OPCODE_CONVOLUTION_FILTER_2D
:
6747 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6748 ctx
->Unpack
= ctx
->DefaultPacking
;
6749 CALL_ConvolutionFilter2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6750 n
[4].i
, n
[5].e
, n
[6].e
,
6752 ctx
->Unpack
= save
; /* restore */
6755 case OPCODE_CONVOLUTION_PARAMETER_I
:
6756 CALL_ConvolutionParameteri(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].i
));
6758 case OPCODE_CONVOLUTION_PARAMETER_IV
:
6765 CALL_ConvolutionParameteriv(ctx
->Exec
,
6766 (n
[1].e
, n
[2].e
, params
));
6769 case OPCODE_CONVOLUTION_PARAMETER_F
:
6770 CALL_ConvolutionParameterf(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].f
));
6772 case OPCODE_CONVOLUTION_PARAMETER_FV
:
6779 CALL_ConvolutionParameterfv(ctx
->Exec
,
6780 (n
[1].e
, n
[2].e
, params
));
6783 case OPCODE_COPY_COLOR_SUB_TABLE
:
6784 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6785 n
[3].i
, n
[4].i
, n
[5].i
));
6787 case OPCODE_COPY_COLOR_TABLE
:
6788 CALL_CopyColorSubTable(ctx
->Exec
, (n
[1].e
, n
[2].i
,
6789 n
[3].i
, n
[4].i
, n
[5].i
));
6791 case OPCODE_COPY_PIXELS
:
6792 CALL_CopyPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
,
6793 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
,
6796 case OPCODE_COPY_TEX_IMAGE1D
:
6797 CALL_CopyTexImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6798 n
[5].i
, n
[6].i
, n
[7].i
));
6800 case OPCODE_COPY_TEX_IMAGE2D
:
6801 CALL_CopyTexImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].i
,
6802 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
));
6804 case OPCODE_COPY_TEX_SUB_IMAGE1D
:
6805 CALL_CopyTexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6806 n
[4].i
, n
[5].i
, n
[6].i
));
6808 case OPCODE_COPY_TEX_SUB_IMAGE2D
:
6809 CALL_CopyTexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6810 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6813 case OPCODE_COPY_TEX_SUB_IMAGE3D
:
6814 CALL_CopyTexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
6815 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
6818 case OPCODE_CULL_FACE
:
6819 CALL_CullFace(ctx
->Exec
, (n
[1].e
));
6821 case OPCODE_DEPTH_FUNC
:
6822 CALL_DepthFunc(ctx
->Exec
, (n
[1].e
));
6824 case OPCODE_DEPTH_MASK
:
6825 CALL_DepthMask(ctx
->Exec
, (n
[1].b
));
6827 case OPCODE_DEPTH_RANGE
:
6828 CALL_DepthRange(ctx
->Exec
,
6829 ((GLclampd
) n
[1].f
, (GLclampd
) n
[2].f
));
6831 case OPCODE_DISABLE
:
6832 CALL_Disable(ctx
->Exec
, (n
[1].e
));
6834 case OPCODE_DISABLE_INDEXED
:
6835 /*CALL_DisableIndexed(ctx->Exec, (n[1].ui, n[2].e));*/
6837 case OPCODE_DRAW_BUFFER
:
6838 CALL_DrawBuffer(ctx
->Exec
, (n
[1].e
));
6840 case OPCODE_DRAW_PIXELS
:
6842 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
6843 ctx
->Unpack
= ctx
->DefaultPacking
;
6844 CALL_DrawPixels(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].e
, n
[4].e
,
6846 ctx
->Unpack
= save
; /* restore */
6850 CALL_Enable(ctx
->Exec
, (n
[1].e
));
6852 case OPCODE_ENABLE_INDEXED
:
6853 /*CALL_EnableIndexed(ctx->Exec, (n[1].ui, n[2].e));*/
6855 case OPCODE_EVALMESH1
:
6856 CALL_EvalMesh1(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
));
6858 case OPCODE_EVALMESH2
:
6859 CALL_EvalMesh2(ctx
->Exec
,
6860 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
6869 CALL_Fogfv(ctx
->Exec
, (n
[1].e
, p
));
6872 case OPCODE_FRONT_FACE
:
6873 CALL_FrontFace(ctx
->Exec
, (n
[1].e
));
6875 case OPCODE_FRUSTUM
:
6876 CALL_Frustum(ctx
->Exec
,
6877 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6880 CALL_Hint(ctx
->Exec
, (n
[1].e
, n
[2].e
));
6882 case OPCODE_HISTOGRAM
:
6883 CALL_Histogram(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
, n
[4].b
));
6885 case OPCODE_INDEX_MASK
:
6886 CALL_IndexMask(ctx
->Exec
, (n
[1].ui
));
6888 case OPCODE_INIT_NAMES
:
6889 CALL_InitNames(ctx
->Exec
, ());
6898 CALL_Lightfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, p
));
6901 case OPCODE_LIGHT_MODEL
:
6908 CALL_LightModelfv(ctx
->Exec
, (n
[1].e
, p
));
6911 case OPCODE_LINE_STIPPLE
:
6912 CALL_LineStipple(ctx
->Exec
, (n
[1].i
, n
[2].us
));
6914 case OPCODE_LINE_WIDTH
:
6915 CALL_LineWidth(ctx
->Exec
, (n
[1].f
));
6917 case OPCODE_LIST_BASE
:
6918 CALL_ListBase(ctx
->Exec
, (n
[1].ui
));
6920 case OPCODE_LOAD_IDENTITY
:
6921 CALL_LoadIdentity(ctx
->Exec
, ());
6923 case OPCODE_LOAD_MATRIX
:
6924 if (sizeof(Node
) == sizeof(GLfloat
)) {
6925 CALL_LoadMatrixf(ctx
->Exec
, (&n
[1].f
));
6930 for (i
= 0; i
< 16; i
++) {
6933 CALL_LoadMatrixf(ctx
->Exec
, (m
));
6936 case OPCODE_LOAD_NAME
:
6937 CALL_LoadName(ctx
->Exec
, (n
[1].ui
));
6939 case OPCODE_LOGIC_OP
:
6940 CALL_LogicOp(ctx
->Exec
, (n
[1].e
));
6944 GLenum target
= n
[1].e
;
6945 GLint ustride
= _mesa_evaluator_components(target
);
6946 GLint uorder
= n
[5].i
;
6947 GLfloat u1
= n
[2].f
;
6948 GLfloat u2
= n
[3].f
;
6949 CALL_Map1f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6950 (GLfloat
*) n
[6].data
));
6955 GLenum target
= n
[1].e
;
6956 GLfloat u1
= n
[2].f
;
6957 GLfloat u2
= n
[3].f
;
6958 GLfloat v1
= n
[4].f
;
6959 GLfloat v2
= n
[5].f
;
6960 GLint ustride
= n
[6].i
;
6961 GLint vstride
= n
[7].i
;
6962 GLint uorder
= n
[8].i
;
6963 GLint vorder
= n
[9].i
;
6964 CALL_Map2f(ctx
->Exec
, (target
, u1
, u2
, ustride
, uorder
,
6965 v1
, v2
, vstride
, vorder
,
6966 (GLfloat
*) n
[10].data
));
6969 case OPCODE_MAPGRID1
:
6970 CALL_MapGrid1f(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
6972 case OPCODE_MAPGRID2
:
6973 CALL_MapGrid2f(ctx
->Exec
,
6974 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
));
6976 case OPCODE_MATRIX_MODE
:
6977 CALL_MatrixMode(ctx
->Exec
, (n
[1].e
));
6979 case OPCODE_MIN_MAX
:
6980 CALL_Minmax(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].b
));
6982 case OPCODE_MULT_MATRIX
:
6983 if (sizeof(Node
) == sizeof(GLfloat
)) {
6984 CALL_MultMatrixf(ctx
->Exec
, (&n
[1].f
));
6989 for (i
= 0; i
< 16; i
++) {
6992 CALL_MultMatrixf(ctx
->Exec
, (m
));
6996 CALL_Ortho(ctx
->Exec
,
6997 (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
));
6999 case OPCODE_PASSTHROUGH
:
7000 CALL_PassThrough(ctx
->Exec
, (n
[1].f
));
7002 case OPCODE_PIXEL_MAP
:
7003 CALL_PixelMapfv(ctx
->Exec
,
7004 (n
[1].e
, n
[2].i
, (GLfloat
*) n
[3].data
));
7006 case OPCODE_PIXEL_TRANSFER
:
7007 CALL_PixelTransferf(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7009 case OPCODE_PIXEL_ZOOM
:
7010 CALL_PixelZoom(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7012 case OPCODE_POINT_SIZE
:
7013 CALL_PointSize(ctx
->Exec
, (n
[1].f
));
7015 case OPCODE_POINT_PARAMETERS
:
7021 CALL_PointParameterfvEXT(ctx
->Exec
, (n
[1].e
, params
));
7024 case OPCODE_POLYGON_MODE
:
7025 CALL_PolygonMode(ctx
->Exec
, (n
[1].e
, n
[2].e
));
7027 case OPCODE_POLYGON_STIPPLE
:
7029 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7030 ctx
->Unpack
= ctx
->DefaultPacking
;
7031 CALL_PolygonStipple(ctx
->Exec
, ((GLubyte
*) n
[1].data
));
7032 ctx
->Unpack
= save
; /* restore */
7035 case OPCODE_POLYGON_OFFSET
:
7036 CALL_PolygonOffset(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7038 case OPCODE_POP_ATTRIB
:
7039 CALL_PopAttrib(ctx
->Exec
, ());
7041 case OPCODE_POP_MATRIX
:
7042 CALL_PopMatrix(ctx
->Exec
, ());
7044 case OPCODE_POP_NAME
:
7045 CALL_PopName(ctx
->Exec
, ());
7047 case OPCODE_PRIORITIZE_TEXTURE
:
7048 CALL_PrioritizeTextures(ctx
->Exec
, (1, &n
[1].ui
, &n
[2].f
));
7050 case OPCODE_PUSH_ATTRIB
:
7051 CALL_PushAttrib(ctx
->Exec
, (n
[1].bf
));
7053 case OPCODE_PUSH_MATRIX
:
7054 CALL_PushMatrix(ctx
->Exec
, ());
7056 case OPCODE_PUSH_NAME
:
7057 CALL_PushName(ctx
->Exec
, (n
[1].ui
));
7059 case OPCODE_RASTER_POS
:
7060 CALL_RasterPos4f(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7062 case OPCODE_READ_BUFFER
:
7063 CALL_ReadBuffer(ctx
->Exec
, (n
[1].e
));
7065 case OPCODE_RESET_HISTOGRAM
:
7066 CALL_ResetHistogram(ctx
->Exec
, (n
[1].e
));
7068 case OPCODE_RESET_MIN_MAX
:
7069 CALL_ResetMinmax(ctx
->Exec
, (n
[1].e
));
7072 CALL_Rotatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7075 CALL_Scalef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7077 case OPCODE_SCISSOR
:
7078 CALL_Scissor(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7080 case OPCODE_SHADE_MODEL
:
7081 CALL_ShadeModel(ctx
->Exec
, (n
[1].e
));
7083 case OPCODE_PROVOKING_VERTEX
:
7084 CALL_ProvokingVertexEXT(ctx
->Exec
, (n
[1].e
));
7086 case OPCODE_STENCIL_FUNC
:
7087 CALL_StencilFunc(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].ui
));
7089 case OPCODE_STENCIL_MASK
:
7090 CALL_StencilMask(ctx
->Exec
, (n
[1].ui
));
7092 case OPCODE_STENCIL_OP
:
7093 CALL_StencilOp(ctx
->Exec
, (n
[1].e
, n
[2].e
, n
[3].e
));
7095 case OPCODE_STENCIL_FUNC_SEPARATE
:
7096 CALL_StencilFuncSeparate(ctx
->Exec
,
7097 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].ui
));
7099 case OPCODE_STENCIL_MASK_SEPARATE
:
7100 CALL_StencilMaskSeparate(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7102 case OPCODE_STENCIL_OP_SEPARATE
:
7103 CALL_StencilOpSeparate(ctx
->Exec
,
7104 (n
[1].e
, n
[2].e
, n
[3].e
, n
[4].e
));
7113 CALL_TexEnvfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7123 CALL_TexGenfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7126 case OPCODE_TEXPARAMETER
:
7133 CALL_TexParameterfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, params
));
7136 case OPCODE_TEX_IMAGE1D
:
7138 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7139 ctx
->Unpack
= ctx
->DefaultPacking
;
7140 CALL_TexImage1D(ctx
->Exec
, (n
[1].e
, /* target */
7142 n
[3].i
, /* components */
7144 n
[5].e
, /* border */
7145 n
[6].e
, /* format */
7148 ctx
->Unpack
= save
; /* restore */
7151 case OPCODE_TEX_IMAGE2D
:
7153 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7154 ctx
->Unpack
= ctx
->DefaultPacking
;
7155 CALL_TexImage2D(ctx
->Exec
, (n
[1].e
, /* target */
7157 n
[3].i
, /* components */
7159 n
[5].i
, /* height */
7160 n
[6].e
, /* border */
7161 n
[7].e
, /* format */
7164 ctx
->Unpack
= save
; /* restore */
7167 case OPCODE_TEX_IMAGE3D
:
7169 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7170 ctx
->Unpack
= ctx
->DefaultPacking
;
7171 CALL_TexImage3D(ctx
->Exec
, (n
[1].e
, /* target */
7173 n
[3].i
, /* components */
7175 n
[5].i
, /* height */
7177 n
[7].e
, /* border */
7178 n
[8].e
, /* format */
7181 ctx
->Unpack
= save
; /* restore */
7184 case OPCODE_TEX_SUB_IMAGE1D
:
7186 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7187 ctx
->Unpack
= ctx
->DefaultPacking
;
7188 CALL_TexSubImage1D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7190 n
[6].e
, n
[7].data
));
7191 ctx
->Unpack
= save
; /* restore */
7194 case OPCODE_TEX_SUB_IMAGE2D
:
7196 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7197 ctx
->Unpack
= ctx
->DefaultPacking
;
7198 CALL_TexSubImage2D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7200 n
[6].i
, n
[7].e
, n
[8].e
,
7202 ctx
->Unpack
= save
; /* restore */
7205 case OPCODE_TEX_SUB_IMAGE3D
:
7207 const struct gl_pixelstore_attrib save
= ctx
->Unpack
;
7208 ctx
->Unpack
= ctx
->DefaultPacking
;
7209 CALL_TexSubImage3D(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].i
,
7210 n
[4].i
, n
[5].i
, n
[6].i
, n
[7].i
,
7211 n
[8].i
, n
[9].e
, n
[10].e
,
7213 ctx
->Unpack
= save
; /* restore */
7216 case OPCODE_TRANSLATE
:
7217 CALL_Translatef(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7219 case OPCODE_VIEWPORT
:
7220 CALL_Viewport(ctx
->Exec
, (n
[1].i
, n
[2].i
,
7221 (GLsizei
) n
[3].i
, (GLsizei
) n
[4].i
));
7223 case OPCODE_WINDOW_POS
:
7224 CALL_WindowPos4fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7226 case OPCODE_ACTIVE_TEXTURE
: /* GL_ARB_multitexture */
7227 CALL_ActiveTextureARB(ctx
->Exec
, (n
[1].e
));
7229 case OPCODE_COMPRESSED_TEX_IMAGE_1D
: /* GL_ARB_texture_compression */
7230 CALL_CompressedTexImage1DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7231 n
[4].i
, n
[5].i
, n
[6].i
,
7234 case OPCODE_COMPRESSED_TEX_IMAGE_2D
: /* GL_ARB_texture_compression */
7235 CALL_CompressedTexImage2DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7236 n
[4].i
, n
[5].i
, n
[6].i
,
7237 n
[7].i
, n
[8].data
));
7239 case OPCODE_COMPRESSED_TEX_IMAGE_3D
: /* GL_ARB_texture_compression */
7240 CALL_CompressedTexImage3DARB(ctx
->Exec
, (n
[1].e
, n
[2].i
, n
[3].e
,
7241 n
[4].i
, n
[5].i
, n
[6].i
,
7245 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_1D
: /* GL_ARB_texture_compress */
7246 CALL_CompressedTexSubImage1DARB(ctx
->Exec
,
7247 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7248 n
[5].e
, n
[6].i
, n
[7].data
));
7250 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_2D
: /* GL_ARB_texture_compress */
7251 CALL_CompressedTexSubImage2DARB(ctx
->Exec
,
7252 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7253 n
[5].i
, n
[6].i
, n
[7].e
, n
[8].i
,
7256 case OPCODE_COMPRESSED_TEX_SUB_IMAGE_3D
: /* GL_ARB_texture_compress */
7257 CALL_CompressedTexSubImage3DARB(ctx
->Exec
,
7258 (n
[1].e
, n
[2].i
, n
[3].i
, n
[4].i
,
7259 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7260 n
[9].e
, n
[10].i
, n
[11].data
));
7262 case OPCODE_SAMPLE_COVERAGE
: /* GL_ARB_multisample */
7263 CALL_SampleCoverageARB(ctx
->Exec
, (n
[1].f
, n
[2].b
));
7265 case OPCODE_WINDOW_POS_ARB
: /* GL_ARB_window_pos */
7266 CALL_WindowPos3fMESA(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
));
7268 #if FEATURE_NV_vertex_program || FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7269 case OPCODE_BIND_PROGRAM_NV
: /* GL_NV_vertex_program */
7270 CALL_BindProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7273 #if FEATURE_NV_vertex_program
7274 case OPCODE_EXECUTE_PROGRAM_NV
:
7281 CALL_ExecuteProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, v
));
7284 case OPCODE_REQUEST_RESIDENT_PROGRAMS_NV
:
7285 CALL_RequestResidentProgramsNV(ctx
->Exec
, (n
[1].ui
,
7286 (GLuint
*) n
[2].data
));
7288 case OPCODE_LOAD_PROGRAM_NV
:
7289 CALL_LoadProgramNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].i
,
7290 (const GLubyte
*) n
[4].data
));
7292 case OPCODE_TRACK_MATRIX_NV
:
7293 CALL_TrackMatrixNV(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].e
, n
[4].e
));
7297 #if FEATURE_NV_fragment_program
7298 case OPCODE_PROGRAM_LOCAL_PARAMETER_ARB
:
7299 CALL_ProgramLocalParameter4fARB(ctx
->Exec
,
7300 (n
[1].e
, n
[2].ui
, n
[3].f
, n
[4].f
,
7303 case OPCODE_PROGRAM_NAMED_PARAMETER_NV
:
7304 CALL_ProgramNamedParameter4fNV(ctx
->Exec
, (n
[1].ui
, n
[2].i
,
7305 (const GLubyte
*) n
[3].
7306 data
, n
[4].f
, n
[5].f
,
7311 case OPCODE_ACTIVE_STENCIL_FACE_EXT
:
7312 CALL_ActiveStencilFaceEXT(ctx
->Exec
, (n
[1].e
));
7314 case OPCODE_DEPTH_BOUNDS_EXT
:
7315 CALL_DepthBoundsEXT(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7317 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
7318 case OPCODE_PROGRAM_STRING_ARB
:
7319 CALL_ProgramStringARB(ctx
->Exec
,
7320 (n
[1].e
, n
[2].e
, n
[3].i
, n
[4].data
));
7323 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program || FEATURE_NV_vertex_program
7324 case OPCODE_PROGRAM_ENV_PARAMETER_ARB
:
7325 CALL_ProgramEnvParameter4fARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
, n
[3].f
,
7330 #if FEATURE_queryobj
7331 case OPCODE_BEGIN_QUERY_ARB
:
7332 CALL_BeginQueryARB(ctx
->Exec
, (n
[1].e
, n
[2].ui
));
7334 case OPCODE_END_QUERY_ARB
:
7335 CALL_EndQueryARB(ctx
->Exec
, (n
[1].e
));
7338 case OPCODE_DRAW_BUFFERS_ARB
:
7340 GLenum buffers
[MAX_DRAW_BUFFERS
];
7341 GLint i
, count
= MIN2(n
[1].i
, MAX_DRAW_BUFFERS
);
7342 for (i
= 0; i
< count
; i
++)
7343 buffers
[i
] = n
[2 + i
].e
;
7344 CALL_DrawBuffersARB(ctx
->Exec
, (n
[1].i
, buffers
));
7347 #if FEATURE_EXT_framebuffer_blit
7348 case OPCODE_BLIT_FRAMEBUFFER
:
7349 CALL_BlitFramebufferEXT(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
,
7350 n
[5].i
, n
[6].i
, n
[7].i
, n
[8].i
,
7355 case OPCODE_USE_PROGRAM
:
7356 CALL_UseProgramObjectARB(ctx
->Exec
, (n
[1].ui
));
7358 case OPCODE_UNIFORM_1F
:
7359 CALL_Uniform1fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
));
7361 case OPCODE_UNIFORM_2F
:
7362 CALL_Uniform2fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
));
7364 case OPCODE_UNIFORM_3F
:
7365 CALL_Uniform3fARB(ctx
->Exec
, (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
));
7367 case OPCODE_UNIFORM_4F
:
7368 CALL_Uniform4fARB(ctx
->Exec
,
7369 (n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
));
7371 case OPCODE_UNIFORM_1FV
:
7372 CALL_Uniform1fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7374 case OPCODE_UNIFORM_2FV
:
7375 CALL_Uniform2fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7377 case OPCODE_UNIFORM_3FV
:
7378 CALL_Uniform3fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7380 case OPCODE_UNIFORM_4FV
:
7381 CALL_Uniform4fvARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7383 case OPCODE_UNIFORM_1I
:
7384 CALL_Uniform1iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7386 case OPCODE_UNIFORM_2I
:
7387 CALL_Uniform2iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
));
7389 case OPCODE_UNIFORM_3I
:
7390 CALL_Uniform3iARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
));
7392 case OPCODE_UNIFORM_4I
:
7393 CALL_Uniform4iARB(ctx
->Exec
,
7394 (n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
, n
[5].i
));
7396 case OPCODE_UNIFORM_1IV
:
7397 CALL_Uniform1ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7399 case OPCODE_UNIFORM_2IV
:
7400 CALL_Uniform2ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7402 case OPCODE_UNIFORM_3IV
:
7403 CALL_Uniform3ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7405 case OPCODE_UNIFORM_4IV
:
7406 CALL_Uniform4ivARB(ctx
->Exec
, (n
[1].i
, n
[2].i
, n
[3].data
));
7409 case OPCODE_UNIFORM_MATRIX22
:
7410 CALL_UniformMatrix2fvARB(ctx
->Exec
,
7411 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7413 case OPCODE_UNIFORM_MATRIX33
:
7414 CALL_UniformMatrix3fvARB(ctx
->Exec
,
7415 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7417 case OPCODE_UNIFORM_MATRIX44
:
7418 CALL_UniformMatrix4fvARB(ctx
->Exec
,
7419 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7421 case OPCODE_UNIFORM_MATRIX23
:
7422 CALL_UniformMatrix2x3fv(ctx
->Exec
,
7423 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7425 case OPCODE_UNIFORM_MATRIX32
:
7426 CALL_UniformMatrix3x2fv(ctx
->Exec
,
7427 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7429 case OPCODE_UNIFORM_MATRIX24
:
7430 CALL_UniformMatrix2x4fv(ctx
->Exec
,
7431 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7433 case OPCODE_UNIFORM_MATRIX42
:
7434 CALL_UniformMatrix4x2fv(ctx
->Exec
,
7435 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7437 case OPCODE_UNIFORM_MATRIX34
:
7438 CALL_UniformMatrix3x4fv(ctx
->Exec
,
7439 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7441 case OPCODE_UNIFORM_MATRIX43
:
7442 CALL_UniformMatrix4x3fv(ctx
->Exec
,
7443 (n
[1].i
, n
[2].i
, n
[3].b
, n
[4].data
));
7446 case OPCODE_TEX_BUMP_PARAMETER_ATI
:
7449 GLuint i
, pname
= n
[1].ui
;
7451 for (i
= 0; i
< 4; i
++)
7452 values
[i
] = n
[1 + i
].f
;
7453 CALL_TexBumpParameterfvATI(ctx
->Exec
, (pname
, values
));
7456 #if FEATURE_ATI_fragment_shader
7457 case OPCODE_BIND_FRAGMENT_SHADER_ATI
:
7458 CALL_BindFragmentShaderATI(ctx
->Exec
, (n
[1].i
));
7460 case OPCODE_SET_FRAGMENT_SHADER_CONSTANTS_ATI
:
7463 GLuint i
, dst
= n
[1].ui
;
7465 for (i
= 0; i
< 4; i
++)
7466 values
[i
] = n
[1 + i
].f
;
7467 CALL_SetFragmentShaderConstantATI(ctx
->Exec
, (dst
, values
));
7471 case OPCODE_ATTR_1F_NV
:
7472 CALL_VertexAttrib1fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7474 case OPCODE_ATTR_2F_NV
:
7475 /* Really shouldn't have to do this - the Node structure
7476 * is convenient, but it would be better to store the data
7477 * packed appropriately so that it can be sent directly
7478 * on. With x86_64 becoming common, this will start to
7481 if (sizeof(Node
) == sizeof(GLfloat
))
7482 CALL_VertexAttrib2fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7484 CALL_VertexAttrib2fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7486 case OPCODE_ATTR_3F_NV
:
7487 if (sizeof(Node
) == sizeof(GLfloat
))
7488 CALL_VertexAttrib3fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7490 CALL_VertexAttrib3fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7493 case OPCODE_ATTR_4F_NV
:
7494 if (sizeof(Node
) == sizeof(GLfloat
))
7495 CALL_VertexAttrib4fvNV(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7497 CALL_VertexAttrib4fNV(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7500 case OPCODE_ATTR_1F_ARB
:
7501 CALL_VertexAttrib1fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
));
7503 case OPCODE_ATTR_2F_ARB
:
7504 /* Really shouldn't have to do this - the Node structure
7505 * is convenient, but it would be better to store the data
7506 * packed appropriately so that it can be sent directly
7507 * on. With x86_64 becoming common, this will start to
7510 if (sizeof(Node
) == sizeof(GLfloat
))
7511 CALL_VertexAttrib2fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7513 CALL_VertexAttrib2fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
));
7515 case OPCODE_ATTR_3F_ARB
:
7516 if (sizeof(Node
) == sizeof(GLfloat
))
7517 CALL_VertexAttrib3fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7519 CALL_VertexAttrib3fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7522 case OPCODE_ATTR_4F_ARB
:
7523 if (sizeof(Node
) == sizeof(GLfloat
))
7524 CALL_VertexAttrib4fvARB(ctx
->Exec
, (n
[1].e
, &n
[2].f
));
7526 CALL_VertexAttrib4fARB(ctx
->Exec
, (n
[1].e
, n
[2].f
, n
[3].f
,
7529 case OPCODE_MATERIAL
:
7530 if (sizeof(Node
) == sizeof(GLfloat
))
7531 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, &n
[3].f
));
7538 CALL_Materialfv(ctx
->Exec
, (n
[1].e
, n
[2].e
, f
));
7542 CALL_Begin(ctx
->Exec
, (n
[1].e
));
7545 CALL_End(ctx
->Exec
, ());
7548 CALL_Rectf(ctx
->Exec
, (n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
));
7550 case OPCODE_EVAL_C1
:
7551 CALL_EvalCoord1f(ctx
->Exec
, (n
[1].f
));
7553 case OPCODE_EVAL_C2
:
7554 CALL_EvalCoord2f(ctx
->Exec
, (n
[1].f
, n
[2].f
));
7556 case OPCODE_EVAL_P1
:
7557 CALL_EvalPoint1(ctx
->Exec
, (n
[1].i
));
7559 case OPCODE_EVAL_P2
:
7560 CALL_EvalPoint2(ctx
->Exec
, (n
[1].i
, n
[2].i
));
7563 case OPCODE_CONTINUE
:
7564 n
= (Node
*) n
[1].next
;
7566 case OPCODE_END_OF_LIST
:
7572 _mesa_sprintf(msg
, "Error in execute_list: opcode=%d",
7574 _mesa_problem(ctx
, msg
);
7579 /* increment n to point to next compiled command */
7580 if (opcode
!= OPCODE_CONTINUE
) {
7581 n
+= InstSize
[opcode
];
7586 if (ctx
->Driver
.EndCallList
)
7587 ctx
->Driver
.EndCallList(ctx
);
7589 ctx
->ListState
.CallDepth
--;
7594 /**********************************************************************/
7596 /**********************************************************************/
7599 * Test if a display list number is valid.
7601 static GLboolean GLAPIENTRY
7602 _mesa_IsList(GLuint list
)
7604 GET_CURRENT_CONTEXT(ctx
);
7605 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7606 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, GL_FALSE
);
7607 return islist(ctx
, list
);
7612 * Delete a sequence of consecutive display lists.
7614 static void GLAPIENTRY
7615 _mesa_DeleteLists(GLuint list
, GLsizei range
)
7617 GET_CURRENT_CONTEXT(ctx
);
7619 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7620 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7623 _mesa_error(ctx
, GL_INVALID_VALUE
, "glDeleteLists");
7626 for (i
= list
; i
< list
+ range
; i
++) {
7627 destroy_list(ctx
, i
);
7633 * Return a display list number, n, such that lists n through n+range-1
7636 static GLuint GLAPIENTRY
7637 _mesa_GenLists(GLsizei range
)
7639 GET_CURRENT_CONTEXT(ctx
);
7641 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7642 ASSERT_OUTSIDE_BEGIN_END_WITH_RETVAL(ctx
, 0);
7645 _mesa_error(ctx
, GL_INVALID_VALUE
, "glGenLists");
7653 * Make this an atomic operation
7655 _glthread_LOCK_MUTEX(ctx
->Shared
->Mutex
);
7657 base
= _mesa_HashFindFreeKeyBlock(ctx
->Shared
->DisplayList
, range
);
7659 /* reserve the list IDs by with empty/dummy lists */
7661 for (i
= 0; i
< range
; i
++) {
7662 _mesa_HashInsert(ctx
->Shared
->DisplayList
, base
+ i
,
7663 make_list(base
+ i
, 1));
7667 _glthread_UNLOCK_MUTEX(ctx
->Shared
->Mutex
);
7674 * Begin a new display list.
7676 static void GLAPIENTRY
7677 _mesa_NewList(GLuint name
, GLenum mode
)
7679 GET_CURRENT_CONTEXT(ctx
);
7681 FLUSH_CURRENT(ctx
, 0); /* must be called before assert */
7682 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7684 if (MESA_VERBOSE
& VERBOSE_API
)
7685 _mesa_debug(ctx
, "glNewList %u %s\n", name
,
7686 _mesa_lookup_enum_by_nr(mode
));
7689 _mesa_error(ctx
, GL_INVALID_VALUE
, "glNewList");
7693 if (mode
!= GL_COMPILE
&& mode
!= GL_COMPILE_AND_EXECUTE
) {
7694 _mesa_error(ctx
, GL_INVALID_ENUM
, "glNewList");
7698 if (ctx
->ListState
.CurrentList
) {
7699 /* already compiling a display list */
7700 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glNewList");
7704 ctx
->CompileFlag
= GL_TRUE
;
7705 ctx
->ExecuteFlag
= (mode
== GL_COMPILE_AND_EXECUTE
);
7707 /* Reset acumulated list state:
7709 invalidate_saved_current_state( ctx
);
7711 /* Allocate new display list */
7712 ctx
->ListState
.CurrentList
= make_list(name
, BLOCK_SIZE
);
7713 ctx
->ListState
.CurrentBlock
= ctx
->ListState
.CurrentList
->Head
;
7714 ctx
->ListState
.CurrentPos
= 0;
7716 ctx
->Driver
.NewList(ctx
, name
, mode
);
7718 ctx
->CurrentDispatch
= ctx
->Save
;
7719 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7724 * End definition of current display list.
7726 static void GLAPIENTRY
7729 GET_CURRENT_CONTEXT(ctx
);
7730 SAVE_FLUSH_VERTICES(ctx
);
7731 ASSERT_OUTSIDE_BEGIN_END_AND_FLUSH(ctx
);
7733 if (MESA_VERBOSE
& VERBOSE_API
)
7734 _mesa_debug(ctx
, "glEndList\n");
7736 /* Check that a list is under construction */
7737 if (!ctx
->ListState
.CurrentList
) {
7738 _mesa_error(ctx
, GL_INVALID_OPERATION
, "glEndList");
7742 /* Call before emitting END_OF_LIST, in case the driver wants to
7743 * emit opcodes itself.
7745 ctx
->Driver
.EndList(ctx
);
7747 (void) alloc_instruction(ctx
, OPCODE_END_OF_LIST
, 0);
7749 /* Destroy old list, if any */
7750 destroy_list(ctx
, ctx
->ListState
.CurrentList
->Name
);
7752 /* Install the new list */
7753 _mesa_HashInsert(ctx
->Shared
->DisplayList
,
7754 ctx
->ListState
.CurrentList
->Name
,
7755 ctx
->ListState
.CurrentList
);
7758 if (MESA_VERBOSE
& VERBOSE_DISPLAY_LIST
)
7759 mesa_print_display_list(ctx
->ListState
.CurrentList
->Name
);
7761 ctx
->ListState
.CurrentList
= NULL
;
7762 ctx
->ExecuteFlag
= GL_TRUE
;
7763 ctx
->CompileFlag
= GL_FALSE
;
7765 ctx
->CurrentDispatch
= ctx
->Exec
;
7766 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7771 _mesa_CallList(GLuint list
)
7773 GLboolean save_compile_flag
;
7774 GET_CURRENT_CONTEXT(ctx
);
7775 FLUSH_CURRENT(ctx
, 0);
7776 /* VERY IMPORTANT: Save the CompileFlag status, turn it off, */
7777 /* execute the display list, and restore the CompileFlag. */
7779 if (MESA_VERBOSE
& VERBOSE_API
)
7780 _mesa_debug(ctx
, "glCallList %d\n", list
);
7783 _mesa_error(ctx
, GL_INVALID_VALUE
, "glCallList(list==0)");
7787 /* mesa_print_display_list( list ); */
7789 save_compile_flag
= ctx
->CompileFlag
;
7790 if (save_compile_flag
) {
7791 ctx
->CompileFlag
= GL_FALSE
;
7794 execute_list(ctx
, list
);
7795 ctx
->CompileFlag
= save_compile_flag
;
7797 /* also restore API function pointers to point to "save" versions */
7798 if (save_compile_flag
) {
7799 ctx
->CurrentDispatch
= ctx
->Save
;
7800 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7806 * Execute glCallLists: call multiple display lists.
7809 _mesa_CallLists(GLsizei n
, GLenum type
, const GLvoid
* lists
)
7811 GET_CURRENT_CONTEXT(ctx
);
7813 GLboolean save_compile_flag
;
7815 if (MESA_VERBOSE
& VERBOSE_API
)
7816 _mesa_debug(ctx
, "glCallLists %d\n", n
);
7820 case GL_UNSIGNED_BYTE
:
7822 case GL_UNSIGNED_SHORT
:
7824 case GL_UNSIGNED_INT
:
7832 _mesa_error(ctx
, GL_INVALID_ENUM
, "glCallLists(type)");
7836 /* Save the CompileFlag status, turn it off, execute display list,
7837 * and restore the CompileFlag.
7839 save_compile_flag
= ctx
->CompileFlag
;
7840 ctx
->CompileFlag
= GL_FALSE
;
7842 for (i
= 0; i
< n
; i
++) {
7843 GLuint list
= (GLuint
) (ctx
->List
.ListBase
+ translate_id(i
, type
, lists
));
7844 execute_list(ctx
, list
);
7847 ctx
->CompileFlag
= save_compile_flag
;
7849 /* also restore API function pointers to point to "save" versions */
7850 if (save_compile_flag
) {
7851 ctx
->CurrentDispatch
= ctx
->Save
;
7852 _glapi_set_dispatch(ctx
->CurrentDispatch
);
7858 * Set the offset added to list numbers in glCallLists.
7860 static void GLAPIENTRY
7861 _mesa_ListBase(GLuint base
)
7863 GET_CURRENT_CONTEXT(ctx
);
7864 FLUSH_VERTICES(ctx
, 0); /* must be called before assert */
7865 ASSERT_OUTSIDE_BEGIN_END(ctx
);
7866 ctx
->List
.ListBase
= base
;
7870 /* Can no longer assume ctx->Exec->Func is equal to _mesa_Func.
7872 static void GLAPIENTRY
7875 GET_CURRENT_CONTEXT(ctx
);
7876 FLUSH_VERTICES(ctx
, 0);
7877 CALL_Finish(ctx
->Exec
, ());
7880 static void GLAPIENTRY
7883 GET_CURRENT_CONTEXT(ctx
);
7884 FLUSH_VERTICES(ctx
, 0);
7885 CALL_Flush(ctx
->Exec
, ());
7888 static void GLAPIENTRY
7889 exec_GetBooleanv(GLenum pname
, GLboolean
*params
)
7891 GET_CURRENT_CONTEXT(ctx
);
7892 FLUSH_VERTICES(ctx
, 0);
7893 CALL_GetBooleanv(ctx
->Exec
, (pname
, params
));
7896 static void GLAPIENTRY
7897 exec_GetClipPlane(GLenum plane
, GLdouble
* equation
)
7899 GET_CURRENT_CONTEXT(ctx
);
7900 FLUSH_VERTICES(ctx
, 0);
7901 CALL_GetClipPlane(ctx
->Exec
, (plane
, equation
));
7904 static void GLAPIENTRY
7905 exec_GetDoublev(GLenum pname
, GLdouble
*params
)
7907 GET_CURRENT_CONTEXT(ctx
);
7908 FLUSH_VERTICES(ctx
, 0);
7909 CALL_GetDoublev(ctx
->Exec
, (pname
, params
));
7912 static GLenum GLAPIENTRY
7915 GET_CURRENT_CONTEXT(ctx
);
7916 FLUSH_VERTICES(ctx
, 0);
7917 return CALL_GetError(ctx
->Exec
, ());
7920 static void GLAPIENTRY
7921 exec_GetFloatv(GLenum pname
, GLfloat
*params
)
7923 GET_CURRENT_CONTEXT(ctx
);
7924 FLUSH_VERTICES(ctx
, 0);
7925 CALL_GetFloatv(ctx
->Exec
, (pname
, params
));
7928 static void GLAPIENTRY
7929 exec_GetIntegerv(GLenum pname
, GLint
*params
)
7931 GET_CURRENT_CONTEXT(ctx
);
7932 FLUSH_VERTICES(ctx
, 0);
7933 CALL_GetIntegerv(ctx
->Exec
, (pname
, params
));
7936 static void GLAPIENTRY
7937 exec_GetLightfv(GLenum light
, GLenum pname
, GLfloat
*params
)
7939 GET_CURRENT_CONTEXT(ctx
);
7940 FLUSH_VERTICES(ctx
, 0);
7941 CALL_GetLightfv(ctx
->Exec
, (light
, pname
, params
));
7944 static void GLAPIENTRY
7945 exec_GetLightiv(GLenum light
, GLenum pname
, GLint
*params
)
7947 GET_CURRENT_CONTEXT(ctx
);
7948 FLUSH_VERTICES(ctx
, 0);
7949 CALL_GetLightiv(ctx
->Exec
, (light
, pname
, params
));
7952 static void GLAPIENTRY
7953 exec_GetMapdv(GLenum target
, GLenum query
, GLdouble
* v
)
7955 GET_CURRENT_CONTEXT(ctx
);
7956 FLUSH_VERTICES(ctx
, 0);
7957 CALL_GetMapdv(ctx
->Exec
, (target
, query
, v
));
7960 static void GLAPIENTRY
7961 exec_GetMapfv(GLenum target
, GLenum query
, GLfloat
* v
)
7963 GET_CURRENT_CONTEXT(ctx
);
7964 FLUSH_VERTICES(ctx
, 0);
7965 CALL_GetMapfv(ctx
->Exec
, (target
, query
, v
));
7968 static void GLAPIENTRY
7969 exec_GetMapiv(GLenum target
, GLenum query
, GLint
* v
)
7971 GET_CURRENT_CONTEXT(ctx
);
7972 FLUSH_VERTICES(ctx
, 0);
7973 CALL_GetMapiv(ctx
->Exec
, (target
, query
, v
));
7976 static void GLAPIENTRY
7977 exec_GetMaterialfv(GLenum face
, GLenum pname
, GLfloat
*params
)
7979 GET_CURRENT_CONTEXT(ctx
);
7980 FLUSH_VERTICES(ctx
, 0);
7981 CALL_GetMaterialfv(ctx
->Exec
, (face
, pname
, params
));
7984 static void GLAPIENTRY
7985 exec_GetMaterialiv(GLenum face
, GLenum pname
, GLint
*params
)
7987 GET_CURRENT_CONTEXT(ctx
);
7988 FLUSH_VERTICES(ctx
, 0);
7989 CALL_GetMaterialiv(ctx
->Exec
, (face
, pname
, params
));
7992 static void GLAPIENTRY
7993 exec_GetPixelMapfv(GLenum map
, GLfloat
*values
)
7995 GET_CURRENT_CONTEXT(ctx
);
7996 FLUSH_VERTICES(ctx
, 0);
7997 CALL_GetPixelMapfv(ctx
->Exec
, (map
, values
));
8000 static void GLAPIENTRY
8001 exec_GetPixelMapuiv(GLenum map
, GLuint
*values
)
8003 GET_CURRENT_CONTEXT(ctx
);
8004 FLUSH_VERTICES(ctx
, 0);
8005 CALL_GetPixelMapuiv(ctx
->Exec
, (map
, values
));
8008 static void GLAPIENTRY
8009 exec_GetPixelMapusv(GLenum map
, GLushort
*values
)
8011 GET_CURRENT_CONTEXT(ctx
);
8012 FLUSH_VERTICES(ctx
, 0);
8013 CALL_GetPixelMapusv(ctx
->Exec
, (map
, values
));
8016 static void GLAPIENTRY
8017 exec_GetPolygonStipple(GLubyte
* dest
)
8019 GET_CURRENT_CONTEXT(ctx
);
8020 FLUSH_VERTICES(ctx
, 0);
8021 CALL_GetPolygonStipple(ctx
->Exec
, (dest
));
8024 static const GLubyte
*GLAPIENTRY
8025 exec_GetString(GLenum name
)
8027 GET_CURRENT_CONTEXT(ctx
);
8028 FLUSH_VERTICES(ctx
, 0);
8029 return CALL_GetString(ctx
->Exec
, (name
));
8032 static void GLAPIENTRY
8033 exec_GetTexEnvfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8035 GET_CURRENT_CONTEXT(ctx
);
8036 FLUSH_VERTICES(ctx
, 0);
8037 CALL_GetTexEnvfv(ctx
->Exec
, (target
, pname
, params
));
8040 static void GLAPIENTRY
8041 exec_GetTexEnviv(GLenum target
, GLenum pname
, GLint
*params
)
8043 GET_CURRENT_CONTEXT(ctx
);
8044 FLUSH_VERTICES(ctx
, 0);
8045 CALL_GetTexEnviv(ctx
->Exec
, (target
, pname
, params
));
8048 static void GLAPIENTRY
8049 exec_GetTexGendv(GLenum coord
, GLenum pname
, GLdouble
*params
)
8051 GET_CURRENT_CONTEXT(ctx
);
8052 FLUSH_VERTICES(ctx
, 0);
8053 CALL_GetTexGendv(ctx
->Exec
, (coord
, pname
, params
));
8056 static void GLAPIENTRY
8057 exec_GetTexGenfv(GLenum coord
, GLenum pname
, GLfloat
*params
)
8059 GET_CURRENT_CONTEXT(ctx
);
8060 FLUSH_VERTICES(ctx
, 0);
8061 CALL_GetTexGenfv(ctx
->Exec
, (coord
, pname
, params
));
8064 static void GLAPIENTRY
8065 exec_GetTexGeniv(GLenum coord
, GLenum pname
, GLint
*params
)
8067 GET_CURRENT_CONTEXT(ctx
);
8068 FLUSH_VERTICES(ctx
, 0);
8069 CALL_GetTexGeniv(ctx
->Exec
, (coord
, pname
, params
));
8072 static void GLAPIENTRY
8073 exec_GetTexImage(GLenum target
, GLint level
, GLenum format
,
8074 GLenum type
, GLvoid
* pixels
)
8076 GET_CURRENT_CONTEXT(ctx
);
8077 FLUSH_VERTICES(ctx
, 0);
8078 CALL_GetTexImage(ctx
->Exec
, (target
, level
, format
, type
, pixels
));
8081 static void GLAPIENTRY
8082 exec_GetTexLevelParameterfv(GLenum target
, GLint level
,
8083 GLenum pname
, GLfloat
*params
)
8085 GET_CURRENT_CONTEXT(ctx
);
8086 FLUSH_VERTICES(ctx
, 0);
8087 CALL_GetTexLevelParameterfv(ctx
->Exec
, (target
, level
, pname
, params
));
8090 static void GLAPIENTRY
8091 exec_GetTexLevelParameteriv(GLenum target
, GLint level
,
8092 GLenum pname
, GLint
*params
)
8094 GET_CURRENT_CONTEXT(ctx
);
8095 FLUSH_VERTICES(ctx
, 0);
8096 CALL_GetTexLevelParameteriv(ctx
->Exec
, (target
, level
, pname
, params
));
8099 static void GLAPIENTRY
8100 exec_GetTexParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8102 GET_CURRENT_CONTEXT(ctx
);
8103 FLUSH_VERTICES(ctx
, 0);
8104 CALL_GetTexParameterfv(ctx
->Exec
, (target
, pname
, params
));
8107 static void GLAPIENTRY
8108 exec_GetTexParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8110 GET_CURRENT_CONTEXT(ctx
);
8111 FLUSH_VERTICES(ctx
, 0);
8112 CALL_GetTexParameteriv(ctx
->Exec
, (target
, pname
, params
));
8115 static GLboolean GLAPIENTRY
8116 exec_IsEnabled(GLenum cap
)
8118 GET_CURRENT_CONTEXT(ctx
);
8119 FLUSH_VERTICES(ctx
, 0);
8120 return CALL_IsEnabled(ctx
->Exec
, (cap
));
8123 static void GLAPIENTRY
8124 exec_PixelStoref(GLenum pname
, GLfloat param
)
8126 GET_CURRENT_CONTEXT(ctx
);
8127 FLUSH_VERTICES(ctx
, 0);
8128 CALL_PixelStoref(ctx
->Exec
, (pname
, param
));
8131 static void GLAPIENTRY
8132 exec_PixelStorei(GLenum pname
, GLint param
)
8134 GET_CURRENT_CONTEXT(ctx
);
8135 FLUSH_VERTICES(ctx
, 0);
8136 CALL_PixelStorei(ctx
->Exec
, (pname
, param
));
8139 static void GLAPIENTRY
8140 exec_ReadPixels(GLint x
, GLint y
, GLsizei width
, GLsizei height
,
8141 GLenum format
, GLenum type
, GLvoid
* pixels
)
8143 GET_CURRENT_CONTEXT(ctx
);
8144 FLUSH_VERTICES(ctx
, 0);
8145 CALL_ReadPixels(ctx
->Exec
, (x
, y
, width
, height
, format
, type
, pixels
));
8148 static GLint GLAPIENTRY
8149 exec_RenderMode(GLenum mode
)
8151 GET_CURRENT_CONTEXT(ctx
);
8152 FLUSH_VERTICES(ctx
, 0);
8153 return CALL_RenderMode(ctx
->Exec
, (mode
));
8156 static void GLAPIENTRY
8157 exec_FeedbackBuffer(GLsizei size
, GLenum type
, GLfloat
* buffer
)
8159 GET_CURRENT_CONTEXT(ctx
);
8160 FLUSH_VERTICES(ctx
, 0);
8161 CALL_FeedbackBuffer(ctx
->Exec
, (size
, type
, buffer
));
8164 static void GLAPIENTRY
8165 exec_SelectBuffer(GLsizei size
, GLuint
* buffer
)
8167 GET_CURRENT_CONTEXT(ctx
);
8168 FLUSH_VERTICES(ctx
, 0);
8169 CALL_SelectBuffer(ctx
->Exec
, (size
, buffer
));
8172 static GLboolean GLAPIENTRY
8173 exec_AreTexturesResident(GLsizei n
, const GLuint
* texName
,
8174 GLboolean
* residences
)
8176 GET_CURRENT_CONTEXT(ctx
);
8177 FLUSH_VERTICES(ctx
, 0);
8178 return CALL_AreTexturesResident(ctx
->Exec
, (n
, texName
, residences
));
8181 static void GLAPIENTRY
8182 exec_ColorPointer(GLint size
, GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8184 GET_CURRENT_CONTEXT(ctx
);
8185 FLUSH_VERTICES(ctx
, 0);
8186 CALL_ColorPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8189 static void GLAPIENTRY
8190 exec_DeleteTextures(GLsizei n
, const GLuint
* texName
)
8192 GET_CURRENT_CONTEXT(ctx
);
8193 FLUSH_VERTICES(ctx
, 0);
8194 CALL_DeleteTextures(ctx
->Exec
, (n
, texName
));
8197 static void GLAPIENTRY
8198 exec_DisableClientState(GLenum cap
)
8200 GET_CURRENT_CONTEXT(ctx
);
8201 FLUSH_VERTICES(ctx
, 0);
8202 CALL_DisableClientState(ctx
->Exec
, (cap
));
8205 static void GLAPIENTRY
8206 exec_EdgeFlagPointer(GLsizei stride
, const GLvoid
* vptr
)
8208 GET_CURRENT_CONTEXT(ctx
);
8209 FLUSH_VERTICES(ctx
, 0);
8210 CALL_EdgeFlagPointer(ctx
->Exec
, (stride
, vptr
));
8213 static void GLAPIENTRY
8214 exec_EnableClientState(GLenum cap
)
8216 GET_CURRENT_CONTEXT(ctx
);
8217 FLUSH_VERTICES(ctx
, 0);
8218 CALL_EnableClientState(ctx
->Exec
, (cap
));
8221 static void GLAPIENTRY
8222 exec_GenTextures(GLsizei n
, GLuint
* texName
)
8224 GET_CURRENT_CONTEXT(ctx
);
8225 FLUSH_VERTICES(ctx
, 0);
8226 CALL_GenTextures(ctx
->Exec
, (n
, texName
));
8229 static void GLAPIENTRY
8230 exec_GetPointerv(GLenum pname
, GLvoid
**params
)
8232 GET_CURRENT_CONTEXT(ctx
);
8233 FLUSH_VERTICES(ctx
, 0);
8234 CALL_GetPointerv(ctx
->Exec
, (pname
, params
));
8237 static void GLAPIENTRY
8238 exec_IndexPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8240 GET_CURRENT_CONTEXT(ctx
);
8241 FLUSH_VERTICES(ctx
, 0);
8242 CALL_IndexPointer(ctx
->Exec
, (type
, stride
, ptr
));
8245 static void GLAPIENTRY
8246 exec_InterleavedArrays(GLenum format
, GLsizei stride
, const GLvoid
* pointer
)
8248 GET_CURRENT_CONTEXT(ctx
);
8249 FLUSH_VERTICES(ctx
, 0);
8250 CALL_InterleavedArrays(ctx
->Exec
, (format
, stride
, pointer
));
8253 static GLboolean GLAPIENTRY
8254 exec_IsTexture(GLuint texture
)
8256 GET_CURRENT_CONTEXT(ctx
);
8257 FLUSH_VERTICES(ctx
, 0);
8258 return CALL_IsTexture(ctx
->Exec
, (texture
));
8261 static void GLAPIENTRY
8262 exec_NormalPointer(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8264 GET_CURRENT_CONTEXT(ctx
);
8265 FLUSH_VERTICES(ctx
, 0);
8266 CALL_NormalPointer(ctx
->Exec
, (type
, stride
, ptr
));
8269 static void GLAPIENTRY
8270 exec_PopClientAttrib(void)
8272 GET_CURRENT_CONTEXT(ctx
);
8273 FLUSH_VERTICES(ctx
, 0);
8274 CALL_PopClientAttrib(ctx
->Exec
, ());
8277 static void GLAPIENTRY
8278 exec_PushClientAttrib(GLbitfield mask
)
8280 GET_CURRENT_CONTEXT(ctx
);
8281 FLUSH_VERTICES(ctx
, 0);
8282 CALL_PushClientAttrib(ctx
->Exec
, (mask
));
8285 static void GLAPIENTRY
8286 exec_TexCoordPointer(GLint size
, GLenum type
, GLsizei stride
,
8289 GET_CURRENT_CONTEXT(ctx
);
8290 FLUSH_VERTICES(ctx
, 0);
8291 CALL_TexCoordPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8294 static void GLAPIENTRY
8295 exec_GetCompressedTexImageARB(GLenum target
, GLint level
, GLvoid
* img
)
8297 GET_CURRENT_CONTEXT(ctx
);
8298 FLUSH_VERTICES(ctx
, 0);
8299 CALL_GetCompressedTexImageARB(ctx
->Exec
, (target
, level
, img
));
8302 static void GLAPIENTRY
8303 exec_VertexPointer(GLint size
, GLenum type
, GLsizei stride
,
8306 GET_CURRENT_CONTEXT(ctx
);
8307 FLUSH_VERTICES(ctx
, 0);
8308 CALL_VertexPointer(ctx
->Exec
, (size
, type
, stride
, ptr
));
8311 static void GLAPIENTRY
8312 exec_CopyConvolutionFilter1D(GLenum target
, GLenum internalFormat
,
8313 GLint x
, GLint y
, GLsizei width
)
8315 GET_CURRENT_CONTEXT(ctx
);
8316 FLUSH_VERTICES(ctx
, 0);
8317 CALL_CopyConvolutionFilter1D(ctx
->Exec
,
8318 (target
, internalFormat
, x
, y
, width
));
8321 static void GLAPIENTRY
8322 exec_CopyConvolutionFilter2D(GLenum target
, GLenum internalFormat
,
8323 GLint x
, GLint y
, GLsizei width
, GLsizei height
)
8325 GET_CURRENT_CONTEXT(ctx
);
8326 FLUSH_VERTICES(ctx
, 0);
8327 CALL_CopyConvolutionFilter2D(ctx
->Exec
,
8328 (target
, internalFormat
, x
, y
, width
,
8332 static void GLAPIENTRY
8333 exec_GetColorTable(GLenum target
, GLenum format
, GLenum type
, GLvoid
* data
)
8335 GET_CURRENT_CONTEXT(ctx
);
8336 FLUSH_VERTICES(ctx
, 0);
8337 CALL_GetColorTable(ctx
->Exec
, (target
, format
, type
, data
));
8340 static void GLAPIENTRY
8341 exec_GetColorTableParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8343 GET_CURRENT_CONTEXT(ctx
);
8344 FLUSH_VERTICES(ctx
, 0);
8345 CALL_GetColorTableParameterfv(ctx
->Exec
, (target
, pname
, params
));
8348 static void GLAPIENTRY
8349 exec_GetColorTableParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8351 GET_CURRENT_CONTEXT(ctx
);
8352 FLUSH_VERTICES(ctx
, 0);
8353 CALL_GetColorTableParameteriv(ctx
->Exec
, (target
, pname
, params
));
8356 static void GLAPIENTRY
8357 exec_GetConvolutionFilter(GLenum target
, GLenum format
, GLenum type
,
8360 GET_CURRENT_CONTEXT(ctx
);
8361 FLUSH_VERTICES(ctx
, 0);
8362 CALL_GetConvolutionFilter(ctx
->Exec
, (target
, format
, type
, image
));
8365 static void GLAPIENTRY
8366 exec_GetConvolutionParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8368 GET_CURRENT_CONTEXT(ctx
);
8369 FLUSH_VERTICES(ctx
, 0);
8370 CALL_GetConvolutionParameterfv(ctx
->Exec
, (target
, pname
, params
));
8373 static void GLAPIENTRY
8374 exec_GetConvolutionParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8376 GET_CURRENT_CONTEXT(ctx
);
8377 FLUSH_VERTICES(ctx
, 0);
8378 CALL_GetConvolutionParameteriv(ctx
->Exec
, (target
, pname
, params
));
8381 static void GLAPIENTRY
8382 exec_GetHistogram(GLenum target
, GLboolean reset
, GLenum format
,
8383 GLenum type
, GLvoid
*values
)
8385 GET_CURRENT_CONTEXT(ctx
);
8386 FLUSH_VERTICES(ctx
, 0);
8387 CALL_GetHistogram(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8390 static void GLAPIENTRY
8391 exec_GetHistogramParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8393 GET_CURRENT_CONTEXT(ctx
);
8394 FLUSH_VERTICES(ctx
, 0);
8395 CALL_GetHistogramParameterfv(ctx
->Exec
, (target
, pname
, params
));
8398 static void GLAPIENTRY
8399 exec_GetHistogramParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8401 GET_CURRENT_CONTEXT(ctx
);
8402 FLUSH_VERTICES(ctx
, 0);
8403 CALL_GetHistogramParameteriv(ctx
->Exec
, (target
, pname
, params
));
8406 static void GLAPIENTRY
8407 exec_GetMinmax(GLenum target
, GLboolean reset
, GLenum format
,
8408 GLenum type
, GLvoid
*values
)
8410 GET_CURRENT_CONTEXT(ctx
);
8411 FLUSH_VERTICES(ctx
, 0);
8412 CALL_GetMinmax(ctx
->Exec
, (target
, reset
, format
, type
, values
));
8415 static void GLAPIENTRY
8416 exec_GetMinmaxParameterfv(GLenum target
, GLenum pname
, GLfloat
*params
)
8418 GET_CURRENT_CONTEXT(ctx
);
8419 FLUSH_VERTICES(ctx
, 0);
8420 CALL_GetMinmaxParameterfv(ctx
->Exec
, (target
, pname
, params
));
8423 static void GLAPIENTRY
8424 exec_GetMinmaxParameteriv(GLenum target
, GLenum pname
, GLint
*params
)
8426 GET_CURRENT_CONTEXT(ctx
);
8427 FLUSH_VERTICES(ctx
, 0);
8428 CALL_GetMinmaxParameteriv(ctx
->Exec
, (target
, pname
, params
));
8431 static void GLAPIENTRY
8432 exec_GetSeparableFilter(GLenum target
, GLenum format
, GLenum type
,
8433 GLvoid
*row
, GLvoid
*column
, GLvoid
*span
)
8435 GET_CURRENT_CONTEXT(ctx
);
8436 FLUSH_VERTICES(ctx
, 0);
8437 CALL_GetSeparableFilter(ctx
->Exec
,
8438 (target
, format
, type
, row
, column
, span
));
8441 static void GLAPIENTRY
8442 exec_SeparableFilter2D(GLenum target
, GLenum internalFormat
,
8443 GLsizei width
, GLsizei height
, GLenum format
,
8444 GLenum type
, const GLvoid
*row
, const GLvoid
*column
)
8446 GET_CURRENT_CONTEXT(ctx
);
8447 FLUSH_VERTICES(ctx
, 0);
8448 CALL_SeparableFilter2D(ctx
->Exec
,
8449 (target
, internalFormat
, width
, height
, format
,
8450 type
, row
, column
));
8453 static void GLAPIENTRY
8454 exec_ColorPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8455 GLsizei count
, const GLvoid
*ptr
)
8457 GET_CURRENT_CONTEXT(ctx
);
8458 FLUSH_VERTICES(ctx
, 0);
8459 CALL_ColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8462 static void GLAPIENTRY
8463 exec_EdgeFlagPointerEXT(GLsizei stride
, GLsizei count
, const GLboolean
*ptr
)
8465 GET_CURRENT_CONTEXT(ctx
);
8466 FLUSH_VERTICES(ctx
, 0);
8467 CALL_EdgeFlagPointerEXT(ctx
->Exec
, (stride
, count
, ptr
));
8470 static void GLAPIENTRY
8471 exec_IndexPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8474 GET_CURRENT_CONTEXT(ctx
);
8475 FLUSH_VERTICES(ctx
, 0);
8476 CALL_IndexPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8479 static void GLAPIENTRY
8480 exec_NormalPointerEXT(GLenum type
, GLsizei stride
, GLsizei count
,
8483 GET_CURRENT_CONTEXT(ctx
);
8484 FLUSH_VERTICES(ctx
, 0);
8485 CALL_NormalPointerEXT(ctx
->Exec
, (type
, stride
, count
, ptr
));
8488 static void GLAPIENTRY
8489 exec_TexCoordPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8490 GLsizei count
, const GLvoid
*ptr
)
8492 GET_CURRENT_CONTEXT(ctx
);
8493 FLUSH_VERTICES(ctx
, 0);
8494 CALL_TexCoordPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8497 static void GLAPIENTRY
8498 exec_VertexPointerEXT(GLint size
, GLenum type
, GLsizei stride
,
8499 GLsizei count
, const GLvoid
*ptr
)
8501 GET_CURRENT_CONTEXT(ctx
);
8502 FLUSH_VERTICES(ctx
, 0);
8503 CALL_VertexPointerEXT(ctx
->Exec
, (size
, type
, stride
, count
, ptr
));
8506 static void GLAPIENTRY
8507 exec_LockArraysEXT(GLint first
, GLsizei count
)
8509 GET_CURRENT_CONTEXT(ctx
);
8510 FLUSH_VERTICES(ctx
, 0);
8511 CALL_LockArraysEXT(ctx
->Exec
, (first
, count
));
8514 static void GLAPIENTRY
8515 exec_UnlockArraysEXT(void)
8517 GET_CURRENT_CONTEXT(ctx
);
8518 FLUSH_VERTICES(ctx
, 0);
8519 CALL_UnlockArraysEXT(ctx
->Exec
, ());
8522 static void GLAPIENTRY
8523 exec_ClientActiveTextureARB(GLenum target
)
8525 GET_CURRENT_CONTEXT(ctx
);
8526 FLUSH_VERTICES(ctx
, 0);
8527 CALL_ClientActiveTextureARB(ctx
->Exec
, (target
));
8530 static void GLAPIENTRY
8531 exec_SecondaryColorPointerEXT(GLint size
, GLenum type
,
8532 GLsizei stride
, const GLvoid
*ptr
)
8534 GET_CURRENT_CONTEXT(ctx
);
8535 FLUSH_VERTICES(ctx
, 0);
8536 CALL_SecondaryColorPointerEXT(ctx
->Exec
, (size
, type
, stride
, ptr
));
8539 static void GLAPIENTRY
8540 exec_FogCoordPointerEXT(GLenum type
, GLsizei stride
, const GLvoid
*ptr
)
8542 GET_CURRENT_CONTEXT(ctx
);
8543 FLUSH_VERTICES(ctx
, 0);
8544 CALL_FogCoordPointerEXT(ctx
->Exec
, (type
, stride
, ptr
));
8547 /* GL_EXT_multi_draw_arrays */
8548 static void GLAPIENTRY
8549 exec_MultiDrawArraysEXT(GLenum mode
, GLint
* first
,
8550 GLsizei
* count
, GLsizei primcount
)
8552 GET_CURRENT_CONTEXT(ctx
);
8553 FLUSH_VERTICES(ctx
, 0);
8554 CALL_MultiDrawArraysEXT(ctx
->Exec
, (mode
, first
, count
, primcount
));
8557 /* GL_IBM_multimode_draw_arrays */
8558 static void GLAPIENTRY
8559 exec_MultiModeDrawArraysIBM(const GLenum
* mode
, const GLint
* first
,
8560 const GLsizei
* count
, GLsizei primcount
,
8563 GET_CURRENT_CONTEXT(ctx
);
8564 FLUSH_VERTICES(ctx
, 0);
8565 CALL_MultiModeDrawArraysIBM(ctx
->Exec
,
8566 (mode
, first
, count
, primcount
, modestride
));
8569 /* GL_IBM_multimode_draw_arrays */
8570 static void GLAPIENTRY
8571 exec_MultiModeDrawElementsIBM(const GLenum
* mode
,
8572 const GLsizei
* count
,
8574 const GLvoid
* const *indices
,
8575 GLsizei primcount
, GLint modestride
)
8577 GET_CURRENT_CONTEXT(ctx
);
8578 FLUSH_VERTICES(ctx
, 0);
8579 CALL_MultiModeDrawElementsIBM(ctx
->Exec
,
8580 (mode
, count
, type
, indices
, primcount
,
8587 * Setup the given dispatch table to point to Mesa's display list
8588 * building functions.
8590 * This does not include any of the tnl functions - they are
8591 * initialized from _mesa_init_api_defaults and from the active vtxfmt
8595 _mesa_init_save_table(struct _glapi_table
*table
)
8597 _mesa_loopback_init_api_table(table
);
8600 SET_Accum(table
, save_Accum
);
8601 SET_AlphaFunc(table
, save_AlphaFunc
);
8602 SET_Bitmap(table
, save_Bitmap
);
8603 SET_BlendFunc(table
, save_BlendFunc
);
8604 SET_CallList(table
, save_CallList
);
8605 SET_CallLists(table
, save_CallLists
);
8606 SET_Clear(table
, save_Clear
);
8607 SET_ClearAccum(table
, save_ClearAccum
);
8608 SET_ClearColor(table
, save_ClearColor
);
8609 SET_ClearDepth(table
, save_ClearDepth
);
8610 SET_ClearIndex(table
, save_ClearIndex
);
8611 SET_ClearStencil(table
, save_ClearStencil
);
8612 SET_ClipPlane(table
, save_ClipPlane
);
8613 SET_ColorMask(table
, save_ColorMask
);
8614 /*SET_ColorMaskIndexedEXT(table, save_ColorMaskIndexed);*/
8615 (void) save_ColorMaskIndexed
;
8616 SET_ColorMaterial(table
, save_ColorMaterial
);
8617 SET_CopyPixels(table
, save_CopyPixels
);
8618 SET_CullFace(table
, save_CullFace
);
8619 SET_DeleteLists(table
, _mesa_DeleteLists
);
8620 SET_DepthFunc(table
, save_DepthFunc
);
8621 SET_DepthMask(table
, save_DepthMask
);
8622 SET_DepthRange(table
, save_DepthRange
);
8623 SET_Disable(table
, save_Disable
);
8624 /*SET_DisableIndexed(table, save_DisableIndexed);*/
8625 (void) save_DisableIndexed
;
8626 SET_DrawBuffer(table
, save_DrawBuffer
);
8627 SET_DrawPixels(table
, save_DrawPixels
);
8628 SET_Enable(table
, save_Enable
);
8629 /*SET_EnableIndexed(table, save_EnableIndexed);*/
8630 (void) save_EnableIndexed
;
8631 SET_EndList(table
, _mesa_EndList
);
8632 SET_EvalMesh1(table
, save_EvalMesh1
);
8633 SET_EvalMesh2(table
, save_EvalMesh2
);
8634 SET_Finish(table
, exec_Finish
);
8635 SET_Flush(table
, exec_Flush
);
8636 SET_Fogf(table
, save_Fogf
);
8637 SET_Fogfv(table
, save_Fogfv
);
8638 SET_Fogi(table
, save_Fogi
);
8639 SET_Fogiv(table
, save_Fogiv
);
8640 SET_FrontFace(table
, save_FrontFace
);
8641 SET_Frustum(table
, save_Frustum
);
8642 SET_GenLists(table
, _mesa_GenLists
);
8643 SET_GetBooleanv(table
, exec_GetBooleanv
);
8644 SET_GetClipPlane(table
, exec_GetClipPlane
);
8645 SET_GetDoublev(table
, exec_GetDoublev
);
8646 SET_GetError(table
, exec_GetError
);
8647 SET_GetFloatv(table
, exec_GetFloatv
);
8648 SET_GetIntegerv(table
, exec_GetIntegerv
);
8649 SET_GetLightfv(table
, exec_GetLightfv
);
8650 SET_GetLightiv(table
, exec_GetLightiv
);
8651 SET_GetMapdv(table
, exec_GetMapdv
);
8652 SET_GetMapfv(table
, exec_GetMapfv
);
8653 SET_GetMapiv(table
, exec_GetMapiv
);
8654 SET_GetMaterialfv(table
, exec_GetMaterialfv
);
8655 SET_GetMaterialiv(table
, exec_GetMaterialiv
);
8656 SET_GetPixelMapfv(table
, exec_GetPixelMapfv
);
8657 SET_GetPixelMapuiv(table
, exec_GetPixelMapuiv
);
8658 SET_GetPixelMapusv(table
, exec_GetPixelMapusv
);
8659 SET_GetPolygonStipple(table
, exec_GetPolygonStipple
);
8660 SET_GetString(table
, exec_GetString
);
8661 SET_GetTexEnvfv(table
, exec_GetTexEnvfv
);
8662 SET_GetTexEnviv(table
, exec_GetTexEnviv
);
8663 SET_GetTexGendv(table
, exec_GetTexGendv
);
8664 SET_GetTexGenfv(table
, exec_GetTexGenfv
);
8665 SET_GetTexGeniv(table
, exec_GetTexGeniv
);
8666 SET_GetTexImage(table
, exec_GetTexImage
);
8667 SET_GetTexLevelParameterfv(table
, exec_GetTexLevelParameterfv
);
8668 SET_GetTexLevelParameteriv(table
, exec_GetTexLevelParameteriv
);
8669 SET_GetTexParameterfv(table
, exec_GetTexParameterfv
);
8670 SET_GetTexParameteriv(table
, exec_GetTexParameteriv
);
8671 SET_Hint(table
, save_Hint
);
8672 SET_IndexMask(table
, save_IndexMask
);
8673 SET_InitNames(table
, save_InitNames
);
8674 SET_IsEnabled(table
, exec_IsEnabled
);
8675 SET_IsList(table
, _mesa_IsList
);
8676 SET_LightModelf(table
, save_LightModelf
);
8677 SET_LightModelfv(table
, save_LightModelfv
);
8678 SET_LightModeli(table
, save_LightModeli
);
8679 SET_LightModeliv(table
, save_LightModeliv
);
8680 SET_Lightf(table
, save_Lightf
);
8681 SET_Lightfv(table
, save_Lightfv
);
8682 SET_Lighti(table
, save_Lighti
);
8683 SET_Lightiv(table
, save_Lightiv
);
8684 SET_LineStipple(table
, save_LineStipple
);
8685 SET_LineWidth(table
, save_LineWidth
);
8686 SET_ListBase(table
, save_ListBase
);
8687 SET_LoadIdentity(table
, save_LoadIdentity
);
8688 SET_LoadMatrixd(table
, save_LoadMatrixd
);
8689 SET_LoadMatrixf(table
, save_LoadMatrixf
);
8690 SET_LoadName(table
, save_LoadName
);
8691 SET_LogicOp(table
, save_LogicOp
);
8692 SET_Map1d(table
, save_Map1d
);
8693 SET_Map1f(table
, save_Map1f
);
8694 SET_Map2d(table
, save_Map2d
);
8695 SET_Map2f(table
, save_Map2f
);
8696 SET_MapGrid1d(table
, save_MapGrid1d
);
8697 SET_MapGrid1f(table
, save_MapGrid1f
);
8698 SET_MapGrid2d(table
, save_MapGrid2d
);
8699 SET_MapGrid2f(table
, save_MapGrid2f
);
8700 SET_MatrixMode(table
, save_MatrixMode
);
8701 SET_MultMatrixd(table
, save_MultMatrixd
);
8702 SET_MultMatrixf(table
, save_MultMatrixf
);
8703 SET_NewList(table
, save_NewList
);
8704 SET_Ortho(table
, save_Ortho
);
8705 SET_PassThrough(table
, save_PassThrough
);
8706 SET_PixelMapfv(table
, save_PixelMapfv
);
8707 SET_PixelMapuiv(table
, save_PixelMapuiv
);
8708 SET_PixelMapusv(table
, save_PixelMapusv
);
8709 SET_PixelStoref(table
, exec_PixelStoref
);
8710 SET_PixelStorei(table
, exec_PixelStorei
);
8711 SET_PixelTransferf(table
, save_PixelTransferf
);
8712 SET_PixelTransferi(table
, save_PixelTransferi
);
8713 SET_PixelZoom(table
, save_PixelZoom
);
8714 SET_PointSize(table
, save_PointSize
);
8715 SET_PolygonMode(table
, save_PolygonMode
);
8716 SET_PolygonOffset(table
, save_PolygonOffset
);
8717 SET_PolygonStipple(table
, save_PolygonStipple
);
8718 SET_PopAttrib(table
, save_PopAttrib
);
8719 SET_PopMatrix(table
, save_PopMatrix
);
8720 SET_PopName(table
, save_PopName
);
8721 SET_PushAttrib(table
, save_PushAttrib
);
8722 SET_PushMatrix(table
, save_PushMatrix
);
8723 SET_PushName(table
, save_PushName
);
8724 SET_RasterPos2d(table
, save_RasterPos2d
);
8725 SET_RasterPos2dv(table
, save_RasterPos2dv
);
8726 SET_RasterPos2f(table
, save_RasterPos2f
);
8727 SET_RasterPos2fv(table
, save_RasterPos2fv
);
8728 SET_RasterPos2i(table
, save_RasterPos2i
);
8729 SET_RasterPos2iv(table
, save_RasterPos2iv
);
8730 SET_RasterPos2s(table
, save_RasterPos2s
);
8731 SET_RasterPos2sv(table
, save_RasterPos2sv
);
8732 SET_RasterPos3d(table
, save_RasterPos3d
);
8733 SET_RasterPos3dv(table
, save_RasterPos3dv
);
8734 SET_RasterPos3f(table
, save_RasterPos3f
);
8735 SET_RasterPos3fv(table
, save_RasterPos3fv
);
8736 SET_RasterPos3i(table
, save_RasterPos3i
);
8737 SET_RasterPos3iv(table
, save_RasterPos3iv
);
8738 SET_RasterPos3s(table
, save_RasterPos3s
);
8739 SET_RasterPos3sv(table
, save_RasterPos3sv
);
8740 SET_RasterPos4d(table
, save_RasterPos4d
);
8741 SET_RasterPos4dv(table
, save_RasterPos4dv
);
8742 SET_RasterPos4f(table
, save_RasterPos4f
);
8743 SET_RasterPos4fv(table
, save_RasterPos4fv
);
8744 SET_RasterPos4i(table
, save_RasterPos4i
);
8745 SET_RasterPos4iv(table
, save_RasterPos4iv
);
8746 SET_RasterPos4s(table
, save_RasterPos4s
);
8747 SET_RasterPos4sv(table
, save_RasterPos4sv
);
8748 SET_ReadBuffer(table
, save_ReadBuffer
);
8749 SET_ReadPixels(table
, exec_ReadPixels
);
8750 SET_RenderMode(table
, exec_RenderMode
);
8751 SET_Rotated(table
, save_Rotated
);
8752 SET_Rotatef(table
, save_Rotatef
);
8753 SET_Scaled(table
, save_Scaled
);
8754 SET_Scalef(table
, save_Scalef
);
8755 SET_Scissor(table
, save_Scissor
);
8756 SET_FeedbackBuffer(table
, exec_FeedbackBuffer
);
8757 SET_SelectBuffer(table
, exec_SelectBuffer
);
8758 SET_ShadeModel(table
, save_ShadeModel
);
8759 SET_StencilFunc(table
, save_StencilFunc
);
8760 SET_StencilMask(table
, save_StencilMask
);
8761 SET_StencilOp(table
, save_StencilOp
);
8762 SET_TexEnvf(table
, save_TexEnvf
);
8763 SET_TexEnvfv(table
, save_TexEnvfv
);
8764 SET_TexEnvi(table
, save_TexEnvi
);
8765 SET_TexEnviv(table
, save_TexEnviv
);
8766 SET_TexGend(table
, save_TexGend
);
8767 SET_TexGendv(table
, save_TexGendv
);
8768 SET_TexGenf(table
, save_TexGenf
);
8769 SET_TexGenfv(table
, save_TexGenfv
);
8770 SET_TexGeni(table
, save_TexGeni
);
8771 SET_TexGeniv(table
, save_TexGeniv
);
8772 SET_TexImage1D(table
, save_TexImage1D
);
8773 SET_TexImage2D(table
, save_TexImage2D
);
8774 SET_TexParameterf(table
, save_TexParameterf
);
8775 SET_TexParameterfv(table
, save_TexParameterfv
);
8776 SET_TexParameteri(table
, save_TexParameteri
);
8777 SET_TexParameteriv(table
, save_TexParameteriv
);
8778 SET_Translated(table
, save_Translated
);
8779 SET_Translatef(table
, save_Translatef
);
8780 SET_Viewport(table
, save_Viewport
);
8783 SET_AreTexturesResident(table
, exec_AreTexturesResident
);
8784 SET_BindTexture(table
, save_BindTexture
);
8785 SET_ColorPointer(table
, exec_ColorPointer
);
8786 SET_CopyTexImage1D(table
, save_CopyTexImage1D
);
8787 SET_CopyTexImage2D(table
, save_CopyTexImage2D
);
8788 SET_CopyTexSubImage1D(table
, save_CopyTexSubImage1D
);
8789 SET_CopyTexSubImage2D(table
, save_CopyTexSubImage2D
);
8790 SET_DeleteTextures(table
, exec_DeleteTextures
);
8791 SET_DisableClientState(table
, exec_DisableClientState
);
8792 SET_EdgeFlagPointer(table
, exec_EdgeFlagPointer
);
8793 SET_EnableClientState(table
, exec_EnableClientState
);
8794 SET_GenTextures(table
, exec_GenTextures
);
8795 SET_GetPointerv(table
, exec_GetPointerv
);
8796 SET_IndexPointer(table
, exec_IndexPointer
);
8797 SET_InterleavedArrays(table
, exec_InterleavedArrays
);
8798 SET_IsTexture(table
, exec_IsTexture
);
8799 SET_NormalPointer(table
, exec_NormalPointer
);
8800 SET_PopClientAttrib(table
, exec_PopClientAttrib
);
8801 SET_PrioritizeTextures(table
, save_PrioritizeTextures
);
8802 SET_PushClientAttrib(table
, exec_PushClientAttrib
);
8803 SET_TexCoordPointer(table
, exec_TexCoordPointer
);
8804 SET_TexSubImage1D(table
, save_TexSubImage1D
);
8805 SET_TexSubImage2D(table
, save_TexSubImage2D
);
8806 SET_VertexPointer(table
, exec_VertexPointer
);
8809 SET_CopyTexSubImage3D(table
, save_CopyTexSubImage3D
);
8810 SET_TexImage3D(table
, save_TexImage3D
);
8811 SET_TexSubImage3D(table
, save_TexSubImage3D
);
8814 SET_StencilFuncSeparate(table
, save_StencilFuncSeparate
);
8815 SET_StencilMaskSeparate(table
, save_StencilMaskSeparate
);
8816 SET_StencilOpSeparate(table
, save_StencilOpSeparate
);
8818 /* ATI_separate_stencil */
8819 SET_StencilFuncSeparateATI(table
, save_StencilFuncSeparateATI
);
8821 /* GL_ARB_imaging */
8822 /* Not all are supported */
8823 SET_BlendColor(table
, save_BlendColor
);
8824 SET_BlendEquation(table
, save_BlendEquation
);
8825 SET_ColorSubTable(table
, save_ColorSubTable
);
8826 SET_ColorTable(table
, save_ColorTable
);
8827 SET_ColorTableParameterfv(table
, save_ColorTableParameterfv
);
8828 SET_ColorTableParameteriv(table
, save_ColorTableParameteriv
);
8829 SET_ConvolutionFilter1D(table
, save_ConvolutionFilter1D
);
8830 SET_ConvolutionFilter2D(table
, save_ConvolutionFilter2D
);
8831 SET_ConvolutionParameterf(table
, save_ConvolutionParameterf
);
8832 SET_ConvolutionParameterfv(table
, save_ConvolutionParameterfv
);
8833 SET_ConvolutionParameteri(table
, save_ConvolutionParameteri
);
8834 SET_ConvolutionParameteriv(table
, save_ConvolutionParameteriv
);
8835 SET_CopyColorSubTable(table
, save_CopyColorSubTable
);
8836 SET_CopyColorTable(table
, save_CopyColorTable
);
8837 SET_CopyConvolutionFilter1D(table
, exec_CopyConvolutionFilter1D
);
8838 SET_CopyConvolutionFilter2D(table
, exec_CopyConvolutionFilter2D
);
8839 SET_GetColorTable(table
, exec_GetColorTable
);
8840 SET_GetColorTableParameterfv(table
, exec_GetColorTableParameterfv
);
8841 SET_GetColorTableParameteriv(table
, exec_GetColorTableParameteriv
);
8842 SET_GetConvolutionFilter(table
, exec_GetConvolutionFilter
);
8843 SET_GetConvolutionParameterfv(table
, exec_GetConvolutionParameterfv
);
8844 SET_GetConvolutionParameteriv(table
, exec_GetConvolutionParameteriv
);
8845 SET_GetHistogram(table
, exec_GetHistogram
);
8846 SET_GetHistogramParameterfv(table
, exec_GetHistogramParameterfv
);
8847 SET_GetHistogramParameteriv(table
, exec_GetHistogramParameteriv
);
8848 SET_GetMinmax(table
, exec_GetMinmax
);
8849 SET_GetMinmaxParameterfv(table
, exec_GetMinmaxParameterfv
);
8850 SET_GetMinmaxParameteriv(table
, exec_GetMinmaxParameteriv
);
8851 SET_GetSeparableFilter(table
, exec_GetSeparableFilter
);
8852 SET_Histogram(table
, save_Histogram
);
8853 SET_Minmax(table
, save_Minmax
);
8854 SET_ResetHistogram(table
, save_ResetHistogram
);
8855 SET_ResetMinmax(table
, save_ResetMinmax
);
8856 SET_SeparableFilter2D(table
, exec_SeparableFilter2D
);
8858 /* 2. GL_EXT_blend_color */
8860 SET_BlendColorEXT(table
, save_BlendColorEXT
);
8863 /* 3. GL_EXT_polygon_offset */
8864 SET_PolygonOffsetEXT(table
, save_PolygonOffsetEXT
);
8866 /* 6. GL_EXT_texture3d */
8868 SET_CopyTexSubImage3DEXT(table
, save_CopyTexSubImage3D
);
8869 SET_TexImage3DEXT(table
, save_TexImage3DEXT
);
8870 SET_TexSubImage3DEXT(table
, save_TexSubImage3D
);
8873 /* 14. GL_SGI_color_table */
8875 SET_ColorTableSGI(table
, save_ColorTable
);
8876 SET_ColorSubTableSGI(table
, save_ColorSubTable
);
8877 SET_GetColorTableSGI(table
, exec_GetColorTable
);
8878 SET_GetColorTableParameterfvSGI(table
, exec_GetColorTableParameterfv
);
8879 SET_GetColorTableParameterivSGI(table
, exec_GetColorTableParameteriv
);
8882 /* 30. GL_EXT_vertex_array */
8883 SET_ColorPointerEXT(table
, exec_ColorPointerEXT
);
8884 SET_EdgeFlagPointerEXT(table
, exec_EdgeFlagPointerEXT
);
8885 SET_IndexPointerEXT(table
, exec_IndexPointerEXT
);
8886 SET_NormalPointerEXT(table
, exec_NormalPointerEXT
);
8887 SET_TexCoordPointerEXT(table
, exec_TexCoordPointerEXT
);
8888 SET_VertexPointerEXT(table
, exec_VertexPointerEXT
);
8890 /* 37. GL_EXT_blend_minmax */
8892 SET_BlendEquationEXT(table
, save_BlendEquationEXT
);
8895 /* 54. GL_EXT_point_parameters */
8896 SET_PointParameterfEXT(table
, save_PointParameterfEXT
);
8897 SET_PointParameterfvEXT(table
, save_PointParameterfvEXT
);
8899 /* 97. GL_EXT_compiled_vertex_array */
8900 SET_LockArraysEXT(table
, exec_LockArraysEXT
);
8901 SET_UnlockArraysEXT(table
, exec_UnlockArraysEXT
);
8903 /* 145. GL_EXT_secondary_color */
8904 SET_SecondaryColorPointerEXT(table
, exec_SecondaryColorPointerEXT
);
8906 /* 148. GL_EXT_multi_draw_arrays */
8907 SET_MultiDrawArraysEXT(table
, exec_MultiDrawArraysEXT
);
8909 /* 149. GL_EXT_fog_coord */
8910 SET_FogCoordPointerEXT(table
, exec_FogCoordPointerEXT
);
8912 /* 173. GL_EXT_blend_func_separate */
8913 SET_BlendFuncSeparateEXT(table
, save_BlendFuncSeparateEXT
);
8915 /* 196. GL_MESA_resize_buffers */
8916 SET_ResizeBuffersMESA(table
, _mesa_ResizeBuffersMESA
);
8918 /* 197. GL_MESA_window_pos */
8919 SET_WindowPos2dMESA(table
, save_WindowPos2dMESA
);
8920 SET_WindowPos2dvMESA(table
, save_WindowPos2dvMESA
);
8921 SET_WindowPos2fMESA(table
, save_WindowPos2fMESA
);
8922 SET_WindowPos2fvMESA(table
, save_WindowPos2fvMESA
);
8923 SET_WindowPos2iMESA(table
, save_WindowPos2iMESA
);
8924 SET_WindowPos2ivMESA(table
, save_WindowPos2ivMESA
);
8925 SET_WindowPos2sMESA(table
, save_WindowPos2sMESA
);
8926 SET_WindowPos2svMESA(table
, save_WindowPos2svMESA
);
8927 SET_WindowPos3dMESA(table
, save_WindowPos3dMESA
);
8928 SET_WindowPos3dvMESA(table
, save_WindowPos3dvMESA
);
8929 SET_WindowPos3fMESA(table
, save_WindowPos3fMESA
);
8930 SET_WindowPos3fvMESA(table
, save_WindowPos3fvMESA
);
8931 SET_WindowPos3iMESA(table
, save_WindowPos3iMESA
);
8932 SET_WindowPos3ivMESA(table
, save_WindowPos3ivMESA
);
8933 SET_WindowPos3sMESA(table
, save_WindowPos3sMESA
);
8934 SET_WindowPos3svMESA(table
, save_WindowPos3svMESA
);
8935 SET_WindowPos4dMESA(table
, save_WindowPos4dMESA
);
8936 SET_WindowPos4dvMESA(table
, save_WindowPos4dvMESA
);
8937 SET_WindowPos4fMESA(table
, save_WindowPos4fMESA
);
8938 SET_WindowPos4fvMESA(table
, save_WindowPos4fvMESA
);
8939 SET_WindowPos4iMESA(table
, save_WindowPos4iMESA
);
8940 SET_WindowPos4ivMESA(table
, save_WindowPos4ivMESA
);
8941 SET_WindowPos4sMESA(table
, save_WindowPos4sMESA
);
8942 SET_WindowPos4svMESA(table
, save_WindowPos4svMESA
);
8944 /* 200. GL_IBM_multimode_draw_arrays */
8945 SET_MultiModeDrawArraysIBM(table
, exec_MultiModeDrawArraysIBM
);
8946 SET_MultiModeDrawElementsIBM(table
, exec_MultiModeDrawElementsIBM
);
8948 #if FEATURE_NV_vertex_program
8949 /* 233. GL_NV_vertex_program */
8950 /* The following commands DO NOT go into display lists:
8951 * AreProgramsResidentNV, IsProgramNV, GenProgramsNV, DeleteProgramsNV,
8952 * VertexAttribPointerNV, GetProgram*, GetVertexAttrib*
8954 SET_BindProgramNV(table
, save_BindProgramNV
);
8955 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
8956 SET_ExecuteProgramNV(table
, save_ExecuteProgramNV
);
8957 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
8958 SET_AreProgramsResidentNV(table
, _mesa_AreProgramsResidentNV
);
8959 SET_RequestResidentProgramsNV(table
, save_RequestResidentProgramsNV
);
8960 SET_GetProgramParameterfvNV(table
, _mesa_GetProgramParameterfvNV
);
8961 SET_GetProgramParameterdvNV(table
, _mesa_GetProgramParameterdvNV
);
8962 SET_GetProgramivNV(table
, _mesa_GetProgramivNV
);
8963 SET_GetProgramStringNV(table
, _mesa_GetProgramStringNV
);
8964 SET_GetTrackMatrixivNV(table
, _mesa_GetTrackMatrixivNV
);
8965 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
8966 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
8967 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
8968 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
8969 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
8970 SET_LoadProgramNV(table
, save_LoadProgramNV
);
8971 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
8972 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
8973 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
8974 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
8975 SET_ProgramParameters4dvNV(table
, save_ProgramParameters4dvNV
);
8976 SET_ProgramParameters4fvNV(table
, save_ProgramParameters4fvNV
);
8977 SET_TrackMatrixNV(table
, save_TrackMatrixNV
);
8978 SET_VertexAttribPointerNV(table
, _mesa_VertexAttribPointerNV
);
8981 /* 244. GL_ATI_envmap_bumpmap */
8982 SET_TexBumpParameterivATI(table
, save_TexBumpParameterivATI
);
8983 SET_TexBumpParameterfvATI(table
, save_TexBumpParameterfvATI
);
8985 /* 245. GL_ATI_fragment_shader */
8986 #if FEATURE_ATI_fragment_shader
8987 SET_BindFragmentShaderATI(table
, save_BindFragmentShaderATI
);
8988 SET_SetFragmentShaderConstantATI(table
, save_SetFragmentShaderConstantATI
);
8991 /* 282. GL_NV_fragment_program */
8992 #if FEATURE_NV_fragment_program
8993 SET_ProgramNamedParameter4fNV(table
, save_ProgramNamedParameter4fNV
);
8994 SET_ProgramNamedParameter4dNV(table
, save_ProgramNamedParameter4dNV
);
8995 SET_ProgramNamedParameter4fvNV(table
, save_ProgramNamedParameter4fvNV
);
8996 SET_ProgramNamedParameter4dvNV(table
, save_ProgramNamedParameter4dvNV
);
8997 SET_GetProgramNamedParameterfvNV(table
,
8998 _mesa_GetProgramNamedParameterfvNV
);
8999 SET_GetProgramNamedParameterdvNV(table
,
9000 _mesa_GetProgramNamedParameterdvNV
);
9001 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9002 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9003 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9004 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9005 SET_GetProgramLocalParameterdvARB(table
,
9006 _mesa_GetProgramLocalParameterdvARB
);
9007 SET_GetProgramLocalParameterfvARB(table
,
9008 _mesa_GetProgramLocalParameterfvARB
);
9011 /* 262. GL_NV_point_sprite */
9012 SET_PointParameteriNV(table
, save_PointParameteriNV
);
9013 SET_PointParameterivNV(table
, save_PointParameterivNV
);
9015 /* 268. GL_EXT_stencil_two_side */
9016 SET_ActiveStencilFaceEXT(table
, save_ActiveStencilFaceEXT
);
9018 /* 273. GL_APPLE_vertex_array_object */
9019 SET_BindVertexArrayAPPLE(table
, _mesa_BindVertexArrayAPPLE
);
9020 SET_DeleteVertexArraysAPPLE(table
, _mesa_DeleteVertexArraysAPPLE
);
9021 SET_GenVertexArraysAPPLE(table
, _mesa_GenVertexArraysAPPLE
);
9022 SET_IsVertexArrayAPPLE(table
, _mesa_IsVertexArrayAPPLE
);
9024 /* ???. GL_EXT_depth_bounds_test */
9025 SET_DepthBoundsEXT(table
, save_DepthBoundsEXT
);
9027 /* ARB 1. GL_ARB_multitexture */
9028 SET_ActiveTextureARB(table
, save_ActiveTextureARB
);
9029 SET_ClientActiveTextureARB(table
, exec_ClientActiveTextureARB
);
9031 /* ARB 3. GL_ARB_transpose_matrix */
9032 SET_LoadTransposeMatrixdARB(table
, save_LoadTransposeMatrixdARB
);
9033 SET_LoadTransposeMatrixfARB(table
, save_LoadTransposeMatrixfARB
);
9034 SET_MultTransposeMatrixdARB(table
, save_MultTransposeMatrixdARB
);
9035 SET_MultTransposeMatrixfARB(table
, save_MultTransposeMatrixfARB
);
9037 /* ARB 5. GL_ARB_multisample */
9038 SET_SampleCoverageARB(table
, save_SampleCoverageARB
);
9040 /* ARB 12. GL_ARB_texture_compression */
9041 SET_CompressedTexImage3DARB(table
, save_CompressedTexImage3DARB
);
9042 SET_CompressedTexImage2DARB(table
, save_CompressedTexImage2DARB
);
9043 SET_CompressedTexImage1DARB(table
, save_CompressedTexImage1DARB
);
9044 SET_CompressedTexSubImage3DARB(table
, save_CompressedTexSubImage3DARB
);
9045 SET_CompressedTexSubImage2DARB(table
, save_CompressedTexSubImage2DARB
);
9046 SET_CompressedTexSubImage1DARB(table
, save_CompressedTexSubImage1DARB
);
9047 SET_GetCompressedTexImageARB(table
, exec_GetCompressedTexImageARB
);
9049 /* ARB 14. GL_ARB_point_parameters */
9050 /* aliased with EXT_point_parameters functions */
9052 /* ARB 25. GL_ARB_window_pos */
9053 /* aliased with MESA_window_pos functions */
9055 /* ARB 26. GL_ARB_vertex_program */
9056 /* ARB 27. GL_ARB_fragment_program */
9057 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9058 /* glVertexAttrib* functions alias the NV ones, handled elsewhere */
9059 SET_VertexAttribPointerARB(table
, _mesa_VertexAttribPointerARB
);
9060 SET_EnableVertexAttribArrayARB(table
, _mesa_EnableVertexAttribArrayARB
);
9061 SET_DisableVertexAttribArrayARB(table
, _mesa_DisableVertexAttribArrayARB
);
9062 SET_ProgramStringARB(table
, save_ProgramStringARB
);
9063 SET_BindProgramNV(table
, save_BindProgramNV
);
9064 SET_DeleteProgramsNV(table
, _mesa_DeletePrograms
);
9065 SET_GenProgramsNV(table
, _mesa_GenPrograms
);
9066 SET_IsProgramNV(table
, _mesa_IsProgramARB
);
9067 SET_GetVertexAttribdvNV(table
, _mesa_GetVertexAttribdvNV
);
9068 SET_GetVertexAttribfvNV(table
, _mesa_GetVertexAttribfvNV
);
9069 SET_GetVertexAttribivNV(table
, _mesa_GetVertexAttribivNV
);
9070 SET_GetVertexAttribPointervNV(table
, _mesa_GetVertexAttribPointervNV
);
9071 SET_ProgramEnvParameter4dARB(table
, save_ProgramEnvParameter4dARB
);
9072 SET_ProgramEnvParameter4dvARB(table
, save_ProgramEnvParameter4dvARB
);
9073 SET_ProgramEnvParameter4fARB(table
, save_ProgramEnvParameter4fARB
);
9074 SET_ProgramEnvParameter4fvARB(table
, save_ProgramEnvParameter4fvARB
);
9075 SET_ProgramLocalParameter4dARB(table
, save_ProgramLocalParameter4dARB
);
9076 SET_ProgramLocalParameter4dvARB(table
, save_ProgramLocalParameter4dvARB
);
9077 SET_ProgramLocalParameter4fARB(table
, save_ProgramLocalParameter4fARB
);
9078 SET_ProgramLocalParameter4fvARB(table
, save_ProgramLocalParameter4fvARB
);
9079 SET_GetProgramEnvParameterdvARB(table
, _mesa_GetProgramEnvParameterdvARB
);
9080 SET_GetProgramEnvParameterfvARB(table
, _mesa_GetProgramEnvParameterfvARB
);
9081 SET_GetProgramLocalParameterdvARB(table
,
9082 _mesa_GetProgramLocalParameterdvARB
);
9083 SET_GetProgramLocalParameterfvARB(table
,
9084 _mesa_GetProgramLocalParameterfvARB
);
9085 SET_GetProgramivARB(table
, _mesa_GetProgramivARB
);
9086 SET_GetProgramStringARB(table
, _mesa_GetProgramStringARB
);
9089 /* ARB 28. GL_ARB_vertex_buffer_object */
9090 #if FEATURE_ARB_vertex_buffer_object
9091 /* None of the extension's functions get compiled */
9092 SET_BindBufferARB(table
, _mesa_BindBufferARB
);
9093 SET_BufferDataARB(table
, _mesa_BufferDataARB
);
9094 SET_BufferSubDataARB(table
, _mesa_BufferSubDataARB
);
9095 SET_DeleteBuffersARB(table
, _mesa_DeleteBuffersARB
);
9096 SET_GenBuffersARB(table
, _mesa_GenBuffersARB
);
9097 SET_GetBufferParameterivARB(table
, _mesa_GetBufferParameterivARB
);
9098 SET_GetBufferPointervARB(table
, _mesa_GetBufferPointervARB
);
9099 SET_GetBufferSubDataARB(table
, _mesa_GetBufferSubDataARB
);
9100 SET_IsBufferARB(table
, _mesa_IsBufferARB
);
9101 SET_MapBufferARB(table
, _mesa_MapBufferARB
);
9102 SET_UnmapBufferARB(table
, _mesa_UnmapBufferARB
);
9105 #if FEATURE_queryobj
9106 SET_BeginQueryARB(table
, save_BeginQueryARB
);
9107 SET_EndQueryARB(table
, save_EndQueryARB
);
9108 SET_GenQueriesARB(table
, _mesa_GenQueriesARB
);
9109 SET_DeleteQueriesARB(table
, _mesa_DeleteQueriesARB
);
9110 SET_IsQueryARB(table
, _mesa_IsQueryARB
);
9111 SET_GetQueryivARB(table
, _mesa_GetQueryivARB
);
9112 SET_GetQueryObjectivARB(table
, _mesa_GetQueryObjectivARB
);
9113 SET_GetQueryObjectuivARB(table
, _mesa_GetQueryObjectuivARB
);
9115 SET_DrawBuffersARB(table
, save_DrawBuffersARB
);
9117 #if FEATURE_EXT_framebuffer_blit
9118 SET_BlitFramebufferEXT(table
, save_BlitFramebufferEXT
);
9121 /* GL_ARB_shader_objects */
9122 SET_UseProgramObjectARB(table
, save_UseProgramObjectARB
);
9123 SET_Uniform1fARB(table
, save_Uniform1fARB
);
9124 SET_Uniform2fARB(table
, save_Uniform2fARB
);
9125 SET_Uniform3fARB(table
, save_Uniform3fARB
);
9126 SET_Uniform4fARB(table
, save_Uniform4fARB
);
9127 SET_Uniform1fvARB(table
, save_Uniform1fvARB
);
9128 SET_Uniform2fvARB(table
, save_Uniform2fvARB
);
9129 SET_Uniform3fvARB(table
, save_Uniform3fvARB
);
9130 SET_Uniform4fvARB(table
, save_Uniform4fvARB
);
9131 SET_Uniform1iARB(table
, save_Uniform1iARB
);
9132 SET_Uniform2iARB(table
, save_Uniform2iARB
);
9133 SET_Uniform3iARB(table
, save_Uniform3iARB
);
9134 SET_Uniform4iARB(table
, save_Uniform4iARB
);
9135 SET_Uniform1ivARB(table
, save_Uniform1ivARB
);
9136 SET_Uniform2ivARB(table
, save_Uniform2ivARB
);
9137 SET_Uniform3ivARB(table
, save_Uniform3ivARB
);
9138 SET_Uniform4ivARB(table
, save_Uniform4ivARB
);
9139 SET_UniformMatrix2fvARB(table
, save_UniformMatrix2fvARB
);
9140 SET_UniformMatrix3fvARB(table
, save_UniformMatrix3fvARB
);
9141 SET_UniformMatrix4fvARB(table
, save_UniformMatrix4fvARB
);
9142 SET_UniformMatrix2x3fv(table
, save_UniformMatrix2x3fv
);
9143 SET_UniformMatrix3x2fv(table
, save_UniformMatrix3x2fv
);
9144 SET_UniformMatrix2x4fv(table
, save_UniformMatrix2x4fv
);
9145 SET_UniformMatrix4x2fv(table
, save_UniformMatrix4x2fv
);
9146 SET_UniformMatrix3x4fv(table
, save_UniformMatrix3x4fv
);
9147 SET_UniformMatrix4x3fv(table
, save_UniformMatrix4x3fv
);
9149 /* ARB 30/31/32. GL_ARB_shader_objects, GL_ARB_vertex/fragment_shader */
9150 SET_BindAttribLocationARB(table
, exec_BindAttribLocationARB
);
9151 SET_GetAttribLocationARB(table
, exec_GetAttribLocationARB
);
9152 /* XXX additional functions need to be implemented here! */
9154 /* 299. GL_EXT_blend_equation_separate */
9155 SET_BlendEquationSeparateEXT(table
, save_BlendEquationSeparateEXT
);
9157 /* GL_EXT_gpu_program_parmaeters */
9158 #if FEATURE_ARB_vertex_program || FEATURE_ARB_fragment_program
9159 SET_ProgramEnvParameters4fvEXT(table
, save_ProgramEnvParameters4fvEXT
);
9160 SET_ProgramLocalParameters4fvEXT(table
, save_ProgramLocalParameters4fvEXT
);
9163 /* ARB 50. GL_ARB_map_buffer_range */
9164 #if FEATURE_ARB_map_buffer_range
9165 SET_MapBufferRange(table
, _mesa_MapBufferRange
); /* no dlist save */
9166 SET_FlushMappedBufferRange(table
, _mesa_FlushMappedBufferRange
); /* no dl */
9169 /* ARB 59. GL_ARB_copy_buffer */
9170 SET_CopyBufferSubData(table
, _mesa_CopyBufferSubData
); /* no dlist save */
9172 /* 364. GL_EXT_provoking_vertex */
9173 SET_ProvokingVertexEXT(table
, save_ProvokingVertexEXT
);
9179 enum_string(GLenum k
)
9181 return _mesa_lookup_enum_by_nr(k
);
9186 * Print the commands in a display list. For debugging only.
9187 * TODO: many commands aren't handled yet.
9189 static void GLAPIENTRY
9190 print_list(GLcontext
*ctx
, GLuint list
)
9192 struct gl_display_list
*dlist
;
9196 if (!islist(ctx
, list
)) {
9197 _mesa_printf("%u is not a display list ID\n", list
);
9201 dlist
= lookup_list(ctx
, list
);
9207 _mesa_printf("START-LIST %u, address %p\n", list
, (void *) n
);
9209 done
= n
? GL_FALSE
: GL_TRUE
;
9211 const OpCode opcode
= n
[0].opcode
;
9213 if (is_ext_opcode(opcode
)) {
9214 n
+= ext_opcode_print(ctx
, n
);
9219 _mesa_printf("Accum %s %g\n", enum_string(n
[1].e
), n
[2].f
);
9222 _mesa_printf("Bitmap %d %d %g %g %g %g %p\n", n
[1].i
, n
[2].i
,
9223 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
, (void *) n
[7].data
);
9225 case OPCODE_CALL_LIST
:
9226 _mesa_printf("CallList %d\n", (int) n
[1].ui
);
9228 case OPCODE_CALL_LIST_OFFSET
:
9229 _mesa_printf("CallList %d + offset %u = %u\n", (int) n
[1].ui
,
9230 ctx
->List
.ListBase
, ctx
->List
.ListBase
+ n
[1].ui
);
9232 case OPCODE_COLOR_TABLE_PARAMETER_FV
:
9233 _mesa_printf("ColorTableParameterfv %s %s %f %f %f %f\n",
9234 enum_string(n
[1].e
), enum_string(n
[2].e
),
9235 n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9237 case OPCODE_COLOR_TABLE_PARAMETER_IV
:
9238 _mesa_printf("ColorTableParameteriv %s %s %d %d %d %d\n",
9239 enum_string(n
[1].e
), enum_string(n
[2].e
),
9240 n
[3].i
, n
[4].i
, n
[5].i
, n
[6].i
);
9242 case OPCODE_DISABLE
:
9243 _mesa_printf("Disable %s\n", enum_string(n
[1].e
));
9246 _mesa_printf("Enable %s\n", enum_string(n
[1].e
));
9248 case OPCODE_FRUSTUM
:
9249 _mesa_printf("Frustum %g %g %g %g %g %g\n",
9250 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9252 case OPCODE_LINE_STIPPLE
:
9253 _mesa_printf("LineStipple %d %x\n", n
[1].i
, (int) n
[2].us
);
9255 case OPCODE_LOAD_IDENTITY
:
9256 _mesa_printf("LoadIdentity\n");
9258 case OPCODE_LOAD_MATRIX
:
9259 _mesa_printf("LoadMatrix\n");
9260 _mesa_printf(" %8f %8f %8f %8f\n",
9261 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9262 _mesa_printf(" %8f %8f %8f %8f\n",
9263 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9264 _mesa_printf(" %8f %8f %8f %8f\n",
9265 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9266 _mesa_printf(" %8f %8f %8f %8f\n",
9267 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9269 case OPCODE_MULT_MATRIX
:
9270 _mesa_printf("MultMatrix (or Rotate)\n");
9271 _mesa_printf(" %8f %8f %8f %8f\n",
9272 n
[1].f
, n
[5].f
, n
[9].f
, n
[13].f
);
9273 _mesa_printf(" %8f %8f %8f %8f\n",
9274 n
[2].f
, n
[6].f
, n
[10].f
, n
[14].f
);
9275 _mesa_printf(" %8f %8f %8f %8f\n",
9276 n
[3].f
, n
[7].f
, n
[11].f
, n
[15].f
);
9277 _mesa_printf(" %8f %8f %8f %8f\n",
9278 n
[4].f
, n
[8].f
, n
[12].f
, n
[16].f
);
9281 _mesa_printf("Ortho %g %g %g %g %g %g\n",
9282 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9284 case OPCODE_POP_ATTRIB
:
9285 _mesa_printf("PopAttrib\n");
9287 case OPCODE_POP_MATRIX
:
9288 _mesa_printf("PopMatrix\n");
9290 case OPCODE_POP_NAME
:
9291 _mesa_printf("PopName\n");
9293 case OPCODE_PUSH_ATTRIB
:
9294 _mesa_printf("PushAttrib %x\n", n
[1].bf
);
9296 case OPCODE_PUSH_MATRIX
:
9297 _mesa_printf("PushMatrix\n");
9299 case OPCODE_PUSH_NAME
:
9300 _mesa_printf("PushName %d\n", (int) n
[1].ui
);
9302 case OPCODE_RASTER_POS
:
9303 _mesa_printf("RasterPos %g %g %g %g\n",
9304 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9307 _mesa_printf("Rotate %g %g %g %g\n",
9308 n
[1].f
, n
[2].f
, n
[3].f
, n
[4].f
);
9311 _mesa_printf("Scale %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9313 case OPCODE_TRANSLATE
:
9314 _mesa_printf("Translate %g %g %g\n", n
[1].f
, n
[2].f
, n
[3].f
);
9316 case OPCODE_BIND_TEXTURE
:
9317 _mesa_printf("BindTexture %s %d\n",
9318 _mesa_lookup_enum_by_nr(n
[1].ui
), n
[2].ui
);
9320 case OPCODE_SHADE_MODEL
:
9321 _mesa_printf("ShadeModel %s\n", _mesa_lookup_enum_by_nr(n
[1].ui
));
9324 _mesa_printf("Map1 %s %.3f %.3f %d %d\n",
9325 _mesa_lookup_enum_by_nr(n
[1].ui
),
9326 n
[2].f
, n
[3].f
, n
[4].i
, n
[5].i
);
9329 _mesa_printf("Map2 %s %.3f %.3f %.3f %.3f %d %d %d %d\n",
9330 _mesa_lookup_enum_by_nr(n
[1].ui
),
9331 n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
,
9332 n
[6].i
, n
[7].i
, n
[8].i
, n
[9].i
);
9334 case OPCODE_MAPGRID1
:
9335 _mesa_printf("MapGrid1 %d %.3f %.3f\n", n
[1].i
, n
[2].f
, n
[3].f
);
9337 case OPCODE_MAPGRID2
:
9338 _mesa_printf("MapGrid2 %d %.3f %.3f, %d %.3f %.3f\n",
9339 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].i
, n
[5].f
, n
[6].f
);
9341 case OPCODE_EVALMESH1
:
9342 _mesa_printf("EvalMesh1 %d %d\n", n
[1].i
, n
[2].i
);
9344 case OPCODE_EVALMESH2
:
9345 _mesa_printf("EvalMesh2 %d %d %d %d\n",
9346 n
[1].i
, n
[2].i
, n
[3].i
, n
[4].i
);
9349 case OPCODE_ATTR_1F_NV
:
9350 _mesa_printf("ATTR_1F_NV attr %d: %f\n", n
[1].i
, n
[2].f
);
9352 case OPCODE_ATTR_2F_NV
:
9353 _mesa_printf("ATTR_2F_NV attr %d: %f %f\n",
9354 n
[1].i
, n
[2].f
, n
[3].f
);
9356 case OPCODE_ATTR_3F_NV
:
9357 _mesa_printf("ATTR_3F_NV attr %d: %f %f %f\n",
9358 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9360 case OPCODE_ATTR_4F_NV
:
9361 _mesa_printf("ATTR_4F_NV attr %d: %f %f %f %f\n",
9362 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9364 case OPCODE_ATTR_1F_ARB
:
9365 _mesa_printf("ATTR_1F_ARB attr %d: %f\n", n
[1].i
, n
[2].f
);
9367 case OPCODE_ATTR_2F_ARB
:
9368 _mesa_printf("ATTR_2F_ARB attr %d: %f %f\n",
9369 n
[1].i
, n
[2].f
, n
[3].f
);
9371 case OPCODE_ATTR_3F_ARB
:
9372 _mesa_printf("ATTR_3F_ARB attr %d: %f %f %f\n",
9373 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
);
9375 case OPCODE_ATTR_4F_ARB
:
9376 _mesa_printf("ATTR_4F_ARB attr %d: %f %f %f %f\n",
9377 n
[1].i
, n
[2].f
, n
[3].f
, n
[4].f
, n
[5].f
);
9380 case OPCODE_MATERIAL
:
9381 _mesa_printf("MATERIAL %x %x: %f %f %f %f\n",
9382 n
[1].i
, n
[2].i
, n
[3].f
, n
[4].f
, n
[5].f
, n
[6].f
);
9385 _mesa_printf("BEGIN %x\n", n
[1].i
);
9388 _mesa_printf("END\n");
9391 _mesa_printf("RECTF %f %f %f %f\n", n
[1].f
, n
[2].f
, n
[3].f
,
9394 case OPCODE_EVAL_C1
:
9395 _mesa_printf("EVAL_C1 %f\n", n
[1].f
);
9397 case OPCODE_EVAL_C2
:
9398 _mesa_printf("EVAL_C2 %f %f\n", n
[1].f
, n
[2].f
);
9400 case OPCODE_EVAL_P1
:
9401 _mesa_printf("EVAL_P1 %d\n", n
[1].i
);
9403 case OPCODE_EVAL_P2
:
9404 _mesa_printf("EVAL_P2 %d %d\n", n
[1].i
, n
[2].i
);
9407 case OPCODE_PROVOKING_VERTEX
:
9408 _mesa_printf("ProvokingVertex %s\n",
9409 _mesa_lookup_enum_by_nr(n
[1].ui
));
9413 * meta opcodes/commands
9416 _mesa_printf("Error: %s %s\n",
9417 enum_string(n
[1].e
), (const char *) n
[2].data
);
9419 case OPCODE_CONTINUE
:
9420 _mesa_printf("DISPLAY-LIST-CONTINUE\n");
9421 n
= (Node
*) n
[1].next
;
9423 case OPCODE_END_OF_LIST
:
9424 _mesa_printf("END-LIST %u\n", list
);
9428 if (opcode
< 0 || opcode
> OPCODE_END_OF_LIST
) {
9430 ("ERROR IN DISPLAY LIST: opcode = %d, address = %p\n",
9431 opcode
, (void *) n
);
9435 _mesa_printf("command %d, %u operands\n", opcode
,
9439 /* increment n to point to next compiled command */
9440 if (opcode
!= OPCODE_CONTINUE
) {
9441 n
+= InstSize
[opcode
];
9450 * Clients may call this function to help debug display list problems.
9451 * This function is _ONLY_FOR_DEBUGGING_PURPOSES_. It may be removed,
9452 * changed, or break in the future without notice.
9455 mesa_print_display_list(GLuint list
)
9457 GET_CURRENT_CONTEXT(ctx
);
9458 print_list(ctx
, list
);
9462 /**********************************************************************/
9463 /***** Initialization *****/
9464 /**********************************************************************/
9467 _mesa_save_vtxfmt_init(GLvertexformat
* vfmt
)
9469 _MESA_INIT_ARRAYELT_VTXFMT(vfmt
, _ae_
);
9471 vfmt
->Begin
= save_Begin
;
9473 _MESA_INIT_DLIST_VTXFMT(vfmt
, save_
);
9475 vfmt
->Color3f
= save_Color3f
;
9476 vfmt
->Color3fv
= save_Color3fv
;
9477 vfmt
->Color4f
= save_Color4f
;
9478 vfmt
->Color4fv
= save_Color4fv
;
9479 vfmt
->EdgeFlag
= save_EdgeFlag
;
9480 vfmt
->End
= save_End
;
9482 _MESA_INIT_EVAL_VTXFMT(vfmt
, save_
);
9484 vfmt
->FogCoordfEXT
= save_FogCoordfEXT
;
9485 vfmt
->FogCoordfvEXT
= save_FogCoordfvEXT
;
9486 vfmt
->Indexf
= save_Indexf
;
9487 vfmt
->Indexfv
= save_Indexfv
;
9488 vfmt
->Materialfv
= save_Materialfv
;
9489 vfmt
->MultiTexCoord1fARB
= save_MultiTexCoord1f
;
9490 vfmt
->MultiTexCoord1fvARB
= save_MultiTexCoord1fv
;
9491 vfmt
->MultiTexCoord2fARB
= save_MultiTexCoord2f
;
9492 vfmt
->MultiTexCoord2fvARB
= save_MultiTexCoord2fv
;
9493 vfmt
->MultiTexCoord3fARB
= save_MultiTexCoord3f
;
9494 vfmt
->MultiTexCoord3fvARB
= save_MultiTexCoord3fv
;
9495 vfmt
->MultiTexCoord4fARB
= save_MultiTexCoord4f
;
9496 vfmt
->MultiTexCoord4fvARB
= save_MultiTexCoord4fv
;
9497 vfmt
->Normal3f
= save_Normal3f
;
9498 vfmt
->Normal3fv
= save_Normal3fv
;
9499 vfmt
->SecondaryColor3fEXT
= save_SecondaryColor3fEXT
;
9500 vfmt
->SecondaryColor3fvEXT
= save_SecondaryColor3fvEXT
;
9501 vfmt
->TexCoord1f
= save_TexCoord1f
;
9502 vfmt
->TexCoord1fv
= save_TexCoord1fv
;
9503 vfmt
->TexCoord2f
= save_TexCoord2f
;
9504 vfmt
->TexCoord2fv
= save_TexCoord2fv
;
9505 vfmt
->TexCoord3f
= save_TexCoord3f
;
9506 vfmt
->TexCoord3fv
= save_TexCoord3fv
;
9507 vfmt
->TexCoord4f
= save_TexCoord4f
;
9508 vfmt
->TexCoord4fv
= save_TexCoord4fv
;
9509 vfmt
->Vertex2f
= save_Vertex2f
;
9510 vfmt
->Vertex2fv
= save_Vertex2fv
;
9511 vfmt
->Vertex3f
= save_Vertex3f
;
9512 vfmt
->Vertex3fv
= save_Vertex3fv
;
9513 vfmt
->Vertex4f
= save_Vertex4f
;
9514 vfmt
->Vertex4fv
= save_Vertex4fv
;
9515 vfmt
->VertexAttrib1fNV
= save_VertexAttrib1fNV
;
9516 vfmt
->VertexAttrib1fvNV
= save_VertexAttrib1fvNV
;
9517 vfmt
->VertexAttrib2fNV
= save_VertexAttrib2fNV
;
9518 vfmt
->VertexAttrib2fvNV
= save_VertexAttrib2fvNV
;
9519 vfmt
->VertexAttrib3fNV
= save_VertexAttrib3fNV
;
9520 vfmt
->VertexAttrib3fvNV
= save_VertexAttrib3fvNV
;
9521 vfmt
->VertexAttrib4fNV
= save_VertexAttrib4fNV
;
9522 vfmt
->VertexAttrib4fvNV
= save_VertexAttrib4fvNV
;
9523 vfmt
->VertexAttrib1fARB
= save_VertexAttrib1fARB
;
9524 vfmt
->VertexAttrib1fvARB
= save_VertexAttrib1fvARB
;
9525 vfmt
->VertexAttrib2fARB
= save_VertexAttrib2fARB
;
9526 vfmt
->VertexAttrib2fvARB
= save_VertexAttrib2fvARB
;
9527 vfmt
->VertexAttrib3fARB
= save_VertexAttrib3fARB
;
9528 vfmt
->VertexAttrib3fvARB
= save_VertexAttrib3fvARB
;
9529 vfmt
->VertexAttrib4fARB
= save_VertexAttrib4fARB
;
9530 vfmt
->VertexAttrib4fvARB
= save_VertexAttrib4fvARB
;
9532 vfmt
->Rectf
= save_Rectf
;
9534 /* The driver is required to implement these as
9535 * 1) They can probably do a better job.
9536 * 2) A lot of new mechanisms would have to be added to this module
9537 * to support it. That code would probably never get used,
9541 vfmt
->DrawArrays
= 0;
9542 vfmt
->DrawElements
= 0;
9543 vfmt
->DrawRangeElements
= 0;
9544 vfmt
->MultiDrawElemementsEXT
= 0;
9545 vfmt
->DrawElementsBaseVertex
= 0;
9546 vfmt
->DrawRangeElementsBaseVertex
= 0;
9547 vfmt
->MultiDrawElemementsBaseVertex
= 0;
9553 _mesa_install_dlist_vtxfmt(struct _glapi_table
*disp
,
9554 const GLvertexformat
*vfmt
)
9556 SET_CallList(disp
, vfmt
->CallList
);
9557 SET_CallLists(disp
, vfmt
->CallLists
);
9561 void _mesa_init_dlist_dispatch(struct _glapi_table
*disp
)
9563 SET_CallList(disp
, _mesa_CallList
);
9564 SET_CallLists(disp
, _mesa_CallLists
);
9566 SET_DeleteLists(disp
, _mesa_DeleteLists
);
9567 SET_EndList(disp
, _mesa_EndList
);
9568 SET_GenLists(disp
, _mesa_GenLists
);
9569 SET_IsList(disp
, _mesa_IsList
);
9570 SET_ListBase(disp
, _mesa_ListBase
);
9571 SET_NewList(disp
, _mesa_NewList
);
9575 #endif /* FEATURE_dlist */
9579 * Initialize display list state for given context.
9582 _mesa_init_display_list(GLcontext
*ctx
)
9584 static GLboolean tableInitialized
= GL_FALSE
;
9586 /* zero-out the instruction size table, just once */
9587 if (!tableInitialized
) {
9588 _mesa_bzero(InstSize
, sizeof(InstSize
));
9589 tableInitialized
= GL_TRUE
;
9592 /* extension info */
9593 ctx
->ListExt
= CALLOC_STRUCT(gl_list_extensions
);
9596 ctx
->ListState
.CallDepth
= 0;
9597 ctx
->ExecuteFlag
= GL_TRUE
;
9598 ctx
->CompileFlag
= GL_FALSE
;
9599 ctx
->ListState
.CurrentBlock
= NULL
;
9600 ctx
->ListState
.CurrentPos
= 0;
9602 /* Display List group */
9603 ctx
->List
.ListBase
= 0;
9606 _mesa_save_vtxfmt_init(&ctx
->ListState
.ListVtxfmt
);
9612 _mesa_free_display_list_data(GLcontext
*ctx
)
9615 ctx
->ListExt
= NULL
;